Submission #1954218
Source Code Expand
#include<stdio.h> #include<string.h> int main() { char str[100]; int rank[100]; int n,m,w,c=1; scanf("%d",n); scanf("%d",str); for(int i=n;i>=0;i--) { for(int j=0;j<n-1;j++) { if(str[j]>str[j+1]) { w=str[j]; str[j]=str[j+1]; str[j+1]=w; } } } rank[0]=str[0]; for(int i=1;i<n;i++) { if(str[i]!=str[i+1]) { rank[i]=str[i]; c++; } } printf("%d",c); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Kagami Mochi |
User | kaoru1012 |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 601 Byte |
Status | RE |
Exec Time | 102 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:8:11: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=] scanf("%d",n); ^ ./Main.c:9:11: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘char *’ [-Wformat=] scanf("%d",str); ^ ./Main.c:8:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",n); ^ ./Main.c:9:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",str); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | a01, a02, a03 |
All | a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
a01 | RE | 101 ms | 128 KB |
a02 | RE | 99 ms | 128 KB |
a03 | RE | 102 ms | 128 KB |
b04 | RE | 101 ms | 128 KB |
b05 | RE | 101 ms | 128 KB |
b06 | RE | 100 ms | 128 KB |
b07 | RE | 101 ms | 128 KB |
b08 | RE | 100 ms | 128 KB |
b09 | RE | 100 ms | 128 KB |
b10 | RE | 102 ms | 128 KB |
b11 | RE | 100 ms | 128 KB |
b12 | RE | 101 ms | 128 KB |
b13 | RE | 102 ms | 128 KB |