Submission #595693

#TimeUsernameProblemLanguageResultExecution timeMemory
595693NekoRollyAliens (IOI07_aliens)C++17
30 / 100
2 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){ string s; if (m < 1 || n < m) return 0; if (f) cout << "examine " << m << " " << y << endl; else cout << "examine " << x << " " << m << endl; cin >> s; return s == "true"; } 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 << " " << M << 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...