# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
207491 | DystoriaX | Bali Sculptures (APIO15_sculpture) | C++14 | 6 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int y[100010];
long long dp[1010][1010], pref[1010];
int main(){
scanf("%d%d%d", &n, &a, &b);
for(int i = 1; i <= n; i++){
scanf("%d", &y[i]);
pref[i] = y[i] + pref[i - 1];
}
for(int i = 0; i <= n; i++)
for(int j = 0; j <= n; j++)
dp[i][j] = 1e18;
dp[0][0] = 0;
for(int j = 1; j <= n; j++){
for(int i = j; i <= n; i++){
for(int k = j - 1; k < i; k++){
dp[i][j] = min(dp[i][j], dp[k][j - 1] | (pref[i] - pref[k]));
}
}
}
long long ans = 1e18;
for(int i = a; i <= b; i++) ans = min(ans, dp[n][i]);
printf("%lld\n", 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... |