# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39886 | 2018-01-23T13:42:28 Z | ddokddogi | Bali Sculptures (APIO15_sculpture) | C++11 | 0 ms | 2116 KB |
#include <bits/stdc++.h> using namespace std; typedef long long lld; lld dp[110][110], n, a, b, num[110], dap=LONG_LONG_MAX, sum[110]; int main(){ //freopen("input.txt", "r", stdin); lld i, j, k; scanf("%lld%lld%lld",&n,&a,&b); for(i=1;i<=n;i++){scanf("%lld", &num[i]);sum[i]=sum[i-1]+num[i];} for(i=1;i<=n;i++)for(j=1;j<=n;j++)dp[i][j]=LONG_LONG_MAX; for(i=1;i<=n;i++)dp[1][i]=sum[i]; for(i=2;i<=n;i++){ for(j=i;j<=n;j++){ for(k=i-1;k<j;k++){ dp[i][j] = min(dp[i][j], (dp[i-1][k]|(sum[j]-sum[k]))); } } } for(i=a;i<=b;i++) dap = min(dap, dp[i][n]); printf("%lld", dap); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2116 KB | Output is correct |
2 | Incorrect | 0 ms | 2116 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2116 KB | Output is correct |
2 | Incorrect | 0 ms | 2116 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2116 KB | Output is correct |
2 | Incorrect | 0 ms | 2116 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2116 KB | Output is correct |
2 | Incorrect | 0 ms | 2116 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2116 KB | Output is correct |
2 | Incorrect | 0 ms | 2116 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |