HDU1097 A hard puzzle
A hard puzzle
this puzzle describes that: gave a and b,how to know the a^b's the last digit number.But everybody is too lazy to slove this problem,so they remit to you who is wise.
7 66
8 800
9
6
#include <stdio.h>
#include <string.h>
const char *sam[] = {"0", "1", "2486", "3971", "46", "5", "6", "7931", "8426", "91"};
int main()
{
int a, b;
while(scanf("%d%d", &a, &b) == 2)
printf("%c\n", sam[a % 10][(b-1) % strlen(sam[a%10])]);
return 0;
}
版权声明:本文博主原创文章,博客,未经同意不得转载。
HDU1097 A hard puzzle的更多相关文章
- Puzzle 面向服务/切面(AOP/IOC)开发框架 For .Net
Puzzle 面向服务/切面AOP开发框架 For .Net AOP主要实现的目的是针对业务处理过程中的切面进行提取,它所面对的是处理过程中的某个步骤或阶段,以获得逻辑过程中各部分之间低耦合性的隔离效 ...
- HDU5456 Matches Puzzle Game(DP)
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5456 Description As an exciting puzzle game for ...
- one recursive approach for 3, hdu 1016 (with an improved version) , permutations, N-Queens puzzle 分类: hdoj 2015-07-19 16:49 86人阅读 评论(0) 收藏
one recursive approach to solve hdu 1016, list all permutations, solve N-Queens puzzle. reference: t ...
- poj3678 Katu Puzzle 2-SAT
Katu Puzzle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6714 Accepted: 2472 Descr ...
- POJ1651Multiplication Puzzle[区间DP]
Multiplication Puzzle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8737 Accepted: ...
- codeforce B Island Puzzle
B. Island Puzzle time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...
- poj 1651 Multiplication Puzzle (区间dp)
题目链接:http://poj.org/problem?id=1651 Description The multiplication puzzle is played with a row of ca ...
- Ignatius's puzzle
Ignatius's puzzle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- A hard puzzle
A hard puzzle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
随机推荐
- Perl 中级教程 第5章课后习题
5. 9. 1. 练习1 [5 分钟] 先不要运行程序, 看看你能否判断出这程序的哪部份出了问题?如果你看不出 来, 就可以运行一相程序, 得到些暗示, 来看是否能修改好: my %passenger ...
- 泛型? extents super
?可以接受任何泛型集合,但是不能编辑集合值.所以一般只在方法参数中用 例子: ? extends Number 则类型只能是Number类的子孙类 ? super String 则类型只能是Str ...
- Extjs4 关于设置form中所有子控件为readOnly属性的解决方案
之前在网上找了一堆,但那些确实没法用,后来考虑了一下,发现主要是网上提供的假设form中只有一层控件,没有考虑到布局稍微复杂的form情形,此处采用递归的形式实现对form中所有控件(grid及but ...
- 子元素的margin-top影响父元素原因和解决办法
这个问题会出现在所有浏览器当中,原因是css2.1盒子模型中规定, In this specification, the expression collapsing margins means tha ...
- ThinkPHP框架下,给jq动态添加的标签添加点击事件移除标签
jq移除标签主要就是$("#要移除的id").remove();不再赘述,这里要提醒的是jq中动态添加标签后怎样添加点击事件.一般的jq添加点击事件是用这种方法$("#i ...
- Apache与php的整合(经典版),花了一天去配置成功经验
1.首先在官方下载php-7.0.7-Win32-VC14-x64.zip和httpd-2.4.20-win64-VC14.zip,也可以下载镜像版的apache:apache_2.4.4-x64-o ...
- [Windows] php开发工具,zendstudio13使用方法补丁
官网原版下载 http://downloads.zend.com/studio ... win32.win32.x86.exe 破解补丁: 链接:http://pan.baidu.com/s/1gdi ...
- Day11 线程、进程、协程
创建线程第一种:import threadingdef f1(arg): print(arg) t = threading.Thread(target=f1, args=(123,))#t.start ...
- 测试gcc的优化选项
一.测试准备及原理 测试代码: static void wait(volatile unsigned long dly) { ; dly--); } int main(void) { unsigned ...
- 一篇旧文章,结合汇编探索this指针
//VC6.0下成功编译 #include <iostream.h> class X{ public: void foo(int b,int c){ this->a=b*c; cou ...