#include <bits/stdc++.h>
#include "books.h"
using namespace std;
typedef long double ld;
typedef long long lli;
typedef vector<int32_t> vi;
typedef vector<ld> vld;
typedef vector<lli> vlli;
typedef pair<lli, lli> pii;
// #define int int64_t
#define endl "\n"
#define inp(n) lli n; cin >> n
#define inpstr(s) string s; cin >> s
#define inp2(a,b) lli a,b; cin >> a >> b
#define inparr(arr,n) lli arr[n]; f0(t_ind, n) cin >> arr[t_ind]
#define f0(i,n) for(int32_t i = 0; i < (n); i++)
#define f1(i,n) for(int32_t i = 1; i <= (n); i++)
#define testIn cin >> test
#define tests for(int32_t testNo=1; testNo <= (test); testNo++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(a) ((int64_t)(a).size())
#define lcm(a, b) (((a)*(b))/gcd(a,b))
#define ff first
#define ss second
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define finish return 0
#define clean fflush(stdout)
#define Inf (lli)(1e9)
#define Eps (ld)(1e-9)
#define PI (ld)(3.141592653589793238462643383279502884197169L)
#define MOD (int32_t)(1e9+7)
//
// --- 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
int n = N;
vector<long long> books;
f1(i, N) {
books.push_back(skim(i));
}
f0(i, n) {
for(int j = i+1; j < n; j++) {
for(int k = j+1; k < n; k++) {
if(books[i] + books[j] + books[k] <= 2*A && A <= books[i] + books[j] + books[k]) {
answer({i+1, j+1, k+1});
return;
}
}
}
}
impossible();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
4 ms |
448 KB |
Output is correct |
3 |
Correct |
4 ms |
692 KB |
Output is correct |
4 |
Correct |
112 ms |
608 KB |
Output is correct |
5 |
Correct |
3 ms |
440 KB |
Output is correct |
6 |
Correct |
3 ms |
440 KB |
Output is correct |
7 |
Correct |
4 ms |
444 KB |
Output is correct |
8 |
Correct |
88 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
4 ms |
696 KB |
Output is correct |
3 |
Correct |
4 ms |
444 KB |
Output is correct |
4 |
Correct |
120 ms |
436 KB |
Output is correct |
5 |
Correct |
4 ms |
444 KB |
Output is correct |
6 |
Correct |
4 ms |
440 KB |
Output is correct |
7 |
Correct |
4 ms |
440 KB |
Output is correct |
8 |
Correct |
100 ms |
440 KB |
Output is correct |
9 |
Incorrect |
101 ms |
1944 KB |
Incorrect |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
444 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
444 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
444 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
444 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
444 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |