Submission #886631

#TimeUsernameProblemLanguageResultExecution timeMemory
886631MackerAliens (IOI07_aliens)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(v) v.begin(), v.end() int main() { int bx, by, n; cin >> n >> bx >> by; int mid; int up = 1, lup = 0; while(true){ cout << "examine " << bx << " " << by + up << endl; string s; cin >> s; if(s == "false"){ break; } lup = up; up *= 2; } while(lup < up){ mid = (lup + up + 1) / 2; cout << "examine " << bx << " " << by + mid << endl; string s; cin >> s; if(s == "false") up = mid - 1; else lup = mid; } int dw = 1, ldw = 0; while(true){ cout << "examine " << bx << " " << by - dw << endl; string s; cin >> s; if(s == "false"){ break; } ldw = dw; dw *= 2; } while(ldw < dw){ mid = (ldw + dw + 1) / 2; cout << "examine " << bx << " " << by - mid << endl; string s; cin >> s; if(s == "false") dw = mid - 1; else ldw = mid; } int lf = 1, llf = 0; while(true){ cout << "examine " << bx + lf << " " << by << endl; string s; cin >> s; if(s == "false"){ break; } llf = lf; lf *= 2; } while(llf < lf){ mid = (llf + lf + 1) / 2; cout << "examine " << bx + mid << " " << by << endl; string s; cin >> s; if(s == "false") lf = mid - 1; else llf = mid; } cout << (up + dw) << " " << up << " " << lf << endl; by += up - (up + dw) / 2; bx += lf - (up + dw) / 2; int mxl = 0; for (int i = 1; i < 5; i++) { cout << "examine " << bx + (up + dw) * 2 * i << " " << by << endl; string s; cin >> s; if(s == "true") mxl = i; else break; } int mxu = 0; for (int i = 1; i < 5; i++) { cout << "examine " << bx << " " << by + (up + dw) * 2 * i << endl; string s; cin >> s; if(s == "true") mxu = i; else break; } int mxd = 0; for (int i = 1; i < 5; i++) { cout << "examine " << bx << " " << by - (up + dw) * 2 * i << endl; string s; cin >> s; if(s == "true") mxd = i; else break; } if(mxd + mxu == 1) { if(mxd == 1) by -= (up + dw); else by += (up + dw); if(mxl == 1) bx += (up + dw); else bx -= (up + dw); } else { if(mxd == 2) by -= (up + dw) * 2; if(mxd == 0) by += (up + dw) * 2; if(mxl == 2) bx += (up + dw) * 2; if(mxl == 0) bx -= (up + dw) * 2; } cout << "solution " << bx << " " << by << 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...