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. centos 6.4下的postgresql 9.2使用

    http://www.cnblogs.com/mchina/archive/2012/06/06/2539003.html

  2. PostgreSQL中关于关键字(保留字)在表名和字段名中的应用文件解决

    标识符和关键词 受限标识符或被引号修饰的标识符.它是由双引号(")包围的一个任意字符序列.一个受限标识符总是一个标识符而不会是一个关键字.因此"select"可以用于引用 ...

  3. Leetcode: Elimination Game

    There is a list of sorted integers from 1 to n. Starting from left to right, remove the first number ...

  4. [原创]java WEB学习笔记86:Hibernate学习之路-- -映射 n-n 关系,单向n-n,双向n-n

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

  5. RC-50221 问题解决 - netstat 查看端口占用情况

    查看端口占用情况   netstat -an|grep LIST|grep 15     数据库监听占用情况. netstat -an|grep 1521                  1521为 ...

  6. RF前端

    加入LTE之后的多模多频需求: 在加入LTE后,不但要求终端在多模的基础上增加LTE工作频段,而且还要增加可以确保用户实现国际漫游的频段.然而 全球分配的LTE频段较多且较离散.   频段 上行工作频 ...

  7. 【rails3教材】博客构建过程

    构建rails项目--blog $ rails new blog --skip-bundle $ cd blog $ bundle --local $ bundle install #安装需要的包 $ ...

  8. tomcat支持的websocket服务

    首发:个人博客 在tomcat7之后的版本,写个websocket服务程序非常容易——如以下代码所示,当客户端建立了一个连接并发送了一些什么内容到服务器,服务器将每隔两秒返回一个字符串“world”. ...

  9. setInterval 实时驱动界面改变

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  10. nginx负载均衡的实现

    将一台nginx主机当作前端负载均衡服务器,后面通过交换机链接多台web服务器,提供html和php的web界面服务.通过配置前端负载均衡服务器,可以实现将html界面和php界面的分开访问,即htm ...