Submission #862513

# Submission time Handle Problem Language Result Execution time Memory
862513 2023-10-18T12:28:11 Z JakobZorz Aliens (IOI07_aliens) C++14
0 / 100
719 ms 452 KB
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<limits.h>
#include<math.h>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<iomanip>
typedef long long ll;
typedef long double ld;
using namespace std;
const int MOD=1e9+7;
//typedef pair<ll,ll>Point;
//typedef pair<ll,ll>Line;
//#define x first
//#define y second

int n;
bool query(int x,int y){
    if(x>=n||y>=n||x<0||y<0)
        return false;
    cout<<"examine "<<x+1<<" "<<y+1<<endl;
    string res;
    cin>>res;
    return res=="true";
}

int main(){
    ios::sync_with_stdio(false);
    cout.tie(NULL);
    cin.tie(NULL);
    
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int x,y;
    cin>>n>>x>>y;
    x--;y--;
    
    {
        int l=x,r=x+1;
        while(query(r,y)){
            r=l+(r-l)*2;
        }
        
        while(l<r-1){
            int m=(l+r);
            if(query(m,y)){
                l=m;
            }else{
                r=m;
            }
        }
        x=l;
    }
    
    {
        int l=y,r=y+1;
        while(query(x,r)){
            r=l+(r-l)*2;
        }
        
        while(l<r-1){
            int m=(l+r);
            if(query(x,m)){
                l=m;
            }else{
                r=m;
            }
        }
        y=l;
    }
    
    int size=0;
    {
        int l=x-1,r=x;
        while(query(l,y)){
            l=r-(r-l)*2;
        }
        
        while(l<r-1){
            int m=(l+r)/2;
            if(query(m,y)){
                r=m;
            }else{
                l=m;
            }
        }
        
        size=x-l;
    }
    
    while(query(x,y))
        x+=size*2;
    x-=size*2;
    
    while(query(x,y))
        y+=size*2;
    y-=size*2;
    
    int offset=2*size-size/2;
    cout<<"solution "<<x-offset<<" "<<y-offset<<"\n";
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 719 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 387 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 452 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 448 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 48 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 69 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 452 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 380 KB Incorrect
2 Halted 0 ms 0 KB -