This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, A, B;
cin >> n >> A >> B;
int a[n], D[n+1], S[n+1];
S[0] = 0;
for (int i = 1; i <= n; i++)
{
D[i] = 2000000000;
cin >> a[i-1];
S[i] = S[i-1] + a[i-1];
}
D[0] = 0;
for (int i = 1; i <= n; i++)
{
for (int y = A; y <= B; y++)
{
if (i-y >= 0)
{
D[i] = min(D[i], D[i-y] | (S[i]-S[i-y]));
}
}
}
cout << D[n];
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... |