# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
424181 | MOUF_MAHMALAT | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 204 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 "molecules.h"
#include<bits/stdc++.h>
#define all(s) s.begin(),s.end()
using namespace std;
typedef int ll;
multiset<ll>s;
vector<ll>v;
pair<ll,ll>p[200009];
ll sum,id;
vector<int>find_subset(int l, int u, vector<int> w)
{
for(ll i=0; i<w.size(); i++)
{
sum+=w[i];
s.insert(w[i]);
p[i]= {w[i],i};
}
while(sum>u)
{
auto z=s.lower_bound(sum-u);
if(z==s.end())
z--;
sum-=*z;
s.erase(z);
//cout<<sum<<endl;
}
if(sum<l)
return v;
sort(p,p+w.size());
for(auto x:s)
{
while(x!=p[id].first)
id++;
v.push_back(p[id].second);
id++;
}
sort(all(v));
return v;
}
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... |