#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
/**
if (skim(2) == 42) {
impossible();
} else {
answer({1, 3});
}**/
std::vector<long long> w(n + 1);
for(int i = 1; i <= n; i++) {
w[i] = skim(i);
}
for(int i = 1; i + 2 <= n; i++) {
if(w[i] + w[i + 1] + w[i + 2] >= a && w[i] + w[i + 1] + w[i + 2] <= 2LL * a) {
answer( {i, i + 1, i + 2} );
}
}
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... |