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. bzoj2243【SDOI2011】染色

    2243: [SDOI2011]染色 Time Limit: 20 Sec  Memory Limit: 512 MB Submit: 4537  Solved: 1702 [id=2243" ...

  2. Mysql 存储引擎中InnoDB与MyISAM差别(网络整理)

    1. 事务处理 innodb 支持事务功能,myisam 不支持. Myisam 的运行速度更快,性能更好. 2,select ,update ,insert ,delete 操作 MyISAM:假设 ...

  3. P3092 [USACO13NOV]没有找零No Change 状压dp

    这个题有点意思,其实不是特别难,但是不太好想...中间用二分找最大的可买长度就行了. 题干: 题目描述 Farmer John <= K <= ), each with value .., ...

  4. 2018.2.24Test总结

    T1(luogu3434) comment:水题,考试时我想的是开一个数组在读入时预处理出该长度什么时候会被拦住,但这样数组开不下,剩下只能模拟. 实际上应该把圆筒变成递减序列,再二分该长度即可. T ...

  5. Flink之Stateful Operators

    Implementing Stateful Functions source function的stateful看官网,要加lock Declaring Keyed State at the Runt ...

  6. Redis学习和应用记录(2)--常用数据类型及命令

    这一节主要介绍Redis支持的数据结构及常用命令. 数据类型 Redis支持多种数据类型的存储,包括字符,列表,集合,有续集合,哈希表,bit数组,超级日志等.下面分别介绍: strings:存储普通 ...

  7. 一个不错的jquery插件模版

    pageplugin.js (function ($) { $.PagePlugin = function (obj, opt) { var options = $.extend({}, $.Page ...

  8. 什么是JavaScript对象?

    对象是JavaScript的基本数据类型.对象是一种复合值:它将很多值(原始值或者其他对象)聚合在一起,可通过名字访问这些值.对象也可看做是属性的无序集合,每个属性都是一个名/值对.属性名是字符串,因 ...

  9. 吝啬的国度 ---用vector 来构图

    根据题目可以看出来  有n 个城市 只有 n-1  条路线 那么  就可以确定这个图中  不存在 圆  所以从一个点到另一个点 只有一条唯一的路  所以从一个节点到另一个节点 那么 这个节点只有一个唯 ...

  10. git下

    ----------- 1. 分支管理策略 1)master分支 非常稳定的,只用来发布新版本,平时不在上面干活 2)dev分支 不稳定的,主要在上面干活,每个人都有自己的分支,时不时的往dev分支上 ...