Submission #14104

#TimeUsernameProblemLanguageResultExecution timeMemory
14104jackae98볼질 (OJUZ10_ballparade)C++98
22 / 100
7 ms1276 KiB
#include <stdio.h> int n; int a[50010]; int b[5]; int ball; int main() { scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } for(int i=1;i<=n;i++){ if(a[i]==1) { ball++; if(ball==4) { ball=0; b[0]++; for(int j=3;j>=0;j--){ if(b[j]>=1) { b[j+1]++; b[j]--; } } } } if(a[i]==2) { ball=0; b[0]++; for(int j=3;j>=0;j--){ if(b[j]>=1) { b[j+1]++; b[j]--; } } } if(a[i]==3) { ball++; if(ball==4) { ball=0; b[0]++; } for(int j=3;j>=0;j--){ if(b[j]>=1) { b[j+1]++; b[j]--; } } } } printf("%d",b[4]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...