This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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(le < n) {
while(ri < n and sum < l) sum += (ll)v[ri++].F;
if (sum >= l and sum <= u) break;
sum -= (ll)v[le++].F;
}
rep(le);
rep(ri);
vector<int> res;
for (int i = le; i < ri; ++i)
res.pb(v[i].S);
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |