# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48278 | 2018-05-11T10:48:18 Z | arman_ferdous | Bali Sculptures (APIO15_sculpture) | C++11 | 23 ms | 32160 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2010; const ll INF = 4e17; int n, k, A, B; ll arr[N], c[N][N], dp[N][N]; int main() { for(int i = 0; i < N; i++) for(int j = 0; j < N; j++) dp[i][j] = INF; scanf("%d %d %d", &n, &A, &B); for(int i = 1; i <= n; i++) scanf("%lld", &arr[i]); for(int i = 1; i <= n; i++) { c[i][i] = arr[i]; for(int j = i+1; j <= n; j++) c[i][j] = c[i][j-1] + arr[i]; } for(int i = 1; i <= n; i++) dp[i][1] = c[1][i]; for(int j = 2; j <= B; j++) for(int i = 1; i <= n; i++) for(int p = 1; p < i; p++) dp[i][j] = min((dp[p][j-1]|c[p+1][i]), dp[i][j]); ll ans = INF; 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 | Incorrect | 23 ms | 31992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 31992 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 32028 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 32084 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 32160 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |