hdu 4541 Ten Googol
http://acm.hdu.edu.cn/showproblem.php?pid=4541
打表找规律
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; int t;
int n,m;
int a[][]={{, , , , },{, , , , },{, , , , , , },{, , , , , , },{, , , }, {,, ,, , , , , , , , , ,}, {, , , , , , , , , , , , , , , , , , , , , ,, }}; int main()
{
scanf("%d",&t);
int cas=;
while(t--)
{
scanf("%d%d",&n,&m);
printf("Case #%d: ",cas++);
if(m>a[n-][])
{
printf("-1\n");
}
else if(n==&&m==)
{
printf("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n");
}
else if(n==&&m==)
{
printf("20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n");
}
else if(n==&&m==)
{
printf("60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n");
}
else if(n==&&m==)
{
printf("100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n");
}
else
{
printf("%d\n",a[n-][m]);
}
}
return ;
}
hdu 4541 Ten Googol的更多相关文章
- 【HDOJ】4541 Ten Googol
打表的大水题. /* 4541 */ #include <cstdio> #include <cstdlib> #include <cstring> , , , } ...
- hdu 4541(麻烦的模拟)
Ten Googol Time Limit: 500/200 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Su ...
- hdu Waiting ten thousand years for Love
被这道题坑到了,如果单纯的模拟题目所给的步骤,就会出现同一个位置要走两次的情况...所以对于bfs来说会很头痛. 第一个代码是wa掉的代码,经过调试才知道这个wa的有点惨,因为前面的操作有可能会阻止后 ...
- HDU 2653 - Waiting ten thousand years for Love
首先,对于一个 '@' 飞上去,飞下来都要耗1点魔力,所以是两点= = 然后站在同一格 魔力可能不同,所以要增加一维. 还有当前搜到的不一定是最小. 别的也没啥. #include <iostr ...
- HDU 2653 (记忆化BFS搜索+优先队列)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2653 题目大意:迷宫中有普通点和陷阱.其中普通点可以走可以飞,但是陷阱只能飞.走耗时1,飞耗时2.但 ...
- HDU 1671 Phone List(Trie的应用与内存释放)
Phone List Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- HDU 3555 Bomb 数位dp
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3555 Bomb Time Limit: 2000/1000 MS (Java/Others) Mem ...
- HDU 4278 Faulty Odometer 8进制转10进制
Faulty Odometer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...
- Hdu 4312-Meeting point-2 切比雪夫距离,曼哈顿距离,前缀和
题目: http://acm.hdu.edu.cn/showproblem.php?pid=4312 Meeting point-2 Time Limit: 2000/1000 MS (Java/Ot ...
随机推荐
- Flask+Mysql搭建网站之数据库问题
关于 SQLAlchemy (1.0.8) 和 Flask-SQLAlchemy (2.0) SQLALchemy 是Python语言的SQL工具包及对象关系映射(ORM)工具.Flask-SQLAL ...
- Python 列表(list)、字典(dict)、字符串(string)常用基本操作小结
创建列表 sample_list = ['a',1,('a','b')] Python 列表操作 sample_list = ['a','b',0,1,3] 得到列表中的某一个值 value_star ...
- 数据库 —— mySQL的基本操作
学习资源: 0.学习教程 :MySQL 教程(runoob.com) (MySQL Tutorial)turtorialPoint 1.学习帮助手册与平台: MySQL学习平台 英文手册chm ...
- Android批量图片载入经典系列——使用LruCache、AsyncTask缓存并异步载入图片
一.问题描写叙述 使用LruCache.AsyncTask实现批量图片的载入并达到下列技术要求 1.从缓存中读取图片,若不在缓存中,则开启异步线程(AsyncTask)载入图片,并放入缓存中 2.及时 ...
- c++对象模型之Data布局
Data语意学 class X{}; class Y : publicvirtual X {}; class Z : publicvirtual X {}; class A : publicY, pu ...
- [Angular 2] Passing Observables into Components with Async Pipe
The components inside of your container components can easily accept Observables. You simply define ...
- [Redux] Store Methods: getState(), dispatch(), and subscribe()
console.clear(); const counter = (state = 0, action) => { switch (action.type) { case 'INCREMENT' ...
- LAMP php5.4编译 _php_image_stream_putc等问题
编译时出现下列问题时: In file included from /usr/local/src/php-5.4.6/ext/gd/gd.c:103: /usr/local/src/php-5.4.6 ...
- java执行命令行
List<String> command = new ArrayList<String>(); command.add("ping"); ProcessBu ...
- python面对对象编程------4:类基本的特殊方法__str__,__repr__,__hash__,__new__,__bool__,6大比较方法
一:string相关:__str__(),__repr__(),__format__() str方法更面向人类阅读,print()使用的就是str repr方法更面对python,目标是希望生成一个放 ...