摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1255覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2933 Accepted Submission(s): 1447 Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.Input输入数据的第一行是一个正整数T(1=2,计算面积,改变其cover值:cover+=line3.flag,因为li 阅读全文
摘要:
http://poj.org/problem?id=3373Changing DigitsTime Limit:3000MSMemory Limit:65536KTotal Submissions:2719Accepted:863DescriptionGiven two positive integersnandk, you are asked to generate a new integer, saym, by changing some (maybe none) digits ofn, such that the following properties holds:mcontains 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3303Harmony ForeverTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 813 Accepted Submission(s): 222 Problem DescriptionWe believe that every inhabitant of this universe eventually will find a way to live 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2665[ poj 21042761 ] 改变一下输入就可以过http://poj.org/problem?id=2104http://poj.org/problem?id=2761Kth numberTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3266 Accepted Submission(s): 1090 Problem DescriptionG 阅读全文
摘要:
http://poj.org/problem?id=1348ComputingTime Limit:1000MSMemory Limit:10000KTotal Submissions:1681Accepted:248DescriptionInput any five positive integral numbers n1, n2, n3, n4, n5, such that 0 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 struct Nod 9 { 10 int son; //分子... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1021Fibonacci AgainTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29201 Accepted Submission(s): 14148 Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + 阅读全文
摘要:
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1560BFS题解:http://www.cnblogs.com/crazyapple/p/3218107.html构造一个串,使得它包含所有的给定DNA序列,并且要求长度最短。采用dfs策略,对于每个串定义1个指针,当全部指针为串尾时判断构造的长度,由于状态空间过大,但是又存在冗余搜索,可以用迭代加深将状态减少。最长待构造长度 + 当前长度 2 #include 3 #include 4 5 using namespace std; 6 7 struct Nod 8 { 9 int p... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1560DNA sequenceTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 732 Accepted Submission(s): 356 Problem DescriptionThe twenty-first century is a biology-technology developing century. We know that a gene 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1043http://poj.org/problem?id=1077EightTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9173 Accepted Submission(s): 2473 Special JudgeProblem DescriptionThe 15-puzzle has been around for over 100 years; 阅读全文
摘要:
{1,2,3,4,...,n}表示1,2,3,...,n的排列如 {1,2,3} 按从小到大排列一共6个。123 132 213 231 312 321 。代表的数字 1 2 3 4 5 6 也就是把10进制数与一个排列对应起来。他们间的对应关系可由康托展开来找到。如我想知道321是{1,2,3}中第几个大的数可以这样考虑 :第一位是3,当第一位的数小于3时,那排列数小于321 如 123、 213 ,小于3的数有1、2 。所以有2*2!个。再看小于第二位2的:小于2的数只有一个就是1 ,所以有1*1!=1 所以小于321的{1,2,3}排列数有2*2!+1*1!=5个。所以321是第6个大的 阅读全文