이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
int main()
{
bool x=0, y=0, z=0;
int r=0, c=0, n, a, i;
scanf("%d", &n);
for(i=0;i<n;i++)
{
scanf("%d", &a);
if(a==1||a==3)
{
if(a==3)
{
if(z)
r++;
z=y;
y=x;
x=0;
}
c++;
}
if(c==4||a==2)
{
c=0;
if(x&&y&&z)
{
z=0;
r++;
}
if(x&&y)
{
z=1;
y=0;
}
if(x)
y=1;
x=1;
}
}
printf("%d", r);
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... |