# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382395 | Trunkty | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 492 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 <iostream>
#include <algorithm>
#include <vector>
using namespace std;
long long sum=0;
vector<int> find_subset(int li, int ui, vector<int> wi){
long long l=li,u=ui;
vector<vector<long long>> w={};
for(int i=0;i<wi.size();i++){
w.push_back({wi[i],i});
}
sort(w.begin(),w.end());
long long lef=0,rit=-1;
while(rit!=w.size()){
rit++;
sum += w[rit][0];
while(sum>u){
sum -= w[lef][0];
lef++;
}
if(sum<=u and sum>=l){
vector<int> a = {};
for(int i=lef;i<=rit;i++){
a.push_back(w[i][1]);
}
return a;
}
}
return {};
}
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... |