轻量级前端框架助力开发者提升项目效率与性能
676
2022-10-21
Problem 30 Digit fifth powers (暴力枚举)
Digit fifth powers
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.
The sum of these numbers is 1634 + 8208 + 9474 = 19316.
Find the sum of all the numbers that can be written as the sum of fifth powers of their digits.
Answer: | 443839 |
Completed on Sat, 29 Oct 2016, 03:12 |
题解:如果是一个6位数,各位数字5次方之和最大为 6 * 95 = 354294,是一个6位数,所以6位数是有可能满足的。 如果是一个7位数,各位数字5次方之和最大为 7 * 95 = 413343,是一个6位数,不可能等于7位数自身,所以7位数是不可能满足的。注意:As 1 = 14 is not a sum it is not included..
代码:
#include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~