| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368517 | kahoul | A Difficult(y) Choice (BOI21_books) | C++20 | 0 ms | 420 KiB |
#include <bits/stdc++.h>
#include "books.h"
#define int long long
using namespace std;
//
// --- Sample implementation for the task books ---
//
// To compile this program with the sample grader, place:
// books.h books.cpp grader.cpp
// in a single folder and run:
// g++ books.cpp grader.cpp
// in this folder.
//
map<int, int> a;
void solve(signed N, signed K, long long A, signed S) {
int l = 0, r = N - K;
while (l < r) {
int m = (l + r) / 2;
int sum = 0;
for (int i = m; i <= m + K - 1; i++) {
sum += (a[i] = (a.count(i) ? a[i] : skim(i + 1)));
}
if (sum >= A) r = m;
else l = m + 1;
}
vector<signed> ans;
int sum = 0;
for (int i = l; i <= l + K - 1; i++) {
sum += a[i];
ans.push_back(i + 1);
}
if (A <= sum && sum <= 2 * A) {
answer(ans);
return;
}
impossible();
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
