#include "molecules.h"
using namespace std;
vector<int> find_subset(int l, int u, vector<int> v) {
vector<int> ans;
int n = v.size();
int s=0,beg = 0, end = 0;
while (end < n){
if (s < l){
s += v[end];
end++;
}
if (s > u){
s -= v[beg];
beg++;
}
if (s >= l and s <= u){
for (int i=beg; i<=end-1; ++i){
ans.emplace_back(v[i]);
}
return ans;
}
}
return vector<int>(0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
364 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
Integer 50 violates the range [0, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
364 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
364 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
364 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
0 ms |
364 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |