Chinaunix首页 | 论坛 | 博客
  • 博客访问: 86590
  • 博文数量: 47
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 625
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-11 12:11
文章分类

全部博文(47)

文章存档

2008年(47)

我的朋友

分类:

2008-11-24 12:49:39

Problem 62

30 January 2004

The cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube.

Find the smallest cube for which exactly five permutations of its digits are cube.    

def fun62():
    d = {}
    for i in range(10000):
        t = i**3
        l = map(int, str(t))
        l.sort()
        d[str(l)] = d.get(str(l), []) + [t]
        if len(d[str(l)]) ==  5:
            print l, d[str(l)]
            return d[str(l)][0]

answer is 127035954683,
这5个数为[127035954683L, 352045367981L, 373559126408L, 569310543872L, 589323567104L]
[5027, 7061, 7202, 8288, 8384]的立方
time:0.344000101089
阅读(515) | 评论(0) | 转发(0) |
0

上一篇:Problem 58

下一篇:Problem 64

给主人留下些什么吧!~~