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. ViewPager相互嵌套,导致子ViewPager无法滑动,且子ViewPager中的view无法被点击

        场景:当使用ViewPager进行嵌套的时候,子viewPager是无法进行嵌套的,因此我们要重写ViewPager类,并重写里层viewPager类中的onTouchEvent方法,调用其父 ...

  2. c++的学习内容一汇总篇(常更新)

    在这里假定读者们是有一定编程经验的.例如c#,java,c或者其他任何编程语言. 所有语言都无外乎掌握它的语法,熟悉它的一些库的调用. ---------------语法篇-------------- ...

  3. Oracle Savepoint

    1.目的: Use the SAVEPOINT statement to identify a point in a transaction to which you can later roll b ...

  4. 夺命雷公狗TP下关联查询

    记录下我们常用的关联查询: public function add4(){ $id=$_GET['id']; $this->list = M("student")->t ...

  5. 「ruby/MiniMagick」用MiniMagick处理图片

    包的选择和配置 想用RMagick,但据说内存泄露的问题比较厉害,作为替代品MiniMagick不存在内存泄露的问题.而二者都是使用ImageMagick的,所以需要下载并安装ImageMagick. ...

  6. Yii2下拉框实现

    详细介绍yii2下拉框的实现方法,以商品分类的下拉框为例: 第一种方法:使用Html的activeDropDownList(),该方法的优点是:可以自定义下拉框的样式.具体实现如下: 1.控制器中,获 ...

  7. Windows应用层网络模块扫盲

           说到Windows应用层网络通信不得不提winsock,winsock是工作在TCP/IP层的应用层(TCP/IP层分为主机到网络层[比特].网络互联层[数据帧].传输层[数据包].应用 ...

  8. empty()、html("")和text("")

    empty().html("")和text("")在删除匹配元素内内容时是一样的.jQuery源码中实现有所不同,但效果相同.可以测试一下源码: <!DO ...

  9. NOIP201208同余方程

    NOIP201208同余方程 描述 求关于x的同余方程ax ≡ 1 (mod b)的最小正整数解. 格式 输入格式 输入只有一行,包含两个正整数a, b,用一个空格隔开. 输出格式 输出只有一行,包含 ...

  10. 删除项目中的.svn文件

    删除项目中的.svn文件 1.创建个文件,名字改为kill-svn-folders.reg 2.把下面的代码考进去,每一行前面不要留空, Windows Registry Editor Version ...