Problem 30

https://projecteuler.net/problem=30

Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:

很惊奇地,只有三个数字可以写成它们的位数的四次方之和。

1634 = 14 + 64 + 34 + 44
8208 = 84 + 24 + 04 + 84
9474 = 94 + 44 + 74 + 44

As 1 = 14 is not a sum it is not included.

不考虑1。

The sum of these numbers is 1634 + 8208 + 9474 = 19316.

这些数字之和为19316。

Find the sum of all the numbers that can be written as the sum of fifth powers of their digits.

找出所有可以被写成它们的位数的五次方之和的数字之和。

from math import pow

fifth = []
for i in range(2, 999999):
print(i-999999)
digits = list(str(i))
power = 0
for digit in digits:
power += pow(int(digit), 5)
if power == i:
fifth.append(i)
print(fifth, sum(fifth))

Problem 30的更多相关文章

  1. HDU4891_The Great Pan_字符串水题

    2014多校第五题,当时题面上的10^5写成105,我们大家都wa了几发,改正后我和一血就差几秒…不能忍 题目:http://acm.hdu.edu.cn/showproblem.php?pid=48 ...

  2. 296. Best Meeting Point

    题目: A group of two or more people wants to meet and minimize the total travel distance. You are give ...

  3. HDU 4891 The Great Pan (模拟)

    The Great Pan 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/D Description As a programm ...

  4. 走上模拟道路 HDU4891

    http://vjudge.net/contest/view.action?cid=51327#problem/D Description Yoda: May the Force be with yo ...

  5. iOS开发 Swift开发数独游戏(四) 游戏界面的界面与逻辑

    一.游戏界面涉及到的功能点 1)数独格子的建模 (1)绘制数独格子要考虑到标记功能 所以要在每个格子内预先塞入9个标记数字,仅数独格子算下来就有9*9*9=729个格子且存在大量嵌套(这导致我在操作S ...

  6. The Great Pan

                                             The Great Pan Time Limit:1000MS     Memory Limit:65536KB    ...

  7. Tourists Codeforces - 487E

    https://codeforces.com/contest/487/problem/E http://uoj.ac/problem/30 显然割点走过去就走不回来了...可以看出题目跟点双有关 有一 ...

  8. BNUOJ 35759 The Great Pan

    The Great Pan Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged on HDU. Original ...

  9. HDU--4891--The Great Pan--暴力搜索

    The Great Pan Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) To ...

随机推荐

  1. ios9--UIImageView的帧动画

    // // ViewController.m // 05-UIImageView的帧动画 // #import "ViewController.h" @interface View ...

  2. 深入理解7816(1)---- 关于F/D和etu【转】

    本文转载自:http://blog.sina.com.cn/s/blog_4df8400a0101gkss.html 深入理解7816(1)---- 关于F/D和etu 对于刚接触智能卡的工程师来说, ...

  3. [模板] BSGS

    BSGS是一种解决一类专门的问题的解法,主要是解决已知A, B, C,求X使得A^x = B (mod p)这一类问题. 解法很简单,先设x = i*m-j(m=ceil(sqrt(p))),然后进行 ...

  4. 回顾2017Java 小结

    一.Java语言最流行 最近,调查结果已公布:Java 被评为最流行的语言,JavaScript 是最常用的语言,而 Go 被认为是最有前途的语言,Python 是最多人想去尝试的语言. https: ...

  5. codeforces round #414 div1+div2

    A:判断一下就可以了 #include<bits/stdc++.h> using namespace std; typedef long long ll; int a, b, c, n; ...

  6. jqgrid formatter

    日期 formatter:"date",formatoptions: {srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'} value {name ...

  7. zabbix监控kafka消费

    一.Kafka监控的几个指标 1.lag:多少消息没有消费 lag=logsize-offset 2.logsize:Kafka存的消息总数 3.offset:已经消费的消息 Kafka管理工具 介绍 ...

  8. Instantaneous Transference(强连通分量及其缩点)

    http://poj.org/problem?id=3592 题意:给出一个n*m的矩阵,左上角代表起始点,每个格子都有一定价值的金矿,其中‘#’代表岩石不可达,‘*’代表时空门可以到达指定格子,求出 ...

  9. jquery模拟下拉框

    <!DOCTYPE html> <html lang="en"> <head> <title>jquery模拟SELECT框< ...

  10. 微信小程序压缩图片并上传到服务器(拿去即用)

    这里注意一下,图片压缩后的宽度是画布宽度的一半 canvasToTempFilePath 创建画布的时候会有一定的时间延迟容易失败,这里加setTimeout来缓冲一下 这是单张图片压缩,多张的压缩暂 ...