Submission #890364

#TimeUsernameProblemLanguageResultExecution timeMemory
890364Sir_Ahmed_ImranAliens (IOI07_aliens)C++17
40 / 100
2 ms444 KiB
///~~~LOTA~~~/// #include <bits/stdc++.h> using namespace std; bool query(int x,int y){ string s; cout<<"examine "<<x<<' '<<y<<endl; cin>>s; return (s=="true"); } void solve(){ int n,m,o,p,q,x1,x2,y1,y2; cin>>n>>p>>q; for(x2=p+1;x2<=n;x2++) if(!query(x2,q)) break; for(x1=p-1;x1>0;x1--) if(!query(x1,q)) break; p=(x1+x2)/2; m=2*(x2-x1-1); for(y2=q+1;y2<=n;y2++) if(!query(p,y2)) break; for(y1=q-1;y1>0;y1--) if(!query(p,y1)) break; q=(y2+y1)/2; for(x1=p-m;x1>0;x1-=m) if(!query(x1,q)) break; for(x2=p+m;x2<=n;x2+=m) if(!query(x2,q)) break; for(y1=q-m;y1>0;y1-=m) if(!query(p,y1)) break; for(y2=q+m;y2<=n;y2+=m) if(!query(p,y2)) break; cout<<"solution "<<(x1+x2)/2<<' '<<(y1+y2)/2<<endl; } int main(){ solve(); return 0; }

Compilation message (stderr)

aliens.cpp: In function 'void solve()':
aliens.cpp:11:13: warning: unused variable 'o' [-Wunused-variable]
   11 |     int n,m,o,p,q,x1,x2,y1,y2;
      |             ^
#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...