# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
16840 | sinceww77 | 볼질 (OJUZ10_ballparade) | C++98 | 8 ms | 1276 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
int data[50010],c[5];
int main()
{
int i,j,n,m,b=0,tot=0;
scanf("%d\n",&n);
for(i=0;i<n;i++)
{
scanf("%d ",&m);
if(m==1) b++;
if(b==4)
{
if(c[3]==1)
{
c[3]=0;
tot+=1;
}
if(c[2]==1)
{
c[2]=0;
c[3]=1;
}
if(c[1]==1)
{
c[2]=1;
}
b=0;
}
if(m==2)
{
if(c[3]==1)
{
c[3]=0;
tot+=1;
}
if(c[2]==1)
{
c[2]=0;
c[3]=1;
}
if(c[1]==1)
{
c[2]=1;
}
c[1]=1;
b=0;
}
if(m==3)
{
if(c[3]==1)
{
c[3]=0;
tot+=1;
}
if(c[2]==1)
{
c[2]=0;
c[3]=1;
}
if(c[1]==1)
{
c[1]=0;
c[2]=1;
}
b=0;
}
}
printf("%d",tot);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |