摘要: The BalanceTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4737Accepted Submission(s): 1895Problem DescriptionNow you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you shou 阅读全文
posted @ 2013-08-02 20:49 龚细军 阅读(241) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1171Big Event in HDUTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18439Accepted Submission(s): 6457Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, ma 阅读全文
posted @ 2013-08-02 17:32 龚细军 阅读(361) 评论(1) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1398Square CoinsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6697Accepted Submission(s): 4521Problem DescriptionPeople in Silverland use square coins. Not only they have square shapes but also their valu 阅读全文
posted @ 2013-08-02 16:01 龚细军 阅读(290) 评论(0) 推荐(0)
摘要: (关于卡特兰数的详细介绍)http://baike.baidu.com/view/2499752.htm下面有练习的题目:经过测试,_int64/long long 最大只能表示到33位,超过这个范围就要用大数来表示。。。有几个重要的公式是要记得的F(n)=f(n-1)*(4*n-2)/(n+1);还有 f(n)=C(2n,n)/(n+1);或者 f(n)=c(2n,n)-c(2n,n+1);http://acm.hdu.edu.cn/showproblem.php?pid=1023代码: 1 #include 2 #define maxn 100 3 int arr[101][maxn+1] 阅读全文
posted @ 2013-08-02 15:25 龚细军 阅读(2476) 评论(0) 推荐(1)
摘要: next_permutation算法对区间元素进行一次组合排序,使之字典顺序大于原来的排序,有如下两个使用原形,对迭代器区间[first,last)元素序列进行组合排序。当新排序的字典顺序大于原排序时,返回true,否则返回false,利用该算法也可以进行元素排序,但是速度较慢,排序的算法时间复杂度为n!阶乘. 对应的有向后字典排序 prev_permutation算法用于选择一个字典序更小的排序。有如下两个使用原形,对迭代器区间[first,last)元素序列进行组合排序。当新排序的字典顺序大于原排序时,返回true,否则返回false,利用该算法也可以进行元素排序,但是速度较慢,排序的算. 阅读全文
posted @ 2013-08-02 09:01 龚细军 阅读(410) 评论(0) 推荐(0)