#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) x.begin(),x.end();
using ll=long long;
int N;
bool question(ll x,ll y){
if(x<1)return false;
if(x>N)return false;
if(y<1)return false;
if(y>N)return false;
cout<<"examine "<<x<<" "<<y<<endl;
string s;
cin>>s;
if(s=="true")return true;
return false;
};
int main(){
cin>>N;
ll x,y;
cin>>x>>y;
rep(i,3){
for(int j=28; j>=0; j--){
if(question(x-(1LL<<j),y)){
x-=1LL<<j;
}
}
}
rep(i,3){
for(int j=28; j>=0; j--){
if(question(x,y-(1LL<<j))){
y-=1LL<<j;
}
}
}
for(int i=30; i>=0; i--){
if(question(x+(1LL<<i),y+(1LL<<i))){
x+=1LL<<i;
y+=1LL<<i;
}
}
ll bx=x,by=y;
for(int i=30; i>=0; i--){
if(question(x-(1LL<<i),y-(1LL<<i))){
x-=1LL<<i;
y-=1LL<<i;
}
}
x=(x+bx)/2;
y=(y+by)/2;
for(int i=30; i>=0; i--){
if(question(x-(1LL<<i),y+(1LL<<i))){
x-=1LL<<i;
y+=1LL<<i;
}
}
bx=x;
by=y;
for(int i=30; i>=0; i--){
if(question(x+(1LL<<i),y-(1LL<<i))){
x+=1LL<<i;
y-=1LL<<i;
}
}
x=(x+bx)/2;
y=(y+by)/2;
cout<<"solution "<<x<<" "<<y<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |