# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1067276 | duckindog | A Difficult(y) Choice (BOI21_books) | C++17 | 3017 ms | 2464 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>
#include "books.h"
using namespace std;
namespace sub5 {
void solve(int n, int k, long long a, int s) {
vector<long long> x(n + 1);
vector<int> ret;
{ // k - 1
long long total = 0;
for (int i = 1; i < k; ++i) {
if (!x[i]) x[i] = skim(i);
total += x[i];
}
auto get = [&](int i) {
if (!x[i]) x[i] = skim(i);
return total + x[i];
};
int l = k, r = n;
while (l <= r) {
int mid = l + r >> 1;
auto value = get(mid);
if (a <= value && value <= 2 * a) {
for (int i = 1; i < k; ++i) ret.push_back(i);
ret.push_back(mid);
Compilation message (stderr)
# | 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... |