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 ...
随机推荐
- Java多线程编程(二)
在 Java多线程编程(一) 中的多线程并没有返回值,本文将介绍带返回值的多线程. 要想有返回值,则需要实现新的接口Callable而不再是Runnable接口,实现的方法也改为call()方法,执行 ...
- 利用golang语法检查对象是否实现了接口
var _ ipc.Server = &CenterServer{} CenterServer是否实现了 ipc.Server的接口.编译期间检测,这是很好的编程实践. 稍后详述...
- Object-C 函数定义 -- 笔记
-(int) f:(int)x; 1.这里 - 表示对象方法, +表示类的方法 2.参数分割使用 : 号来分开 多参数情况: 1.函数不带参数 (函数名: f) -(int) f 2.带一个参数(函数 ...
- ssh远程连接不上ubuntu
问题描述: 1.ubuntu安装了openssh-server,启动了ssh 守护进程,使用端口22 2.在本机可以 ssh 127.0.0.1 连接 3.通过ssh远程(比如用putty 或crt) ...
- 苹果iOS操作系统整体架构层次讲解
iOS的系统架构分为四个层次:核心操作系统层(Core OS layer).核心服务层(Core Services layer).媒体层(Media layer)和可触摸层(Cocoa Touch ...
- 使用jcrop进行头像剪切
http://www.cnblogs.com/chenssy/archive/2013/05/18/3084985.html http://code.ciaoca.com/jquery/jcrop/ ...
- Swift Core Data 图片存储与读取Demo
实体的模型定义: 实体的class定义: @objc(ImageEntity) class ImageEntity: NSManagedObject { @NSManaged var imageDat ...
- 10 Questions To Make Programming Interviews Less Expensive--reference
Conducting Interview is not cheap and costs both time and money to a company. It take a lot of time ...
- Java基础知识强化之IO流笔记04:throw和throws的区别
1. throw概述 在功能方法内部出现某种问题,程序不能继续运行,需要进行跳转时,就用throw把异常对象抛出. 2. 案例演示: (1) package com.himi.throwdemo; p ...
- linux批量执行工具omnitty使用方法
一.omnitty概述 在生产环境中,可能会有多台linux主机.运维人员可能会对多台主机进行同样的操作,例:同时在多台主机上添加一个user或查看所有主机的硬件信息,如果没有批量操作工具,设备少于2 ...