답안 #642301

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
642301 2022-09-19T08:15:21 Z makanhulia Aliens (IOI07_aliens) C++17
40 / 100
4 ms 312 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
const ll mod=1e9+7;
const ll maxn=2e6+5;
const ll INF=1e18;
#define ok ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define endl '\n'
int n, x, y, l, r, u, d, mx=-1, xx=1, yy=1;
string jwb;
int main() {
    ok
    cin >> n >> x >> y;
    l=x; r=x; u=y; d=y;
    for(int i=x-1; i>=1; i--) {
        cout << "examine " << i << " " << y << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") l=i;
        else break;
    }
    for(int i=x+1; i<=n; i++) {
        cout << "examine " << i << " " << y << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") r=i;
        else break;
    }
    for(int i=y-1; i>=1; i--) {
        cout << "examine " << x << " " << i << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") d=i;
        else break;
    }
    for(int i=y+1; i<=n; i++) {
        cout << "examine " << x << " " << i << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") u=i;
        else break;
    }
    int midx=(l+r)/2, midy=(u+d)/2, sz=u-d+1;
    l=midx; r=midx; u=midy; d=midy;
    for(int i=1; i<=2; i++) {
        int nx=midx-2*i*sz;
        if(nx<1) break;
        cout << "examine " << nx << " " << midy << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") {
            l=nx;
        } else break;
    }
    for(int i=1; i<=2; i++) {
        int nx=midx+2*i*sz;
        if(nx>n) break;
        cout << "examine " << nx << " " << midy << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") {
            r=nx;
        } else break;
    }
    for(int i=1; i<=2; i++) {
        int nx=midy-2*i*sz;
        if(nx<1) break;
        cout << "examine " << midx << " " << nx << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") {
            d=nx;
        } else break;
    }
    for(int i=1; i<=2; i++) {
        int nx=midy+2*i*sz;
        if(nx>n) break;
        cout << "examine " << midx << " " << nx << endl;
        cout.flush();
        cin >> jwb;
        if(jwb=="true") {
            u=nx;
        } else break;
    }
    cout << "solution " << (l+r)/2 << " " << (u+d)/2 << endl;
    cout.flush();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 2 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 208 KB Output is correct
2 Correct 2 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 2 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 208 KB Output is correct
2 Runtime error 1 ms 312 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Runtime error 3 ms 208 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -