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>
using namespace std;
//#define int long long
#define pii pair<int,int>
#define float long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(v) (int)v.size()
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
int n=sz(w);
vector<pii> v;
for(int i=0;i<n;i++){
v.pb({w[i],i});
}
sort(all(v));
int sum=0;
vector<int> ans;
for(int i=0,j=0;j<n;j++){
sum+=v[j].fi;
while(sum>u){
sum-=v[i].fi;
i++;
}
if(l<=sum){
while(i<=j){
ans.pb(v[i].se);
}
break;
}
}
return ans;
}
# | 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... |