| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1300353 | Agageldi | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 352 KiB |
#include "bits/stdc++.h"
#include "molecules.h"
// #include "grader.cpp"
using namespace std;
#define f first
#define s second
vector <pair<int,int>> v;
vector<int> find_subset(int l, int u, vector<int> w) {
int inx = 0;
for(auto i : w) {
v.push_back({i, inx});
inx++;
}
sort(v.begin(),v.end());
int sm = 0;
deque <int> h = {};
for(auto i : v) {
sm += i.f;
h.push_back(i.s);
while(sm > u){
sm -= v[h[0]].f;
h.pop_front();
}
if(sm >= l && sm <= u) break;
}
vector <int> ans = {};
if(sm >= l && sm <= u)for(auto i : h) ans.push_back(i);
return ans;
}
Compilation message (stderr)
| # | 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... | ||||
