# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
45747 | 2018-04-16T05:39:23 Z | antimirage | Bali Sculptures (APIO15_sculpture) | C++17 | 27 ms | 32048 KB |
#include <bits/stdc++.h> #define fr first #define sc second #define mk make_pair #define pb push_back #define OK puts("OK"); #define sz(s) (int)s.size() #define all(s) s.begin(), s.end() #define int long long using namespace std; const int N = 2005; int n, a, b, ar[N], dp[N][N], pref[N], ans = 1e18; main() { cin >> n >> a >> b; for (int i = 1; i <= n; i++) scanf("%d", &ar[i]), pref[i] = ar[i] + pref[i - 1]; memset ( dp, 0x3f3f3f3f, sizeof(dp) ); dp[0][0] = 0; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) for (int k = 1; k <= j; k++) dp[i][j] = min(dp[i][j], ( dp[i - 1][k - 1] | (pref[j] - pref[k - 1]) ) ); for (int i = a; i <= b; i++) ans = min(ans, dp[i][n]); cout << ans << endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 25 ms | 31736 KB | Output is correct |
2 | Incorrect | 25 ms | 31848 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 31916 KB | Output is correct |
2 | Incorrect | 23 ms | 31976 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 31976 KB | Output is correct |
2 | Incorrect | 24 ms | 31976 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 31976 KB | Output is correct |
2 | Incorrect | 23 ms | 31976 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 31976 KB | Output is correct |
2 | Incorrect | 23 ms | 32048 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |