| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1339051 | vjudge1 | Aliens (IOI07_aliens) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
void solve(){
int n,x,y;cin>>n>>x>>y;
int cnt = 1;
while(true){
if(x + cnt <= n){
cout<<"examine "<<x+cnt<<" "<<y<<endl;
cout.flush();
string v;cin>>v;
if(v == "true"){
cnt++;
}
else{
break;
}
}
else break;
}
int oldcnt = cnt;
int fah = 1;
while(true){
if(x - fah >= 1){
cout<<"examine "<<x-fah<<" "<<y<<endl;
cout.flush();
string v;cin>>v;
if(v == "true")fah++;
else break;
}
}
int m = fah+cnt-1;
cnt = 1;
int dist = 1;
while(true){
if(y + cnt <= n){
cout<<"examine "<<x<<" "<<y+cnt<<endl;
cout.flush();
string v;cin>>v;
if(v == "true"){
cnt++;
dist++;
}
else break;
}
else break;
}
pair<int,int> org = {(oldcnt)-m/2+x-1,(dist)-m/2+y-1};
pair<int,int> cur = {(oldcnt)-m/2+x-1,(dist)-m/2+y-1};
pair<int,int> cur2 = {(oldcnt)-m/2+x-1,(dist)-m/2+y-1};
/*cout<<"M "<<m<<endl;
cout<<org.first<<" "<<org.second<<endl;
cout<<"fah"<<endl;
cout<<"oldcnt "<<oldcnt<<endl;
cout<<"dist "<<dist<<endl;
cout.flush();*/
int bby = 0;
int r = 0;
cur.first += m;
int md = 0;
while(true){
if(md == 4)break;
if(cur.first <= n && cur.second <= n && cur.first >= 1 && cur.second >= 1){
cout<<"examine "<<cur.first<<" "<<cur.second<<endl;
cout.flush();
string v;cin>>v;
if(v == "true" && md % 2 == 1){
cout<<"bby "<<bby<<endl;
bby++;
cur.first += m;
}
else if(v == "false" && md % 2 == 0){
cout<<"bby "<<bby<<endl;
bby++;
cur.first += m;
}
else if(v == "false"){
cout<<"bby "<<bby<<endl;
break;
}
md++;
}
else break;
}
md = 0;
cur2.second += m;
while(true){
if(md == 4){
//cout<<"aaaaaa"<<endl;
break;
}
if(cur2.first <= n && cur2.second <= n && cur2.first >= 1 && cur2.second >= 1){
cout<<"examine "<<cur2.first<<" "<<cur2.second<<endl;
cout.flush();
string v;cin>>v;
if(v == "true" && md % 2 == 1){
//cout<<"r "<<r<<endl;
r++;
cur2.second += m;
}
else if(v == "false" && md % 2 == 0){
//cout<<"r "<<r<<endl;
r++;
cur2.second += m;
c//out<<"aaaaaaaaaa"<<endl;
}
else if(v == "false"){
//cout<<"r "<<r<<endl;
//cout<<"kkkkkk"<<endl;
break;
}
md++;
}
else {
//cout<<"yyyyyyyyyyy"<<endl;
break;}
}
/*cout<<"R "<<r<<endl;
cout<<"BBY "<<bby<<endl;*/
cout<<"solution "<<org.first + (bby-2)*m<<" "<<org.second + (r-2)*m<<endl;
cout.flush();
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;//cin>>t;
t = 1;
while(t--){
solve();
}
}