hdu1061Rightmost Digit
来源:互联网 发布:五子棋c语言判断胜负 编辑:程序博客网 时间:2024/05/20 13:36
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1061
快速幂模板题
#include <cstdio>const int mod = 1e5;typedef long long ll;ll quickAns(ll a,ll b){ ll res = 1; while(b) { if(b & 1) res = (res * a) % mod ; a = (a * a) % mod; b >>= 1; } return res;}int main(){ int _; scanf("%d",&_); while(_--) { ll n; scanf("%lld",&n); ll ans = quickAns(n % mod,n % mod); printf("%d\n",ans % 10); } return 0;}
0 0
- hdu1061Rightmost Digit
- HDU1061Rightmost Digit
- HDU1061Rightmost Digit题解
- hdu1061Rightmost Digit(快速幂模板题)
- Rightmost Digit & Leftmost Digit
- Rightmost Digit
- Rightmost Digit
- Rightmost Digit
- Leftmost Digit
- Rightmost Digit
- Rome Digit
- Rightmost digit
- Leftmost Digit
- Rightmost Digit
- Leftmost Digit
- Rightmost Digit
- BIT1046Leftmost Digit
- Rightmost Digit
- PHP URL 重定向 的三种方法
- CodeForces 612C Replace To Make Regular Bracket Sequence
- ubuntu sublime 支持拼音输入的方法
- 聊聊Android的缓存(一)
- 数据结构的二叉链表中序遍历
- hdu1061Rightmost Digit
- (转载)Python学习–数据分析路线
- 从程序员到CTO的Java技术路线图
- 【递推】【NOIP模拟】彩灯的问题 Lights
- CodeForces 612D The Union of k-Segments
- 一个关于类数组中如何使用new
- android studio 添加第三方jar
- 软件工程3
- Pinot中的Inverted Index源码分析