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;
const int maxn = 2e5 + 10;
bool mrk[maxn];
vector<int> find_subset(int l, int r, vector<int>w) {
vector<int>ret;
long long sum = 0;
sort(w.begin(),w.end());
int n = (int)w.size();
int j = 0;
for(int i = 0; i < n; ++i){
sum += w[i];
mrk[i] = true;
while(j < i && sum > r){
sum -= w[j];
mrk[j] = false;
++j;
}
if(l <= sum && sum <= r) break;
}
if(l <= sum && sum <= r){
for(int i = 0; i < n; ++i)
if(mrk[i])
ret.push_back(i);
}
return ret;
}
# | 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... |