Self powers Problem 48
来源:互联网 发布:免费刷空间留言软件 编辑:程序博客网 时间:2024/05/29 06:44
The series, 11 + 22 + 33 + … + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + … + 10001000.
Answer:
9110846700
#include<bits/stdc++.h>using namespace std;const long long mod=10000000000;const long long digs=1e5;long long multimod(long long n,long long m){ long long a,b,c,d,ans=0; a=n/digs;b=n%digs; c=m/digs;d=m%digs; ans=(ans+(((a*digs)%mod)*d))%mod; ans=(ans+(((b*digs)%mod)*c))%mod; ans=(ans+b*d)%mod; return ans;}int main(){ long long ans=0; for(long long i=1;i<=1000;i++) { long long sum=1; long long z=i; long long k=i; while(z) { if(z%2) sum=multimod(sum,k)%mod; k=multimod(k,k)%mod; z/=2; } ans=(ans+sum)%mod; } cout<<ans%mod<<endl;}
阅读全文
0 0
- Self powers Problem 48
- Problem 48 Self powers
- Problem 48—Self powers
- Project Euler:Problem 48 Self powers
- Problem 48 Self powers (技巧)
- Project Euler Problem 48: Self powers
- PE 48 Self powers
- Project Euler 题解 #48 Self Powers
- 欧拉工程第48题:Self 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
- Educational Codeforces Round 15, problem: (B) Powers of Two
- Problem 30 Digit fifth powers (暴力枚举)
- spring DI四种依赖注入方式
- Object类的理解
- 理解RAID
- DBCP2使用jtds中出现AbstratMethodError的问题
- <s:checkbox id="doSele" name="tags" value="true" 的 fieldValue= 取值问题
- Self powers Problem 48
- java读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*。
- 修改AfxMessageBox对话框标题
- null value was assigned to a property of primitive type setter of原因急解决方法
- 2017 CCPC-WFinal&&HDOJ6026 Deleting Edges
- eclipse运行报java.lang.OutOfMemoryError: PermGen space解决方法
- 耐心积累
- java某个公司采用公用电话传递数据,数据是四位的整数,在传递过程中是加密的,加密规则如下:每位数字都加上5,然后用和除以10的余数代替该数字,再将第一位和第四位交换,第二位和第三位交换。
- 用PHP Demo 学 RabbitMq