# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890316 | MuhammadSaram | Aliens (IOI07_aliens) | C++17 | 1 ms | 436 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.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x,y;
cin>>n>>x>>y;
int m,cor,cor1;
for (int i=1;i<min(101,n-x+1);i++)
{
cout<<"examine "<<x+i<<' '<<y<<endl;
string s;
cin>>s;
if (s=="false")
{
m=i;
break;
}
if (i==n-x)
m=i+1;
}
for (int i=1;i<min(101,x);i++)
{
cout<<"examine "<<x-i<<' '<<y<<endl;
string s;
cin>>s;
if (s=="false")
{
cor=i;
m+=i-1;
break;
}
if (i==x-1)
{
m+=i;
cor=x;
}
}
for (int i=1;i<min(101,y);i++)
{
cout<<"examine "<<x<<' '<<y-i<<endl;
string s;
cin>>s;
if (s=="false")
{
cor1=i;
break;
}
if (i==y-1)
cor1=y;
}
x+=(m+1)/2-cor;
y+=(m+1)/2-cor1;
for (int i=1;i<=5;i++)
for (int j=1;j<=5;j++)
{
if (i%2!=j%2)
continue;
bool b=true;
for (int k=1;k<=5 and b;k++)
if (i%2==k%2 and k!=j)
{
int y1=y+(k-j)*m;
if (y1<1 or y1>n)
b=false;
else
{
cout<<"examine "<<x<<' '<<y1<<endl;
string s;
cin>>s;
if (s=="false")
b=false;
}
}
for (int k=1;k<=5 and b;k++)
if (j%2==k%2 and k!=i)
{
int x1=x+(k-i)*m;
if (x1<1 or x1>n)
b=false;
else
{
cout<<"examine "<<x1<<' '<<y<<endl;
string s;
cin>>s;
if (s=="false")
b=false;
}
}
if (b)
{
cout<<"solution "<<x+(3-i)*m<<' '<<y+(3-j)*m<<endl;
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... |