# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
337338 | aanji | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 384 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;
typedef long long ll;
vector<int> W;
vector<int> find_subset(int l, int r, vector<int> w) {
vector<int> x(w.size()); W = w;
iota(x.begin(), x.end(), 0);
sort(x.begin(), x.end(), [](int a, int b) {
return W[a] < W[b];
});
ll a = 0, b = 0, s = 0;
while (b < w.size()) {
if (s < l) {
s += w[x[b++]];
}
else if (s > r) {
s -= w[x[a++]];
}
else {
vector<int> k;
for (int i = a; i < b; i++) {
k.push_back(x[i]);
}
return k;
}
}
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... |