# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1015602 | Unforgettablepl | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 432 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>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<pair<int,int>> arr;
for(int i=0;i<w.size();i++)arr.emplace_back(w[i],i);
sort(arr.begin(),arr.end());
bool flag = false;
redo:
vector<int> ans;
int sum = 0;
for(auto[a,b]:arr){
sum+=a;
ans.emplace_back(b);
if(l<=sum and sum<=u)return ans;
}
if(flag)return {};
flag = true;
reverse(arr.begin(),arr.end());
goto redo;
}
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... |