Submission #14037

#TimeUsernameProblemLanguageResultExecution timeMemory
14037jinmo123볼질 (OJUZ10_ballparade)C11
0 / 100
10 ms1080 KiB
int taja = 0; int len; char ball = 0; char m[3]; int score = 0; void jinru() { if(m[0]) { if(m[1]) { if(m[2]) { m[2] = 0; score++; } m[2] = m[1]; } m[1] = m[0]; } ball = 0; } int main() { scanf("%d", &len); int i; for(i = 0; i < len; i++) { int b; scanf("%d", &b); switch(b) { case 1: ball++; printf("Ball! %d\n", taja); if(ball == 4) { jinru(); m[0] = 1; taja++; } break; case 2: //printf("Deadball! %d\n", taja); jinru(); m[0] = 1; taja++; break; case 3: if(m[2]) score++; m[2] = m[1]; m[1] = m[0]; if(ball == 3) { ball = 0; m[0] = 1; //printf("Poktu! %d\n", taja++); } else { ball++; m[0] = 0; //printf("Poktu! %d\n", taja); } break; } } printf("%d", score); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...