- 博客(15)
- 资源 (1)
- 收藏
- 关注
原创 uva 10739 - String to Palindrome(带增删改操作的回文串问题)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=16802、题目大意:给定一个字符串,可以对其做以下三种操作,增加一个字符,删除一个字符,替换一个字符,求出使得该字符串成回文串的最小操作步数,每种操作执行一次算一步3、DP(x,y)表示比较到
2013-09-29 09:12:58 1529
原创 uva 10306 - e-Coins(二维完全背包)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=12472、题目大意:对于每个样例,先给定两个数n,m,分别表示有n种硬币,对于每一种硬币有两个价值,分别记做x,y,题目要求从中选择一些硬币,使得满足m=sqrt(x^2+y^2),其中是选出的硬
2013-09-27 19:35:59 1644
原创 uva 10651- Pebble Solitaire(状态压缩DP)待看。。。
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=15922、题目:Problem APebble SolitaireInput: standard inputOutput: standard outputTime Limit:
2013-09-27 16:34:19 987
原创 uva 590 - Always on the run
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5312、题目大意:给定两个数n,k,n个城市,k次航班,然后给出n*(n-1)条航班记录,前(n-1)行代表第一个城市分别到其他城市的航班,如果消费为0,则代表没有航班,例如第一个样例,前两行表第
2013-09-27 16:29:05 1348
原创 uva 10051 - Tower of Cubes(类似于LIS,带改正)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=9922、题目 Problem A: Tower of Cubes In this problem you are given N colorful
2013-09-17 21:02:56 718
原创 uva 10069 - Distinct Subsequences(大数相加+DP)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=10102、数据好大,longlong也不对,用大数相加dp[i][j]表示b的前i个字符在a的前j个字符中出现的次数状态转移方程;if(b[i-1]==a[j-1])//如果b的第i个字符
2013-09-16 21:21:51 833 1
原创 uva 825 - Walking on the Safe Side(DP,输入好坑。。。)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=7662、好坑的输入,题目大意是给定一个矩阵,然后给定特殊点,不能走,求出从起始点到终点 有多少33、题目: Walking on the Safe Side
2013-09-14 11:58:51 1116
原创 uva 620 - Cellular Structure
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5612、题目好难懂。。。给定一个细胞链,只有AB两种字母组成,有三种方式,一种是OA,一种是OAB,一种是BOA,O代表是正常的细胞链,最后看一下这个细胞链是否是由这些组合构成的,如果有多种方式构
2013-09-13 10:16:10 1135 1
原创 uva 10404 - Bachet's Game(DP)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=13452、题目大意:给n个石子,有m种取法,每次可以取m堆中的某一堆,Stan先取,Ollie再取,谁取到最后一个石子,谁获胜,最后输出获胜者即可乍一看挺简单,不过还是没想出来怎么做,看网上的
2013-09-12 17:11:15 767
原创 uva 437 - The Tower of Babylon(DP)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=114&page=show_problem&problem=3782、题目: The Tower of Babylon Perhaps you have heard of the
2013-09-09 20:53:06 773
原创 uva 10285 - Longest Run on a Snowboard(dp+记忆化搜索)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=12262、题目大意:给定一个二维的矩阵,其中的数分别代表一些高度,现在可以从某一点滑雪,只能从高处往低处滑,问一条路径最多可以经过多少个点3、题目:Problem CLongest
2013-09-07 20:09:10 695
原创 uva 10465 - Homer Simpson(贪心+完全背包)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=14062、题目:给定一定时间,已知吃一种汉堡用时为m分钟,吃另一种汉堡用时为n分钟,求在保证剩余时间最少的情况下,吃的汉堡的最大数,如果时间有剩余,那么也要输出剩余的时间题目可以看成是简单的完全背
2013-09-06 16:53:08 1350
原创 uva 531 - Compromise(LCS+打印路径)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=114&page=show_problem&problem=4722、题目大意:‘给定两篇文章,由英文单词组成,求最长公共子序列,难点在于打印路径,需要排除打印3、题目: Compromise
2013-09-06 15:19:26 982
原创 uva 10130 - SuperSale(01背包简单变换)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=10712、用滚动数组处理题目:SuperSaleThere is a SuperSale in a SuperHiperMarket. Every person can t
2013-09-05 20:46:19 840
原创 uva 624 CD (01背包+打印路径)
1、http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5652、01背包问题,注意打印路径的方式,可以定义一个二维的path数组,记录是否选中此物品,3、题目: CD You have a lo
2013-09-05 20:09:22 1537 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人