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>
using namespace std;
vector<int> find_subset(int l, int r, vector<int> w) {
int n=w.size();
pair<int,int> a[n];
for (int i=0;i<n;i++)
a[i].first=w[i], a[i].second=i;
sort(a, a+n);
long long zbir=0, index_l=0, index_r=0;
vector<int> rez;
while (index_r<n) {
zbir+=a[index_r].first;
while (zbir>r) {
zbir-=a[index_l].first;
index_l++;
}
if (zbir>=l) {
for (int i=index_l;i<=index_r;i++)
rez.push_back(a[i].second);
break;
}
index_r++;
}
return rez;
}
# | 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... |