# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
400512 | T0p_ | Bali Sculptures (APIO15_sculpture) | C++14 | 1 ms | 308 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
long long dp[2020][2020];
int main()
{
int n, a, b;
scanf(" %d %d %d",&n,&a,&b);
for(int i=1 ; i<=n ; i++)
{
scanf(" %lld",&dp[1][i]);
dp[1][i] += dp[1][i-1];
}
for(int i=2 ; i<=b ; i++)
for(int j=i ; j<=n ; j++)
{
dp[i][j] = 1e18;
for(int k=j ; k>=i ; k--)
dp[i][j] = min(dp[i][j], dp[i-1][k-1] | (dp[1][j] - dp[1][k-1]));
}
long long ans = 1e18;
for(int i=a ; i<=b ; i++)
ans = min(ans, dp[i][n]);
printf("%lld\n",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |