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;
void solve(int n, int k, long long a, int s) {
if (s == n && k == 3) {
vector<long long> x(n + 1);
for (int i = 1; i <= n; ++i) x[i] = skim(i);
for (int i = 1; i < n; ++i) {
for (int j = i + 1; j <= n; ++j) {
if (x[i] + x[j] > 2 * a) break;
int t = lower_bound(x.begin() + 1, x.end(), a - x[i] - x[j]) - x.begin();
for (; t <= n; ++t) {
if (t == i || t == j) continue;
long long value = x[i] + x[j] + x[t];
if (x[i] + x[j] + x[t] > 2 * a) break;
if (a <= value) {
answer(vector<int>{i, j, t});
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... |