Submission #16616

# Submission time Handle Problem Language Result Execution time Memory
16616 2015-08-29T14:51:34 Z eaststar 볼질 (OJUZ10_ballparade) C++14
0 / 100
10 ms 1084 KB
#include <stdio.h>
int a[4]={1},ans,s;
void f(){
    for(int i=3;i;--i)if(a[i-1]){
        if(i>2)ans+=a[i];
        a[i]=1;
    }
}
void g(){
    for(int i=3;i;--i){
        if(i>2)ans+=a[i];
        else a[i+1]=a[i];
        a[i]=0;
    }
}
int main(){
    int n,k;
    scanf("%d",&n);
    for(;n--;){
        scanf("%d",&k);
        if(k==1)if(++s>3)f(),s=0;
        else if(k==2)s=0,f();
        else{
            g();
            if(++s>3)a[1]=1,s=0;
        }
    }
    printf("%d",ans);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1084 KB Output isn't correct
2 Incorrect 0 ms 1084 KB Output isn't correct
3 Incorrect 3 ms 1084 KB Output isn't correct
4 Incorrect 0 ms 1084 KB Output isn't correct
5 Incorrect 0 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
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Incorrect 7 ms 1084 KB Output isn't correct
3 Incorrect 8 ms 1084 KB Output isn't correct
4 Incorrect 1 ms 1084 KB Output isn't correct
5 Incorrect 3 ms 1084 KB Output isn't correct
6 Incorrect 0 ms 1084 KB Output isn't correct
7 Incorrect 0 ms 1084 KB Output isn't correct
8 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Incorrect 4 ms 1084 KB Output isn't correct
3 Incorrect 9 ms 1084 KB Output isn't correct
4 Incorrect 6 ms 1084 KB Output isn't correct
5 Incorrect 0 ms 1084 KB Output isn't correct
6 Incorrect 0 ms 1084 KB Output isn't correct
7 Incorrect 8 ms 1084 KB Output isn't correct
8 Incorrect 7 ms 1084 KB Output isn't correct
9 Incorrect 3 ms 1084 KB Output isn't correct
10 Incorrect 7 ms 1084 KB Output isn't correct
11 Incorrect 10 ms 1084 KB Output isn't correct
12 Incorrect 6 ms 1084 KB Output isn't correct
13 Incorrect 0 ms 1084 KB Output isn't correct
14 Incorrect 8 ms 1084 KB Output isn't correct
15 Correct 0 ms 1084 KB Output is correct