# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
757247 | Seb | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 772 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> sum[10005],aux[10005];
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
for (int i=0;i<w.size();i++) {
for (int j=0;j<=10000;j++) {
if (!sum[j].empty()) {
if (w[i]+j < 10005) {
aux[w[i]+j] = sum[j];
aux[w[i]+j].push_back(i);
}
}
}
for (int j=0;j<=10000;j++) {
if (!aux[j].empty()) swap(aux[j],sum[j]);
aux[j].clear();
}
}
for (int i=l;i<=u;i++) if (!sum[i].empty()) return sum[i];
return vector<int>(0);
}
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... |