# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
758973 | raysh07 | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 340 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) {
int sum = 0;
for (auto x : w) sum += x;
vector <pair<int, int>> a;
for (int i = 0; i < w.size(); i++){
a.push_back(make_pair(w[i], i));
}
sort(a.begin(), a.end());
if (sum < l)
return std::vector<int>(0);
vector <int> v;
for (auto x : a){
if (x.first <= u){
u -= x.first;
l -= x.first;
v.push_back(x.second);
}
}
if (l > 0){
return vector<int>(0);
}
return v;
}
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... |