HDU 1097
来源:互联网 发布:单片机65536 编辑:程序博客网 时间:2024/06/12 23:26
求n^n的最后一位,快速幂,主要是留下整理的头文件
#include <bits/stdc++.h>typedef long long ll;typedef double db;#define rep(i,a,n) for (int i=a;i<n;i++)#define per(i,a,n) for (int i=n-1;i>=a;i--)#define mp make_pair#define pb push_back#define fi first#define se second#define all(x) (x).begin(),(x).end()#define SZ(x) ((int)(x).size())#define sspeed ios::sync_with_stdio(false);cin.tie(0)using namespace std;const int inf = 0x3f3f3f3f;const int mod = int(1e9) + 7;const int md=10;ll mypow(ll a,ll e){ if(e==0)return 1; return e&1?mypow(a,e-1)*a%md:mypow(a*a%md,e>>1);}inline ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}inline int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}//-------- headint main(){ ll a,b; while(cin>>a>>b) cout<<mypow(a,b)<<endl; return 0;}
阅读全文
0 0
- hdu 1097
- hdu 1097
- hdu 1097
- hdu 1097
- HDU 1097
- hdu 1097
- hdu 1097
- HDU 1097
- 【循环节】HDU 1005 and HDU 1097
- HDU 5500+HDU 1097 (找规律)
- hdu 1097 数学
- HDU 1097(快速幂求模)
- HDU-ACM-1097
- HDU 1097 快速幂取模
- HDU 1097 JAVA
- hdu 1097 数论
- hdu
- hdu
- 二分类模型评估指标的计算方法与代码实现
- AndroidStudio打开新项目
- 知识学习——Java类的生命周期
- 第十三次学习报告
- 在乌班图系统里找到了python的matplotlib的pyplot的errorbar函数参数用法……
- HDU 1097
- The Python Tutorial(2)-1 激发你的兴趣
- python学习之路(常用系统模块3--os,sys模块)
- markdown使用
- ShaderForge-轮廓光效果
- hello world~~
- 起点
- workspace放在nfs的个人文件夹下
- 超强、超详细Redis入门教程