
组合数学
文章平均质量分 84
HyperDai
Hyper Hyper Hyper Dai~~
展开
-
容斥原理基本概念与例题 - 组合学
概念 |A ∪B| = |A| + |B| − |A ∩ B| |A∪B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C| hdoj-2588-GCD 题意:给定不超过 100 组正整数 N 和 M(2 ≤ N ≤ 1000000000, 1 ≤ M ≤ N),求有多少个正整数 X 满足 1 ≤ X ≤ N 且gc原创 2017-08-02 13:12:49 · 2661 阅读 · 0 评论 -
hdu - Sum-4407 - 容斥原理
Problem DescriptionXXX is puzzled with the question below: 1, 2, 3, …, n (1<=n<=400000) are placed in a line. There are m (1<=m<=1000) operations of two kinds. Operation 1: among the x-th number to原创 2017-08-06 11:49:36 · 499 阅读 · 0 评论 -
hdu - GCD-1695 - 欧拉表+容斥 - 数论/组合学
Problem DescriptionGiven 5 integers: a, b, c, d, k, you’re to find x in a…b, y in c…d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices may be very原创 2017-08-04 11:08:07 · 327 阅读 · 0 评论 -
hdu - Coprime - 二分搜索+容斥 - 组合学
Problem DescriptionPlease write a program to calculate the k-th positive integer that is coprime with m and n simultaneously. A is coprime with B when their greatest common divisor is 1.InputThe first原创 2017-08-07 16:24:30 · 316 阅读 · 0 评论