
组合数学——基本计数原理
Alex_McAvoy
想要成为渔夫的猎手
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
组合数学 —— 基本计数原理
【抽屉原理】 1.内容 把 n+1 件东西放入 n 个抽屉,则至少有一个抽屉里放两件或两件以上的东西。 从令一角度说,把 n-1 件东西放入 n 个抽屉,则至少一个抽屉是空的。 2.经典应用 给出一个含有 n 个数字的序列,要找一个连续的子序列,使他们的和一定是 c 的倍数 假设 sum[i] 存储整数序列中的前 i 项和 根据抽屉原理,以 sum 数组构造抽屉 drawer 数组...原创 2018-08-02 17:31:11 · 2767 阅读 · 0 评论 -
吃糖果(HDU-1205)
Problem Description HOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。 Input 第一行有一个整数T,接下来T组数据,每组数据占2行,第一行是一个整数N(0...原创 2018-08-12 21:33:29 · 651 阅读 · 0 评论 -
Find a multiple(POJ-2356)
Problem Description The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers are not necessarily different (so it ...原创 2018-08-13 06:38:36 · 915 阅读 · 0 评论 -
Halloween treats(HDU-1808)
Problem Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call on him, s...原创 2018-08-12 21:25:12 · 432 阅读 · 0 评论 -
Polycarp's Pockets(CF-1003A)
Problem Description Polycarp has nn coins, the value of the i-th coin is aiai. Polycarp wants to distribute all the coins between his pockets, but he cannot put two coins with the same value into th...原创 2019-05-09 12:28:08 · 562 阅读 · 0 评论 -
Lining Up(AtCoder-2271)
Problem Description There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each pers...原创 2019-05-27 21:28:01 · 775 阅读 · 0 评论