# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
469889 | IvnF | Detecting Molecules (IOI16_molecules) | C++14 | 0 ms | 0 KiB |
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"
std::vector<long long> find_subset(long long l, long long u, std::vector<long long> w) {
long long kiri=0, sums=0, n=w.size();
for(long long i=0;i<n;++i){
sums+=w[i];
while(sums > u){
sums-=w[l++];
}
if(sums>=l && sums<=u){
std::vector<long long>ans;
for(int j=l;j<=i;++j){
ans.push_back(j);
}
return ans;
}
}
}