# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1020143 | KasymK | Bali Sculptures (APIO15_sculpture) | C++17 | 1 ms | 444 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
const int N = 2e3+5;
ll dp[N][N], par[N];
int main(){
// freopen("file.txt", "r", stdin);
int n, a, b;
scanf("%d%d%d", &n, &a, &b);
for(int i = 0; i <= n; ++i)
for(int k = 0; k <= n; ++k)
dp[i][k] = 1e18;
vector<int> v(n);
for(int &i : v)
scanf("%d", &i);
for(int i = 1; i <= n; ++i)
par[i] = par[i-1]+v[i-1];
dp[0][0] = 0;
for(int i = 1; i <= n; ++i)
for(int k = 1; k <= b; ++k)
for(int j = 0; j < i; ++j)
dp[i][k] = min(dp[i][k], dp[j][k-1]|(par[i]-par[j]));
ll ans = 1e18;
for(int k = a; k <= b; ++k)
ans = min(ans, dp[n][k]);
printf("%lld", ans);
return 0;
}
컴파일 시 표준 에러 (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... |