| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1363890 | alexrana2626 | Detecting Molecules (IOI16_molecules) | C++20 | 28 ms | 3752 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> find_subset(int l, int u, vector <int> w)
{
int n = w.size();
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++)
{
a[i] = {w[i], i};
}
sort(a.begin(), a.end());
int j = 0;
long long sum = 0;
vector<int> ans;
for (int i = 0; i < n; i++)
{
sum += a[i].first;
while (j < n and sum > u)
{
sum -= a[j].first;
j++;
}
if (sum >= l and sum <= u)
{
for (int z = j; z <= i; z++)
{
ans.push_back(a[z].second);
}
break;
}
}
sort(ans.begin(), ans.end());
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... | ||||
