# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
600417 | A_D | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 304 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;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<int> vec;
vector<pair<int,int>> s;
for(int i=0;i<w.size();i++){
s.push_back({w[i],i});
}
sort(s.begin(),s.end());
int sum=0;
for(int i=s.size()-1;i>=0;i--){
if(sum+s[i].first<=u){
sum+=s[i].first;
vec.push_back(s[i].second);
}
}
if(sum<l){
vec.clear();
}
sort(vec.begin(),vec.end());
return vec;
}
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... |