#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 = 200000 + 10;
signed main() {
FAST;
int n, m;
cin >> n >> m;
int idx = n + 1;
while(idx--) {
if(idx == 0) {
cout << "end" << endl;
return 0;
}
int last = idx;
for(int i = idx + 1; i <= n + m; i++) {
cout << "cmp " << idx << ' ' << i << endl;
int x;
cin >> x;
if(x == 1) last = i;
if(x == -1 || x == 0) break;
}
for(int i = idx; i < last; i++) {
cout << "reverse " << i << ' ' << i + 1 << endl;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1 ms |
208 KB |
Time limit exceeded (wall clock) |
2 |
Execution timed out |
0 ms |
208 KB |
Time limit exceeded (wall clock) |
3 |
Execution timed out |
1 ms |
208 KB |
Time limit exceeded (wall clock) |
4 |
Execution timed out |
0 ms |
276 KB |
Time limit exceeded (wall clock) |
5 |
Execution timed out |
0 ms |
208 KB |
Time limit exceeded (wall clock) |
6 |
Execution timed out |
0 ms |
208 KB |
Time limit exceeded (wall clock) |
7 |
Execution timed out |
1 ms |
208 KB |
Time limit exceeded (wall clock) |
8 |
Execution timed out |
1 ms |
208 KB |
Time limit exceeded (wall clock) |
9 |
Execution timed out |
1 ms |
208 KB |
Time limit exceeded (wall clock) |
10 |
Execution timed out |
1 ms |
208 KB |
Time limit exceeded (wall clock) |