int taja = 0;
int len;
char ball = 0;
char m[3];
int score = 0;
void jinru() {
if(m[0]) {
if(m[1]) {
if(m[2]) {
m[2] = 0;
score++;
}
m[2] = m[1];
}
m[1] = m[0];
}
ball = 0;
}
int main() {
scanf("%d", &len);
int i;
for(i = 0; i < len; i++) {
int b;
scanf("%d", &b);
switch(b) {
case 1:
ball++;
printf("Ball! %d\n", taja);
if(ball == 4) {
jinru();
m[0] = 1;
taja++;
}
break;
case 2:
//printf("Deadball! %d\n", taja);
jinru();
m[0] = 1;
taja++;
break;
case 3:
if(m[2]) score++;
m[2] = m[1];
m[1] = m[0];
if(ball == 3) {
ball = 0;
m[0] = 1;
//printf("Poktu! %d\n", taja++);
}
else {
ball++;
m[0] = 0;
//printf("Poktu! %d\n", taja);
}
break;
}
}
printf("%d", score);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1080 KB |
Output is correct |
2 |
Incorrect |
4 ms |
1080 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
4 |
Incorrect |
6 ms |
1080 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
2 |
Incorrect |
5 ms |
1080 KB |
Output isn't correct |
3 |
Incorrect |
4 ms |
1080 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
5 |
Correct |
0 ms |
1080 KB |
Output is correct |
6 |
Incorrect |
10 ms |
1080 KB |
Output isn't correct |
7 |
Incorrect |
6 ms |
1080 KB |
Output isn't correct |
8 |
Incorrect |
7 ms |
1080 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
11 |
Incorrect |
7 ms |
1080 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
1080 KB |
Output isn't correct |
14 |
Incorrect |
5 ms |
1080 KB |
Output isn't correct |
15 |
Incorrect |
4 ms |
1080 KB |
Output isn't correct |