Submission #14267

# Submission time Handle Problem Language Result Execution time Memory
14267 2015-05-09T07:00:27 Z moonrabbit2 볼질 (OJUZ10_ballparade) C++
100 / 100
7 ms 1084 KB
//1. 역시 갓승현...
//2. 사이트 이름을 다시 GODainta.com으로!
#include <cstdio>
int main()
{
    int n,base[3]={0},ballnum=0,score=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        int ball,newbase[3]={0};
        scanf("%d",&ball);
        if(ball==1){
            ballnum++;
            if(ballnum!=4){
                for(int j=0;j<4;j++)newbase[j]=base[j];
            }
            if(ballnum==4&&base[0])newbase[1]=1;
            if(ballnum==4&&base[0]&&base[1])newbase[2]=1;
            else if(ballnum==4&&base[1])newbase[1]=1;
            if(ballnum==4&&base[0]&&base[1]&&base[2])score++;
            else if(ballnum==4&&base[2])newbase[2]=1;
            if(ballnum==4){
                newbase[0]=1;
                ballnum=0;
            }
        }
        if(ball==2){
            if(base[0])newbase[1]=1;
            if(base[0]&&base[1])newbase[2]=1;
            else if(base[1])newbase[1]=1;
            if(base[0]&&base[1]&&base[2])score++;
            else if(base[2])newbase[2]=1;
            newbase[0]=1;
            ballnum=0;
        }
        if(ball==3){
            ballnum++;
            if(ballnum==4){
                newbase[0]=1;
                ballnum=0;
            }
            if(base[0])newbase[1]=1;
            if(base[1])newbase[2]=1;
            if(base[2])score++;
        }
        for(int j=0;j<3;j++)base[j]=newbase[j];
    }
    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 1 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 5 ms 1084 KB Output is correct
2 Correct 6 ms 1084 KB Output is correct
3 Correct 3 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
8 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 5 ms 1084 KB Output is correct
4 Correct 4 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 0 ms 1084 KB Output is correct
8 Correct 0 ms 1084 KB Output is correct
9 Correct 0 ms 1084 KB Output is correct
10 Correct 3 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 6 ms 1084 KB Output is correct
14 Correct 0 ms 1084 KB Output is correct
15 Correct 6 ms 1084 KB Output is correct