[hdu6063]RXD and math
来源:互联网 发布:武汉精神卫生中心 知乎 编辑:程序博客网 时间:2024/05/29 07:50
题目大意
给你一个数学式子,要求计(zhao)算(chu)出(jie)来(lun)。
显然
任意数可唯一表示成a^2*b,其中
式子相当于在枚举b,后面乘的系数是a的范围。
那么每个数都被算一次,答案是n^k。
#include<cstdio>#include<algorithm>#define fo(i,a,b) for(i=a;i<=b;i++)using namespace std;typedef long long ll;const int mo=1000000007;ll n,k;int qsm(ll x,ll y){ if (!y) return 1; int t=qsm(x,y/2); t=(ll)t*t%mo; if (y%2) t=(ll)t*(x%mo)%mo; return t;}int main(){ int wdc=0; while (scanf("%lld%lld",&n,&k)!=EOF){ /*if (n%mo==0){ printf("0\n"); continue; }*/ //n%=mo; //k%=(mo-1); wdc++; printf("Case #%d: %d\n",wdc,qsm(n,k)); }}
阅读全文
0 0
- HDU6063-RXD and math
- hdu6063-RXD and math
- HDU6063-RXD and math
- [hdu6063]RXD and math
- hdu6063 RXD and math
- HDU6063 RXD and math 快速幂
- HDU6063---RXD and math(2017多校联赛题目(???))
- Hdu6063 RXD and math(2017多校第3场)
- hdu6063 RXD and math(数学/打表)
- HDU6063 2017杭电多校联赛第三场-RXD and math
- 2017多校训练Contest3: 1008 RXD and math hdu6063
- HDU6063 [2017多校联合3] RXD and math 打表 快速幂
- 2017多校联合三/hdu6063 ( RXD and math )快速幂+思维
- 2017杭电多校联赛第三场-RXD and math (hdu6063) 找规律快速幂
- RXD and math HDU
- RXD and math
- RXD and math
- RXD and math
- HDU 6140 Hybrid Crystals(思维)
- 复试计划(中)
- [ubuntu]squid3代理配置
- discuz防灌水设置
- Android制作 9-Patch图片(可调整大小的位图)
- [hdu6063]RXD and math
- 【 LeetCode】4. Median of Two Sorted Arrays
- $.post error
- 使用tomcat做文件路径映射
- 清华大学2007年机试-最小邮票数-1209
- 看完这个,css中position的绝对定位相对定位就懂了
- QML旋转,缩放中心设置
- 把字符串转换成整数
- 斐波那契数列