# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
14281 |
2015-05-10T01:20:19 Z |
jang718 |
볼질 (OJUZ10_ballparade) |
C++ |
|
7 ms |
1084 KB |
#include<stdio.h>
int main() {
int i,j,n,score=0,k,a[5]={0,},b=0;
scanf("%d",&n);
for(j=0;j<n;j++){
scanf("%d",&k);
if(k==1)b++;
else if(k==2){
b=0;
a[0]=1;
for(i=3;i>=1;i--){if(a[i-1]==1&&a[i]==1){a[i+1]=1;a[i]=0;}else if(a[i-1]==1){a[i]=1;a[i-1]=0;}}
a[1]=1;
a[0]=0;
}
else{
b++;
for(i=3;i>=1;i--){if(a[i]==1){a[i+1]=1;a[i]=0;}else if(a[i-1]==1){a[i]=1;a[i-1]=0;}}
}
if(b==4){
b=0;
a[0]=1;
for(i=3;i>=1;i--)if(a[i-1]==1&&a[i]==1){a[i+1]=1;a[i]=0;}
a[1]=1;
a[0]=0;
}
if(a[4]==1){
score++;
a[4]=0;
}
}
printf("%d",score);
return 0;
}
# |
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 |
0 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 |
0 ms |
1084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1084 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
1084 KB |
Output isn't correct |
3 |
Correct |
0 ms |
1084 KB |
Output is correct |
4 |
Incorrect |
5 ms |
1084 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1084 KB |
Output isn't correct |
6 |
Correct |
0 ms |
1084 KB |
Output is correct |
7 |
Correct |
0 ms |
1084 KB |
Output is correct |
8 |
Incorrect |
7 ms |
1084 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
1084 KB |
Output isn't correct |
2 |
Correct |
0 ms |
1084 KB |
Output is correct |
3 |
Correct |
0 ms |
1084 KB |
Output is correct |
4 |
Incorrect |
5 ms |
1084 KB |
Output isn't correct |
5 |
Incorrect |
5 ms |
1084 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
1084 KB |
Output isn't correct |
7 |
Correct |
0 ms |
1084 KB |
Output is correct |
8 |
Incorrect |
4 ms |
1084 KB |
Output isn't correct |
9 |
Incorrect |
6 ms |
1084 KB |
Output isn't correct |
10 |
Incorrect |
5 ms |
1084 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
1084 KB |
Output isn't correct |
12 |
Incorrect |
3 ms |
1084 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
1084 KB |
Output isn't correct |
14 |
Incorrect |
6 ms |
1084 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
1084 KB |
Output isn't correct |