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. css高级:flash嵌入

    1,由flash创建的object/embed标签的标准集.缺点:他们与各种无效属性和元素在一起被加载,破坏文档对web标准的依从性, 因为embed是人生w3c规范没有的专有元素. 2,迂回解决方案 ...

  2. [译]使用AssetBundle Manader

    AssetBundle and the AssetBundle Manager 介绍 AssetBundle允许从本地或者远程服务器加载Assets资源,利用AssetBundles技术,Assets ...

  3. ping测试局域网内主机是否alive

    [root@zabbix ~]# cat alivehost.sh #!/bin/bash #Checks to see if hosts 192.168.1.100-192.168.1.200 ar ...

  4. IEC61131-3——数据类型

    1. 摘要 列出IEC61131-3支持的几种常用数据类型. 2. 内容 使用USB-CAN接口卡调试从站,SDO发送使用的功能码与字节的关系如下. 2f表示8位,2b表示16位,23表示32位数据. ...

  5. JSP-Runoob:JSP 日期处理

    ylbtech-JSP-Runoob:JSP 日期处理 1.返回顶部 1. JSP 日期处理 使用JSP最重要的优势之一,就是可以使用所有Java  API.本章将会详细地讲述Java中的Date类, ...

  6. codeforces round #427 div2

    A:读懂题,乘一下判断大小就行了 #include<bits/stdc++.h> using namespace std; int main() { int s, v1, v2, t1, ...

  7. java静态代理实例

    package test; class ProxyTest { public static void main(String[] args) { ProxyClass proxy = new Prox ...

  8. Akka源码分析-Actor&ActorContext&ActorRef&ActorCell

    分析源码的过程中我们发现,Akka出现了Actor.ActorRef.ActorCell.ActorContext等几个相似的概念,它们之间究竟有什么区别和联系呢? /** * Actor base ...

  9. Windows(7/8/10)搭建kibana 6.x版本(elasticsearch的可视化服务)

    在搭建kibana之前,我们先了解下什么是kibana Kibana 是一款开源的数据分析和可视化平台,它是 Elastic Stack 成员之一,设计用于和 Elasticsearch 协作.您可以 ...

  10. drawable的文件名大写

    drawable的文件名大写导致的R文件消失!!!1