码迷,mamicode.com
首页 >  
搜索关键字:nyoj 336 子序列    ( 6902个结果
计算子序列和是定值的子序列个数
题目如下: Counting Subsequences Time Limit: 5000 MSMemory Limit: 65536 K Description ?"47 is the quintessential random number," states the 47 society. And there might be a grain of truth in that....
分类:其他好文   时间:2014-07-22 08:13:34    阅读次数:281
NYOJ 709(ZZULIOJ1481) 异 形 卵
题目描述 我们探索宇宙,是想了解浩瀚星空的奥妙,但我们却很少意识到宇宙深处藏匿的危险,它们无时无刻不紧盯着我们的地球。如果外星人拜访我们,结果可能与哥伦布当年踏足美洲大陆不会有什么两样,这是历史,也是现实。 在ZDM-777星球上发现的休眠异形卵,其外表与常见的卵不同,表面被一层石墨覆盖。当人走近时,那层石墨开始消融,能看到里面的异形卵正在活动,异形卵是活物,具备一些热量或...
分类:其他好文   时间:2014-07-22 00:30:37    阅读次数:285
最长公共递增子序列【模板】
虽然很多人说记模板提升空间有限,但是对于我这种菜鸟级别的人来说。能做的也只有记记模板了! 希望这个模板能帮到你,如果有更好的模板记得告诉我哦!!谢谢。 二维代码: #include #include #include using namespace std; int n,m,a[505],b[505],dp[505][505]; int LICS() { int max,i,j; mem...
分类:其他好文   时间:2014-07-21 11:42:44    阅读次数:192
查找最长递增子序列
一般情况: #include #include #include using namespace std; int a[1005],dp[1005],n; int LIS() { int i,j,ans,m; dp[1] = 1; ans = 1; for(i = 2;i<=n;i++) { m = 0; for(...
分类:其他好文   时间:2014-07-21 11:23:15    阅读次数:185
[ACM] POJ 2796 Feel Good (求序列中子序列的和与子序列中的最小数最大乘积)
Feel Good Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 9186   Accepted: 2509 Case Time Limit: 1000MS   Special Judge Description Bill is developi...
分类:其他好文   时间:2014-07-21 11:21:15    阅读次数:235
STL 源码剖析 算法 stl_algo.h -- nth_element
nth_element ------------------------------------------------------------------------------ 描述:重新排序,使得[nth,last)内没有任何一个元素小于[first,nth)内的元素, 但对于[first,nth)和[nth,last)两个子区间内的元素次序则无任何保证。 思路: 1.以 median-of-3-partition 将整个序列分割为更小的左、右子序列 2.如果 nth 迭代器落于左序列,就再对左子...
分类:其他好文   时间:2014-07-20 23:20:34    阅读次数:279
最长公共上升子序列(LCIS)ZOJ 2432
立方算法: #include #include #include #include #define M 505 using namespace std; typedef long long LL; LL a[M],b[M]; int dp[M][M]; int main() { //freopen("in.txt","r",stdin); int T; cin>>T; ...
分类:其他好文   时间:2014-07-20 23:01:50    阅读次数:284
NYOJ 118 修路方案
修路方案时间限制:3000ms | 内存限制:65535KB难度:5描述南将军率领着许多部队,它们分别驻扎在N个不同的城市里,这些城市分别编号1~N,由于交通不太便利,南将军准备修路。现在已经知道哪些城市之间可以修路,如果修路,花费是多少。现在,军师小工已经找到了一种修路的方案,能够使各个城市都联通...
分类:其他好文   时间:2014-07-20 22:35:44    阅读次数:345
编程算法 - 最长上升子序列问题 代码(C)
最长上升子序列问题 代码(C)本文地址: http://blog.csdn.net/caroline_wendy题目: 有一个长为n的数列a. 请求出这个序列中最长上升子序列的长度. 最长上升子序列的数字之间可以有间隔.即最长上升子序列(LIS, Longest Increasing Subsequence), 例如: n=5, a={4,2,3,1,5}, result=3(2,3,5).使用动...
分类:其他好文   时间:2014-07-20 22:34:43    阅读次数:297
POJ 2533 Longest Ordered Subsequence
题意:求最长递增子序列 AC代码:#include #include #include using namespace std; int dp[1010],a[1010]; int main() { int i,j,n; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;...
分类:其他好文   时间:2014-07-20 10:28:31    阅读次数:235
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!