<快速幂模> N^N的末尾数字
来源:互联网 发布:数组合并 js concat 编辑:程序博客网 时间:2024/06/05 07:56
链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1004
快速幂模板。。。
<span style="font-size:24px;">#include <cstdio>#include <algorithm>#include <iostream>#include <cstring>using namespace std;#define LL long longLL mod_pow(LL a, LL b, LL p){ LL ans = 1; while(b > 0) { if(b & 1) ans = (ans * a ) % p; a = (a * a) % p; b >>= 1; } return ans;}int main(){ LL n; while(cin>>n) { cout << mod_pow(n, n, 10) << endl; } return 0;}</span>
0 0
- <快速幂模> N^N的末尾数字
- 快速求N!末尾零的个数
- 51nod 1004 n^n的末尾数字
- n^n的末位数字(快速幂)
- 1004 n^n的末位数字(快速幂)
- 1004 n^n的末位数字 (快速幂)
- 51Nod-1004 n^n的末位数字【快速模幂】
- 求一个数n次方后的末尾数(数论/快速幂)
- LightOJ 1138 给出数字n,求m使得m!的末尾含有n个0
- N!末尾0的个数
- n!末尾0的个数.
- N!末尾0的个数
- n!末尾0的个数
- N!末尾0的个数
- 51nod 1004 n^n的末位数字(快速幂)
- 51Nod 1004 n^n的末位数字(快速幂)
- n!末尾有多少个0以及n!末尾第一个非0数字
- UVA10061求不同进制的n!的数字位数和末尾零的个数
- Fragment学习记录二 动态创建fragment
- 清除浮动事二三
- puppet学习与精通之入门
- Android 按下home键,程序在后台运行,在launcher里面再点击icon又重新启动了
- 实现spring+mybatis+uncode dal,应用自动切换连接数据库
- <快速幂模> N^N的末尾数字
- 并发下常见的加锁及锁的PHP具体实现
- 丰厚资本杨守彬:创业就是从地狱到天堂,路过人间而已
- XXX Params.addRule(); 该方法不能用的问题
- sql和mysql内连接更新
- n个元素进栈,输出所有出栈序列-卡特兰数-递归
- 孙孙啊i之项目实战(三) 引导页
- eax, ebx, ecx, edx, esi, edi, ebp, esp等通用寄存器的作用
- java中BitMap实现