Submission #436791

# Submission time Handle Problem Language Result Execution time Memory
436791 2021-06-24T23:14:41 Z definitelynotmee Aliens (IOI07_aliens) C++
40 / 100
7 ms 200 KB
#include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INFL = (1LL<<62)-1;
const int INF = (1<<30)-1;
const int MOD = 1e9 + 7;
const int MAXN = 1e6+1;

bool check(){
    string s;
    cin >> s;
    if(s[0] == 't')
        return true;
    return false;
}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n, x, y;
    cin >> n >> x >> y;
    ll aux = x+1;
    ll resp = 1;
    while(aux <= n){
        
        cout << "examine " << aux << ' ' << y << endl;

        if(check()){
            resp++;
        } else break;
        aux++;
    }
    aux = x-1;
    while(aux > 0){
        cout << "examine " << aux << ' ' << y << endl;

        if(check()){
            resp++;
        } else break;
        aux--;
    }
    aux++;
    ll auy = y-1;
    while(auy > 0){
        cout << "examine " << aux << ' ' << auy << endl;

        if(!check())
            break;
        auy--;
    }
    auy++;
    auy-=2*resp;
    while(auy > 0){
        cout << "examine " << aux << ' ' << auy << endl;

        if(!check())
            break;
        auy-=2*resp;
    }
    auy+=2*resp;
    aux-=2*resp;
    while(aux > 0){
        cout << "examine " << aux << ' ' << auy << endl;

        if(!check())
            break;
        aux-=2*resp;
    }
    aux+=2*resp;
    if(aux-1 > 0 && auy-1 > 0){
        cout << "examine " << aux-1 << ' ' << auy - 1 << endl;
        if(check()){
            aux = aux-resp;
            auy = auy-resp;
        }
    }
    cout << "solution " << aux + 2*resp + resp/2 << ' ' << auy + 2*resp + resp/2 << endl;
    return 0;

}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 3 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 4 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 2 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Runtime error 5 ms 200 KB Execution killed with signal 13
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Runtime error 5 ms 200 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -