# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1173458 | tegshzaya | Detecting Molecules (IOI16_molecules) | C++20 | 36 ms | 6176 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
#define ll long long int
#define ss second
#define ff first
#define pb push_back
#define endl '\n'
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
ll x=w.size(),j=0,sum=0;
vector<pair<ll,ll> > v;
vector<int> s;
for(ll i=0; i<w.size(); i++)
{v.pb({w[i],i});
}
sort(v.begin(),v.end());
for(ll i=0; i<v.size(); i++)
{
sum+=v[i].ff;
if(sum>=l && sum<=u){
for(ll t=j; t<=i; t++)
{s.pb(v[t].ss);
}
break;
}
while(sum>u){
sum-=v[j].ff;
j++;
}
if(sum>=l && sum<=u){
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... |