随笔分类 - 容斥原理
摘要:HDU5765 Bonds (高维前缀和) 题意:$n(n include include include include include define IOS ios::sync_with_stdio(false) define pb push_back define Pii pair defin
阅读全文
摘要:Codeforces Round 519 by Botan Investments A. Elections c++ include typedef long long ll; const int N = 3e5 + 7; const int mod = 1e9 + 7; using namespa
阅读全文
摘要:Codeforces Round 497 (Div. 1) A. Reorder the Array 先满足数值较小的位置,每次找恰好大于这个值的一个值即可。 B. Pave the Parallelepiped 比赛时,只推出了几种特殊情况的规律。下来学习了一下,将 A, B, C 的所有约数分类
阅读全文
摘要:Wannafly挑战赛19 A. 队列Q 需要支持把一个元素移到队首,把一个元素移到队尾,移到队首就直接放到队首前面那个位置,原位置标为0,队尾同理。 C. 多彩的树 预处理每种颜色状态下的路径数,但是这次统计的包含这个状态的所有子状态。因此考虑容斥,当当前状态的颜色数为奇数时,加奇数,减偶数,当为
阅读全文