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 |
我是用DP做的。dp[i][j]代表前i个数最大公约数是j的种数,这里的话最大公约数状态是m的因子,所以要离散化一下。dp[0][m]=1 dp[i][j]=sum{dp[i-1][k]*Eul(m/(k/j),k/j)} where k%j==0; Eul(n,t)为n和t互质的个数。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator