CSUFT 1005 Coffin Tiles
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
Output
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的更多相关文章
- 1569: Wet Tiles
Description Alice owns a construction company in the town of Norainia, famous for its unusually dry ...
- 【BZOJ 1005】【HNOI 2008】明明的烦恼
http://www.lydsy.com/JudgeOnline/problem.php?id=1005 答案是\[\frac{(n-2)!}{(n-2-sum)!×\prod_{i=1}^{cnt} ...
- BZOJ 1005 [HNOI2008] 明明的烦恼(组合数学 Purfer Sequence)
题目大意 自从明明学了树的结构,就对奇怪的树产生了兴趣...... 给出标号为 1 到 N 的点,以及某些点最终的度数,允许在任意两点间连线,可产生多少棵度数满足要求的树? Input 第一行为 N( ...
- MySQL ERROR 1005: Can't create table (errno: 150)的错误解决办法
在mysql 中建立引用约束的时候会出现MySQL ERROR 1005: Can't create table (errno: 150)的错误信息结果是不能建立 引用约束. 出现问题的大致情况 1. ...
- PKU 1005
比较简单吧,其实算是数学问题了 // 1005.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include "stdio.h ...
- PAT 乙级 1005. 继续(3n+1)猜想 (25)
1005. 继续(3n+1)猜想 (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 卡拉兹(Callatz)猜想已经在1001中给出了描述.在这个题目里,情 ...
- apache tiles 页面模板的使用
jar包maven <!-- Tiles 模板--> <dependency> <groupId>org.apache.tiles</groupId> ...
- hdu 1005
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1005 思路:找规律题 #include<stdio.h> main() { ]; int ...
- Tiles & SiteMesh
Tiles & SiteMesh 这两天在给公司的新项目搭框架,在配tiles框架的时候发现一个小问题: 比如开发团队一共5人,每人10个页面,如果按照简单的tiles框架配置方法,每个 ...
随机推荐
- UITableView——点击某一行移动到指定位置
选中某一行后想要tableView自动滚动使得选中行始终处于table的top.middle或者bottom,使用以下方法中的一个就可以实现: [tableView scrollToRowAtInde ...
- Leetcode: Self Crossing
You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to th ...
- 双端队列(单调队列)poj2823 区间最小值(RMQ也可以)
Sliding Window Time Limit: 12000MS Memory Limit: 65536K Total Submissions: 41844 Accepted: 12384 ...
- [转] JVM 调优系列 & 高并发Java系列
1.JVM调优总结(1):一些概念:http://www.importnew.com/18694.html 2.JVM调优总结(2):基本垃圾回收算法:http://www.importnew.com ...
- 利用MyEclipes的反转工程来配置Hibernate各种配置
首先需要有设计好的数据库,然后创建一个Web Project然后右键点击项目选择MyEclipse→add Hibernate Capabilities →→ →→,然后如果没有管理员的话需要在选择M ...
- Android使用ZXing生成带图片的二维码
效果图如下: 制作过程很简单的就是在原始的二维码图片上添加一个logn图标,代码的注释写得很详细,也就不给大家啰嗦了 package com.example.day44_02_qrcodewithlo ...
- sql 中英文格式的时间转数字格式
select receiveBillDt,CONVERT(varchar(100), cast(receiveBillDt as datetime), 21),a.LoanDate from Prot ...
- php+jquery注册实例
写了一个简单的PHP+jQuery注册模块,需要填写的栏目包括用户名.邮箱.密码.重复密码和验证码,其中每个栏目需要具备的功能和要求如下图: 在做这个模块的时候,很大程度上借鉴了网易注册( http: ...
- 【海岛帝国系列赛】No.7 海岛帝国:神圣之日
50237242海岛帝国:神圣之日 [试题描述] 战争持续九个月了.“购物券”WHT的军队还在跟恐怖分子僵持着.WHT和LJX已经向“公务员”告急,情况不宜乐观.YSF为守护帝国决定打开“够累 的”星 ...
- python核心编程学习记录之基础知识
虽然对python的基础知识有所了解,但是为了更深入的学习,要对python的各种经典书籍进行学习 第一章介绍python的优缺点,略过 第二章介绍python起步,第三章介绍python基础,仅记录 ...