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;
#define forn(i,n) for(int i=0;i<n;++i)
#define pb push_back
#define all(x) x.begin(),x.end()
#define pi pair<int,int>
#define f first
#define s second
vector<int> find_subset(int l, int r, vector<int> w) {
#define int long long
int n=w.size();
int sum=0;
vector<pi> a;
forn(i,n) a.pb({w[i],i});
sort(all(a));
deque<int> st;
int R=0;
forn(L,n) {
while (R<n && sum<l) {
sum+=a[R].f;
st.pb(a[R].s);
++R;
}
if (sum<l) break;
if (sum>r) {
sum-=a[L].f;
st.pop_front();
continue;
}
vector<int32_t> z;
for(auto&x:st) z.pb(x);
return z;
}
return {};
#undef int
}
# | 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... |