Submission #906029

#TimeUsernameProblemLanguageResultExecution timeMemory
906029stefanneaguDetecting Molecules (IOI16_molecules)C++17
31 / 100
1024 ms58348 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; const int nmax = 1e5; bitset<nmax> ans[nmax]; bitset<nmax> f; std::vector<int> find_subset(int vmin, int vmax, std::vector<int> de_ce_de_la_zero) { int n = de_ce_de_la_zero.size(); vector<int> v; v.push_back(0); for(auto it : de_ce_de_la_zero) { v.push_back(it); } f[0] = 1; for(int i = 1; i <= n; i ++) { for(int sum = vmax - v[i]; sum >= 0; sum --) { if(f[sum]) { f[sum + v[i]] = 1; ans[sum + v[i]] = ans[sum]; ans[sum + v[i]][i] = 1; } } } for(int i = vmin; i <= vmax; i ++) { if(f[i]) { vector<int> r; for(int j = 1; j <= n; j ++) { if(ans[i][j]) { r.push_back(j - 1); } } return r; } } vector<int> skill_issue; return skill_issue; }
#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...