Submission #1107264

#TimeUsernameProblemLanguageResultExecution timeMemory
1107264jadai007Aliens (IOI07_aliens)C++17
0 / 100
3 ms336 KiB
#include<bits/stdc++.h> using namespace std; int n, xo, yo; string ck; bool check(int x, int y){ if(x < 1 || x > n || y < 1 || y > n) return false; cout << "examine " << x << ' ' << y << endl; cin >> ck; if(ck == "false") return false; return true; } int main(){ cin >> n >> xo >> yo; int lx = xo, ly = yo, x, y; for(int j = 0; j < 3; ++j){ for(int i = 31; i >= 0; --i){ x = lx - (1<<i), y = ly; if(check(x, y)) lx = x, ly = y; } } for(int j = 0; j < 3; ++j){ for(int i = 31; i >= 0; --i){ x = lx, y = ly = y - (1<<i); if(check(x, y)) lx = x, ly = y; } } for(int i = 31; i >= 0; --i){ x = lx - (1<<i), y = ly - (1<<i); if(check(x, y)) lx = x, ly = y; } int rx = lx; for(int i = 31; i >= 0; --i){ int cx = rx + (1<<i); if(check(cx, ly)) rx = cx; } int m = 0; x = lx, y = ly; for (int i = 31; i >= 0; i--) { if (check(x + (1<<i), y + (1<<i))) m += (1<<i), x += (1<<i), y += (1<<i); } cout << "solution " << lx + m/2 << " " << ly + m/2 << endl; }
#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...