# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
376000 | Alex_tz307 | Split the sequence (APIO14_sequence) | C++17 | 44 ms | 364 KiB |
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>
#define int long long
using namespace std;
const int NMAX = 2048;
const int INF = 1e18L;
int N, A, B, a[NMAX], dp[NMAX], ans = (1LL << 60) - 1;
void min_self(int &a, int b) {
a = min(a, b);
}
bool check() {
for(int i = 1; i <= N; ++i)
dp[i] = INF;
for(int i = 0; i < N; ++i) {
int sum = 0;
for(int j = i; j < N; ++j) {
sum += a[j];
if((sum | ans) == ans)
min_self(dp[j + 1], dp[i] + 1);
}
}
return dp[N] <= B;
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |