# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
45759 | antimirage | Bali Sculptures (APIO15_sculpture) | C++17 | 1115 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define int long long
using namespace std;
const int N = 2005, inf = 1e18;
int n, a, b, ar[N], pref[N], ans = 1e18;
vector <int> dp[N][N];
main()
{
cin >> n >> a >> b;
for (int i = 1; i <= n; i++)
scanf("%lld", &ar[i]), pref[i] = ar[i] + pref[i - 1];
dp[0][0].push_back( 0 );
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
for (int k = 1; k <= j; k++)
{
for (auto it : dp[i - 1][k - 1])
dp[i][j].push_back( it | (pref[j] - pref[k - 1]) );
}
}
}
for (int i = a; i <= b; i++)
{
sort(all(dp[i][n]));
ans = min(ans, dp[i][n][0]);
}
cout << ans << endl;
}
컴파일 시 표준 에러 (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... |