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 ...
随机推荐
- C++类型转换[转]
转自 http://www.cnblogs.com/goodhacker/archive/2011/07/20/2111996.html C风格的强制类型转换(Type Cast)很简单,不管什么类型 ...
- J - Borg Maze - poj 3026(BFS+prim)
在一个迷宫里面需要把一些字母.也就是 ‘A’ 和 ‘B’连接起来,求出来最短的连接方式需要多长,也就是最小生成树,地图需要预处理一下,用BFS先求出来两点间的最短距离, *************** ...
- 【转】使用 NuGet 管理项目库-Phil Haack
原文地址:https://msdn.microsoft.com/zh-cn/magazine/hh547106.aspx 无论多么努力,Microsoft 也没办法提供开发人员所需要的每一个库. 虽然 ...
- java—— 调用系统命令
调用所在环境的命令 链接:http://blog.csdn.net/yy6060/article/details/6311916 1 import java.io.*; 2 class Exec{ 3 ...
- WIN8.1 PROBLEMS 01
win8装好后右下角显示secureboot未正确配置桌面会显示“Windows 8.1 Secure Boot未正确配置”的水印问题: 安全启动(Secure Boot)可以阻止未授权软件的运行,提 ...
- javascript动态改变当前页面中元素的状态行为
function Datea() { var timed = document.getElementById('timed'); var t = setInterval(function TDate( ...
- Object-C @synthesize -- 笔记
- [Angular 2] Rendering an Observable with the Async Pipe
Angular 2 templates use a special Async pipe to be able to render out Observables. This lesson cover ...
- 函数学习(JY07-JavaScript-JS基础03)
- linux执行文件命令
1.如果path中有你的程序所在的目录,那么直接执行filename即可 2.如果path中没有程序所在目录,那么进入目录./filename或者path/filename 比如 wj@ubuntu: ...