#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
vector<int> ret;
void get(int l, int r) {
for(int i = l; i <= r; i++)
ret.push_back(i);
}
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
int n = w.size();
sort(w.begin(),w.end());
if(w[0] > u) return ret;
long long x = 0, sum = w[0];
while(x + 1 < n && sum + w[x + 1] < l) { sum += w[x+1]; x++; }
if(x + 1 < n && sum + w[x + 1] <= u && sum + w[x + 1] >= l) {
get(0,x+1);
return ret;
}
for(int i = x + 1; i < n; i++) {
sum += w[i];
sum -= w[i - x - 1];
if(l <= sum && sum <= u) {
get(i - x, i);
return ret;
}
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
252 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
504 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
540 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
540 KB |
OK (n = 12, answer = YES) |
2 |
Correct |
2 ms |
656 KB |
OK (n = 12, answer = YES) |
3 |
Correct |
2 ms |
692 KB |
OK (n = 12, answer = NO) |
4 |
Correct |
2 ms |
692 KB |
OK (n = 12, answer = NO) |
5 |
Correct |
2 ms |
792 KB |
OK (n = 12, answer = YES) |
6 |
Correct |
3 ms |
792 KB |
OK (n = 12, answer = YES) |
7 |
Correct |
2 ms |
792 KB |
OK (n = 12, answer = YES) |
8 |
Correct |
2 ms |
792 KB |
OK (n = 12, answer = YES) |
9 |
Correct |
2 ms |
792 KB |
OK (n = 6, answer = YES) |
10 |
Correct |
2 ms |
996 KB |
OK (n = 12, answer = YES) |
11 |
Correct |
2 ms |
996 KB |
OK (n = 100, answer = NO) |
12 |
Incorrect |
2 ms |
996 KB |
sum of weights should be in [50..51] but it is 73 |
13 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
252 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
504 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
540 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
252 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
504 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
540 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
252 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
504 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
540 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
252 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
504 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
540 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |