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 ...
随机推荐
- Android 自己定义圆圈进度并显示百分比例控件(纯代码实现)
首先,感谢公司能给我闲暇的时间,来稳固我的技术,让我不断的去探索研究,在此不胜感激. 先不说实现功能,上图看看效果 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZ ...
- BNU 13024 . Fi Binary Number 数位dp/fibonacci数列
B. Fi Binary Number A Fi-binary number is a number that contains only 0 and 1. It does not conta ...
- 一些SQL高级函数
一些SQL高级函数 Posted on 2010-08-08 21:34 moss_tan_jun 阅读(311) 评论(0) 编辑 收藏 长度与分析用 datalength(Char_expr) 返 ...
- go语言笔记——defer作用DB资源等free或实现调试
defer 和追踪 关键字 defer 允许我们推迟到函数返回之前(或任意位置执行 return 语句之后)一刻才执行某个语句或函数(为什么要在返回之后才执行这些语句?因为 return 语句同样可以 ...
- CSS里面position:relative与position:absolute 区别
position:absolute这个是绝对定位:是相对于浏览器的定位.比如:position:absolute:left:20px;top:80px; 这个容器始终位于距离浏览器左20px,距离浏览 ...
- bzoj 2217 Lollipop
题目大意: 有一个长度为n的序列a1,a2,...,an.其中ai要么是1("W"),要么是2("T") 现在有m个询问,每个询问是询问有没有一个连续的子序列, ...
- bag of words in c++
#include <iostream> #include <vector> #include <cstddef> #include <string> # ...
- vs2010打开vs2012项目
修改.sln文件的前两行 修改前: Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 修 ...
- Appium + python - TouchAction操作
from appium import webdriverfrom appium.webdriver.common.touch_action import TouchActionfrom appium. ...
- JavaScript入门三
*********BOM和DOM******** JavaScript分为 ECMAScript,DOM,BOM. BOM(Browser Object Model)是指浏览器对象模型,它使 Java ...