# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
481223 | glome | Detecting Molecules (IOI16_molecules) | C++17 | 2 ms | 3404 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.
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
struct S {
int b = 0;
vector<int> ind;
};
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<S> ok(100000+1);
ok[0].b = 1;
int cnt = 0;
vector<int> avai;
avai.push_back(0);
for (int i : w) {
for (int j : avai) {
if(ok[j+i].b) {
ok[j].ind = ok[j+i].ind;
ok[j].b = 1;
(ok[j].ind).push_back(cnt);
avai.push_back(j);
}
}
cnt++;
}
vector<int> ans;
for (int i = l; i<=u; i++) {
if(ok[i].b) {
return ok[i].ind;
}
}
return ans;
}
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... |