| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 498272 | OrazB | Detecting Molecules (IOI16_molecules) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define N 100005
#define ll long long int
#define pii pair <long long, long long>
#define pb push_back
#define ff first
#define ss second
using namespace std;
vector <ll> find_subset(ll l, ll u, vector <ll> w){
ll sm = 0, tr = 0;
vector <pii> v;
vector <ll> ans;
for (int i = 0; i < w.size(); i++) v.pb({w[i], i});
sort (v.begin(), v.end());
for (int i = 0; i < v.size(); i++){
sm += v[i].ff;
ans.pb(v[i].ss);
if (sm >= l and sm <= u){tr = 1; break;}
}
if (!tr) ans.clear();
return ans;
}
