답안 #14179

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14179 2015-05-03T07:55:54 Z gs14041 볼질 (OJUZ10_ballparade) C++
0 / 100
0 ms 1076 KB
#include<stdio.h>
int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int score;
    int x[4]={};
    int n,i,j,a;
    int ball=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a);
        if(a==1 || a==3)
        {
            ball++;
            if(ball==4)
            {
                if(a==3)
                {
                    score+=x[3];
                    x[3]=x[2];
                    x[2]=x[1];
                    x[1]=0;
                }
                else
                {
                    if(x[1] && x[2])
                    {
                        x[3]=0;
                        score++;
                    }
                    if(x[1])
                    {
                        x[2]=0;
                        x[3]=1;
                    }
                    x[2]=x[1];
                    x[1]=1;
                }
                ball=0;
            }
        }
        if(a==2)
        {
            ball=0;
            if(x[1] && x[2])
            {
                x[3]=0;
                score++;
            }
            if(x[1])
            {
                x[2]=0;
                x[3]=1;
            }
            x[2]=x[1];
            x[1]=1;
        }
    }
    printf("%d",score);
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
2 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
3 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
4 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
5 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
6 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
7 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
2 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
3 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
4 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
5 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
6 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
7 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
8 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
2 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
3 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
4 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
5 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
6 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
7 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
8 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
9 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
10 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
11 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
12 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
13 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
14 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)
15 Runtime error 0 ms 1076 KB open (syscall #2) was called by the program (disallowed syscall)