| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1343113 | curious_tiger | Detecting Molecules (IOI16_molecules) | C++20 | 34 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=w[0].first;
bool flag = false;
while (i<=j && j<n) {
if (s<l) {
if (j>=n-1)
break;
j++;
s += w[j].first;
}
else if (u<s) {
if (i>=n-1)
break;
s -= w[i].first;
i++;
}
else {
flag = true;
break;
}
}
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... | ||||
