#include <iostream>
#include <vector>
#include "books.h"
#define ll long long
using namespace std;
void solve(int n, int k, ll A, int S) {
vector<ll> a(n);
ll sum = 0;
int mid = -1;
for(int i = 0; i < n; i++) {
a[i] = skim(i+1);
if(a[i] >= A && mid == -1) mid = i;
}
for(int i = 0; i < k-1; i++) sum+=a[i];
mid = min(mid, k);
for(int i = mid; i > k-1; i--) {
if(sum+a[mid] >= A && sum+a[mid] <= 2*A) {
vector<int> b(k);
for(int j = 0; j < k-1; j++) b[j] = j;
b[k] = i;
answer(b);
}
if(i == k) {
impossible();
break;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
1228 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
1228 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
1228 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
1228 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
1228 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |