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;
vector<int>find_subset(int l, int u, vector<int>w) {
int index = int(w.size()) - 1, sum = 0;
while(index > -1 && sum < l){
sum += w[index--];
}
int length = int(w.size()) - index - 1;
while(index > -1 && sum > u){
sum -= w[index + length] - w[index];
index--;
}
if(sum > u){
return vector<int>{};
}
vector<int>ans(length);
iota(ans.begin(), ans.end(), index + 1);
return ans;
}
# | 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... |