Submission #507944

#TimeUsernameProblemLanguageResultExecution timeMemory
507944ac2huAliens (IOI07_aliens)C++14
0 / 100
5 ms304 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int M = 31623; const int N = 2'000'000'000; bool check(int i,int j,int n){ if(i >0 && j >0 && i <= n && j <= n){ cout << "examine " << i << " " << j << endl; string s;cin >> s; return ((s == "true")? true : false); } return 0; } signed main(){ iostream::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr); int n,x,y;cin >> n >> x >> y; int rx = x; for( ;rx<=n;rx++){ if(!check(rx,y,n)){ break; } } rx--; int ry = y; for(;ry<=n;ry++) if(!check(rx,ry,n)) break; ry--; int l = 0,r = n - max(rx,ry); while(l < r){ int mid = (l + r + 1)/2; if(check(rx + mid, ry + mid,n)) l = mid; else r = mid - 1; } pair<int,int> topcorner = {rx + l, ry + l}; l = 0,r = min(rx,ry) - 1; while(l < r){ int mid = (l + r + 1)/2; if(check(rx - mid,ry - mid, n)) l = mid; else r = mid - 1; } pair<int,int> bottomcorner = {rx - l,ry - l}; pair<int,int> center = {(topcorner.first + bottomcorner.first)/2,(topcorner.second + bottomcorner.second)/2}; cout << "solution " << center.first << " " << center.second << "\n"; }
#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...