题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6333 解题心得: 这个题可以说是十分精彩了,首先推组合数学的公式,其中一个很重要的公式是Cnm = Cmn-1 + Cm-1n-1 这个公式知道杨辉三角的都明白,但是一看发现似乎没啥用。但是可以以这个公 ...
分类:
移动开发 时间:
2018-08-12 17:27:25
阅读次数:
209
HDU-6333 题意:有n个不同的苹果,你最多可以拿m个,问有多少种取法,多组数据,组数和n,m都是1e5,所以打表也打不了。 思路:这道题要用到组合数的性质,记S(n,m)为从n中最多取m个的方法总数,显然是C(n,0),C(n,1)……C(n,m)的和。 显然S(n,m+1) = S(n, m ...
分类:
移动开发 时间:
2018-08-07 21:29:01
阅读次数:
215
累惹。 B. Harvest of Apples 题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6333 题意:求∑(i=0,m) C(n,m)。 分析:定义S(n,m)=∑(i=0,m) C(n,m)。可以知道: S(n,m)=S(n,m-1)+C ...
分类:
其他好文 时间:
2018-08-05 15:20:14
阅读次数:
155
1001:Problem A. Integers Exhibition 1002:Problem B. Harvest of Apples 1003:Problem C. Problems on a Tree 1004:Problem D. Nothing is Impossible 1005:Pr ...
分类:
其他好文 时间:
2018-08-05 10:29:50
阅读次数:
205
Description Running a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick u ...
分类:
其他好文 时间:
2018-08-03 19:53:59
阅读次数:
151
There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefu ...
分类:
移动开发 时间:
2018-08-03 18:07:31
阅读次数:
198
Problem B. Harvest of Apples Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2397 Accepted Subm ...
分类:
其他好文 时间:
2018-08-03 16:26:52
阅读次数:
178
合并多个commit 1、三个commit合并 git rebase -i commit_id 其中,-i 的参数是不需要合并的 commit 的 hash 值,这里指的是第一条 commit, 接着我们就进入到 vi 的编辑模式 2、pick 和 squash 选择 pick 的意思是要会执行这个 ...
分类:
其他好文 时间:
2018-08-03 11:29:20
阅读次数:
1221
求C(n,0)+C(n,1)+C(n,2)+.....+C(n,m); 设S(n,m)=C(n,0)+C(n,1)+C(n,2)+.....+C(n,m); 第一个式子易得,第二个式子:杨辉三角的 n,m=(n-1,m)+(n-1,m-1) 那么就是这一行等于上一行的都用了2次,只有第最后一个用了一 ...
分类:
移动开发 时间:
2018-08-02 16:00:16
阅读次数:
503
PS:没看出这个可以离线。。。官方题解 标程貌似不是常规莫队的写法,同一个块内,没有对 r 排序,优先处理每个块的答案。学习到了阶乘逆元的递推公式。 避免加法溢出 避免乘法溢出 避免减法取模溢出 ...
分类:
移动开发 时间:
2018-08-02 13:57:40
阅读次数:
224