#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
const int inf = 2e5+9;
int n,pre[inf];
pair<int,int> a[inf];
vector<int> find_subset(int l, int r, vector<int> w) {
vector<int> ans;
n = w.size();
for(int i=1;i<=n;i++)
a[i] = make_pair(w[i-1],i) , pre[i] =pre[i-1] + a[i].first;
sort(a+1,a+1+n);
for(int i=1;i<=n;i++){
for(int j=i;j<=n;j++){
if(pre[j] - pre[i-1] >=l && pre[j] - pre[i-1] <= r){
for(int z=i;z<=j;z++)
ans.push_back(a[z].second);
return ans;
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
376 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
372 KB |
OK (n = 12, answer = YES) |
2 |
Correct |
2 ms |
376 KB |
OK (n = 12, answer = YES) |
3 |
Correct |
2 ms |
376 KB |
OK (n = 12, answer = NO) |
4 |
Correct |
2 ms |
376 KB |
OK (n = 12, answer = NO) |
5 |
Incorrect |
2 ms |
376 KB |
sum of weights should be in [290..300] but it is 301 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
376 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
376 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
376 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
2 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
2 ms |
376 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |