
容斥原理
永夜莫明
菜是原罪
展开
-
Card Collector(概率期望+容斥原理+状压)
In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108 people in the famous novel Water Margin, you will win an amazi...原创 2019-02-26 11:04:50 · 658 阅读 · 0 评论 -
计数JS(容斥原理)
题目描述给定一个长度为n的序列a1..an,求m以内的不能被a1..an中任意一个ai整除的正整数有多少个?输入第一行两个数n,m接下来一行n个数,a1..an输出共一个数,即m以内的不能被a1..an中任意一个ai整除的正整数有多少个。样例输入3 20154 5 6样例输出1075提示对于 30% 的数据,1≤...原创 2019-07-09 15:16:31 · 297 阅读 · 1 评论 -
wyh的考核(dp/容斥原理)
链接:https://ac.nowcoder.com/acm/problem/15442来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述wyh非常喜欢lol游戏,一天,他听说学校要选拔lol队员,他非常高兴的就去了,选拔规则是,一共有N个评委,每个评委根据线上对线...原创 2019-06-29 18:09:18 · 420 阅读 · 0 评论 -
Queries for Number of Palindromes(回文串,dp,好题)
https://cn.vjudge.net/problem/CodeForces-245HYou've got a strings = s1s2...s|s|of length|s|, consisting of lowercase English letters. There also areqqueries, each query is described by two int...原创 2019-07-17 22:57:53 · 372 阅读 · 0 评论