#include "molecules.h"
#include <bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define pb push_back
#define endl '\n'
#define rep(x) cerr<<#x<<"="<<x<<endl
#define OK cerr<<"OK"<<endl<<flush
using namespace std;
const int MOD = 1e9 + 7;
const int N = 510;
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.pb({w[i], i});
sort(v.begin(), v.end());
ll sum = (ll)v[0].F, le = 0, ri = 1;
while(l < n) {
while(ri < n and sum < l) sum += (ll)v[ri++].F;
if (sum >= l and sum <= u) break;
sum -= (ll)v[le++].F;
}
vector<int> res;
for (int i = le; i <= ri; ++i)
res.pb(v[i].S);
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
sum of weights should be in [302..304] but it is 100 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Integer 2 violates the range [0, 1] |
2 |
Halted |
0 ms |
0 KB |
- |