poj 2229 Sumsets Time Limit: 2000MS Memory Limit: 200000K Total Submissions: 21281 Accepted: 8281 Description Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an…
1.直接用递归函数计算状态转移方程,效率十分低下,可以考虑用递推方法,其实就是“正着推导,逆着计算” #include<iostream> #include<algorithm> using namespace std; #define maxn 1000+5 int n; int a[maxn][maxn]; int d[maxn][maxn]; int main(){ for(;cin>>n && n;){ memset(d,,sizeof(d));…