热卖商品
新闻详情
Sum hdu - Up Panda - CSDN博客
来自 : CSDN技术社区
发布时间:2021-03-25
Sum
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 5322 Accepted Submission(s): 2099
Problem Description
Sample Input
2
Sample Output
2
Hint
For N 2, S(1) S(2) 1.
The input file consists of multiple test cases.
Source
2013 Multi-University Training Contest 10
费马小定理/快速幂运算
https://blog.csdn.net/codeswarrior/article/details/79867198
#include bits/stdc .h using namespace std;const long long mod 1e9 7; char r[100010];long long qpow(long long x,long long k) long long ans 1,res x; while(k) if(k 1) ans (ans*res)%mod; k 1; res res*res%mod; return ans;int main(){ long long n; while(~scanf( %s ,r)) { n 0; for(int i 0;i strlen(r);i ) n (n*10 r[i]- 0 )%(mod-1); long long ans qpow(2,n-1); printf( %lld\\n ,ans);
2019年3月7日HDU 1001Sum Problem(入门题,C,Java两个版本) ...都可以抽象出一个子问题:判断一个数s同区间(x,y...eNSP V390 USG6000v WEB配置(史上最详细) 阅读数...Sum hduSumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 5322 Accepted Submission(s): 2099Problem DescriptionSample Input2Sample Output2H...Sum hdu
本文链接: http://usgysum.immuno-online.com/view-722512.html
发布于 : 2021-03-25
阅读(0)
最新动态
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
联络我们