# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
998701 | The_Samurai | Detecting Molecules (IOI16_molecules) | C++17 | 0 ms | 348 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;
const int N = 5e5 + 5;
std::vector<int> find_subset(int l, int r, std::vector<int> w) {
int n = w.size();
long long sum = 0;
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++) a[i] = make_pair(w[i], i);
sort(a.begin(), a.end());
for (int lx = 0, rx = 0; rx < w.size(); rx++) {
sum += w[rx];
while (sum > r) {
sum -= w[lx++];
}
if (sum >= l) {
vector<int> ans;
for (int i = lx; i <= rx; i++) ans.emplace_back(a[i].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... |