# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
106366 | 2019-04-18T03:18:43 Z | Hideo | Bali Sculptures (APIO15_sculpture) | C++14 | 637 ms | 263168 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mk make_pair #define fr first #define sc second #define vi vector < int > #define vl vector < ll > #define pi pair < int, int > #define pii pair < int, pi > #define vii vector < pi > const int N = 107; const int INF = 1e9 + 7; ll dp[N][N], pr[N], x[N], ans; int n, a, b; vii v[N]; main(){ ans = INF; cin >> n >> a >> b; for (int i = 1; i <= n; i++){ scanf("%d", &x[i]); pr[i] = pr[i - 1] + x[i]; } for (int i = 1; i < N; i++) for (int j = 0; j < N; j++) dp[i][j] = INF; v[0].pb(mk(0, 0)); for (int i = 1; i <= n; i++){ for (int g = 1; g <= min(i, b); g++){ for (pi to : v[g - 1]){ v[g].pb(mk((to.fr | (pr[i] - pr[to.sc])), i)); dp[i][g] = min(dp[i][g], (to.fr | (pr[i] - pr[to.sc]))); } } } for (int i = a; i <= b; i++) ans = min(ans, dp[n][i]); cout << ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Runtime error | 611 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Runtime error | 637 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 512 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 3 ms | 512 KB | Output is correct |
6 | Runtime error | 607 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 356 KB | Output is correct |
6 | Runtime error | 631 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Runtime error | 579 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
7 | Halted | 0 ms | 0 KB | - |