#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w)
{
vector<int> ans, tmp;
int n = w.size();
long long sum = 0;
deque<int> deq;
sort(w.begin(), w.end());
for(int i=0 ; i<n ; i++)
{
deq.push_back(w[i]);
sum += w[i];
while(sum > u)
{
sum -= deq.front();
deq.pop_front();
}
if(l <= sum && sum <= u)
{
while(!deq.empty())
{
ans.push_back(deq.front());
deq.pop_front();
}
return ans;
}
}
return tmp;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Integer 50 violates the range [0, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 10 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |