Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我是用DP做的。dp[i][j]代表前i个数最大公约数是j的种数,这里的话最大公约数状态是m的因子,所以要离散化一下。

Posted by yygy at 2012-11-23 01:12:50 on Problem 1091
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator