# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129358 | 2019-07-12T05:06:17 Z | arnold518 | Bali Sculptures (APIO15_sculpture) | C++14 | 2 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 100; const ll INF = numeric_limits<ll>::max(); int N, A, B; ll Y[MAXN+10], dp[MAXN+10][MAXN+10], ans=INF; int main() { int i, j, k; scanf("%d%d%d", &N, &A, &B); for(i=1; i<=N; i++) scanf("%lld", &Y[i]), Y[i]+=Y[i-1]; dp[1][0]=INF; for(i=1; i<=N; i++) dp[1][i]=Y[i]; for(i=2; i<=N; i++) { for(j=1; j<=N; j++) { dp[i][j]=INF; for(k=1; k<j; k++) { dp[i][j]=min(dp[i][j], dp[i-1][k]|(Y[j]-Y[k])); } } } for(i=A; i<=B; i++) ans=min(ans, dp[i][N]); printf("%lld", ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 252 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 252 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |