作者LPH66 (-858993460)
看板puzzle
标题Re: [中译] ProjectEuler 374 Maximum Integer Partition Product
时间Sun Mar 4 03:08:59 2012
374. Maximum Integer Partition Product
http://projecteuler.net/problem=374
所谓一个整数 n 的分割就是将 n 写成一些正整数的和。
如果两种分割只差在排列不同的话就视为同一种分割。
所谓「相异分割」则是分割的各个正整数至多出现一次。
5 的所有相异分割一共有 5, 4+1, 3+2 三种。
令 f(n) 表示 n 的所有相异分割各数的乘积中最大的那个,
m(n) 表示出现上述乘积的分割有几个数。
由此可知 f(5) = 6 及 m(5) = 2。
对 n=10 最大乘积出现在 10 = 2+3+5,於是知 f(10) = 30 及 m(10) = 3,
两者的乘积 f(10) * m(10) = 30 * 3 = 90。
给定 Σf(n)*m(n), 1≦n≦100 的答案是 1683550844462。
求 Σf(n)*m(n), 1≦n≦10^14。
请回答此数除以 982451653 的余数 (这是第五千万个质数)。
--
竟然出整数分割...orz
--
'You've sort of made up for it tonight,' said Harry. 'Getting the
sword. Finishing the Horcrux. Saving my life.'
'That makes me sound a lot cooler then I was,' Ron mumbled.
'Stuff like that always sounds cooler then it really was,' said
Harry. 'I've been trying to tell you that for years.'
-- Harry Potter and the Deathly Hollows, P.308
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.28.91
1F:→ LPH66:结果不难嘛 orz 03/04 04:00