| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1265486 | canhnam357 | Bali Sculptures (APIO15_sculpture) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
#define N 100
int dp[N][N + 1];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, l, r;
cin >> n >> l >> r;
vector<int> a(n);
for (int &i : a) cin >> i;
long long ans = 0;
for (int mask = 40; mask >= 0; mask--) {
for (int i = 0; i < n; i++) {
for (int j = 0; j <= r; j++) dp[i][j] = 0;
}
for (int i = 0; i < n; i++) {
long long sum = 0;
for (int j = i; j >= 0; j--) {
sum += a[j];
if ((sum ^ ans) < (1LL << mask)) {
if (j == 0) {
dp[i][1] = 1;
}
else {
for (int k = 2; k <= r; k++) {
dp[i][k] |= dp[j - 1][k - 1];
}
}
}
}
}
long long add = (1LL << mask);
for (int i = l; i <= r; i++) {
if (dp[n - 1][i]) {
add = 0;
break;
}
}
ans += add;
}
cout << ans;
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... | ||||
