E sum
来源:互联网 发布:看high类似软件 编辑:程序博客网 时间:2024/05/29 04:55
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=110042#problem/E
密码nefu
#include <iostream> #include <cstring> using namespace std; const int MAXN = 1e5+5; const int MOD = 1e9+7; typedef long long LL; LL quick_mod(LL a, LL b, LL m) { LL ans = 1; while(b) { if(b&1) ans = ans*a%m; b>>=1; a = a*a%m; } return ans; } LL GetMod(char st[]) { LL ret = 0; int len = strlen(st); for(int i=0; i<len; i++) ret = (ret*10+(st[i]-'0')) % (MOD-1); ret--; return ret; } char str[MAXN]; int main() { while(cin>>str) { LL tmp = GetMod(str); cout<<quick_mod(2, tmp, MOD)<<endl; } return 0; }
0 0
- E sum
- leetcode(E)two sum
- leetcode(E) two sum
- LeetCode-E-Two Sum
- Codeforces 631E:Product Sum
- LeetCode-E-Two Sum II
- Codeforces 616E Sum of Remainders
- Codeforces 616E Sum Of Reminders
- codeforces 616E - Sum of Remainders
- Codeforces 616E - Sum of Remainders
- 1. Two Sum【E】【59+25】【leetcode】
- 303-e-Range Sum Query - Immutable
- 【leetcode】371. Sum of Two Integers【E】
- E - 4 Values whose Sum is 0
- E. Sum of Remainders (数学)★
- 【leetcode】404. Sum of Left Leaves【E】
- 豪杰信息杯E-Partial Sum
- ZOJ 3813 Alternating Sum (牡丹江网络赛E题)
- VB.net学习笔记(二十九)认识STA与MTA
- POJ 1006 - Biorhythms (中国剩余定理)
- Codeforces7C 扩展欧几里得
- 驱动编写小经验,新手,请勿吐槽(持续更新中......)
- HDU 2588 GCD
- E sum
- HDU 5317 RGCDQ
- 破解数字游戏 —— 概率篇
- HDU 2082 母函数模板题
- HDU 1023 Traning Problem (2) 大数卡特兰数
- HDU 1521 排列组合 指数型母函数
- VS2010 常用快捷键
- HDU 5651 xiaoxin juju needs help 逆元
- HDU1695 GCD (欧拉函数+容斥原理)