| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1343334 | minhtien | Bali Sculptures (APIO15_sculpture) | C++20 | 1 ms | 344 KiB |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N=2e3+5;
const ll inf=1e18+7;
int n;
int x,y;
ll a[N];
ll dp[N][N];
ll tong2=inf;
int main()
{
cin >>n >>x >>y;
for(int i=1;i<=n;i++){
cin >> a[i];
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
dp[i][j]=inf;
}
}
ll tong=0;
for(int i=1;i<=n;i++){
tong+=a[i];
dp[i][1]=tong;
}
for(int i=2;i<=n;i++){
ll tong1=0;
for(int j=i;j>=1;j--){
tong1+=a[j];
for(int k=2;k<=y;k++){
dp[i][k]=min(dp[i][k],((dp[j-1][k-1])|tong1));
}
}
}
for(int k=x;k<=y;k++){
tong2=min(tong2,dp[n][k]);
}
cout << tong2;
return 0;
}
| # | 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... | ||||
