| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1344061 | sdan | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 344 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
vector<int> find_subset(int l, int r, vector<int> w) {
int n = w.size(), sum = 0;
vector<int> s;
vector<pair<int, int>> a;
for(int i = 0; i < n; ++i) a.pb({w[i], i});
sort(a.begin(), a.end());
for(int i = n - 1; i > -1; --i) {
if(sum + a[i].f <= r) sum += a[i].f; s.pb(a[i].s);
if(sum >= l) break;
}
if(sum >= l && sum <= r) return s;
return {};
}| # | 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... | ||||
