hdu 2035 人见人爱A^B
2015-09-08 19:52
337 查看
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2035
[code]#include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> #include<cstdio> #include<vector> #include<map> using std::map; using std::min; using std::find; using std::pair; using std::vector; using std::multimap; #define pb(e) push_back(e) #define sz(c) (int)(c).size() #define mp(a, b) make_pair(a, b) #define all(c) (c).begin(), (c).end() #define iter(c) __typeof((c).begin()) #define cls(arr, val) memset(arr, val, sizeof(arr)) #define cpresent(c, e) (find(all(c), (e)) != (c).end()) #define rep(i, n) for(int i = 0; i < (int)n; i++) #define tr(c, i) for(iter(c) i = (c).begin(); i != (c).end(); ++i) const int M = 1000; const int N = 100001; const int INF = 0x3f3f3f3f; void pow_mod(int A, int B) { int ans = 1; while(B) { if(B & 1) ans = ans * A % M; A = A * A % M; B >>= 1; } printf("%d\n", ans); } int main() { #ifdef LOCAL freopen("in.txt", "r", stdin); freopen("out.txt", "w+", stdout); #endif int A, B; while(~scanf("%d %d", &A, &B), A + B) { pow_mod(A, B); } return 0; }
相关文章推荐
- Pyqtdeploy Android PyQtForAndroid 编译记录【更新中
- 1018. 锤子剪刀布 (20)
- 促进胎儿入盆试试运动法和调整姿势
- 胎儿入盆是什么感觉 怎样促进胎儿入盆
- HTTP - 条件请求
- Markdown编辑器写博客
- 第2周-跑道长度
- 浅析SAE与DBM(Deep Learning)
- OC 字符串及数组
- Vim 配色设置与配色脚本语法
- JAXB--学习2
- [Swoole入门]-Ubuntu环境下安装Swoole扩展
- ArcGIS Server 10.1下载地址
- UVA 10817(状态压缩)
- iOS7 boundingRectWithSize 计算文本尺寸
- OGRE学习记录-自阴影
- SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'dtdate' 解决方法
- 交换两个int类型数值(总结分析,理解记忆)
- c#的托管事件
- Mantis实验提高篇