Submission #445491

#TimeUsernameProblemLanguageResultExecution timeMemory
445491PiejanVDCDetecting Molecules (IOI16_molecules)C++17
0 / 100
76 ms65540 KiB
#include <molecules.h> #include <bits/stdc++.h> using namespace std; vector<int> find_subset(int l, int u, vector<int> w) { int dp[u+1]; dp[0]=1; vector<int>ans; bool found=false; for(auto z : w) { if(z > u) continue; for(int i = u ; i >= z ; i--) { if(dp[i-z]) { dp[i]=z; if(i >= l) { int pos = i; while(pos>0) { ans.push_back(dp[pos]); pos-=dp[pos]; found=true; } break; } } } if(found) break; } return ans; }
#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...