Problem 30
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的更多相关文章
- HDU4891_The Great Pan_字符串水题
2014多校第五题,当时题面上的10^5写成105,我们大家都wa了几发,改正后我和一血就差几秒…不能忍 题目:http://acm.hdu.edu.cn/showproblem.php?pid=48 ...
- 296. Best Meeting Point
题目: A group of two or more people wants to meet and minimize the total travel distance. You are give ...
- HDU 4891 The Great Pan (模拟)
The Great Pan 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/D Description As a programm ...
- 走上模拟道路 HDU4891
http://vjudge.net/contest/view.action?cid=51327#problem/D Description Yoda: May the Force be with yo ...
- iOS开发 Swift开发数独游戏(四) 游戏界面的界面与逻辑
一.游戏界面涉及到的功能点 1)数独格子的建模 (1)绘制数独格子要考虑到标记功能 所以要在每个格子内预先塞入9个标记数字,仅数独格子算下来就有9*9*9=729个格子且存在大量嵌套(这导致我在操作S ...
- The Great Pan
The Great Pan Time Limit:1000MS Memory Limit:65536KB ...
- Tourists Codeforces - 487E
https://codeforces.com/contest/487/problem/E http://uoj.ac/problem/30 显然割点走过去就走不回来了...可以看出题目跟点双有关 有一 ...
- BNUOJ 35759 The Great Pan
The Great Pan Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged on HDU. Original ...
- HDU--4891--The Great Pan--暴力搜索
The Great Pan Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) To ...
随机推荐
- 算法题:打印1到最大的n位数
说明:本文仅供学习交流,转载请标明出处,欢迎转载! 今天看到剑指offer上的第12题,题目例如以下: 输入数字n.按顺序打印出从1到最大的n位十位数. 比方输入3,则打印 ...
- There was a conflict between
解读,首先搜索到第一个5>的开头的那一行,确认是在编译哪一个项目. 那么后面的冲突,就是在和这个项目冲突. There was a conflict between "log4net, ...
- PCB 利用nginx正向代理实现上网
在PCB行业中,为了保证服务器的安全性,服务器正常都是需要与外网断开的,如果想在服务器通过浏览器下载一点东西是不行.通常作法是在一台可以上网的电脑下载文件,接着放到网络盘上,再从网络盘拷贝到服务器上. ...
- [Swift通天遁地]八、媒体与动画-(13)CoreText框架实现图文混排
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- Vue使用html2canvas将页面转化为图片
需求是微信端将页面截屏之后保存到本地,使用了html2canvas插件 先引入插件 npm install --save html2canvas 之后在你所需要使用的页面引入 import html2 ...
- Vue中nextTick()解析
最近,在开发的时候遇到一个问题,让我对vue中nextTick()的用法加深了了解- 下面是在组件中引用的一个拖拽的组件: <vue-draggable-resizable class=&quo ...
- 简单认识http协议
1.什么是TCP/IP 如果要了解一个人,可以从他归属的集体聊起来.我们的HTTP协议就属于TCP/IP协议家族中的一员,了解HTTP协议再整个网络流程中的地位,也能更加充分的理解HTTP协议. 要 ...
- Android 关于android.os.Build介绍
关于Build类的介绍 这个类为一个获取设备一些初始化信息的类,该类的主要信息都是通过一些static的字段获得: public static final String BOARD The name ...
- flask中的蓝图(BluePrint)
蓝图,听起来就是一个很宏伟的东西 在Flask中的蓝图 blueprint 也是非常宏伟的 它的作用就是将 功能 与 主服务 分开怎么理解呢? 比如说,你有一个客户管理系统,最开始的时候,只有一个查看 ...
- JSP执行原理图