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;
// #define int long long
vector<int> find_subset(int l, int r, vector<int> v) {
sort(v.begin(), v.end());
int n = v.size();
vector<int> sol;
for(int i = n-1; i >= 0; i--){
int aux = v[i];
vector<int> pos;
pos.push_back(i);
for(int j = i-1; i >= 0; j--){
if(aux+v[j] > r) continue;
else{
aux+=v[j];
pos.push_back(v[j]);
}
if(aux >= l) break;
}
if(aux >= l && aux <= r){
sol = pos;
reverse(sol.begin(), sol.end());
break;
}
}
return sol;
}
# | 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... |