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;
#include "molecules.h"
vector<int> find_subset(int l, int r, vector<int> w) {
vector<int> rval;
int n = w.size();
vector<pair<int,int>> arr(n);
for (int i = 0; i < n; ++i)
{
arr[i]={w[i],i};
}
sort(arr.begin(), arr.end());
if (arr[0].first>r){
return rval;
}
for (int i = 0; i < n; i++){
int somma = 0;
for (int j = i; j < n; j++){
somma+=arr[j].first;
if (somma>=l && somma<=r){
for (int z = i; z <= j; z++){
rval.push_back(arr[z].second);
}
return rval;
}
if (somma>r) break;
}
}
return rval;
}
# | 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... |