Submission #1268695
Source Code Expand
q[1<<18];i,n; main(a){ for(;~scanf("%d",&a);)n?q[a]=++i:(n=a); for(a=0;--i;a?q[n]<q[i]^q[i]<q[i+1]^q[i+1]<q[n]?a++,n=i+1:0:q[i]<q[i+1]?n--:a++); printf("%d",a); }
Submission Info
Submission Time | |
---|---|
Task | F - Strange Sorting |
User | kotatsugame |
Language | C (GCC 5.4.1) |
Score | 2400 |
Code Size | 170 Byte |
Status | AC |
Exec Time | 22 ms |
Memory | 896 KB |
Compile Error
./Main.c:1:1: warning: data definition has no type or storage class q[1<<18];i,n; ^ ./Main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘q’ [-Wimplicit-int] ./Main.c:1:10: warning: data definition has no type or storage class q[1<<18];i,n; ^ ./Main.c:1:10: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] ./Main.c:1:12: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] q[1<<18];i,n; ^ ./Main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main(a){ ^ ./Main.c: In function ‘main’: ./Main.c:2:1: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int] ./Main.c:3:8: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] for(;~scanf("%d",&a);)n?q[a]=++i:(n=a); ^ ./Main.c:3:8: warning: incompatible implicit declaration of built-in function ‘scanf’ ./Main.c:3:8: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ ./Main.c:5:2: warning: implicit declaration of function ...
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 2400 / 2400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in2.txt, in20.txt, in21.txt, in22.txt, in23.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 22 ms | 896 KB |
in10.txt | AC | 22 ms | 896 KB |
in11.txt | AC | 22 ms | 896 KB |
in12.txt | AC | 22 ms | 896 KB |
in13.txt | AC | 22 ms | 896 KB |
in14.txt | AC | 22 ms | 896 KB |
in15.txt | AC | 22 ms | 896 KB |
in16.txt | AC | 22 ms | 896 KB |
in17.txt | AC | 22 ms | 896 KB |
in18.txt | AC | 22 ms | 896 KB |
in19.txt | AC | 22 ms | 896 KB |
in2.txt | AC | 22 ms | 896 KB |
in20.txt | AC | 22 ms | 896 KB |
in21.txt | AC | 19 ms | 896 KB |
in22.txt | AC | 20 ms | 896 KB |
in23.txt | AC | 0 ms | 128 KB |
in3.txt | AC | 22 ms | 896 KB |
in4.txt | AC | 22 ms | 896 KB |
in5.txt | AC | 22 ms | 896 KB |
in6.txt | AC | 22 ms | 896 KB |
in7.txt | AC | 22 ms | 896 KB |
in8.txt | AC | 22 ms | 896 KB |
in9.txt | AC | 22 ms | 896 KB |
sample1.txt | AC | 0 ms | 128 KB |
sample2.txt | AC | 1 ms | 128 KB |
sample3.txt | AC | 1 ms | 128 KB |