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