容斥原理
_奶酪
这个作者很懒,什么都没留下…
展开
-
【牛客练习44:C】小y的质数(求区间内k生互斥数对数---容斥原理+质因子分解)
题目地址:https://ac.nowcoder.com/acm/contest/634/C题意求区间[l,r]内有多少对k生互斥数对数,所谓k生互斥数即(y-k,y+k)互斥,且两个数都在区间内注意:l,r可以从0开始!数据范围比较大,要转换思维,普通方法会超时解题思路(终于把大佬的代码看懂了!!(;´༎ຶД༎ຶ`) 数论是知识盲点,想不出来,想出来也不会写QAQ)...原创 2019-04-20 11:31:09 · 515 阅读 · 0 评论 -
【HDU6286】2018(容斥)
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6286题目:Problem DescriptionGivena,b,c,d, find out the number of pairs of integers(x,y)wherea≤x≤b,c≤y≤dandx⋅yis a multiple of2018.InputTh...原创 2019-09-25 19:57:50 · 166 阅读 · 0 评论