#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<int> ans;
int idx=0;
for(auto k: w){
if(k>=l && k<=u){
ans={idx};
return ans;
}
idx++;
}
long long s=0;
for(int i=(int)w.size()-1 ; i>= 0; i--){
int k=w[i];
if(k<l){
s+=k;
ans.push_back(i);
}
if(s>=l){
sort(ans.begin(),ans.end());
return ans;
}
}
return {};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
1 ms |
364 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
508 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
1 ms |
512 KB |
OK (n = 3, answer = YES) |
13 |
Incorrect |
1 ms |
360 KB |
sum of weights should be in [6..9] but it is 10 |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
512 KB |
sum of weights should be in [302..304] but it is 306 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
1 ms |
364 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
508 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
1 ms |
512 KB |
OK (n = 3, answer = YES) |
13 |
Incorrect |
1 ms |
360 KB |
sum of weights should be in [6..9] but it is 10 |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
1 ms |
364 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
508 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
1 ms |
512 KB |
OK (n = 3, answer = YES) |
13 |
Incorrect |
1 ms |
360 KB |
sum of weights should be in [6..9] but it is 10 |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
1 ms |
364 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
508 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
1 ms |
512 KB |
OK (n = 3, answer = YES) |
13 |
Incorrect |
1 ms |
360 KB |
sum of weights should be in [6..9] but it is 10 |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
1 ms |
364 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
508 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
1 ms |
364 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
1 ms |
512 KB |
OK (n = 3, answer = YES) |
13 |
Incorrect |
1 ms |
360 KB |
sum of weights should be in [6..9] but it is 10 |
14 |
Halted |
0 ms |
0 KB |
- |