답안 #1026598

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1026598 2024-07-18T08:27:40 Z 변재우(#10949) COVID tests (CEOI24_covid) C++17
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>
using namespace std;

int N, T; double P;

bool chk[1010]={0};
void F(int l, int r) {
    if(l==r) {
        chk[l]=true;
        return;
    }
    int m=(l+r)/2;
    printf("Q ");
    for(int i=1; i<=N; i++) {
        if(l<=i && i<=m) printf("1");
        else printf("0");
    }
    printf("\n");
    fflush(stdout);
    char x; scanf(" %c", &x);
    if(x=='P') F(l, m);
    else F(m+1, r);
}

signed main() {
    scanf("%d%lf%d", &N, &P, &T);
    while(T--) {
        fill(chk+1, chk+N+1, false);
        F(1, N);
        printf("A ");
        for(int i=1; i<=N; i++) printf("%d", chk[i]);
        printf("\n");
        fflush(stdout);
        char x; scanf("%c", &x);
    }
    return 0;
}

Compilation message

Main.cpp: In function 'void F(int, int)':
Main.cpp:20:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |     char x; scanf(" %c", &x);
      |             ~~~~~^~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:26:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   26 |     scanf("%d%lf%d", &N, &P, &T);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:34:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   34 |         char x; scanf("%c", &x);
      |                 ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB translate:wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -