-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
179 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"activityBar.background": "#F59F83", | ||
"titleBar.activeBackground": "#F8BAA6", | ||
"titleBar.activeForeground": "#310F04" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
|
||
## E. LCM Plus GCD | ||
[题目链接](https://codeforces.com/gym/104396/problem/E) | ||
|
||
**题意:** | ||
|
||
输入x和k,求集合大小为k的方案数,集合中为$a_1, a_2, \cdots, a_k$各不相同的正整数,所有数的lcm+gcd=x | ||
|
||
数据范围 1<= x,k <=1E9 | ||
|
||
**思路:** | ||
|
||
首先,容易知道 lcm是gcd的倍数 | ||
|
||
设gcd = g, lcm = A * g | ||
|
||
=> A * g + g = x | ||
|
||
=> (A + 1) * g = x | ||
|
||
即g是x的因数,故枚举g | ||
|
||
考虑对每一个质因子, $p^{g_p}$是gcd中的系数, $p^{l_p}$是lcm中的系数 | ||
|
||
对于$a_1, a_2, \cdots, a_k$中的每一个数的质因子p的次方$k_i$ | ||
|
||
都需要满足 $g_p <= k_i <= l_p$ | ||
|
||
同时需要满足存在至少有一个$k_i$取到了$g_p$和$l_p$ | ||
|
||
- 考虑容斥 | ||
|
||
我们很好求得满足每个质数都 $g_p <= k_i <= l_p$ 的种类数 | ||
|
||
相当于一共能够造出 $S = \prod_{i = 1}^{不同的质因子个数}{l_p - g_p + 1}$ 个不同大小的数 | ||
|
||
之后 $C[S][K]$ 即可 (通过逆元阶乘来求组合数O(n)) | ||
|
||
一共有2m个约束条件(通过容斥来去除违反约束条件的情况) | ||
|
||
取 $g_p <= k_i$ 还是 $g_p + 1 <= k_i$ (即没取到下界gcd的 == 违反限制条件) | ||
|
||
取 $k_i <= l_p$ 还是 $k_i <= l_p + 1$ (即没取到上界lca的 == 违反限制条件) |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,16 @@ | |
!!! note "a title" | ||
hello world | ||
|
||
```cpp | ||
#include<iostream> | ||
using namespace std | ||
``` | ||
### 1234 | ||
> asjio | ||
> | ||
> | ||
> | ||
--- |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
!!! abstract | ||
|
||
前面的区域,以后再来探索吧! | ||
前面的区域,以后再来探索吧! | ||
|
||
**Everything in Linux is a file** | ||
|
||
|
||
!!! example | ||
|
||
比如说ls就是一个文件,存在于/bin的目录下。 | ||
|
||
bin的含义就是binary二进制文件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters