# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
752548 | 2023-06-03T07:24:52 Z | wenqi | Archery (IOI09_archery) | C++17 | 2000 ms | 5964 KB |
// trans rights #include <bits/extc++.h> using namespace std; using ll = long long; #ifdef DEBUG #define D(args...) fprintf(stderr, args) #else #define D(...) #endif int N, R; int rk[400005]; int me; int G1[200005], G2[200005]; int f(int x, int y) { if (x != y) return 0; return x; } int take_best(int x) { if (x == 1) return 1; return -1; } int take_worst(int x) { if (x == -1) return -1; return 1; } void trans(int *X) { int x = X[0], y = X[N - 1]; int w = f(take_worst(x), take_worst(y)); for (int i = 0; i < N - 1; i++) { int p = i ? take_worst(X[i]) : take_best(X[i]); int q = take_best(X[i + 1]); X[i] = f(p, q); } X[N - 1] = w; } int main(int argc, const char *argv[]) { scanf(" %d %d", &N, &R); R = (R - 2 * N) % N + 2 * N; scanf(" %d", &me); for (int i = 0; i < 2 * N - 1; i++) scanf(" %d", &rk[i]); pair<int, int> ans = {N, 0}; for (int i = 0; i < N; i++) { for (int j = 0; j < i; j++) { int x = rk[2 * j], y = rk[2 * j + 1]; if ((x < me) == (y < me)) G1[j] = G2[j] = x < me ? -1 : 1; else G1[j] = G2[j] = 0; } int m = rk[2 * i]; G1[i] = m < me ? -1 : 1; G2[i] = 0; for (int j = i + 1; j < N; j++) { int x = rk[2 * j - 1], y = rk[2 * j]; if ((x < me) == (y < me)) G1[j] = G2[j] = x < me ? -1 : 1; else G1[j] = G2[j] = 0; } for (int k = 0; k < R; k++) { trans(G1); trans(G2); } int e = 0; for (int j = 0; j < N; j++) if (G1[j] != G2[j]) e = j; ans = min(ans, {e, -i}); } printf("%d", -ans.second + 1); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Execution timed out | 2075 ms | 320 KB | Time limit exceeded |
3 | Correct | 8 ms | 212 KB | Output is correct |
4 | Execution timed out | 2057 ms | 320 KB | Time limit exceeded |
5 | Correct | 0 ms | 312 KB | Output is correct |
6 | Correct | 56 ms | 308 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 212 KB | Output is correct |
2 | Correct | 57 ms | 212 KB | Output is correct |
3 | Execution timed out | 2082 ms | 320 KB | Time limit exceeded |
4 | Execution timed out | 2056 ms | 692 KB | Time limit exceeded |
5 | Execution timed out | 2062 ms | 5180 KB | Time limit exceeded |
6 | Correct | 44 ms | 212 KB | Output is correct |
7 | Execution timed out | 2070 ms | 316 KB | Time limit exceeded |
8 | Execution timed out | 2070 ms | 656 KB | Time limit exceeded |
9 | Execution timed out | 2076 ms | 852 KB | Time limit exceeded |
10 | Execution timed out | 2079 ms | 340 KB | Time limit exceeded |
11 | Execution timed out | 2037 ms | 852 KB | Time limit exceeded |
12 | Execution timed out | 2072 ms | 340 KB | Time limit exceeded |
13 | Execution timed out | 2065 ms | 3732 KB | Time limit exceeded |
14 | Execution timed out | 2069 ms | 340 KB | Time limit exceeded |
15 | Execution timed out | 2064 ms | 1108 KB | Time limit exceeded |
16 | Correct | 52 ms | 312 KB | Output is correct |
17 | Execution timed out | 2086 ms | 316 KB | Time limit exceeded |
18 | Execution timed out | 2051 ms | 340 KB | Time limit exceeded |
19 | Execution timed out | 2035 ms | 340 KB | Time limit exceeded |
20 | Execution timed out | 2077 ms | 340 KB | Time limit exceeded |
21 | Execution timed out | 2063 ms | 852 KB | Time limit exceeded |
22 | Execution timed out | 2076 ms | 1108 KB | Time limit exceeded |
23 | Execution timed out | 2061 ms | 5372 KB | Time limit exceeded |
24 | Correct | 75 ms | 308 KB | Output is correct |
25 | Execution timed out | 2080 ms | 340 KB | Time limit exceeded |
26 | Execution timed out | 2079 ms | 340 KB | Time limit exceeded |
27 | Execution timed out | 2066 ms | 852 KB | Time limit exceeded |
28 | Execution timed out | 2075 ms | 3908 KB | Time limit exceeded |
29 | Execution timed out | 2072 ms | 340 KB | Time limit exceeded |
30 | Execution timed out | 2063 ms | 340 KB | Time limit exceeded |
31 | Execution timed out | 2065 ms | 852 KB | Time limit exceeded |
32 | Execution timed out | 2057 ms | 5228 KB | Time limit exceeded |
33 | Correct | 61 ms | 212 KB | Output is correct |
34 | Correct | 56 ms | 340 KB | Output is correct |
35 | Execution timed out | 2091 ms | 340 KB | Time limit exceeded |
36 | Execution timed out | 2049 ms | 340 KB | Time limit exceeded |
37 | Execution timed out | 2073 ms | 704 KB | Time limit exceeded |
38 | Execution timed out | 2063 ms | 980 KB | Time limit exceeded |
39 | Correct | 54 ms | 212 KB | Output is correct |
40 | Execution timed out | 2071 ms | 340 KB | Time limit exceeded |
41 | Execution timed out | 2069 ms | 340 KB | Time limit exceeded |
42 | Execution timed out | 2064 ms | 340 KB | Time limit exceeded |
43 | Execution timed out | 2083 ms | 340 KB | Time limit exceeded |
44 | Execution timed out | 2071 ms | 468 KB | Time limit exceeded |
45 | Execution timed out | 2069 ms | 852 KB | Time limit exceeded |
46 | Execution timed out | 2052 ms | 836 KB | Time limit exceeded |
47 | Execution timed out | 2062 ms | 5964 KB | Time limit exceeded |