답안 #706270

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
706270 2023-03-06T08:31:55 Z vjudge1 Nizovi (COI14_nizovi) C++17
60 / 100
48 ms 300 KB
#include <bits/stdc++.h>
// #define endl '\n'
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int ll
typedef long long ll;
using namespace std;
const int N = 2e5 + 10;
int n, m;
signed main() {
    FAST;
    cin >> n >> m;
    int idx = n + 1;
    while(idx--) {
        if(idx == 0) {
            cout << "end" << endl;
            return 0;
        }
        int l = idx + 1, r = n + m, in = -1;
        while(l <= r) {
            int mid = (l + r) / 2;
            cout << "cmp " << idx << ' ' << mid << endl;
            int x; cin >> x;
            if(x == 1) {
                l = mid + 1;
                in = mid;
            }
            else r = mid - 1;
        }
        if(in != -1) {
            if(idx != in) cout << "reverse " << idx << ' ' << in << endl;
            if(in - 1 != idx) cout << "reverse " << idx << ' ' << in - 1 << endl;
         }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 4 ms 208 KB Output is correct
3 Correct 2 ms 208 KB Output is correct
4 Correct 48 ms 208 KB Output is correct
5 Correct 31 ms 208 KB Output is correct
6 Correct 33 ms 208 KB Output is correct
7 Runtime error 1 ms 300 KB Execution killed with signal 13
8 Runtime error 1 ms 292 KB Execution killed with signal 13
9 Runtime error 1 ms 296 KB Execution killed with signal 13
10 Runtime error 1 ms 292 KB Execution killed with signal 13