Submission #1009125

#TimeUsernameProblemLanguageResultExecution timeMemory
1009125ALTAKEXEAliens (IOI07_aliens)C++17
0 / 100
2 ms436 KiB
#include <iostream> #include <vector> #include <cmath> using namespace std; void flush() { cout.flush(); } bool examine(int x, int y) { cout << "examine " << x << " " << y << endl; flush(); string response; cin >> response; return response == "true"; } int main() { int N, X0, Y0; cin >> N >> X0 >> Y0; int M = 3; int low = 3, high = N; while (low <= high) { int mid = (low + high) / 2; bool found = true; for (int i = -mid / 2; i <= mid / 2; i++) { for (int j = -mid / 2; j <= mid / 2; j++) { int x = X0 + i * mid; int y = Y0 + j * mid; if (x < 1 || x > N || y < 1 || y > N || !examine(x, y)) { found = false; break; } } if (!found) break; } if (found) { M = mid; break; } high = mid - 1; } int offset = (M * 5) / 2; int XC = X0 + offset; int YC = Y0 + offset; cout << "solution " << XC << " " << YC << endl; flush(); return 0; }
#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...
#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...