| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1358089 | kmath628 | 볼질 (OJUZ10_ballparade) | C++20 | 2 ms | 344 KiB |
#include <bits/stdc++.h>
int main(){
int n,a=0,b=0,c=0,B=0,S=0,v;
scanf("%d",&n);
while(n--){
scanf("%d",&v);
if(v==1) B++;
else if(v==2) B=4;
else{
B++;
if(c==1) S++;
c=b; b=a; a=0;
if(B==4) a=1, B=0;
}
if(B==4){
if(a==1 && b==1 && c==1) S++;
else if(a==1 && b==1) c=1;
else if(a==1) b=1;
else a=1;
B=0;
}
}
printf("%d\n",S); return 0;
}
Compilation message (stderr)
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
