随笔分类 -  容斥定律

摘要:2018 ICPC Asia Nakhon Pathom Regional Contest-F.Lucky Pascal Triangle(杨辉三角,递归,分治,规律) 题意: 问杨辉三角$[0,n]$行有多少个数是7的倍数,\(n\leq 10^{18}\)。 思路: 下图中1代表该数是7的倍数, 阅读全文
posted @ 2020-12-24 22:46 茄子Min 阅读(166) 评论(0) 推荐(0)
摘要:The 2019 ICPC Asia Yinchuan Regional Programming Contest/2019银川区域赛 D Easy Problem(莫比乌斯容斥+欧拉降幂) 题面: 题意: 给定4个整数$n,m,d,k$,让你求$\sum_\sum_\dots\sum_^gcd(a_ 阅读全文
posted @ 2020-11-24 17:21 茄子Min 阅读(238) 评论(0) 推荐(0)
摘要:[HDU - 5116 ] Everlasting L (计数DP,容斥) 题目链接:HDU - 5116 题目链接: 题意: 给定一个大小为$\mathit n$的点集$\mathit S$,现在让求出有多少个集合对$(A,B)$,满足: 一个集合被称为Good,当且仅当满足: 点集$\mathi 阅读全文
posted @ 2020-10-23 15:03 茄子Min 阅读(114) 评论(0) 推荐(0)
摘要:Frogs HDU - 5514 (容斥定律) 题面: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5514 题意: 给定$\mathit m$个石头和$\mathit n$ 个青蛙,石头标号为$0,1,\dots,m-1$。最开始所以青蛙都在标号为 阅读全文
posted @ 2020-10-08 22:09 茄子Min 阅读(153) 评论(0) 推荐(0)
摘要:牛客练习赛64 D 宝石装箱(容斥定律,背包) 链接:https://ac.nowcoder.com/acm/contest/5633/D 来源:牛客网 题意: n颗宝石装进n个箱子使得每个箱子中都有一颗宝石。第i颗宝石不能装入第ai个箱子。求合法的装箱方案对998244353取模。 两种装箱方案不 阅读全文
posted @ 2020-05-23 12:26 茄子Min 阅读(273) 评论(0) 推荐(0)
摘要:[Educational Codeforces Round 86 (Rated for Div. 2)] E. Placing Rooks (组合数学,容斥定律) E. Placing Rooks time limit per test 2 seconds memory limit per test 阅读全文
posted @ 2020-04-29 22:57 茄子Min 阅读(429) 评论(0) 推荐(0)
摘要:[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 阅读全文
posted @ 2020-04-21 17:37 茄子Min 阅读(500) 评论(1) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-27 00:16 茄子Min 阅读(527) 评论(0) 推荐(0)
摘要:[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 阅读全文
posted @ 2020-01-31 13:30 茄子Min 阅读(299) 评论(0) 推荐(2)
摘要: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 ( 阅读全文
posted @ 2019-10-02 17:59 茄子Min 阅读(280) 评论(0) 推荐(0)
摘要: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⋅… 阅读全文
posted @ 2019-09-18 16:56 茄子Min 阅读(357) 评论(0) 推荐(0)
摘要:完全平方数 "HYSBZ 2440 " 小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些 数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而 这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一 个小X讨厌的数。 阅读全文
posted @ 2019-09-17 22:23 茄子Min 阅读(354) 评论(0) 推荐(0)