Submission #1044140

#TimeUsernameProblemLanguageResultExecution timeMemory
1044140CyberCowCOVID tests (CEOI24_covid)C++17
10 / 100
7022 ms348 KiB
#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 (stderr)

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++)
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...