随笔分类 - dp+贪心+背包......
摘要:描述小Hi和小Ho本着礼让他们的心情——当然还因为本来他们买的就是站票,老老实实的呆在两节车厢的结合处。他们本以为就能够这样安稳抵达目的地,但 事与愿违,他们这节车厢的乘务员是一个强迫症,每隔一小会总是要清扫一次卫生,而时值深夜,大家都早已入睡,这种行为总是会惊醒一些人。而一旦相邻的一些 乘客被惊醒...
阅读全文
摘要:Sample Input51 4 2 5 -124-12 1 2 4Sample Output21 4题目:给你两个数字序列,求出这两个序列的最长公共上升子序列。输出最长的长度,并打表输出。可能存在多种正确答案,故此题是special judge!分析:dp[i][j] : A[1...i]和B[1...
阅读全文
摘要:最长公共子序列可以用在下面的问题时:给你一个字符串,请问最少还需要添加多少个字符就可以让它编程一个回文串?解法:ans=strlen(原串)-LCS(原串,反串);Sample Inputabcfbc abfcabprogramming contest abcd ...
阅读全文
摘要:题目地址:http://poj.org/problem?id=1065Sample Input3 5 4 9 5 2 2 1 3 5 1 4 3 2 2 1 1 2 2 3 1 3 2 2 3 1 Sample Output213题目抽象:给你一个序列,序列的每个元素包含两个值(x,y).现在希望找...
阅读全文
摘要:题目地址:http://poj.org/problem?id=1328Sample Input3 21 2-3 12 11 20 20 0Sample OutputCase 1: 2Case 2: 1参考博客地址:http://www.cnblogs.com/jackge/archive/2013/...
阅读全文
摘要:Ferry Loading IITime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 3704Accepted: 1884DescriptionBefore bridges were common, ferries were used to...
阅读全文
摘要:今年暑假不ACTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32877Accepted Submission(s): 17471Problem D...
阅读全文
摘要:DollarsTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu Submit Status DescriptionNew Zealand currency consists of 100, 50, 20, ...
阅读全文
摘要:滑雪Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 79519Accepted: 29581DescriptionMichael 喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你...
阅读全文
摘要:转载地址:http://blog.csdn.net/nike0good/article/details/43449739B. Painting Pebblestime limit per test1 secondmemory limit per test256 megabytesinputstand...
阅读全文