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的更多相关文章

  1. 【HDOJ】4541 Ten Googol

    打表的大水题. /* 4541 */ #include <cstdio> #include <cstdlib> #include <cstring> , , , } ...

  2. hdu 4541(麻烦的模拟)

    Ten Googol Time Limit: 500/200 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Su ...

  3. hdu Waiting ten thousand years for Love

    被这道题坑到了,如果单纯的模拟题目所给的步骤,就会出现同一个位置要走两次的情况...所以对于bfs来说会很头痛. 第一个代码是wa掉的代码,经过调试才知道这个wa的有点惨,因为前面的操作有可能会阻止后 ...

  4. HDU 2653 - Waiting ten thousand years for Love

    首先,对于一个 '@' 飞上去,飞下来都要耗1点魔力,所以是两点= = 然后站在同一格 魔力可能不同,所以要增加一维. 还有当前搜到的不一定是最小. 别的也没啥. #include <iostr ...

  5. HDU 2653 (记忆化BFS搜索+优先队列)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2653 题目大意:迷宫中有普通点和陷阱.其中普通点可以走可以飞,但是陷阱只能飞.走耗时1,飞耗时2.但 ...

  6. HDU 1671 Phone List(Trie的应用与内存释放)

    Phone List Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  7. HDU 3555 Bomb 数位dp

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3555 Bomb Time Limit: 2000/1000 MS (Java/Others) Mem ...

  8. HDU 4278 Faulty Odometer 8进制转10进制

    Faulty Odometer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...

  9. Hdu 4312-Meeting point-2 切比雪夫距离,曼哈顿距离,前缀和

    题目: http://acm.hdu.edu.cn/showproblem.php?pid=4312 Meeting point-2 Time Limit: 2000/1000 MS (Java/Ot ...

随机推荐

  1. 尚学堂 JAVA Day3 概念总结

    java中的运算符 1.算术运算符 + - * / % Arithmetic operators + 运算符有三种身份 Additive Operator 1)加法:如 a + b; 2)连接:如 “ ...

  2. IT码农哥放弃50万年薪:辞职卖咖喱凉皮(背后深藏功与名)_互联网的一些事

    IT码农哥放弃50万年薪:辞职卖咖喱凉皮(背后深藏功与名)_互联网的一些事 IT码农哥放弃50万年薪:辞职卖咖喱凉皮(背后深藏功与名)

  3. sql server 判断相同值的数据

    举个栗子, 求出相同作者的书 select * from [books]  where author in (select author from [books] group by author ha ...

  4. ffmpeg错误隐藏框架分析

    本文主要是分析ffmpeg的错误隐藏框架,故解码流程此处不会特地进行讨论,网上其他地方其实也有不少介绍相关流程的了,但发现基本没有介绍错误隐藏流程的,故本文希望能填补这个空白. 我们直接从decode ...

  5. HDU 2896 AC自动机 裸题

    中文题题意不再赘述 注意字符范围是可见字符,从32开始到95 char c - 32 #include <stdio.h> #include <string.h> #inclu ...

  6. 使用MFC读写Excel

    _Application m_ExlApp;   //组件服务器的各个classes     _Workbook m_ExlBook;     Workbooks m_ExlBooks;     _W ...

  7. JQuery window、document、 body (转)

    转自:http://www.cnblogs.com/luhe/archive/2012/11/08/2760619.html 我电脑屏幕分辨率:1440 * 900   最大化浏览器,刷新浏览器 al ...

  8. js判断访问者是否来自移动端代码

    <script type="text/javascript"> function is_mobile() { var regex_match = /(nokia|iph ...

  9. SQLServer 工具技巧

    SQLServerProfiler 的使用 http://www.jikexueyuan.com/course/1712.html

  10. Atlas mysql的读写分离和负载均衡<转>

    mysql的读写分离和负载均衡 http://my.oschina.net/superbigfu/blog/178134