제출 #595683

#제출 시각아이디문제언어결과실행 시간메모리
595683NekoRollyAliens (IOI07_aliens)C++17
0 / 100
0 ms208 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,x,y,M; ll Lx,Rx,Ly,Ry; ll l,r; bool Query(ll m,bool f){ if (m < 1 || n < m) return 0; if (f) cout << "examine " << m << " " << y << endl; else cout << "examine " << x << " " << m << endl; cin >> f; return f; } void GoLR(bool f,ll &L,ll &R){ for (l=1, r=f?x:y; l<r; ){ ll m = (l+r)/2; if (Query(m, f)) r = m; else l = m+1; } L = l; for (l=f?x:y, r=n; l<r; ){ ll m = (l+r+1)/2; if (Query(m, f)) l = m; else r = m-1; } R = r, M = R - L + 1; if (M%3 == 0 && !Query(L + M/3, f) && Query(L + M/3 - 1, f)) M /= 3, R -= 2*M; if (M%5 == 0 && !Query(L + M/5, f) && Query(L + M/5 - 1, f)) M /= 5, R -= 4*M; for (; Query(L - 2*M, f); ) L -= 2*M, R -= 2*M; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> x >> y; GoLR(1, Lx, Rx), GoLR(0, Ly, Ry); // cout << Lx << " " << Ly << endl; cout << "solution " << Lx + (5*M - 1)/2 << " " << Ly + (5*M - 1)/2 << endl; 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...