| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1343112 | curious_tiger | Detecting Molecules (IOI16_molecules) | C++20 | 35 ms | 4124 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
vector<int> find_subset(int l, int u, vector<int> weight) {
vector<pair<int, int>> w (0);
for (int i=0; i<weight.size(); i++) {
w.emplace_back(weight[i], i);
}
sort(w.begin(), w.end());
int i=0, j=0, n=w.size();
ll s=0;
bool flag = false;
while (i<=j && j<n) {
s += w[j].first;
while (u<s) {
s -= w[i++].first;
}
if (l<=s && s<=u) {
flag = true;
break;
}
j++;
}
vector<int> subset (0);
if (!flag)
return subset;
while (i<=j) {
subset.push_back(w[i].second);
i++;
}
return subset;
}
| # | 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... | ||||
