이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
int R[5];
int main(){
int N, i, j, Ball=0, a;
scanf("%d", &N);
for(i=1; i<=N; i++){
scanf("%d", &a);
if(a==1) Ball++;
if(a==3){
Ball++;
for(j=3; j>=1; j--){
if(R[j]) R[j+1]++;
R[j]=0;
}
}
if(a==2 || Ball==4){
Ball=0;
if(R[1]==1 && R[2]==1 && R[3]==1) R[4]++;
else if(R[1]==1 && R[2]==1) R[3]=1;
else if(R[1]==1) R[2]=1;
else R[1]=1;
}
}
printf("%d", R[4]);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |