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"
#include "molecules.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x) cerr<< #x <<" = "<< x<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
vector<int>pub;
bool cmp(int x,int y){
return (pub[x]<pub[y]);
}
vector<int> find_subset(int l, int u, vector<int> w) {
int n=int(w.size());pub=w;
vector<int>ind,ans;
for(int i=0;i<n;i++)
ind.pb(i);
sort(all(ind),cmp);
int sum=0,p=0;
for(int i=0;i<n;i++){
while(p<n and 1LL*sum+w[ind[p]]<=u)
sum+=w[ind[p++]];
if(sum>=l){
for(int j=i;j<p;j++)
ans.pb(ind[j]);
return ans;
}sum-=w[ind[i]];
}return vector<int>(0);
}
| # | 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... |