# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223848 | 2020-04-16T14:40:03 Z | kingfran1907 | Nizovi (COI14_nizovi) | C++14 | 6 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5+10; int a, b; int cp(int a, int b) { printf("cmp %d %d\n", a, b); fflush(stdout); int x; scanf("%d", &x); return x; } void rev(int a, int b) { printf("reverse %d %d\n", a, b); fflush(stdout); } int main() { scanf("%d%d", &a, &b); int ptr = 0; for (int i = 1; i <= a; i++) { int lo = a + ptr; int hi = a + b; while (lo < hi) { int mid = (lo + hi + 1) / 2; if (cp(i + ptr, mid) == -1) lo = mid; else hi = mid - 1; } if (lo == a + ptr) continue; rev(i + ptr, lo); rev(i + ptr, lo - (a - i + 1)); rev(lo - (a - i), lo); ptr += (lo - (a - i + 1)) - (i + ptr) + 1; } printf("end\n"); fflush(stdout); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Incorrect |
2 | Incorrect | 5 ms | 256 KB | Incorrect |
3 | Incorrect | 5 ms | 384 KB | Incorrect |
4 | Incorrect | 4 ms | 256 KB | Incorrect |
5 | Incorrect | 5 ms | 308 KB | Incorrect |
6 | Incorrect | 5 ms | 384 KB | Incorrect |
7 | Incorrect | 5 ms | 256 KB | Incorrect |
8 | Incorrect | 5 ms | 256 KB | Incorrect |
9 | Incorrect | 6 ms | 256 KB | Incorrect |
10 | Incorrect | 5 ms | 256 KB | Incorrect |