Submission #1223142

#TimeUsernameProblemLanguageResultExecution timeMemory
1223142spetrHow to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid)C++20
Compilation error
0 ms0 KiB
std::pair<int,int> scout(int R, int H) { int velikost = 1; vector<vector<int>> v(1000); for (int i = 0; i < R; i++) { vector<int> pole; for (int j = 1; j <= 1000; j += 2*velikost) { for (int k = j; k < j + velikost && k <= 1000; k++) { pole.push_back(k); v[k-1].push_back(i); } } velikost *= 2; send(pole); } auto p = wait(); for (int i = 0; i < 1000; i++) { if (v[i].empty()) continue; bool ok = true; for (int j = 0; j < (int)v[i].size(); j++) { if (p[v[i][j]] == 0) { ok = false; break; } } if (ok) return {i+1, i+1}; } return {1,1}; }

Compilation message (stderr)

avoid.cpp:1:6: error: 'pair' in namespace 'std' does not name a template type
    1 | std::pair<int,int> scout(int R, int H) {
      |      ^~~~
avoid.cpp:1:1: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
  +++ |+#include <utility>
    1 | std::pair<int,int> scout(int R, int H) {