제출 #445496

#제출 시각아이디문제언어결과실행 시간메모리
445496PiejanVDCDetecting Molecules (IOI16_molecules)C++17
0 / 100
0 ms292 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]; memset(dp,0,sizeof(dp)); 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...