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> r(deque<int> ret){
vector <int> rret;
for(auto it : ret)
rret.push_back(it);
return rret ;
}
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
int n = w.size();
deque<int> ret ;
long long sum = 0 ;
for(int i = 0 ; i < n ; i ++){
sum += w[i];
ret.push_back(i);
while(sum > u ){
sum -= w[ret[0]] , ret.pop_front();
}
if(sum >= l && sum <= u)
return r(ret);
}
return std::vector<int>(0);
}
# | 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... |