# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
13945 |
2015-04-24T14:32:49 Z |
ainta |
볼질 (OJUZ10_ballparade) |
C++ |
|
7 ms |
1084 KB |
#include<stdio.h>
bool chk[3];
int R;
void Move(){
if (chk[2])R++;
chk[2] = chk[1];
chk[1] = chk[0];
chk[0] = false;
}
void Move2(){
if (chk[2]){
if (chk[0] && chk[1]){
R++; chk[2] = false;
}
}
if (chk[1]){
if (chk[0]){
chk[2] = true;
chk[1] = false;
}
}
if (chk[0])chk[1] = true;
chk[0] = true;
}
int main(){
int i, n, a, B = 0;
scanf("%d", &n);
while (n--){
scanf("%d", &a);
if (a == 1){
if (B == 3){
Move2();
B = 0;
}
else B++;
continue;
}
else if (a == 2){
Move2();
B = 0;
}
else{
Move();
B++;
if (B == 4){
chk[0] = true;
B = 0;
}
}
}
printf("%d\n", R);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1084 KB |
Output is correct |
2 |
Correct |
0 ms |
1084 KB |
Output is correct |
3 |
Correct |
0 ms |
1084 KB |
Output is correct |
4 |
Correct |
0 ms |
1084 KB |
Output is correct |
5 |
Correct |
0 ms |
1084 KB |
Output is correct |
6 |
Correct |
0 ms |
1084 KB |
Output is correct |
7 |
Correct |
0 ms |
1084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1084 KB |
Output is correct |
2 |
Correct |
0 ms |
1084 KB |
Output is correct |
3 |
Correct |
0 ms |
1084 KB |
Output is correct |
4 |
Correct |
7 ms |
1084 KB |
Output is correct |
5 |
Correct |
0 ms |
1084 KB |
Output is correct |
6 |
Correct |
6 ms |
1084 KB |
Output is correct |
7 |
Correct |
1 ms |
1084 KB |
Output is correct |
8 |
Correct |
0 ms |
1084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1084 KB |
Output is correct |
2 |
Correct |
3 ms |
1084 KB |
Output is correct |
3 |
Correct |
6 ms |
1084 KB |
Output is correct |
4 |
Correct |
0 ms |
1084 KB |
Output is correct |
5 |
Correct |
0 ms |
1084 KB |
Output is correct |
6 |
Correct |
7 ms |
1084 KB |
Output is correct |
7 |
Correct |
5 ms |
1084 KB |
Output is correct |
8 |
Correct |
2 ms |
1084 KB |
Output is correct |
9 |
Correct |
0 ms |
1084 KB |
Output is correct |
10 |
Correct |
1 ms |
1084 KB |
Output is correct |
11 |
Correct |
0 ms |
1084 KB |
Output is correct |
12 |
Correct |
0 ms |
1084 KB |
Output is correct |
13 |
Correct |
0 ms |
1084 KB |
Output is correct |
14 |
Correct |
0 ms |
1084 KB |
Output is correct |
15 |
Correct |
5 ms |
1084 KB |
Output is correct |