답안 #14282

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14282 2015-05-10T01:26:32 Z jang718 볼질 (OJUZ10_ballparade) C++
22 / 100
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;}else if(a[i-1]==1){a[i]=1;a[i-1]=0;}}
            a[1]=1;
            a[0]=0;
        }
        if(a[4]==1){
            score++;
            a[4]=0;
        }
    }
    printf("%d",score);
    return 0;
}

# 결과 실행 시간 메모리 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 3 ms 1084 KB Output is correct
7 Correct 6 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 1084 KB Output isn't correct
2 Incorrect 3 ms 1084 KB Output isn't correct
3 Incorrect 0 ms 1084 KB Output isn't correct
4 Correct 0 ms 1084 KB Output is correct
5 Incorrect 0 ms 1084 KB Output isn't correct
6 Correct 0 ms 1084 KB Output is correct
7 Incorrect 0 ms 1084 KB Output isn't correct
8 Correct 0 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Correct 0 ms 1084 KB Output is correct
3 Incorrect 6 ms 1084 KB Output isn't correct
4 Incorrect 5 ms 1084 KB Output isn't correct
5 Incorrect 6 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 Correct 0 ms 1084 KB Output is correct
9 Incorrect 5 ms 1084 KB Output isn't correct
10 Incorrect 3 ms 1084 KB Output isn't correct
11 Incorrect 0 ms 1084 KB Output isn't correct
12 Incorrect 0 ms 1084 KB Output isn't correct
13 Incorrect 6 ms 1084 KB Output isn't correct
14 Incorrect 3 ms 1084 KB Output isn't correct
15 Incorrect 7 ms 1084 KB Output isn't correct