# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90527 | 2018-12-22T08:01:47 Z | tjrwodnjs999 | 볼질 (OJUZ10_ballparade) | C++11 | 7 ms | 2500 KB |
#include <bits/stdc++.h> using namespace std; int n,m,a,b,c,d,cnt; int main(){ scanf("%d",&n); while(n--){ scanf("%d",&m); if(m==1) d++; if(m==2||d==4){ if(c&&b&&a) cnt++,c=0; if(b&&a) c=1,b=0; if(a) b=1; a=1; d=0; } if(m==3){ if(c) cnt++,c=0; if(b) c=1,b=0; if(a) b=1,a=0; d++; if(d==4) d=0,a=1; } } printf("%d",cnt); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 944 KB | Output is correct |
2 | Correct | 4 ms | 784 KB | Output is correct |
3 | Correct | 2 ms | 572 KB | Output is correct |
4 | Correct | 2 ms | 596 KB | Output is correct |
5 | Correct | 2 ms | 524 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 1 ms | 500 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 1004 KB | Output is correct |
2 | Correct | 2 ms | 1000 KB | Output is correct |
3 | Correct | 3 ms | 1000 KB | Output is correct |
4 | Correct | 2 ms | 1000 KB | Output is correct |
5 | Correct | 2 ms | 1128 KB | Output is correct |
6 | Correct | 6 ms | 1208 KB | Output is correct |
7 | Correct | 7 ms | 1308 KB | Output is correct |
8 | Correct | 4 ms | 1140 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 1532 KB | Output is correct |
2 | Correct | 6 ms | 2328 KB | Output is correct |
3 | Correct | 6 ms | 2436 KB | Output is correct |
4 | Correct | 6 ms | 2328 KB | Output is correct |
5 | Correct | 7 ms | 2000 KB | Output is correct |
6 | Correct | 6 ms | 2100 KB | Output is correct |
7 | Correct | 2 ms | 1600 KB | Output is correct |
8 | Correct | 2 ms | 1416 KB | Output is correct |
9 | Correct | 2 ms | 1416 KB | Output is correct |
10 | Correct | 4 ms | 1648 KB | Output is correct |
11 | Correct | 2 ms | 1536 KB | Output is correct |
12 | Correct | 5 ms | 2500 KB | Output is correct |
13 | Correct | 6 ms | 1940 KB | Output is correct |
14 | Correct | 6 ms | 1800 KB | Output is correct |
15 | Correct | 6 ms | 1704 KB | Output is correct |