# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
807703 | Deepesson | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 212 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 <bits/stdc++.h>
#include "molecules.h"
typedef std::pair<int,int> pii;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
std::vector<pii> array;
for(int i=0;i!=w.size();++i){
array.push_back({w[i],i});
}
int N = w.size();
long long la=0,ra=0;
long long soma=0;
while(la!=N){
while(soma<l&&ra!=N){
soma+=array[ra].first;
++ra;
}
if(soma<=u&&soma>=l){
std::vector<int> ans;
for(int i=la;i!=ra;++i){
ans.push_back(array[i].second);
}
std::sort(ans.begin(),ans.end());
return ans;
}
soma-=array[la].first;
++la;
}
return std::vector<int>(0);
}
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... |