Submission #16617

#TimeUsernameProblemLanguageResultExecution timeMemory
16617eaststar볼질 (OJUZ10_ballparade)C++14
100 / 100
8 ms1084 KiB
#include <stdio.h> int a[4]={1},ans,s; int main(){ int i,n,k; scanf("%d",&n); for(;n--;){ scanf("%d",&k); if(k==1)++s; if(k==3)ans+=a[3],a[3]=a[2],a[2]=a[1],a[1]=0,++s; if(k==2||s>3){ if(a[1]){ if(a[2]){ if(a[3])++ans; a[3]=1; } a[2]=1; } a[1]=1; s=0; } } printf("%d",ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...