Submission #486364

#TimeUsernameProblemLanguageResultExecution timeMemory
486364rainboyRuka (COI15_ruka)C11
9 / 100
2058 ms1652 KiB
#include <stdio.h> #define N 100000 int main() { static int xx[N], yy[N]; int n, m, i; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d%d", &xx[i], &yy[i]); scanf("%d", &m); i = 0; while (m--) { static char s[2]; scanf("%s", s); if (s[0] == 'B') { if (i > 0) i--; } else if (s[0] == 'F') { if (i + 1 < n) i++; } else if (s[0] == 'C') scanf("%d%d", &xx[i], &yy[i]); else { int j, x, y, cnt; x = 1, y = 1, cnt = 0; for (j = 0; j < n; j++) { if ((x > 0) != (x + xx[j] > 0)) cnt++; if ((y > 0) != (y + yy[j] > 0)) cnt++; x += xx[j], y += yy[j]; } printf("%d\n", cnt); } } return 0; }

Compilation message (stderr)

ruka.c: In function 'main':
ruka.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
ruka.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d%d", &xx[i], &yy[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ruka.c:12:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |  scanf("%d", &m);
      |  ^~~~~~~~~~~~~~~
ruka.c:17:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |   scanf("%s", s);
      |   ^~~~~~~~~~~~~~
ruka.c:25:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |    scanf("%d%d", &xx[i], &yy[i]);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...