1005: Coffin Tiles

Time Limit: 1 Sec      Memory Limit: 128 MB
Submit: 2      Solved: 2

Description

The Pumpkin King has a great idea for this Christmas: Personalized coffins for all the good little boys and girls! To make them extra special, Jack has ordered that the coffins have various designs based upon the interests of the children (This was of course determined by what Google searches the children do most often. The Clown with the Tear-Away face has mad hacking skills).

Most little girls, and some of the boys (Bronies) happen to be really into My Little Pony: Friendship is Magic, and so a large number of Twilight Sparkle themed coffins have been ordered (Twilight is of course, the most awesome pony on the show). These coffins are decorated by affixing alternating tiles in a rectangle up the middle of the coffin lid (They're flat). Now, all the children are different sizes and shapes. Some lids will need a rectangle 3 tiles wide, some less, and some more. In order to keep from ordering too many tiles from the.. ummm... coffin tile factory (Just go with it). The Mayor wants to know how many tiles he needs to order, based upon how many dimensionally unique rectangles can be made using tiles of a certain number.

So, the mayor has asked you to write a program that will, for each given integer, "n", output the minimal number of tiles (The tiles are square) that can be arranged into exactlynunique rectangles. For example, if the number two was given, the minimal number of tiles required to make 2 unique rectangles is 4. With 4 you can make a1x4and a2x2rectangle.

Input

Input consists of a single integer indicating the number of integers to read and a sequence of positive integers separated by whitespace.

Output

For each input integernyour program should output either a single line containing the minimal number of unit squares that can be arranged into exactlynrectangles, or "Too big" if the number of needed unit squares is bigger than 1000000.

Sample Input

5
1 4 19 48 71

Sample Output

1
24
786432
27720
Too big

HINT

 

Source

 
题目又臭又长,我还是连蒙带猜出的结果。
打表大法真开心!!!
/*
#include <bits/stdc++.h> using namespace std; bool judge(int n,int m)
{
int cnt = 0;
int k = (int)sqrt(m*1.0);
for(int i=1; i<=k; i++)
{
if(m%i==0)
cnt++;
}
if(cnt==n)
return true;
else return false; } int calc(int n)
{ for(int i=n*n; i<=1000000; i++)
{
if(judge(n,i))
return i;
}
return -1; } int main()
{
freopen("out.txt","w",stdout);
for(int i=1;i<=1000;i++)
printf("%d\n",calc(i)); return 0;
}
*/ #include <bits/stdc++.h> int a[] = {,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
-,
,
-,
,
,
,
,
,
-,
,
,
,
,
,
-,
,
,
-,
-,
,
,
,
-,
,
,
,
,
,
-,
-,
,
,
-,
-,
,
,
-,
,
-,
,
-,
,
-,
,
-,
-,
,
-,
-,
-,
-,
,
,
-,
-,
,
-,
-,
-,
,
-,
,
-,
-,
-,
-,
,
,
-,
-,
-,
,
-,
-,
-,
-,
,
-,
-,
,
-,
-,
-,
,
-,
-,
-,
-,
-,
-,
-,
}; int main()
{
int t;
scanf("%d",&t);
while(t--) {
int n;
scanf("%d",&n);
if(n>)
puts("Too big");
else {
if(a[n-]==-)
puts("Too big");
else {
printf("%d\n",a[n-]);
}
} }
return ;
} /**************************************************************
Problem: 1005
User: YinJianZuiShuai
Language: C++
Result: Accepted
Time:0 ms
Memory:1700 kb
****************************************************************/

CSUFT 1005 Coffin Tiles的更多相关文章

  1. 1569: Wet Tiles

    Description Alice owns a construction company in the town of Norainia, famous for its unusually dry ...

  2. 【BZOJ 1005】【HNOI 2008】明明的烦恼

    http://www.lydsy.com/JudgeOnline/problem.php?id=1005 答案是\[\frac{(n-2)!}{(n-2-sum)!×\prod_{i=1}^{cnt} ...

  3. BZOJ 1005 [HNOI2008] 明明的烦恼(组合数学 Purfer Sequence)

    题目大意 自从明明学了树的结构,就对奇怪的树产生了兴趣...... 给出标号为 1 到 N 的点,以及某些点最终的度数,允许在任意两点间连线,可产生多少棵度数满足要求的树? Input 第一行为 N( ...

  4. MySQL ERROR 1005: Can't create table (errno: 150)的错误解决办法

    在mysql 中建立引用约束的时候会出现MySQL ERROR 1005: Can't create table (errno: 150)的错误信息结果是不能建立 引用约束. 出现问题的大致情况 1. ...

  5. PKU 1005

    比较简单吧,其实算是数学问题了 // 1005.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include "stdio.h ...

  6. PAT 乙级 1005. 继续(3n+1)猜想 (25)

    1005. 继续(3n+1)猜想 (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B   卡拉兹(Callatz)猜想已经在1001中给出了描述.在这个题目里,情 ...

  7. apache tiles 页面模板的使用

    jar包maven <!-- Tiles 模板--> <dependency> <groupId>org.apache.tiles</groupId> ...

  8. hdu 1005

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1005 思路:找规律题 #include<stdio.h> main() { ]; int ...

  9. Tiles & SiteMesh

    Tiles & SiteMesh 这两天在给公司的新项目搭框架,在配tiles框架的时候发现一个小问题:    比如开发团队一共5人,每人10个页面,如果按照简单的tiles框架配置方法,每个 ...

随机推荐

  1. Groupon面经Prepare: Max Cycle Length

    题目是遇到偶数/2,遇到奇数 *3 + 1的题目,然后找一个range内所有数字的max cycle length.对于一个数字,比如说44,按照题目的公式不停计算,过程是 44, 22, 11, 8 ...

  2. zabbix监控路由器所有接口信息

    zabbix监控路由器所有接口信息 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 1.首先在服务器端安装snmp工具 [root@bogon yinzhengjie]# yum - ...

  3. C# 微信支付教程系列之扫码支付

    微信支付教程系列之扫码支付            今天,我们来一起探讨一下这个微信扫码支付.何为扫码支付呢?这里面,扫的码就是二维码了,就是我们经常扫一扫的那种二维码图片,例如,我们自己添加好友的时候 ...

  4. C# Winform 水波纹效果

    //添加自定义控件 using System; using System.Collections.Generic; using System.ComponentModel; using System. ...

  5. WM (Constants)

    Create page WM (Constants)   Summary WM_* Constants and their definitions or descriptions and what c ...

  6. java使用json将HashMap转化成javabean小例子

    import java.util.HashMap; import java.util.Iterator; import java.util.Map; import net.sf.json.JSONOb ...

  7. C# 把字符串类型日期转换为日期类型

    方法一:Convert.ToDateTime(string) string格式有要求,必须是yyyy-MM-dd hh:mm:ss ================================== ...

  8. EBS登陆链接网址

    SELECT home_url FROM icx_parameters; SELECT profile_option_value FROM fnd_profile_option_values WHER ...

  9. 在 wxWidgets 的介绍中看到的一句话

    3. wxwidgets提供的gui是大量使用宏的,这就意味着它是在尽可能的使用目标系统native的gui样式. ——你可以访问wxwidgets网站,看看那些开发的软件的截图,全是系统native ...

  10. Sqlserver常用的时间函数---GETDATE、GETUTCDATE、DATENAME

    GETDATE 按 datetime 值的 Microsoft® SQL Server™ 标准内部格式返回当前系统日期和时间.语法GETDATE ( )返回类型datetime注释日期函数可用在 SE ...