Submission #14266

#TimeUsernameProblemLanguageResultExecution timeMemory
14266kimjg1119볼질 (OJUZ10_ballparade)C++98
22 / 100
7 ms1084 KiB
#include <stdio.h> int run[4]={},sum,ball; void runover() { if(run[3]==1) sum++; run[3]=run[2]; run[2]=run[1]; run[1]=0; } int main() { int n,t,i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&t); if(t==1) { ball++; if(ball==4) { ball=0; runover(); run[1]=1; } } if(t==3) { ball++; runover(); if(ball==4) { ball=0; run[1]=1; } } if(t==2) { ball=0; runover(); run[1]=1; } } printf("%d",sum); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...