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 "books.h"
using namespace std;
long long get(int x, int K) {
long long ret = 0;
for (int i = 0; i < K; i++) ret += skim(x + i + 1);
return ret;
}
void solve(int N, int K, long long A, int S) {
int l = 0, r = N - K;
while (l < r) {
int m = (l + r) / 2;
long long t = get(m, K);
if (t < A) l = m + 1;
else r = m;
}
if (get(l, K) > 2 * A) impossible();
else {
vector<int> v;
for (int i = 0; i < K; i++) v.push_back(l + i + 1);
answer(v);
}
}
# | 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... |