답안 #1044140

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1044140 2024-08-05T07:34:25 Z CyberCow COVID tests (CEOI24_covid) C++17
10 / 100
7000 ms 348 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 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 344 KB Output is correct
2 Correct 47 ms 344 KB Output is correct
3 Correct 29 ms 344 KB Output is correct
4 Correct 47 ms 344 KB Output is correct
5 Correct 29 ms 344 KB Output is correct
6 Correct 30 ms 344 KB Output is correct
7 Correct 31 ms 344 KB Output is correct
8 Correct 42 ms 344 KB Output is correct
9 Correct 38 ms 348 KB Output is correct
10 Correct 38 ms 344 KB Output is correct
11 Correct 32 ms 344 KB Output is correct
12 Correct 31 ms 344 KB Output is correct
13 Correct 29 ms 344 KB Output is correct
14 Correct 32 ms 344 KB Output is correct
15 Correct 31 ms 344 KB Output is correct
16 Correct 48 ms 344 KB Output is correct
17 Correct 37 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 7022 ms 344 KB Time limit exceeded
2 Halted 0 ms 0 KB -