#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
vector<int> find_subset(int l, int u, vector<int> w) {
sort(w.begin(), w.end());
int N = w.size();
long long sum = w[0];
int low = N-1, up = N-1;
while((sum < l || sum > u) && low >= 0){
while(sum < l && up >= low){
up--;
sum += w[up];
}
if(sum > u){
sum -= w[low];
low--;
}
// cout << low << " " << up << " " << sum << "\n";
}
if(l <= sum && sum <= u){
for(int i = low; i <= up; i++){
ans.push_back(w[i]);
}
return ans;
}
return vector<int>(0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
376 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
256 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
376 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
376 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
376 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
376 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |