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 <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
#define ld long double
#define all(_v) _v.begin(), _v.end()
#define sz(_v) (int)_v.size()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define veci vector <int>
#define vecll vector <ll>
veci find_subset(int asd, int asdas, veci w) {
ll l = asd, r = asdas;
ll sum = 0;
veci res;
for(int i = 0; i < sz(w); ++i) {
if(l <= w[i] && w[i] <= r) return {i};
if(w[i] < l) {
sum += w[i];
res.pb(i);
}
}
if(sum < l) return {};
while(sum > r && !res.empty()) sum -= w[res.back()], res.pop_back();
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... |