답안 #1032805

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1032805 2024-07-24T09:01:06 Z anango Worm Worries (BOI18_worm) C++17
10 / 100
1 ms 412 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
int INF = 1LL<<30;

int query(int x, int y, int z) {
    cout << "? " << x <<" " << y <<" " <<z << endl;
    int an; cin >> an; 
    return an;
}

void answer(int x, int y, int z) {
    cout << "! " << x  << " " << y << " " << z << endl;
}

int n,m,k,q;

signed main() {
    cin >> n >> m >> k >> q;
    int l = 1;
    int r = n;
    while (l<r) {
        int m1 = l+(r-l)/3;
        int m2 = r-(r-l)/3;
        if (query(m1,1,1)<query(m2,1,1)) {
            l=m1+1;
            r=r;
        }
        else {
            l=l;
            r=m2-1;
        }
    }
    answer(l,1,1);
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB not a local maximum
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Incorrect 0 ms 412 KB not a local maximum
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB not a local maximum
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB not a local maximum
3 Halted 0 ms 0 KB -