답안 #14177

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14177 2015-05-03T05:56:43 Z kdh9949 볼질 (OJUZ10_ballparade) C++
22 / 100
6 ms 1084 KB
#include<stdio.h>
int t,n,i,j,s,c,ans,a[4];
void f1()
{
    if(a[3]&&a[2]&&a[1])a[3]--,ans++;
    if(a[2]&&a[1])a[2]--,a[3]++;
    if(a[1])a[2]++,a[1]--;a[1]++;
}
void f2()
{
    if(a[3])ans++;
    if(a[2])a[2]--,a[3]++;
    if(a[1])a[1]--,a[2]++;
}
int main()
{
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&t);
        if(t==1)
        {
            if(c==3)
            {
                f1();
                c=0;
            }
            else c++;
        }
        else if(t==2)
        {
            f1();
            c=0;
        }
        else if(t==3)
        {
            f2();
            if(c==3)
            {
                a[1]++;
                c=0;
            }
            else c++;
        }
    }
    printf("%d",ans);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 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
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 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 Correct 0 ms 1084 KB Output is correct
5 Incorrect 0 ms 1084 KB Output isn't correct
6 Incorrect 4 ms 1084 KB Output isn't correct
7 Incorrect 3 ms 1084 KB Output isn't correct
8 Incorrect 0 ms 1084 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Incorrect 6 ms 1084 KB Output isn't correct
3 Incorrect 3 ms 1084 KB Output isn't correct
4 Incorrect 3 ms 1084 KB Output isn't correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Incorrect 5 ms 1084 KB Output isn't correct
8 Incorrect 3 ms 1084 KB Output isn't correct
9 Incorrect 3 ms 1084 KB Output isn't correct
10 Incorrect 0 ms 1084 KB Output isn't correct
11 Incorrect 5 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 0 ms 1084 KB Output isn't correct
15 Incorrect 5 ms 1084 KB Output isn't correct