# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1211833 | Marco_Escandon | Roller Coaster Railroad (IOI16_railroad) | C++20 | 0 ms | 0 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
typedef int ll;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
sort(w.rbegin(),w.rend());
ll ac=0;
vector<ll> ans;
for(int i=0; i<w.size(); i++)
{
if(ac+w[i]<=u)
{
ac+=w[i];
ans.push_back(i);
if(ac>=l) return ans;
}
}
return ans;
}