# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
649585 | tvladm2009 | 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 "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> find_subset(int l, int u, vector<int> w) {
sort(w.begin(), w.end());
int j = 0, sum = 0;
int cnt = 0;
vector<int> sol;
for (int i = 0; i < w.size(); i++) {
sum += w[i];
while (sum > u && j <= i) {
sum -= w[j];
j++;
}
if (j <= i && l <= sum && sum <= u) {
int cnt = i - j + 1;
for (int k = 1; k <= cnt; k++) {
sol.push_back(j + k - 1);
}
break;
}
}
return sol;
}
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... |