Project Euler 100
Project Euler 100
题目
Arranged probability
If a box contains twenty-one coloured discs, composed of fifteen blue
discs and six red discs, and two discs were taken at random, it can be
seen that the probability of taking two blue discs,
The next such arrangement, for which there is exactly
By finding the first arrangement to contain over
解决方案
假设盒子中有
令
最终化成:
令
假设
容易发现,
将
容易发现,
代码
1 | N = 10 ** 12 |