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;
long long a,b,c,d,e,i,j,ii,jj,zx,xc,f[200009],jm[200009];
pair <long long, long long> p[200009];
int ka;
vector<int> find_subset(int l, int r, vector<int> w) {
a=w.size();
for(i=1; i<=a; i++){
p[i].first=w[i-1];
p[i].second=i-1;
}
sort(p+1,p+a+1);
for(i=1; i<=a; i++){
f[i]=p[i].first;
jm[i]=jm[i-1]+f[i];
}
j=1;
for(i=1; i<=a; i++){
while(j<a&&jm[j]-jm[i-1]<l) j++;
c=jm[j]-jm[i-1];
if(l<=c&&c<=r){
vector <int> vv;
for(ii=i; ii<=j; ii++){
ka=p[ii].second;
vv.push_back(ka);
}
exit(0);
}
}
vector <int> vv;
return vv;
}
# | 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... |