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 pb push_back
using namespace std;
int s, e, sum, i;
std::vector<int> find_subset(int l, int u, std::vector<int> w)
{
vector<int> v;
int n = w.size();
sort(w.begin(), w.end());
s = 0, e = 0, sum = w[0];
bool f = 1;
while(f)
{
//cout << s << ' ' << e << ' ' << sum << '\n';
if(sum >= l && sum <= u)
{
for(i = s; i <= min(n - 1, e); i++)
v.pb(i);
return v;
}
f = 0;
while(e < n && sum < l)
sum += w[++e], f = 1;
while(s < e && sum > u)
sum -= w[s++], f = 1;
}
return v;
}
# | 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... |