Submission #14037

# Submission time Handle Problem Language Result Execution time Memory
14037 2015-04-25T14:58:06 Z jinmo123 볼질 (OJUZ10_ballparade) C
0 / 100
10 ms 1080 KB
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 time Memory Grader output
1 Correct 0 ms 1080 KB Output is correct
2 Incorrect 4 ms 1080 KB Output isn't correct
3 Incorrect 0 ms 1080 KB Output isn't correct
4 Incorrect 6 ms 1080 KB Output isn't correct
5 Incorrect 0 ms 1080 KB Output isn't correct
6 Incorrect 0 ms 1080 KB Output isn't correct
7 Incorrect 0 ms 1080 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1080 KB Output isn't correct
2 Incorrect 0 ms 1080 KB Output isn't correct
3 Incorrect 0 ms 1080 KB Output isn't correct
4 Incorrect 0 ms 1080 KB Output isn't correct
5 Incorrect 0 ms 1080 KB Output isn't correct
6 Incorrect 0 ms 1080 KB Output isn't correct
7 Incorrect 0 ms 1080 KB Output isn't correct
8 Incorrect 0 ms 1080 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1080 KB Output isn't correct
2 Incorrect 5 ms 1080 KB Output isn't correct
3 Incorrect 4 ms 1080 KB Output isn't correct
4 Incorrect 0 ms 1080 KB Output isn't correct
5 Correct 0 ms 1080 KB Output is correct
6 Incorrect 10 ms 1080 KB Output isn't correct
7 Incorrect 6 ms 1080 KB Output isn't correct
8 Incorrect 7 ms 1080 KB Output isn't correct
9 Incorrect 0 ms 1080 KB Output isn't correct
10 Incorrect 0 ms 1080 KB Output isn't correct
11 Incorrect 7 ms 1080 KB Output isn't correct
12 Incorrect 0 ms 1080 KB Output isn't correct
13 Incorrect 0 ms 1080 KB Output isn't correct
14 Incorrect 5 ms 1080 KB Output isn't correct
15 Incorrect 4 ms 1080 KB Output isn't correct