HDU 1061 EASY
//回宿舍去了,明天做点难一点的题,今天做的都很水,感觉。没意思。
#include <iostream>
#include <cstdio>
using namespace std;
const __int64 MOD=10; __int64 Power(__int64 a,__int64 b,__int64 m){
a%=m; __int64 ans=1;
while(b){
if(b&1){
ans=(ans*a)%MOD;
}
b=b>>1;
a=(a*a)%MOD;
}
return ans;
} int main(){
__int64 n;
int t;
scanf("%d",&t);
while(t--){
scanf("%I64d",&n);
__int64 ans=Power(n,n,MOD);
printf("%I64d\n",ans%MOD);
}
return 0;
}
HDU 1061 EASY的更多相关文章
- HDU 1061 Rightmost Digit --- 快速幂取模
HDU 1061 题目大意:给定数字n(1<=n<=1,000,000,000),求n^n%10的结果 解题思路:首先n可以很大,直接累积n^n再求模肯定是不可取的, 因为会超出数据范围, ...
- HDU 1061 N^N (n的n次方的最后一位)
题目意思: http://acm.hdu.edu.cn/showproblem.php?pid=1061 求N^N的最后一位数. 题目分析: 此题有非常多种方法,主要是中循环节,看自己怎么找了.我的方 ...
- HDU 别easy在一系列的
别easy在一系列的 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Su ...
- hdu So Easy!
So Easy! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- HDU 5572--An Easy Physics Problem(射线和圆的交点)
An Easy Physics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/ ...
- HDU 4359——Easy Tree DP?——————【dp+组合计数】
Easy Tree DP? Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)To ...
- HDU——4565So Easy!(矩阵快速幂)
So Easy! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total S ...
- HDU 2601An easy problem-素数的运用,暴力求解
id=17433" target="_blank" style="color:blue; text-decoration:none">An ea ...
- HDU 5475An easy problem 离线set/线段树
An easy problem Time Limit: 8000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
随机推荐
- Linux开发环境搭建与使用——Linux必备软件之Samba
假如我们是在ubuntu环境上做对应的开发.有的时候,我们须要把我们写的程序共享给别人,或者,自己拷贝出来备份一份.我们习惯用U盘拷贝,假设须要频繁拷贝的话,这样会不太方便.这里给大家介绍一种更好的方 ...
- Codeforces Round #349 (Div. 2) C. Reberland Linguistics DP+set
C. Reberland Linguistics First-rate specialists graduate from Berland State Institute of Peace a ...
- 安装eclipse maven插件m2eclipse No repository found containing
m2eclipse插件是Eclipse的一款Maven插件. 安装m2eclipse插件的步骤例如以下: 启动Eclipse,在菜单条中选择Help,然后选择Install New Software- ...
- BZOJ1053 反素数
题目大意 对于任何正整数x,其约数的个数记作g(x).如果某个正整数x满足对任意的0<i<x,都有g(x)>g(i) ,则称x为反质数.现在给定一个数N,求出不超过N的最大的反质数. ...
- js中简单操作
去空格:ss.replace(/\s/g,""); 数组: 千万不能用in操作符 in 是说存不存在这个key而不是value! var a = [66,99,77]; 66 in ...
- element-UI中table表格的row-click事件怎么获取一行数据的id
<el-table :data="tableData" style="width: 100%" @row-click="openDetails( ...
- h5-10 canvas 简易祖玛
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 关于阿里云oss
这两天抽时间看了一下阿里云oss,阿里云oss是阿里为大数据推出的开放存储服务,为多种语言预留出了接口,下面是我对php接口的一点理解. 当注册了阿里云oss账号时会得到接口,在config里面填上这 ...
- SilverLight Q&A
1.在学校prism,Unity框架的时候,遇到的问题“The IModuleCatalog is required and cannot be null in order to initialize ...
- Android CollapsingToolbarLayout Toolbar的title覆盖问题
CollapsingToolbarLayout 里: app:titleEnabled="true" app:title="Hello" Toolbar 里: ...