답안 #14243

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14243 2015-05-07T14:04:03 Z gkwnsals12 볼질 (OJUZ10_ballparade) C++
100 / 100
7 ms 1276 KB
#include <stdio.h>
    int bace[5],a[50001],bc=0,i,j,n,score=0;

int main(void)
{
    FILE *in;
    in=stdin;//fopen("input.txt","r");


    fscanf(in,"%d",&n);
    for(i=0;i<n;i++){
        fscanf(in,"%d",&a[i]);
        if(a[i]==3){
            if(bace[3]==1){
                score++;
                bace[3]=0;
            }
            bace[3]=bace[2];
            bace[2]=bace[1];
    bace[1]=0;
        }
        if(a[i]==1 || a[i]==3)
            bc++;
        if(bc==4 ||a[i]==2){
                bc=0;
            if(bace[1]==1 && bace[2]==1 && bace[3]==1)
                score++;
            else if(bace[1]==1 && bace[2]==1)
                bace[3]=1;
            else if(bace[1]==1)
                bace[2]=1;
            else bace[1]=1;
        }
             //   printf("%d %d %d %d\n",bace[1],bace[2],bace[3],bc);




    }
    printf("%d",score);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1276 KB Output is correct
2 Correct 0 ms 1276 KB Output is correct
3 Correct 0 ms 1276 KB Output is correct
4 Correct 0 ms 1276 KB Output is correct
5 Correct 0 ms 1276 KB Output is correct
6 Correct 1 ms 1276 KB Output is correct
7 Correct 3 ms 1276 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1276 KB Output is correct
2 Correct 0 ms 1276 KB Output is correct
3 Correct 2 ms 1276 KB Output is correct
4 Correct 5 ms 1276 KB Output is correct
5 Correct 0 ms 1276 KB Output is correct
6 Correct 0 ms 1276 KB Output is correct
7 Correct 0 ms 1276 KB Output is correct
8 Correct 6 ms 1276 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1276 KB Output is correct
2 Correct 5 ms 1276 KB Output is correct
3 Correct 0 ms 1276 KB Output is correct
4 Correct 6 ms 1276 KB Output is correct
5 Correct 6 ms 1276 KB Output is correct
6 Correct 3 ms 1276 KB Output is correct
7 Correct 3 ms 1276 KB Output is correct
8 Correct 6 ms 1276 KB Output is correct
9 Correct 7 ms 1276 KB Output is correct
10 Correct 0 ms 1276 KB Output is correct
11 Correct 0 ms 1276 KB Output is correct
12 Correct 5 ms 1276 KB Output is correct
13 Correct 0 ms 1276 KB Output is correct
14 Correct 0 ms 1276 KB Output is correct
15 Correct 7 ms 1276 KB Output is correct