Submission #1051554

#TimeUsernameProblemLanguageResultExecution timeMemory
1051554MercubytheFirstHow to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid)C++17
0 / 100
1 ms448 KiB
#include "avoid.h" #include <bits/stdc++.h> using namespace std; std::pair<int, int> scout(int R, int H) { int l = 1, r = 1000, ans = -1; while(l <= r) { int m = (l + r) / 2; vector<int> query; for(int i = l; i <= m; ++i) { query.push_back(i); } send(query); bool ok = wait()[0]; if(ok) { ans = m; r = m - 1; } else { l = m + 1; } } const int a = ans; l = 1, r = 1000, ans = -1; while(l <= r) { int m = (l + r) / 2; vector<int> query; for(int i = l; i <= m; ++i) { query.push_back(i); } send(query); bool ok = wait()[0]; if(ok) { ans = m; l = m + 1; } else { r = m - 1; } } const int b = ans; assert(a != -1 and b != -1); return {a, b}; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...