# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
860856 | JoksimKaktus | Detecting Molecules (IOI16_molecules) | C++17 | 110 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 <set<int>> ind(u+1);
ind[0].insert(-1);
int stop = -1;
for(int i = 0;i < w.size();i++){
for(int j = u;j -w[i] >= 0;j--){
if(!ind[j-w[i]].empty() && ind[j].empty()){
ind[j].insert(i);
for(int k : ind[j-w[i]]){
if(k == -1) continue;
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... |