| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1378869 | ziyad_alharbi | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w)
{
long long sm=0;
int n=w.size();
sort(w.begin(),w.end());
set<int>st;
for(int x=0;x<n;x++)
{
sm+=w[x];
st.insert(x);
}
while(sm>u)
{
int i=lower_bound(w.begin(),w.end(),sm-u)-w.begin();
auto it=st.upper_bound(i);
if(it!=st.begin())it--;
i=*it;
sm-=w[i];
st.erase(i);
}
if(sm>=l)
{
vector<int>vc;
for(auto i:st)vc.push_back(i+1);
return vc;
}
else return {};
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
