摘要: 三角形Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3416Accepted Submission(s): 2368Problem Description用N个三角形最多可以把平面分成几个区域?Input输入数据的第一行是一个正整数T(1<=T<=10000),表示测试数据的数量.然后是T组测试数据,每组测试数据只包含一个正整数N(1<=N<=10000).Output对于每组测试数据,请输出题目中要求的结果.Samp 阅读全文
posted @ 2013-04-23 12:09 heity 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 汉诺塔问题,给你四个柱子,要把所有的盘子从1 移到 3 上1------12 -----33 ------54-------95 -------136--------177 -------25要是按着先把n-3个盘子移到另一个柱子上这样就有一个递推公式,f[n] = 2[n - 3] + 2 ^3-1用12带进去发现不对,不知道为什么,后来yy了一下,能够找出关系,希望大牛指点。。。。 1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 5 long long a[65]; 6 7 阅读全文
posted @ 2013-04-23 11:35 heity 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIn how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sample tiling of a 3x12 rectangle.InputInput consists of several test cases followed by a line containing -1. Each test case is a line containing an integer 0 ≤ n ≤ 30. OutputFor each test case, output one 阅读全文
posted @ 2013-04-23 08:54 heity 阅读(189) 评论(0) 推荐(0) 编辑