Shilling n! = A:
1/x + 1/y = 1/a = x = y * A/(Y-A)
Re-make k = y-a:
So x = A + a ^ 2/k = k | A ^ 2
It is equivalent to finding an approximate number of a ^2
Prime number sieve a little bit of what is good
1 /**************************************************************2 problem:27213 User:rausen4 language:c++5 result:accepted6 time:588 Ms7 memory:2408 KB8 ****************************************************************/9 Ten#include <cstdio> One A using namespacestd; -typedefLong Longll; - Const intN =1000005; the Const intCnt =80005; - Const intMoD =1000000007; - - intN; + BOOLF[n]; - intCNT, p[cnt], c[cnt]; +ll ans =1; A at intMain () { - intI, J, T; -scanf"%d\n", &n); - for(i =2; i < N; ++i) { - if(! F[i]) p[++cnt] =i; - for(j =1; J <= CNT && p[j] * I < N; ++j) { inF[P[J] * I] =1; - if(P[j]% i = =0) Break; to } + } - for(i =1; I <= CNT; ++i) the for(j = p[i]; j <= N; j + =P[i]) * for(t = j; t% p[i] = =0; T/= P[i]) + +C[i]; $ for(i =1; I <= CNT; ++i)Panax Notoginseng(Ans *= (c[i) <<1|1)) %=MoD; -printf"%lld\n", ans); the return 0; +}
View Code
BZOJ2721 [Violet 5] cherry blossoms