| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1303712 | khba | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 348 KiB |
#include "molecules.h"
#include "bits/stdc++.h"
using namespace std;
vector<int> find_subset(int L, int R, vector<int> w) {
int n = w.size();
vector <int> o(n);
iota(begin(o), end(o), 0);
sort(begin(o), end(o), [&] (int r, int l) { return w[r] < w[l]; });
int64_t s = 0;
for (int r = 0, l = 0; r < n; ++r) {
s += w[o[r]];
while (l <= r and s > R) s -= w[o[l++]];
if (s >= L and s <= R and l <= r) {
vector <int> ans;
for (int i = l; i <= r; ++i) ans.emplace_back(o[i] + 1);
return ans;
}
}
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... | ||||
