# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70974 | RezwanArefin01 | Detecting Molecules (IOI16_molecules) | C++17 | 3 ms | 356 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<int> v;
for(int i = 0; i < w.size(); i++)
v.push_back(i);
sort(v.begin(), v.end(), [&](int i, int j) {
return w[i] < w[j];
});
int l = 0, r = 0;
int sum = 0;
while(l < w.size()) {
while(r < w.size() && sum < L) {
sum += w[v[r++]];
} if(sum >= L) {
vector<int> ans;
for(int i = l; i < r; i++)
ans.push_back(v[i]);
return ans;
} sum -= w[v[l++]];
}
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... |