51nod 1007 正整數分組

傳送門html 分析: 定義dp[i] == true 表示集合中的一些數能夠組成i,則對於dp[i]只要dp[i-a[j]]有一個爲真它就是真的。c++ 代碼: #include <bits/stdc++.h> using namespace std; const int maxn = 1e3; int a[maxn]; bool dp[11000]; int main() { int
相關文章
相關標籤/搜索