# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90527 | tjrwodnjs999 | 볼질 (OJUZ10_ballparade) | C++11 | 7 ms | 2500 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 <bits/stdc++.h>
using namespace std;
int n,m,a,b,c,d,cnt;
int main(){
scanf("%d",&n);
while(n--){
scanf("%d",&m);
if(m==1) d++;
if(m==2||d==4){
if(c&&b&&a) cnt++,c=0;
if(b&&a) c=1,b=0;
if(a) b=1;
a=1; d=0;
}
if(m==3){
if(c) cnt++,c=0;
if(b) c=1,b=0;
if(a) b=1,a=0;
d++;
if(d==4) d=0,a=1;
}
}
printf("%d",cnt);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |