hdu 4541 Ten Googol
尼吗,被这题的googol坑了两个多小时,硬是没明白她那个googol就是10 的100次方
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int s[20][100];
void inite()
{s[3][0]= 4; s[3][1] = 1, s[3][2] = 2, s[3][3] = 6, s[3][4] = 10;s[4][0] = 4;s[4][1] = 0, s[4][2] = 4, s[4][3] = 5, s[4][4] = 9;s[5][0] = 6; s[5][1] = 3, s[5][2] = 7, s[5][3] = 8, s[5][4] = 40;s[5][5] = 50, s[5][6] = 60;s[6][0] = 6, s[6][1] = 11, s[6][2] = 12, s[6][3] = 20, s[6][4] = 30;s[6][5] = 80, s[6][6] = 90;s[7][0] = 3, s[7][1] = 15, s[7][2] = 16, s[7][3] = 70;s[8][0] = 13, s[8][1] = 13, s[8][2] = 14, s[8][3] = 18, s[8][4] = 19;s[8][5] = 41, s[8][6] = 42, s[8][7] = 46, s[8][8] = 51, s[8][9] = 52;s[8][10] = 56,s[8][11] =61 ,s[8][12] = 62,s[8][13] = 66;s[9][0] = 22, s[9][1] = 17,s[9][2] = 21, s[9][3] = 22,s[9][4] = 26;s[9][5] = 31, s[9][6] = 32,s[9][7] = 36, s[9][8] = 44,s[9][9] = 45;s[9][10] = 49,s[9][11] = 54,s[9][12] = 55, s[9][13] = 59,s[9][14] = 64;s[9][15] = 65, s[9][16] = 69,s[9][17] = 81, s[9][18] = 82,s[9][19] = 86;s[9][20] = 91, s[9][21] = 92, s[9][22] = 96;s[10][0] = 25, s[10][1] = 24,s[10][2] = 25, s[10][3] = 29,s[10][4] = 34;s[10][5] = 35, s[10][6] = 39,s[10][7] = 43, s[10][8] = 47,s[10][9] = 48;s[10][10] = 53, s[10][11] = 57,s[10][12] = 58, s[10][13] = 63,s[10][14] = 67;s[10][15] = 68, s[10][16] = 71,s[10][17] = 72, s[10][18] = 76,s[10][19] = 84;s[10][20] = 85, s[10][21] = 89,s[10][22] = 94, s[10][23] = 95,s[10][24] = 99;s[10][25] = 100;s[11][0] = 15, s[11][1] = 23,s[11][2] = 27,s[11][3] = 28,s[11][4] = 33;s[11][5] = 37, s[11][6] = 38,s[11][7] = 74,s[11][8] = 75,s[11][9] = 79;s[11][10] = 83, s[11][11] = 87,s[11][12] = 88,s[11][13] = 93,s[11][14] = 97;s[11][15] = 98;s[12][0] = 3,s[12][1] = 73,s[12][2] = 77,s[12][3] = 78;
}
int main()
{inite();int T, cas = 0;for(scanf("%d", &T); T--; ){int a, b;scanf("%d%d", &a, &b);if((a < 3) || a > 12)printf("Case #%d: -1\n", ++cas);else{if(((s[a][0] < b) && (a != 9)) || ((a == 9) && (s[a][0] + 4< b)))printf("Case #%d: -1\n", ++cas);else{if(a == 9){if(b <= 22)printf("Case #%d: %d\n", ++cas, s[a][b]);else if(b == 23)printf("Case #%d: 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", ++cas);else if(b == 24)printf("Case #%d: 20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", ++cas);else if(b == 25)printf("Case #%d: 60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", ++cas);else if(b == 26)printf("Case #%d: 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", ++cas);}elseprintf("Case #%d: %d\n", ++cas, s[a][b]);}}}return 0;
}
hdu 4541 Ten Googol相关推荐
- hdu 4541 Ten Googol 小水题
Ten Googol Time Limit: 500/200 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total S ...
- HDU 4541 Ten Googol
Ten Googol Time Limit: 500/200 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total S ...
- 【HDOJ】4541 Ten Googol
打表的大水题. 1 /* 4541 */ 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> ...
- Ten Googol
Problem Description Google的面试题向来以古怪闻名,延续自技术公司用逻辑题测试求职者的古老传统.现在我们来看看下面这题: 面试官在房间的白板上写下6个数字: 10,9,60,9 ...
- hdu 4541(麻烦的模拟)
Ten Googol Time Limit: 500/200 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total S ...
- HDU 4541 模拟
第一开始打印10的100次方的时候弄成了1000个0.....,害得我搞了半天 #include<stdio.h> #include<stdlib.h> #include< ...
- HDU - 2619 Love you Ten thousand years
Love you Ten thousand years------Earth's rotation is a day that is the representative of a day I lov ...
- HDU - 2619 Love you Ten thousand years【原根】
Discription Love you Ten thousand years------Earth's rotation is a day that is the representative of ...
- 【HDU 2619】Love you Ten thousand years
1.题目链接.原根的一个性.当a的阶等于phi(m)的时候,说明a是m的一个原根.首先这里原根的存在性是不用判断的,因为奇素数一定存在原根.当a是原根时,a^0,a^1,a^2....a^(odr(a ...
最新文章
- 【译】如何精确判断最终用户响应时间过长的原因?
- django模板过滤器
- Let's Encrypt 免费通配符 SSL 证书申请教程——但是也需要email,域名所有权等,如果是黑产用的话会这样用吗?会不会暴露自己身份???...
- 说出你的个人知识问题!
- 云栖大会第二天:ACK Anywhere 来了
- android读取网络配置文件,Android 中保存、读取设置配置数据、记录登录状态
- 3-08. 栈模拟队列(25)(ZJU_PAT 模拟)
- python123说句心里话的题_如何与回避型依恋的人谈恋爱?
- linux调小根目录,Linux根目录分区大小调整教程
- h5比html新增加的标签,HTML5(H5)新增属性和标签
- body onload 控制窗口大小 html,HTML5 对各个标签的定义与规定:body的介绍
- CentOS 7 安装SVN服务端
- ModalPopupExtender控件主要有两种使用方式:客户端使用方式和服务器端使用方式
- stm32实验报告心得体会_STM32实验报告
- shell提取文件中的dojo mobile类
- nbsp;在IE和FIREFOX下位置不对
- 谢谢你,阅读了这篇文章
- Linux基础命令Xmind图【百度网盘链接】
- 深入理解 ZK 中的 “大多数” 机制
- 传统与现代可视化 PK:再生水厂二维工艺组态系统