Submission #436111

#TimeUsernameProblemLanguageResultExecution timeMemory
436111dutchAliens (IOI07_aliens)C++17
10 / 100
5 ms200 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int n, x, y; bool q(int i, int j){ if(min(i, j) < 1 || max(i, j) > n) return 0; cout << "examine " << i << ' ' << j << endl; string res; cin >> res; return res[0] == 't'; } signed main(){ cin.tie(0)->sync_with_stdio(0); cin >> n >> x >> y; int xMax = x, xMin = x, yMax = y; for(int i=1<<30, j; i/=2; ){ j = xMax + i; if(q(j, y)){ j += xMax; if(q(j/2, y) && (((j+3)/4)<=x || q((j+3)/4, y))) xMax += i; } j = yMax + i; if(q(x, j)){ j += yMax; if(q(x, j/2) && (((j+3)/4)<=y || q(x, (j+3)/4))) yMax += i; } j = xMin - i; if(q(j, y)){ j += xMin; if(q(j/2, y) && (((j+3)/4)>=x || q((j+3)/4, y))) xMin -= i; } } int w = 2*(xMax - xMin + 1); int yMin = yMax - (xMax - xMin); x = (xMin + xMax) / 2; y = (yMin + yMax) / 2; xMin = xMax = x; yMin = yMax = y; if(q(x-w, y)) xMin -= w; if(q(x-w, y)) xMin -= w; if(q(x+w, y)) xMax += w; if(q(x+w, y)) xMax += w; if(q(x, y-w)) yMin -= w; if(q(x, y-w)) yMin -= w; if(q(x, y+w)) yMax += w; if(q(x, y+w)) yMax += w; cout << "solution " << (xMin+xMax)/2 << ' ' << (yMin+yMax)/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...