Submission #777496

#TimeUsernameProblemLanguageResultExecution timeMemory
777496JoenPoenManDetecting Molecules (IOI16_molecules)C++17
0 / 100
104 ms65536 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<pair<int, vector<int>>> dp; dp.push_back({0, {}}); for (unsigned int i = 0; i < w.size(); i++) { for (int j = dp.size()-1; j >= 0; j--) { int we; vector<int> contents; tie(we, contents) = dp[j]; if (we+w[i] <= u) { contents.push_back(i); if (we+w[i] >= l) return contents; dp.push_back({we+w[i], contents}); } } } return std::vector<int>(0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...