# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
45776 | 2018-04-16T06:17:12 Z | daniel_02 | Bali Sculptures (APIO15_sculpture) | C++17 | 1000 ms | 644 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2e3 + 7; const ll inf = 1e18 + 7; ll a[N], pr[N], ans = inf; int n, x, y; void conquer(int pos, ll sum, int rem) { if (rem == 1) { ll sm = pr[n] - pr[pos - 1]; sum = (sum | sm); ans = min(ans, sum); return; } for (int i = pos; i <= n - (rem - 1); i++) { ll sm = pr[i] - pr[pos - 1]; conquer(i + 1, (sum | sm), rem - 1); } } main() { scanf("%d%d%d", &n, &x, &y); if (n > 46) { assert(0); } for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); pr[i] = pr[i - 1] + a[i]; } for (int i = x; i <= y; i++) { conquer(1, 0, i); } cout << ans << endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 408 KB | Output is correct |
4 | Correct | 2 ms | 540 KB | Output is correct |
5 | Correct | 2 ms | 540 KB | Output is correct |
6 | Correct | 2 ms | 540 KB | Output is correct |
7 | Correct | 2 ms | 540 KB | Output is correct |
8 | Correct | 2 ms | 540 KB | Output is correct |
9 | Correct | 2 ms | 540 KB | Output is correct |
10 | Correct | 2 ms | 540 KB | Output is correct |
11 | Correct | 2 ms | 540 KB | Output is correct |
12 | Correct | 2 ms | 548 KB | Output is correct |
13 | Correct | 7 ms | 548 KB | Output is correct |
14 | Correct | 2 ms | 548 KB | Output is correct |
15 | Correct | 2 ms | 548 KB | Output is correct |
16 | Correct | 2 ms | 548 KB | Output is correct |
17 | Correct | 2 ms | 568 KB | Output is correct |
18 | Correct | 2 ms | 568 KB | Output is correct |
19 | Correct | 2 ms | 568 KB | Output is correct |
20 | Correct | 2 ms | 568 KB | Output is correct |
21 | Correct | 2 ms | 568 KB | Output is correct |
22 | Correct | 3 ms | 568 KB | Output is correct |
23 | Correct | 2 ms | 568 KB | Output is correct |
24 | Correct | 2 ms | 568 KB | Output is correct |
25 | Correct | 2 ms | 620 KB | Output is correct |
26 | Correct | 6 ms | 620 KB | Output is correct |
27 | Correct | 2 ms | 636 KB | Output is correct |
28 | Correct | 2 ms | 636 KB | Output is correct |
29 | Correct | 2 ms | 636 KB | Output is correct |
30 | Correct | 2 ms | 636 KB | Output is correct |
31 | Correct | 2 ms | 636 KB | Output is correct |
32 | Correct | 3 ms | 636 KB | Output is correct |
33 | Correct | 7 ms | 636 KB | Output is correct |
34 | Correct | 7 ms | 636 KB | Output is correct |
35 | Correct | 2 ms | 636 KB | Output is correct |
36 | Correct | 7 ms | 636 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 636 KB | Output is correct |
2 | Correct | 2 ms | 636 KB | Output is correct |
3 | Correct | 2 ms | 636 KB | Output is correct |
4 | Correct | 2 ms | 636 KB | Output is correct |
5 | Correct | 2 ms | 636 KB | Output is correct |
6 | Correct | 2 ms | 636 KB | Output is correct |
7 | Correct | 2 ms | 636 KB | Output is correct |
8 | Correct | 2 ms | 636 KB | Output is correct |
9 | Correct | 2 ms | 636 KB | Output is correct |
10 | Correct | 2 ms | 636 KB | Output is correct |
11 | Correct | 2 ms | 636 KB | Output is correct |
12 | Correct | 2 ms | 636 KB | Output is correct |
13 | Correct | 8 ms | 636 KB | Output is correct |
14 | Correct | 2 ms | 636 KB | Output is correct |
15 | Correct | 2 ms | 636 KB | Output is correct |
16 | Correct | 2 ms | 636 KB | Output is correct |
17 | Correct | 2 ms | 636 KB | Output is correct |
18 | Correct | 2 ms | 636 KB | Output is correct |
19 | Correct | 2 ms | 636 KB | Output is correct |
20 | Correct | 2 ms | 636 KB | Output is correct |
21 | Correct | 2 ms | 636 KB | Output is correct |
22 | Correct | 2 ms | 636 KB | Output is correct |
23 | Correct | 2 ms | 636 KB | Output is correct |
24 | Correct | 2 ms | 636 KB | Output is correct |
25 | Correct | 2 ms | 636 KB | Output is correct |
26 | Correct | 7 ms | 636 KB | Output is correct |
27 | Correct | 13 ms | 636 KB | Output is correct |
28 | Correct | 24 ms | 636 KB | Output is correct |
29 | Correct | 3 ms | 636 KB | Output is correct |
30 | Execution timed out | 1086 ms | 636 KB | Time limit exceeded |
31 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 636 KB | Output is correct |
2 | Correct | 2 ms | 636 KB | Output is correct |
3 | Correct | 2 ms | 636 KB | Output is correct |
4 | Correct | 2 ms | 636 KB | Output is correct |
5 | Correct | 2 ms | 636 KB | Output is correct |
6 | Correct | 2 ms | 636 KB | Output is correct |
7 | Correct | 2 ms | 636 KB | Output is correct |
8 | Correct | 2 ms | 636 KB | Output is correct |
9 | Correct | 2 ms | 636 KB | Output is correct |
10 | Correct | 2 ms | 636 KB | Output is correct |
11 | Correct | 2 ms | 636 KB | Output is correct |
12 | Correct | 2 ms | 636 KB | Output is correct |
13 | Correct | 7 ms | 636 KB | Output is correct |
14 | Correct | 12 ms | 636 KB | Output is correct |
15 | Correct | 40 ms | 644 KB | Output is correct |
16 | Correct | 2 ms | 644 KB | Output is correct |
17 | Execution timed out | 1085 ms | 644 KB | Time limit exceeded |
18 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 644 KB | Output is correct |
2 | Correct | 2 ms | 644 KB | Output is correct |
3 | Correct | 2 ms | 644 KB | Output is correct |
4 | Correct | 2 ms | 644 KB | Output is correct |
5 | Correct | 2 ms | 644 KB | Output is correct |
6 | Correct | 2 ms | 644 KB | Output is correct |
7 | Correct | 2 ms | 644 KB | Output is correct |
8 | Correct | 2 ms | 644 KB | Output is correct |
9 | Correct | 2 ms | 644 KB | Output is correct |
10 | Correct | 2 ms | 644 KB | Output is correct |
11 | Correct | 2 ms | 644 KB | Output is correct |
12 | Correct | 2 ms | 644 KB | Output is correct |
13 | Correct | 8 ms | 644 KB | Output is correct |
14 | Correct | 2 ms | 644 KB | Output is correct |
15 | Correct | 2 ms | 644 KB | Output is correct |
16 | Correct | 2 ms | 644 KB | Output is correct |
17 | Correct | 2 ms | 644 KB | Output is correct |
18 | Correct | 2 ms | 644 KB | Output is correct |
19 | Correct | 2 ms | 644 KB | Output is correct |
20 | Correct | 2 ms | 644 KB | Output is correct |
21 | Correct | 3 ms | 644 KB | Output is correct |
22 | Correct | 2 ms | 644 KB | Output is correct |
23 | Correct | 3 ms | 644 KB | Output is correct |
24 | Correct | 2 ms | 644 KB | Output is correct |
25 | Correct | 2 ms | 644 KB | Output is correct |
26 | Correct | 6 ms | 644 KB | Output is correct |
27 | Correct | 2 ms | 644 KB | Output is correct |
28 | Correct | 2 ms | 644 KB | Output is correct |
29 | Correct | 2 ms | 644 KB | Output is correct |
30 | Correct | 2 ms | 644 KB | Output is correct |
31 | Correct | 2 ms | 644 KB | Output is correct |
32 | Correct | 2 ms | 644 KB | Output is correct |
33 | Correct | 6 ms | 644 KB | Output is correct |
34 | Correct | 9 ms | 644 KB | Output is correct |
35 | Correct | 2 ms | 644 KB | Output is correct |
36 | Correct | 7 ms | 644 KB | Output is correct |
37 | Correct | 12 ms | 644 KB | Output is correct |
38 | Correct | 31 ms | 644 KB | Output is correct |
39 | Correct | 2 ms | 644 KB | Output is correct |
40 | Execution timed out | 1067 ms | 644 KB | Time limit exceeded |
41 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 644 KB | Output is correct |
2 | Correct | 2 ms | 644 KB | Output is correct |
3 | Correct | 2 ms | 644 KB | Output is correct |
4 | Correct | 2 ms | 644 KB | Output is correct |
5 | Correct | 2 ms | 644 KB | Output is correct |
6 | Correct | 2 ms | 644 KB | Output is correct |
7 | Correct | 2 ms | 644 KB | Output is correct |
8 | Correct | 2 ms | 644 KB | Output is correct |
9 | Correct | 2 ms | 644 KB | Output is correct |
10 | Correct | 2 ms | 644 KB | Output is correct |
11 | Correct | 2 ms | 644 KB | Output is correct |
12 | Correct | 2 ms | 644 KB | Output is correct |
13 | Correct | 7 ms | 644 KB | Output is correct |
14 | Correct | 2 ms | 644 KB | Output is correct |
15 | Correct | 2 ms | 644 KB | Output is correct |
16 | Correct | 2 ms | 644 KB | Output is correct |
17 | Correct | 2 ms | 644 KB | Output is correct |
18 | Correct | 3 ms | 644 KB | Output is correct |
19 | Correct | 2 ms | 644 KB | Output is correct |
20 | Correct | 7 ms | 644 KB | Output is correct |
21 | Correct | 7 ms | 644 KB | Output is correct |
22 | Correct | 2 ms | 644 KB | Output is correct |
23 | Correct | 7 ms | 644 KB | Output is correct |
24 | Correct | 13 ms | 644 KB | Output is correct |
25 | Correct | 23 ms | 644 KB | Output is correct |
26 | Correct | 3 ms | 644 KB | Output is correct |
27 | Execution timed out | 1067 ms | 644 KB | Time limit exceeded |
28 | Halted | 0 ms | 0 KB | - |