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>
#include "books.h"
using namespace std;
typedef long long ll;
void ans(int st, int k){
vector<int> v(k);
for(int i = 0; i < k; i++) v[i] = st + i;
answer(v);
}
void solve(int n, int k, ll A, int S){
assert(n == S);
vector<ll> x(n + 1);
for(int i = 1; i <= n; i++){
x[i] = skim(i);
}
ll sum = 0;
for(int i = 1; i <= k; i++) sum += x[i];
if(sum > 2 * A) impossible();
if(sum >= A) ans(1, k);
for(int i = k + 1; i <= n; i++){
sum -= x[i - k];
sum += x[i];
if(sum > 2 * A) impossible();
if(sum >= A) ans(i - k + 1, k);
}
impossible();
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |