随笔分类 - 容斥定律
摘要:2018 ICPC Asia Nakhon Pathom Regional Contest-F.Lucky Pascal Triangle(杨辉三角,递归,分治,规律) 题意: 问杨辉三角$[0,n]$行有多少个数是7的倍数,\(n\leq 10^{18}\)。 思路: 下图中1代表该数是7的倍数,
阅读全文
摘要:The 2019 ICPC Asia Yinchuan Regional Programming Contest/2019银川区域赛 D Easy Problem(莫比乌斯容斥+欧拉降幂) 题面: 题意: 给定4个整数$n,m,d,k$,让你求$\sum_\sum_\dots\sum_^gcd(a_
阅读全文
摘要:[HDU - 5116 ] Everlasting L (计数DP,容斥) 题目链接:HDU - 5116 题目链接: 题意: 给定一个大小为$\mathit n$的点集$\mathit S$,现在让求出有多少个集合对$(A,B)$,满足: 一个集合被称为Good,当且仅当满足: 点集$\mathi
阅读全文
摘要:Frogs HDU - 5514 (容斥定律) 题面: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5514 题意: 给定$\mathit m$个石头和$\mathit n$ 个青蛙,石头标号为$0,1,\dots,m-1$。最开始所以青蛙都在标号为
阅读全文
摘要:牛客练习赛64 D 宝石装箱(容斥定律,背包) 链接:https://ac.nowcoder.com/acm/contest/5633/D 来源:牛客网 题意: n颗宝石装进n个箱子使得每个箱子中都有一颗宝石。第i颗宝石不能装入第ai个箱子。求合法的装箱方案对998244353取模。 两种装箱方案不
阅读全文
摘要:[Educational Codeforces Round 86 (Rated for Div. 2)] E. Placing Rooks (组合数学,容斥定律) E. Placing Rooks time limit per test 2 seconds memory limit per test
阅读全文
摘要:[AtCoder Beginner Contest 163] F path pass i (树型dfs,容斥定律) 链接:https://atcoder.jp/contests/abc163/tasks/abc163_f Problem Statement We have a tree with N
阅读全文
摘要:AtCoder Beginner Contest 152 F Tree and Constraints (容斥定理+树上路径的性质) We have a tree with NN vertices numbered 11 to NN. The ii th edge in this tree conn
阅读全文
摘要:[Educational Codeforces Round 81 (Rated for Div. 2)] D. Same GCDs (数论,因子分解,容斥定理) D. Same GCDs time limit per test 2 seconds memory limit per test 256
阅读全文
摘要:G. List Of Integers time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output Let's denote as L (
阅读全文
摘要:Relatively Prime Powers "CodeForces 1036F " Consider some positive integer xx. Its prime factorization will be of form x=2k1⋅3k2⋅5k3⋅…x=2k1⋅3k2⋅5k3⋅…
阅读全文
摘要:完全平方数 "HYSBZ 2440 " 小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些 数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而 这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一 个小X讨厌的数。
阅读全文

浙公网安备 33010602011771号