![](https://img-blog.csdnimg.cn/20190927151101105.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
容斥定理+鸽巢原理
数论
Aloof__
笔记是记忆的缓冲
展开
-
容斥定理+鸽巢原理
今天开会了,刷到剩了18个人,好残酷好悲伤,幸运的是我留了下来,竞争激烈,但我可以的。呵…明天来更新这个算法,先洗洗澡睡觉,打了四个小时的球,累的像狗一样,晚安…...原创 2019-09-16 23:28:11 · 935 阅读 · 0 评论 -
Find a multiple POJ - 2356(鸽巢原理/抽屉原理)
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 may happen that two or...原创 2019-09-18 22:29:11 · 170 阅读 · 0 评论 -
吃糖果 HDU - 1205(排列组合+抽屉原理)
HOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。Input第一行有一个整数T,接下来T组数据,每组数据占2行,第一行是一个整数N(0<N<=1000000),第二行是N个...原创 2019-09-18 22:50:04 · 498 阅读 · 0 评论 -
Teacher Bo HDU - 5762(暴力+抽屉原理)
Teacher BoBo is a geography teacher in the school.One day in his class,he marked N points in the map,the i-th point is at (Xi,Yi).He wonders,whether there is a tetrad (A,B,C,D)(A<B,C<D,A≠CorB≠D)...原创 2019-09-18 23:31:31 · 122 阅读 · 0 评论 -
Ekka Dokka LightOJ - 1116( 暴力枚举)
Ekka and his friend Dokka decided to buy a cake. They both love cakes and that’s why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka ...原创 2019-09-19 16:01:25 · 150 阅读 · 0 评论 -
How many integers can you find HDU - 1796(容斥定理应用)
Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer s...原创 2019-09-19 17:45:05 · 186 阅读 · 0 评论