Sakura
Description
求 1x+1y=1n! 的答案方案个数。
Solution
设
x=n!−a,y=n!−b,n=n!
代入,得
2n−a−b(n−a)(n−b)=1n
化简,移项,得
2n2−(a+b)n=n2−(a+b)n+ab
故有
ab=n2
筛出 n2 的因子即可。
Code:
1 |
|
And they have sloppið the þunga of myrkursins and said that, Gleðileg jól, Lin.
求 1x+1y=1n! 的答案方案个数。
设
x=n!−a,y=n!−b,n=n!
1 | #include<bits/stdc++.h> |