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"
#define all(v) (v.begin()), (v.end())
#define setall(a, val) memset(a, val, sizeof a)
#define ll long long
using namespace std;
void solve(int N, int K, ll A, int S) {
vector<ll> v(N + 1, 0);
vector<int> ans;
int l = 1, r = N - K + 1;
while (l <= r) {
ans.clear();
int mid = (l + r) / 2;
ll s = 0;
for (int i = mid - K / 2; i < mid + K / 2 + (K % 2); i++) {
ans.push_back(i);
if (!v[i])
v[i] = skim(i);
s += v[i];
}
if (s < A)
l = mid + 1;
else if (s > 2 * A)
r = mid - 1;
else {
answer(ans);
return;
}
}
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... |