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>
#define pb push_back
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INF = (ll)1<<62;
const ll MOD = 1e9+7;
const int iINF = 1<<30;
const double PI = 3.14159265359;
vector<int> find_subset(int l, int u, vector<int> w){
vector<pair<int, int> > wd;
for(int i=0;i<(int)w.size();i++) wd.pb({w[i], i});
sort(wd.begin(), wd.end());
deque<int> ans;
int i = 0;
ll s = 0;
while(i<(int)w.size()){
s += wd[i].ff;
ans.pb(wd[i].ss);
while(s > u){
s -= w[ans.front()];
ans.pop_front();
}
i++;
if(s >= l && s <= u){
vector<int> ret;
for(int v : ans) ret.pb(v);
return ret;
}
}
return {};
}
# | 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... |