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 <algorithm>
using namespace std;
array<int64_t,2> v[200010];
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;
int64_t 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(L<=s and s<=R and j<=n){
for(int k = i; k < j; k++)
A.push_back((int)v[k][1]);
break;
}
}
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... |