#include<bits/stdc++.h>
#define lli long long int
#define int long long int
#define pii pair<int, int>
#ifdef LOCAL
#define debug(a) cout<<#a<<' '<<a<<endl;
#endif
#ifndef LOCAL
#define debug(a) ;
#endif
using namespace std;
void faster(void)
{
ios_base::sync_with_stdio(false);
cin.tie();
cout.tie();
}
int lcm(int a, int b)
{
return (a*b)/__gcd(a,b);
}
int32_t main()
{
//#ifdef LOCAL
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
//#endif
string s;
int n, x, y, i, a, b, c, m;
cin >> n >> x >> y;
for(i=1;i<=100;i+=3)
{
if(x+i>=n) break;
cout<<"examine "<<x+i<<' '<<y<<endl;
cin >> s;
if(s[0]=='f') break;
}
for(;i<=100;i++)
{
if(x+i>=n) break;
cout<<"examine "<<x+i<<' '<<y<<endl;
cin >> s;
if(s[0]=='f') break;
}
a=x+i-1;
for(i=1;i<=100;i+=3)
{
if(x-i<=0) break;
cout<<"examine "<<x-i<<' '<<y<<endl;
cin >> s;
if(s[0]=='f') break;
}
for(;i<=100;i++)
{
if(x-i<=0) break;
cout<<"examine "<<x-i<<' '<<y<<endl;
cin >> s;
if(s[0]=='f') break;
}
b=x-i+1;
for(i=1;i<=100;i+=3)
{
if(y+i>=n) break;
cout<<"examine "<<x<<' '<<y+i<<endl;
cin >> s;
if(s[0]=='f') break;
}
for(;i<=100;i++)
{
if(y+i>=n) break;
cout<<"examine "<<x<<' '<<y+i<<endl;
cin >> s;
if(s[0]=='f') break;
}
c = y+i-1;
m = a-b+1;
x = (a+b)/2;
y = c-(m/2);
//cout<<a<<' '<<b<<' '<<c<<endl;
int x1, y1, x2, y2;
for(i=2*m;;i+=2*m)
{
if(x+i>=n) break;
cout<<"examine "<<x+i<<' '<<y<<endl;
cin >> s;
if(s[0]=='f') break;
}
x1=x+i-2*m;
for(i=2*m;;i+=2*m)
{
if(x-i<=0) break;
cout<<"examine "<<x-i<<' '<<y<<endl;
cin >> s;
if(s[0]=='f') break;
}
x2=x-i+2*m;
for(i=2*m;;i+=2*m)
{
if(y+i>=n) break;
cout<<"examine "<<x<<' '<<y+i<<endl;
cin >> s;
if(s[0]=='f') break;
}
y1=y+i-2*m;
for(i=2*m;;i+=2*m)
{
if(y-i<=0) break;
cout<<"examine "<<x<<' '<<y-i<<endl;
cin >> s;
if(s[0]=='f') break;
}
y2=y-i+2*m;
cout<<"solution "<<(x1+x2)/2<<' '<<(y1+y2)/2<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
248 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
376 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
248 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
874 ms |
376 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
248 KB |
Output is correct |
2 |
Incorrect |
831 ms |
376 KB |
too many queries |
3 |
Halted |
0 ms |
0 KB |
- |