# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754015 | Andrey | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 316 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> ans(0);
int a = u;
vector<pair<int,int>> haha(0);
for(int i = 0; i < w.size(); i++) {
haha.push_back({w[i],i});
}
sort(haha.begin(),haha.end());
for(int i = w.size()-1; i >= 0; i--) {
if(a-haha[i].first >= 0) {
a-=haha[i].first;
ans.push_back(haha[i].second);
}
}
if(a <= u-l) {
sort(ans.begin(),ans.end());
}
else {
ans.clear();
}
return ans;
}
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... |