# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
706270 | vjudge1 | Nizovi (COI14_nizovi) | C++17 | 48 ms | 300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |