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 all(a) a.begin(),a.end()
using ll = long long;
const int mxN = (int)2e5+10;
array<ll,2> v[mxN];
vector<int> find_subset(int L, int R, vector<int> w) {
int n = w.size();
for(int i = 0; i < n; i++) v[i]={w[i],i};
sort(v,v+n);
vector<int> A; ll s = 0;
for(int i = 0, j = 0; i < n; s-=v[i++][0]){
while(j<=n and s<L) s+=v[j++][0];
if(j==n+1) break;
if(L<=s and s<=R){
for(int k = i; k < j; k++)
A.push_back((int)v[k][1]);
return A;
}
}
return A;
}
# | 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... |