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>
using namespace std;
pair<long long, long long> a[200000];
vector<int> ans;
vector<int> find_subset(int u1, int u2, vector<int> w)
{
long long n=w.size(), l=u1, r=u2, index=0, sum=0;
for (long long i=0; i<n; i++)
{
a[i].first=w[i];
a[i].second=i;
}
sort(a, a+n);
for (long long i=0; i<n; i++)
{
while (1)
{
if (l<=sum && sum<=r)
{
for (long long j=i; j<index; j++)
ans.push_back(a[j].second);
return ans;
}
if (index<n && sum<=r)
{
sum+=a[index].first;
index++;
}
else
break;
}
sum-=a[i].first;
}
return ans;
}
# | 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... |