Submission #14126

#TimeUsernameProblemLanguageResultExecution timeMemory
14126gs13105볼질 (OJUZ10_ballparade)C++98
0 / 100
6 ms1084 KiB
#include <stdio.h> int main() { int s=0, r=0, c=0, n, a, i; scanf("%d", &n); for(i=0;i<n;i++) { scanf("%d", &a); if(a==1||a==3) { if(a==3) s<<=1; c++; } if(c==4||a==2) { c=0; if(!(s&(s+1))) s=(s>>1)&1; s++; s|=1; } if(s&(1<<3)) { r++; s^=(1<<3); } } printf("%d", r); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...