이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define vi vector < int >
#define vl vector < ll >
#define pi pair < int, int >
#define pii pair < int, pi >
#define vii vector < pi >
const int N = 107;
const int INF = 1e9 + 7;
int c[N], pr[N], dp[N][N];
int n, a, b;
main(){
cin >> n >> a >> b;
for (int i = 1; i <= n; i++){
cin >> c[i];
pr[i] = c[i] + pr[i - 1];
fill(dp[i], dp[i] + N, INF);
}
for (int i = 1; i <= n; i++){
for (int j = 1; j <= min(i, b); j++){
if (j > 1){
for (int k = j; k <= i; k++){
dp[i][j] = min(dp[i][j], (dp[k - 1][j - 1] | (pr[i] - pr[k - 1])));
}
}
else
dp[i][j] = pr[i];
}
}
int mn = INF;
for (int i = a; i <= b; i++){
mn = min(mn, dp[n][i]);
}
cout << mn;
}
컴파일 시 표준 에러 (stderr) 메시지
sculpture.cpp:21:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main(){
^| # | 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... |