| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
某个牛人的总结大家领会下a*(a-1)=p*c*(c-1)/q
set up an array : m[i] = i*(i-1)
find c that m[c]%q==0
solve the equation a^2-a-p*m[c]/q=0
if a exists (a,c-a) is the answer, or find next c;
p/q = a(a-1)/(a+b)(a+b-1)
令a = x, a+b = y;
则: p/q = (x^2-x)/(y^2-y)
x^2-x-np = 0
y^2-x-np = 0
由二次方程根与系数的关系,以及 x<y 得到的
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator