# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
668373 | haxorman | 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 <bits/stdc++.h>
#include "molecules.h"
using namespace std;
vector<int> find_subset(int l, int r, vector<int> arr) {
vector<pair<int,int>> vec;
for (int i = 0; i < arr.size(); ++i) {
vec.push_back({arr[i], i + 1});
}
sort(vec.begin(), vec.end());
long long sum = 0;
set<pair<int,int>> check;
for (int i = 0; i < vec.size(); ++i) {
while (sum > r) {
sum -= (*check.rbegin()).first;
check.erase(*check.rbegin());
}
if (sum >= l) {
vector<int> ans;
for (auto p : check) {
ans.push_back(p.second);
}
return ans;
}
}
return {};
}
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... |