Submission #1058448

#TimeUsernameProblemLanguageResultExecution timeMemory
1058448rainboyCOVID tests (CEOI24_covid)C11
0 / 100
9 ms344 KiB
#include <stdio.h> #include <string.h> #define N 1000 int n; int query(int l, int r) { static char cc[N + 1], s[2]; memset(cc, '0', n * sizeof *cc), memset(cc + l, '1', (r - l) * sizeof *cc), cc[n] = 0; printf("Q %s\n", cc), fflush(stdout); scanf("%s", s); return s[0] == 'P'; } char cc[N + 1]; void solve(int l, int r) { int m; if (!query(l, r)) { memset(cc, '0', (r - l) * sizeof *cc); return; } if (r - l > 1) { m = (l + r) / 2; solve(l, m), solve(m, r); } } int main() { int t; scanf("%d%*f%d", &n, &t); while (t--) { memset(cc, '1', n * sizeof *cc), cc[n] = 0; solve(0, n); printf("A %s\n", cc), fflush(stdout); scanf("%*s"); } return 0; }

Compilation message (stderr)

Main.c: In function 'query':
Main.c:13:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |  scanf("%s", s);
      |  ^~~~~~~~~~~~~~
Main.c: In function 'main':
Main.c:35:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |  scanf("%d%*f%d", &n, &t);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
Main.c:40:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |   scanf("%*s");
      |   ^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...