답안 #1044135

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1044135 2024-08-05T07:33:22 Z CyberCow COVID tests (CEOI24_covid) C++17
0 / 100
29 ms 344 KB
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <iostream>
using namespace std;

int N;
double P;

bool test_students(int g) {
    cout << "Q ";
    for (int i = 0; i < g; i++)
    {
        cout << 0;
    }
    cout << 1;
    for (int i = g + 1; i < N; i++)
    {
        cout << 0;
    }
    cout << endl;
    char c;
    cin >> c;
    if (c == 'P')
        return 1;
    return 0;
}

void find_positive(vector<bool> v) {
    cout << "A ";
    for (int i = 0; i < v.size(); i++)
    {
        cout << v[i] << ' ';
    }
    cout << endl;
    char c;
    cin >> c;
}

int main() {
    int T;
    cin >> N >> P >> T;
    for (int i = 0; i < T; i++) {
        vector<bool> answer;
        for (int j = 0; j < N; j++)
        {
            if (test_students(j))
            {
                answer.push_back(1);
            }
            else
            {
                answer.push_back(0);
            }
        }
        find_positive(answer);
    }
    return 0;
}

Compilation message

Main.cpp: In function 'void find_positive(std::vector<bool>)':
Main.cpp:32:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for (int i = 0; i < v.size(); i++)
      |                     ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 29 ms 344 KB Protocol violation
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 29 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -