# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
860852 | JoksimKaktus | Detecting Molecules (IOI16_molecules) | C++17 | 105 ms | 65536 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;
vector<int> find_subset(int l, int u, vector<int> w) {
vector <bool> tab(u+1,false);
tab[0]=true;
vector <set<int>> ind(u+1);
int stop = -1;
for(int i = 0;i < w.size();i++){
for(int j = u;j -w[i] >= 0;j--){
if(tab[j-w[i]] && !tab[j]){
tab[j]=true;
ind[j].insert(i);
for(int k : ind[j-w[i]]){
ind[j].insert(k);
}
if(j >= l){
stop = j;
break;
}
}
}
if(stop > -1){
break;
}
}
vector <int>res;
if(stop > -1){
for(auto i : ind[stop]){
res.push_back(i);
}
return res;
}else{
return res;
}
}
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... |