# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
377320 | antontsiorvas | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 364 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 <cstdio>
#include <algorithm>
#include "molecules.h"
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
std:sort(w.begin(),w.end());
int cursum = 0;
std::vector<int> ret;
int beg=0, end=0;
while(end < w.size()){
if(l <= cursum && cursum <= u){
for(int i=beg; i<end; i++){
ret.push_back(w[i]);
}
return ret;
}
if(cursum < l){
cursum += w[end];
end++;
}
else if(cursum > u){
cursum -= w[beg];
beg++;
}
}
return ret;
}
Compilation message (stderr)
# | 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... |