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. weblogic Connection has already been closed解决方法

    今天正式环境下的有一个功能报错,看了下weblogic日志,报连接已经关闭. com.ibatis.common.jdbc.exception.NestedSQLException: --- The ...

  2. SQL - 添加外键

    不解释: ---先创建外键的column ALTER TABLE tblLicenses ADD ProductID int not null; ---添加外键 ALTER TABLE tblLice ...

  3. 什么是IP地址、子网掩码、路由和网关

    什么是IP地址.子网掩码.路由和网关?经常有朋友问我,的确这些术语常常被我们看到,今天就给大伙说说这几个术语的意思: 1.IP地址: IP地址有一个32位的连接地址,由4个8位字段组成,8位字段称为8 ...

  4. 查询表达式Linq

    LINQ简介 OO(面向对象)以外的疆域:信息的访问与整合.关系数据库与XML为其中的典型应用. .net Language Integrated Query(Linq):不采用特定关于数据库与XML ...

  5. 使用MySQL的LAST_INSERT_ID--转

    LAST_INSERT_ID 自动返回最后一个 INSERT 或 UPDATE 操作为 AUTO_INCREMENT 列设置的第一个发生的值. 参考这里 The ID that was generat ...

  6. [AngularJS 2 实践 一]My First Angular App

    最近一直在看关于AngularJS 2的资料,查看了网上和官网很多资料,接下来就根据官网教程步骤一步步搭建我的第一个Angular App AngularJS 2说明请参考:http://cnodej ...

  7. Chapter 8. Introduction to multi-project builds 多工程构建介绍

    Only the smallest of projects has a single build file and source tree, unless it happens to be a mas ...

  8. LSI MegaCl i命令使用1

    MegaCli命令使用:cd /opt/MegaRAID/MegaCli/MegaCli -AdpAllInfo -aAll     [显示所有适配器信息]MegaCli -LDInfo -Lall ...

  9. Wcf序列化的循环引用问题1

    1.Wcf数据契约序列化,使用的类DataContractSerializer 默认如果类不指定[DataContract],则序列化类的所有字段,并且在出现循环引用的时候回抛出异常,服务终止 msd ...

  10. C#数组反转

    static void Main(string[] arr) { string[] names = { "老杨1", "老李2", "老王3" ...