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<algorithm>
#include<array>
using namespace std;
vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<array<int,2>> A((int)w.size());
for(int i = 0; i < (int)w.size();i++){
A[i][0] = w[i];
A[i][1] = i;
}
sort(A.begin(),A.end());
vector<int> result;
int64_t sum = 0;
for(int i = 0; i < (int)A.size() && sum < l;i++){
sum += A[i][0];
result.push_back(A[i][1]);
}
return (sum <= u ? result : vector<int>(0));
}
# | 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... |