# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890364 | Sir_Ahmed_Imran | Aliens (IOI07_aliens) | C++17 | 2 ms | 444 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
///~~~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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |