| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1333745 | zhehan | A Difficult(y) Choice (BOI21_books) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "books.h"
using namespace std;
//
// --- Sample implementation for the task books ---
//
// To compile this program with the sample grader, place:
// books.h books_sample.cpp sample_grader.cpp
// in a single folder and run:
// g++ books_sample.cpp sample_grader.cpp
// in this folder.
//
void solve(int N, int K, long long A, int S) {
// TODO implement this function
vector<int> books(N, 0);
for (int i = 1; i <= N; ++i) {
books[i-1] = skim(i);
}
for (int i = 0; i < N; ++i) {
for (int j = i + 1; j < N; ++j) {
int ind =
lower_bound(books.begin(), books.end(), A - books[i] - books[j]) -
books.begin();
if (books[i] + books[j] + books[ind] < 2 * A && ) {
answer(vector<int>{i, j, ind});
}
}
}
impossible();
}
