# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
563429 | 2022-05-17T07:52:58 Z | penguin133 | Bali Sculptures (APIO15_sculpture) | C++14 | 1 ms | 340 KB |
#include <bits/stdc++.h> using namespace std; #define int long long int A[200005] ,P[200005]; int dp[2005][2005]; main(){ ios::sync_with_stdio(0);cin.tie(0); int n,a,b; cin >> n >> a >> b; for(int i=1;i<=n;i++)cin >> A[i], P[i] = P[i-1] + A[i]; for(int i=1;i<=n;i++)dp[0][i] = dp[i][0] = 2e9; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ dp[i][j] = 2e9; if(j > i)continue; for(int k=i-1;k>=0;k--){ dp[i][j] = min(dp[i][j], (dp[k][j-1] | (P[i] - P[k]))); } } } /* for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++)cout << dp[i][j] << " "; cout << '\n'; } */ int ans = 2e9; for(int i=a;i<=b;i++)ans = min(ans, dp[n][i]); cout << ans << '\n'; //cout << (8|1) << '\n'; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Incorrect | 1 ms | 340 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Incorrect | 1 ms | 340 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Incorrect | 1 ms | 340 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Incorrect | 1 ms | 340 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 324 KB | Output is correct |
2 | Incorrect | 0 ms | 340 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |