# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
546454 | d4xn | A Difficult(y) Choice (BOI21_books) | C++17 | 0 ms | 0 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;
//
// --- 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.
//
#define int long long
void solve(int N, int K, long long A, int S) {
// TODO implement this function
// impossible()
// answer()
// puedo hacer S preguntas
// hay N libros
// ordenados de mayor a menor por precio
// tengo que comprar K
// y la suma tiene que ser >= A y <= A*2
vector<int> v(N+1);
for (int i = 1; i <= N; i++) {
v[i] = skim[i];
}
for (int i = 1; i <= N-2; i++) {
for (int j = i+1; j <= N-1; j++) {
for (int i = j+1; k <= N; k++) {
int x = v[i] + v[j] + v[k];
if (A <= x && x <= A*2) {
answer({i, j, k});
}
}
}
}
impossible();
}