Problem 48 Self powers (技巧)
来源:互联网 发布:库房库存数据分析 编辑:程序博客网 时间:2024/05/21 09:33
Self powers
Problem 48
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
代码:
#include <iostream>#include <cmath>using namespace std;long long power(int n){ long long ans = 1; for (int i=1;i<=n;i++) { ans *= n; ans %= 10000000000; } return ans;} int main(){ long long sum = 0; for (int i=1;i<=1000;i++) { sum += power(i); sum %= 10000000000; //取模,只保留最低的10位 } cout<<sum<<endl; return 0;}
2 0
- Problem 48 Self powers (技巧)
- Self powers Problem 48
- Problem 48 Self powers
- Problem 48—Self powers
- Project Euler:Problem 48 Self powers
- Project Euler Problem 48: Self powers
- PE 48 Self powers
- Project Euler 题解 #48 Self Powers
- 欧拉工程第48题:Self powers
- Problem 30 Digit fifth powers (暴力枚举)
- Problem 29 Distinct powers (set)
- [Euler]Problem 30 - Digit fifth powers
- projecteuler---->problem=29----Distinct powers
- projecteuler---->problem=30----Digit fifth powers
- Problem 30—Digit fifth powers
- Project Euler:Problem 29 Distinct powers
- Project Euler:Problem 30 Digit fifth powers
- UVa Problem 10049 Self-describing Sequence (自描述序列)
- c++浮点数值输出
- 计算1-100所有偶数的和
- C语言也被称为函数式语言
- Ubuntu 14.04 安装QQ2015
- tableview的cell的分割线怎么不是满的
- Problem 48 Self powers (技巧)
- 《深入理解Java虚拟机》读书笔记3
- 《APUE》笔记-第五章-标准I/O库
- easyui-datagrid向后台传送其它的参数
- linux c中的测试文件权限(access)
- java中方法重写(Override)与方法重载(Overload)的区别
- 剑指offer面试题3
- 注册表API函数和获取系统版本
- hdu5937 Equation