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;
typedef long long ll;
#define all(x) (x).begin(), (x).end()
#define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
#define pb push_back
vector<int> find_subset(int l1, int u, vector<int> w)
{
int n = w.size(), ans = 0;
set <int> s;
sort(all(w));
int l = 0, r = 0;
while(l < n && r < n)
{
while(ans < l1)
{
ans += w[r], r ++, s.insert(r-1);
}
if(ans >= l1 && ans <= u)
break;
while(ans > u)
ans -= w[l], l ++, s.erase(l-1);
}
if(ans > u || ans < l1)
s.erase(all(s));
vector <int> x;
for(auto it : s)
x.pb(it+1);
return x;
}
# | 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... |