# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
670960 | mdub | Detecting Molecules (IOI16_molecules) | C++14 | 41 ms | 5520 KiB |
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;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<pair<int, int>> a;
for (int i = 0; i < w.size(); i++) {
a.push_back({w[i], i});
}
sort(a.begin(), a.end());
int left = 0;
int sum = 0;
for (int right = 0; right < w.size(); right++) {
sum += a[right].first;
while (sum > u) {
sum -= a[left].first;
left++;
}
if (sum >= l) {
vector<int> ret;
for (int i = left; i <= right; i++) {
ret.push_back(a[i].second);
}
return ret;
}
}
return {};
}
Compilation message (stderr)
# | 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... |