摘要:
数字三角形 题意 算法思路 从倒数第二层向上,更新每层数的最大值,取决于其下一层的左右那个最大,一直更新知道最顶层,即可。 #include<bits/stdc++.h> using namespace std; int f[510][510]; int main() { int i,j,n; ci 阅读全文
摘要:
组合数一 题意 算法思路 C a b 表示从a个苹果中选择b个苹果,假设有一个苹果分开,这个苹果就有选和不选两种方案,分别那么从剩下的a-1个苹果中选择b-1和b个,即 C a-1 b-1 和C a-1 b #include<bits/stdc++.h> using namespace std; t 阅读全文