Submission #13925

#TimeUsernameProblemLanguageResultExecution timeMemory
13925model_code볼질 (OJUZ10_ballparade)C++98
100 / 100
7 ms1084 KiB
#include<stdio.h> int n, bc, base[4], fail; char yn[2][4]={"No","Yes"}; int main(){ int i; scanf("%d", &n); for(i=0; i<n; i++){ int a; scanf("%d", &a); if(a==3){ // wild pitch bc++; fail+=base[3]; base[3]=base[2], base[2]=base[1], base[1]=0; if(bc==4)base[1]=1, bc=0; // BB continue; } if(a==1)bc++; if(a==2 || bc==4){ // base on balls if(base[3] && base[2] && base[1])fail++; else{ if(base[3] || (base[2] && base[1]))base[3]=1; else base[3]=0; if(base[2] || base[1])base[2]=1; else base[2]=0; base[1]=1; } bc=0; } } printf("%d", fail); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...