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>
#include "molecules.h"
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector <int> ret;
int n = w.size();
vector <pii> W(n);
for(int i = 0; i < n; ++i) {
W[i] = {w[i], i};
}
ll sum = 0;
int cnt = 0;
while (sum < l) {
sum += W[cnt++].first;
}
if (l <= sum && sum <= u) {
for(int i = 0; i < cnt; ++i) {
ret.push_back(i);
}
}
return ret;
}
# | 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... |