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;
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
vector<int> perm(n);
for (int i = 0; i < n; i++){
perm[i] = i;
if (l <= w[i] && w[i] <= u) return vector<int>(1, i);
}
sort(perm.begin(), perm.end(), [&](int i, int j){
return w[i] < w[j];
});
for (int i = 0; i < n - 1; i++){
int x = perm[i], y = perm[n - 1];
if (l <= w[x] + w[y] && w[x] + w[y] <= u){
vector<int> v = {y, x};
return v;
}
}
return 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... |