
容斥
文章平均质量分 66
WayJasy
叁肆伍叁,伍肆伍物
展开
-
FJNU Yehan’s hole 组合数逆元+容斥
Yehan’s hole Description Yehan is a angry grumpy rabbit, who likes jumping into the hole. This day,Yehan jumps again in the pit at home. Each time, he should jump from the hole at the coordinate ...原创 2018-09-05 00:38:30 · 183 阅读 · 0 评论 -
hdu 4135 (容斥)
http://acm.hdu.edu.cn/showproblem.php?pid=4135 题意:求出 区间 A~B中与N互质的数的个数,区间元素为 1~n 题解:当N较小时,可以直接求欧拉函数。 本题N较大,因此可以用容斥原理。 将N分解质因数,N的质因数的倍数在区间内一定不和N互质。 假设N的质因数为p1,p2,p3,那么在区间1~A中,p1的倍数有 A/p1个, p2的倍数...原创 2019-03-29 14:23:32 · 194 阅读 · 0 评论