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. JS和JQUERY的区别

    ①.根据ID取元素 { JS:取到的是一个DOM对象. 例:var div = document.getElementByID("one"); JQUERY:取到的是一个JQUER ...

  2. struts2 radio标签 性别固定选项

    <s:radio list="#{'男':'man', '女':'woman'}" value="'男'" name="users.sex&qu ...

  3. JavaScript: basis

    ref: http://www.imooc.com/code/387 1. html里直接嵌入js: <!DOCTYPE HTML> <html> <head> & ...

  4. codeforces 70D Professor's task(动态二维凸包)

    题目链接:http://codeforces.com/contest/70/problem/D Once a walrus professor Plato asked his programming ...

  5. RelativeLayout相对布局属性

    RelativeLayout用到的一些重要的属性: 第一类:属性值为true或falseandroid:layout_centerHrizontal 水平居中android:layout_center ...

  6. Demo13

    this.listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void o ...

  7. paper 25 :SVM支持向量机是什么意思?

    转载来源:https://www.zhihu.com/question/21094489 作者:余洋链接:https://www.zhihu.com/question/21094489/answer/ ...

  8. Open quote is expected for attribute "property" associated with an element type "result".错误

    java  Mybatis 框架下的项目 报   Open quote is expected for attribute "property" associated with a ...

  9. YII2 Activedataprovider 类分页的使用

    下面以管理员列表为例说明Activedataprovider分页的具体使用 1.控制器中 public function actionIndex(){ $model=new Admin(); $dat ...

  10. php setcookie 讲解

    1.setcookie 中 $value 值不能为数组 e.g a.$arr = array('hh','bb');setcookie('username',$arr);这种不会生效的 如果确实要放数 ...