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;
typedef pair<int,int> pii;
pii arr[200000];
vector<int> find_subset(int l, int u, vector<int> w) {
int n=w.size();
for(int i=0;i<n;i++)arr[i]={w[i],i};
sort(arr,arr+n);
int ptr=0;
long long tot=0;
vector<int> ans;
for(int i=0;i<n;i++){
while(ptr<n && tot<l){
tot+=arr[ptr].first;
ptr++;
}
if(tot>=l && tot<=u){
for(int j=i;j<ptr;j++)ans.push_back(arr[j].second);
break;
}
tot-=arr[i].first;
}
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... |