#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
vector <int> ans;
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
vector <pair <int, int> > v;
for (int i = 0;i < n;i++) v.push_back({w[i], i});
sort(v.begin(), v.end());
long long s = 0, curr = 0;
for (int i = 0;i < n;i++){
while (curr < n && s < l) s += v[curr++].first;
if (l <= s && s <= u){
cout <<i << ' '<< curr<< ' '<< s<< endl ;
for (int j = i;j < curr;j++)
ans.push_back(v[j].second);
return ans;
}
s -= v[i].first;
}
return std::vector<int>(0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
256 KB |
Secret is incorrect! |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Secret is incorrect! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
256 KB |
Secret is incorrect! |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
256 KB |
Secret is incorrect! |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
256 KB |
Secret is incorrect! |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
256 KB |
Secret is incorrect! |
4 |
Halted |
0 ms |
0 KB |
- |