Submission #14242

#TimeUsernameProblemLanguageResultExecution timeMemory
14242gkwnsals12볼질 (OJUZ10_ballparade)C11
0 / 100
0 ms1268 KiB
#include <stdio.h> int bace[5],a[50001],bc=0,i,j,n,score=0; int main(void) { FILE *in,*out; in=stdin;//fopen("input.txt","r"); out=fopen("output.txt","w"); fscanf(in,"%d",&n); for(i=0;i<n;i++){ // printf("%d %d %d %d\n",bace[1],bace[2],bace[3],bc); fscanf(in,"%d",&a[i]); if(a[i]==3){ if(bace[3]==1){ score++; bace[3]=0; } bace[3]=bace[2]; bace[2]=bace[1]; bace[1]=0; } if(a[i]==1 || a[i]==3) bc++; if(bc==4 ||a[i]==2){ bc=0; if(bace[1]==1 && bace[2]==1 && bace[3]==1) score++; else if(bace[1]==1 && bace[2]==1) bace[3]=1; else if(bace[1]==1) bace[2]=1; else bace[1]=1; } } printf("%d",score); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...