제출 #1188394

#제출 시각아이디문제언어결과실행 시간메모리
1188394JungPSAliens (IOI07_aliens)C++20
20 / 100
1 ms416 KiB
#include<iostream>
using namespace std;

int xx1,xx2,yy1,yy2;
signed main(){
    int n,x,y; cin >> n >> x >> y;
    int xx,yy;
    xx1=x,yy1=y,xx2=x,yy2=y;

    xx=x,yy=y;
    while(true){
        if(xx>n) break;
        cout << "examine " << xx << " " << yy << endl;
        fflush(stdout);
        string str; cin >> str;
        if(str=="true"){
            xx2=xx;
        }
        else{
            break;
        }
        ++xx;
    }
    xx=x,yy=y;
    while(true){
        if(xx<1) break;
        cout << "examine " << xx << " " << yy << endl;
        fflush(stdout);
        string str; cin >> str;
        if(str=="true"){
            xx1=xx;
        }
        else{
            break;
        }
        --xx;
    }

    xx=x,yy=y;
    while(true){
        if(yy>n) break;
        cout << "examine " << xx << " " << yy << endl;
        fflush(stdout);
        string str; cin >> str;
        if(str=="true"){
            yy2=yy;
        }
        else{
            break;
        }
        ++yy;
    }
    xx=x,yy=y;
    while(true){
        if(yy<1) break;
        cout << "examine " << xx << " " << yy << endl;
        fflush(stdout);
        string str; cin >> str;
        if(str=="true"){
            yy1=yy;
        }
        else{
            break;
        }
        --yy;
    }
    int m=xx2-xx1+1;
    xx=xx2,yy=yy2;
    int xx3,yy3;
    while(true){
        cout << "examine " << xx << " " << yy << endl;
        fflush(stdout);
        string str; cin >> str;
        if(str=="true"){
            xx3=xx;
            yy3=yy;
        }
        else{
            break;
        }
        if(xx+m>n || yy+m>n) break;
        xx+=m;
        yy+=m;
    }
    while(true){
        cout << "examine " << xx << " " << yy << endl;
        fflush(stdout);
        string str; cin >> str;
        if(str=="true"){
            xx3=xx;
            yy3=yy;
        }
        else{
            break;
        }
        if(yy+2*m>n) break;
        yy+=2*m;
    }
    while(true){
        cout << "examine " << xx << " " << yy << endl;
        fflush(stdout);
        string str; cin >> str;
        if(str=="true"){
            xx3=xx;
            yy3=yy;
        }
        else{
            break;
        }
        if(xx+2*m>n) break;
        xx+=2*m;
    }
    cout << "solution " << xx3-2*m-(m/2) << " " << yy3-2*m-(m/2);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...