# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
435336 | FEDIKUS | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 204 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"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<int> res;
sort(w.begin(),w.end());
int ll=0;
int rr=0;
int sum=w[0];
while(rr<w.size()){
if(sum>=l && sum<=u){
for(int i=ll;i<=rr;i++) res.push_back(i);
break;
}else if(sum<l){
if(rr==w.size()) break;
rr++;
sum+=w[rr];
}else{
sum-=w[ll];
ll++;
}
}
return res;
}
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... |