# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
207491 | 2020-03-07T16:15:06 Z | DystoriaX | Bali Sculptures (APIO15_sculpture) | C++14 | 6 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; int n, a, b; int y[100010]; long long dp[1010][1010], pref[1010]; int main(){ scanf("%d%d%d", &n, &a, &b); for(int i = 1; i <= n; i++){ scanf("%d", &y[i]); pref[i] = y[i] + pref[i - 1]; } for(int i = 0; i <= n; i++) for(int j = 0; j <= n; j++) dp[i][j] = 1e18; dp[0][0] = 0; for(int j = 1; j <= n; j++){ for(int i = j; i <= n; i++){ for(int k = j - 1; k < i; k++){ dp[i][j] = min(dp[i][j], dp[k][j - 1] | (pref[i] - pref[k])); } } } long long ans = 1e18; for(int i = a; i <= b; i++) ans = min(ans, dp[n][i]); printf("%lld\n", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Incorrect | 5 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Incorrect | 5 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Incorrect | 6 ms | 372 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Incorrect | 5 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Incorrect | 5 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |