CodeForces 630 L. Cracking the Code(水~)
2016-02-21 10:39
375 查看
Description
给出一个五位数abcde,对这个五位数做两步操作
第一步:重组为一个新的五位数acedb
第二步:输出acedb^5的后五位
Input
一个五位数abcde
Output
输出acedb^5的后五位
Sample Input
12345
Sample Output
71232
Solution
水题,注意乘的时候会爆int,要以05d%输出
Code
给出一个五位数abcde,对这个五位数做两步操作
第一步:重组为一个新的五位数acedb
第二步:输出acedb^5的后五位
Input
一个五位数abcde
Output
输出acedb^5的后五位
Sample Input
12345
Sample Output
71232
Solution
水题,注意乘的时候会爆int,要以05d%输出
Code
#include<cstdio> #include<iostream> using namespace std; typedef long long ll; int n; int main() { while(~scanf("%d",&n)) { int m=n/10000*10000+n/100%10*1000+n%10*100+n/10%10*10+n/1000%10; ll ans=1ll; for(int i=0;i<5;i++)ans=ans*m%100000; printf("%05d\n",ans); } return 0; }
相关文章推荐
- 【SPOJ-YOUTUBE】Youtube【倍增】
- UIApplication类
- 在easyui datagrid中formatter数据后使用linkbutton
- html基础研究(一)-文本格式化标签研究
- UI整理-----part5--UICollectionView
- c语言入门之项目2.4——利用while求最大公约数
- poj-2411 Mondriaan's Dream (状态压缩dp)
- js实现冒泡排序
- 大端模式与小端模式
- 关于破解AI的补丁和方法
- Android 使用Shell脚本截屏并自动传到电脑上
- 浅谈数字舵机与模拟舵机区别
- CodeForces 630 K. Indivisibility(容斥)
- 用UIInterpolatingMotionEffect产生透视效果
- PHP程序的常见漏洞攻击分析
- Design Support Library(五)具有过度效果的布局 Layout
- Design Support Library(四)具有过渡效果的菜单控件
- CF_527A_PlayingWithPaper
- 用TypeScipt和AMD模块化理念实现React官方教程(五)提交和更新数据
- Design Support Library(三)符合 MD 设计的菜单控件