Submission #1036018

#TimeUsernameProblemLanguageResultExecution timeMemory
1036018sleepntsheepCOVID tests (CEOI24_covid)C11
0 / 100
48 ms344 KiB
#include <stdio.h> #include <string.h> int n, t; double p; int main() { scanf("%d%lf%d", &n, &p, &t); while (t--) { char a[1001] = { 0 }; for (int i = 0; i < n; ++i) a[i] = '0'; int at = 0; while (at < n) { int lb = at - 1, ub = n; while (ub - lb > 1) { char q[1001] = { 0 }; for (int i = 0; i < n; ++i) q[i] = '0'; int md = lb + (ub - lb) / 2; for (int j = lb; j <= md; ++j) q[j] = '1'; printf("Q %s\n", q); fflush(stdout); char result; scanf(" %c", &result); if (result == 'P') ub = md; else lb = md; } if (ub < n) a[ub] = '1'; at = ub + 1; } printf("A %s\n", a); fflush(stdout); char verdict; scanf(" %c", &verdict); if ('W' == verdict) return 0; } }

Compilation message (stderr)

Main.c: In function 'main':
Main.c:8:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d%lf%d", &n, &p, &t);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.c:27:17: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |                 scanf(" %c", &result);
      |                 ^~~~~~~~~~~~~~~~~~~~~
Main.c:42:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |         scanf(" %c", &verdict);
      |         ^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...