|
本帖最后由 tensaix2j 于 31-3-2011 11:46 PM 编辑
最近在玩codercharts, 发现一些题目蛮有趣的。。 以下这些都可以推理出一个formula 来应算,因为bruteforce算不了。
(跟projecteuler 有点类似但不像projecteuler 那种给个答案就可以了)
例如 :
给一个号码,x where x > 1000,000,000
求
x ! 转成hexadecimal 号码后一共会有几个trailing zeroes ?
例如说 1234567890! 的hexadecimal 会有几个trailling zeroes ?
你们会用什么formula ?
在来一题是,
给一个号码,x where x > 1,000,000
若x = T1 + T2 + T3 + .... Tn , Tn 跟 Tn+1 的差为 1,
求
T1 跟 Tn where n 是最长的。
你们会用什么formula ? |
|