# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
599638 | daisy2 | Detecting Molecules (IOI16_molecules) | C++14 | 48 ms | 7144 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<iostream>
#include<algorithm>
#include "molecules.h"
using namespace std;
pair<long long,long long> p[200005];
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<int> r;
for(int j=0;j<w.size();j++)
{
p[j].first=w[j];
p[j].second=j;
}
sort(p,p+w.size());
long long t=0,le=0;
for(int ri=0;ri<w.size();ri++)
{
t+=p[ri].first;
while(le<ri && t>u)
{
t-=p[le].first;
le++;
}
if(t>=l && t<=u)
{
for(int i=le;i<=ri;i++)
{
r.push_back(p[i].second);
}
break;
}
}
return r;
}
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... |