제출 #597112

#제출 시각아이디문제언어결과실행 시간메모리
597112ttamxAliens (IOI07_aliens)C++14
0 / 100
1 ms260 KiB
#include<bits/stdc++.h> using namespace std; int n,xo,yo; bool check(int x,int y){ printf("examine %d %d",x,y); string ret; cin >> ret; return ret=="true"; } int main(){ cin.tie(nullptr)->sync_with_stdio(false); cin >> n >> xo >> yo; int l=xo,r=n; for(int i=1;xo+i<=n;i<<=1){ if(!check(xo+i,yo)){ r=xo+i; break; }else{ l=xo+i; } } while(r-1>l){ int m=(l+r)>>1; if(check(m,yo)){ l=m; }else{ r=m; } } int xr=l; l=1,r=xo; for(int i=1;xo-i>=1;i<<=1){ if(!check(xo-i,yo)){ l=xo-i; break; }else{ r=xo-i; } } while(r-1>l){ int m=(l+r)>>1; if(check(m,yo)){ r=m; }else{ l=m; } } int xl=r; int sz=xr-xl+1; l=xr,r=n; for(int i=2*sz;xr+i<=n;i<<=1){ if(!check(xr+i,yo)){ r=xr+i; break; }else{ l=xr+i; } } while(r-sz>l){ int m=(l+r)>>1; if(check(m,yo)){ l=m; }else{ r=m; } } int Xr=l; l=1,r=xl; for(int i=2*sz;xl-i>=1;i<<=1){ if(!check(xl-i,yo)){ l=xl-i; break; }else{ r=xl-i; } } while(r-sz>l){ int m=(l+r)>>1; if(check(m,yo)){ r=m; }else{ l=m; } } int Xl=r; l=yo,r=n; for(int i=2*sz;yo+i<=n;i<<=1){ if(!check(Xl,yo+i)){ r=yo+i; break; }else{ l=yo+i; } } while(r-sz>l){ int m=(l+r)>>1; if(check(Xl,m)){ l=m; }else{ r=m; } } while(r-1>l){ int m=(l+r)>>1; if(check(Xl,m)){ l=m; }else{ r=m; } } int Yr=l; sz=(Xr-Xl)/2; printf("solution %d %d",Xl+sz,Yr-sz); }
#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...