动态规划
文章平均质量分 58
兔兔不爱吃萝卜
加油!!!!
展开
-
A - 放苹果(dp)
把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。 Input 第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。 Output 对输入的每组数据M和N,用一行输出相应的K。 Sample Input 1 7 3 Sample Output 8 动态规划代码: #include<cstdio> #include<cs原创 2021-07-23 09:35:46 · 97 阅读 · 0 评论 -
C - Stock Exchange(动态规划+最长子数列)
The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very concerned about the evolution of the stock exchange. He follows stock prices every day looking for rising trends. Gi原创 2021-07-23 08:41:31 · 865 阅读 · 0 评论 -
K - Jack‘s struggle(动态规划+最长子数列)
A team of airborne troops are ready to complete some missions. The battlefield was divided into a grid of n*n, this team can be air-dropped at any place on time 0. In every time unit after landing, they can go to the grid left, right, up or down to the cur原创 2021-07-22 17:29:12 · 102 阅读 · 1 评论