#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vi;
typedef vector<pair<long long, long long>> vii;
std::vector<int> find_subset(int l, int r, std::vector<int> w) {
int n = w.size();
vii a(n);
for (int i = 0; i < n; i++)
a[i] = {w[i], i};
sort(a.begin(), a.end());
int tl, tr, yi;
tl = tr = yi = 0;
for (;tr < n; tr++) {
yi += a[tr].first;
while (yi > r && tl < tr) {
yi -= a[tl++].first;
}
if (yi >= l) {
vector<int> jv;
for (int k = tl; k <= tr; k++)
jv.push_back(a[k].second);
return jv;
}
}
return vector<int>();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Incorrect |
0 ms |
256 KB |
sum of weights should be in [10..12] but it is 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = YES) |
2 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = YES) |
3 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = NO) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = NO) |
5 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = YES) |
6 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = YES) |
7 |
Correct |
1 ms |
256 KB |
OK (n = 12, answer = YES) |
8 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 6, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = NO) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
13 |
Correct |
1 ms |
256 KB |
OK (n = 100, answer = NO) |
14 |
Correct |
1 ms |
256 KB |
OK (n = 100, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
17 |
Correct |
1 ms |
256 KB |
OK (n = 100, answer = YES) |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Incorrect |
0 ms |
256 KB |
sum of weights should be in [10..12] but it is 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Incorrect |
0 ms |
256 KB |
sum of weights should be in [10..12] but it is 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Incorrect |
0 ms |
256 KB |
sum of weights should be in [10..12] but it is 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Incorrect |
0 ms |
256 KB |
sum of weights should be in [10..12] but it is 13 |
3 |
Halted |
0 ms |
0 KB |
- |