| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362205 | lyra_g13 | Detecting Molecules (IOI16_molecules) | C++20 | 27 ms | 5288 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<pair<ll, ll>> a(w.size());
for (int i = 0; i < w.size(); i++) {
a[i].first = w[i];
a[i].second = i;
}
sort(a.begin(), a.end());
ll sum = 0;
ll idx0 = 0;
ll idx1 = 0;
vector<int> ans;
for (int i = 0; i < w.size(); i++) {
sum += a[i].first;
idx1 = i;
if (sum < l)
continue;
while (sum > u) {
sum -= a[idx0].first;
idx0++;
}
if (sum >= l and sum <= u and u - l >= a[idx1].first - a[idx0].first) {
for (int j = idx0; j <= idx1; j++) {
ans.push_back(a[j].second);
}
return ans;
}
}
return ans;
};| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
