Submission #1010941

#TimeUsernameProblemLanguageResultExecution timeMemory
1010941ivazivaAliens (IOI07_aliens)C++14
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; int main() { string rez; long long st2[30];st2[0]=1; for (long long i=1;i<30;i++) st2[i]=st2[i-1]*2; long long n,x0,y0; cin>>n>>x0>>y0; long long eksponentdesno=0; for (long long i=0;i<30;i++) { if (x0+st2[i]>n) break; cout<<"examine "<<x0+st2[i]<<" "<<y0<<endl;cin>>rez; if (rez=="true") eksponentdesno=st2[i]; else break; } long long ldesno=eksponentdesno; long long rdesno=min(2*eksponentdesno,n-x0); long long rezdesno=x0; while (ldesno<rdesno) { long long mid=(ldesno+rdesno)/2; cout<<"examine "<<x0+mid<<" "<<y0<<endl;cin>>rez; if (rez=="true") {rezdesno=mid;ldesno=mid+1;} else rdesno=mid; } long long desno=x0+rezdesno; long long eksponentlevo=0; for (long long i=0;i<30;i++) { if (x0-st2[i]<=0) break; cout<<"examine "<<x0-st2[i]<<" "<<y0<<endl;cin>>rez; if (rez=="true") eksponentlevo=st2[i]; else break; } long long llevo=eksponentlevo; long long rlevo=min(eksponentlevo*2,x0); long long rezlevo=y0; while (llevo<rlevo) { long long mid=(llevo+rlevo)/2; cout<<"examine "<<x0-mid<<" "<<y0<<endl;cin>>rez; if (rez=="true") {rezlevo=mid;llevo=mid+1;} else rlevo=mid; } long long levo=x0-rezlevo; long long m=desno-levo+1; cout<<m<<" "<<levo<<" "<<desno<<endl; long long lgore=0,rgore=min(m,y0-1); long long rezgore=0; while (lgore<rgore) { long long mid=(lgore+rgore)/2; cout<<"examine "<<x0<<" "<<y0-mid<<endl;cin>>rez; if (rez=="true") {rezgore=mid;lgore=mid+1;} else rgore=mid; } long long gore=y0-rezgore; long long dole=gore+m-1; cout<<gore<<" "<<dole<<endl; long long centarx=(levo+desno)/2; long long centary=(gore+dole)/2; vector<pair<long long,long long>> ans; for (long long i=-2;i<=2;i++) { for (long long j=-2;j<=2;j++) { long long pozx=centarx+i*m; long long pozy=centary+j*m; if (pozx<1 or pozx>n) continue; if (pozy<1 or pozy>n) continue; cout<<"examine "<<pozx<<" "<<pozy<<endl;cin>>rez; if (rez=="true") ans.push_back({pozx,pozy}); } } sort(ans.begin(),ans.end()); cout<<"solution "<<ans[6].first<<" "<<ans[6].second<<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...