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. Cant't call setState(or forceUpdate) on an unmount component. 报错的可能性原因

    react 小白编程 遇到了如下错误 调试了很久没找到到底为啥 后来发现,是因为多次将组件挂在到根节点的原因导致的 使用路由之后,只需要使用 ReactDOM.render()方式将最外层的路由挂在到 ...

  2. [C]if (CONDITION)语句中CONDITION的情况

    编译环境: Ubuntu 12.04: gcc Windows XP : VS-2005 深入一下if (CONDITION)语句中CONDITION的情况.即CONDITION何时为真,何时是假. ...

  3. JZOJ 5791 阶乘 —— 因数

    题目:https://jzoj.net/senior/#main/show/5791 题意:有n个正整数a[i],设它们乘积为p,你可以给p乘上一个正整数q,使p*q刚好为正整数m的阶乘,求m的最小值 ...

  4. Kernel trick----PRML读书笔记

    Many linear parametric models can be re-cast into an equivalent 'dual representstion' in which the p ...

  5. vs2010打开vs2012项目

    修改.sln文件的前两行 修改前: Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 修 ...

  6. myeclipse配背景色

    1:使jsp,html等页面为纯黑色. 2:发现JS的背景颜色还是默认的.而且还是块状的.将它设置背景为黑色的. *效果图: 参考:http://blog.csdn.net/ltqwby/articl ...

  7. ubuntu 更显列表 [Connecting to archive.ubuntu.com (2001:67c:1360:8001::21)] 超时的解决方法

    问题描述: 在使用apt-get update 时更行列表,显示[Connecting to archive.ubuntu.com (2001:67c:1360:8001::21)]超时 分析: 我已 ...

  8. Vue.js中学习使用Vuex详解

    在SPA单页面组件的开发中 Vue的vuex和React的Redux 都统称为同一状态管理,个人的理解是全局状态管理更合适:简单的理解就是你在state中定义了一个数据之后,你可以在所在项目中的任何一 ...

  9. c++小游戏

    #include <iostream> using namespace std; double shengmingli=2000;//定义主角初始生命力 int gongjili=150; ...

  10. JavaScript--改变 HTML 样式

    HTML DOM 允许 JavaScript 改变 HTML 元素的样式.如何改变 HTML 元素的样式呢? 语法: Object.style.property=new style; 注意:Objec ...