码迷,mamicode.com
首页 >  
搜索关键字:lis    ( 17068个结果
python之数据结构
List:list.append(x)list.extend(lis)list.insert(i, x)list.remove(x)list.pop(i) #会同时返回移除的值,如果没有设置i,则返回最后一个值del list[i] del list[i:j]list.index(x)#返回x...
分类:编程语言   时间:2015-05-09 13:09:24    阅读次数:157
UVA10635 Prince and Princess(LIS)
题意:王子和公主同时从1出发走到 n*n, 求他们两个路径的最长公共子序列; 思路:因为这题n有250,如果用LCS负责度为O(n^2),容易超时,于是我们选择它的优化版Lis算法来求最长公共子序列,这样我们的复杂度就降为O(n*logn)了。 Lis算法:      先回顾经典的O(n^2)的动态规划算法,设A[t]表示序列中的第t个数,F[t]表示从1到t这一段中以t结尾的最长上升子序列...
分类:其他好文   时间:2015-05-07 22:09:29    阅读次数:161
linkedlist(c语言_简单实现)
1 #include 2 typedef char Ele ; 3 4 typedef struct node{ 5 Ele e; 6 struct node *next; 7 }lnode,*list; 8 9 void get(Ele);10 11 //构造链表12 lis...
分类:编程语言   时间:2015-05-07 16:19:28    阅读次数:213
LIS POJ 2250 Compromise
题目传送门 1 /* 2 LIS模板题:题目看错了,是求单词的最长上升子序列! 3 编程好累:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std;11...
分类:其他好文   时间:2015-05-05 18:20:11    阅读次数:104
gb2312_to_utf8.go
package main import ( "fmt" "io/ioutil" "os" "path/filepath" "strings" iconv "github.com/djimenez/iconv-go" ) //获取指定目录下的所有文件,不进入下一级目录搜索,可以匹配后缀过滤。 func Lis...
分类:其他好文   时间:2015-05-05 17:00:52    阅读次数:114
LIS HDOJ 1257 最少拦截系统
题目传送门 1 /* 2 LIS模板题:n - 最长下降子序列 -> 最长上升子序列 贪心做法以后再补:) 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 1...
分类:其他好文   时间:2015-05-05 16:08:48    阅读次数:136
模拟新浪微博随便看看栏目
使用ListView来模仿微博随便看看栏【分析】要完成这个效果,我们需要:1.ListView及ListView_Item2.实体类的编写3.自定义适配器的书写4.ListView的绑定数据源与控件【编码】package cn.edu.bzu.adapter;import java.util.Lis...
分类:其他好文   时间:2015-05-04 23:40:51    阅读次数:215
UVA - 10635 - Prince and Princess (LCS转化为LIS)
题目传送:UVA - 10635 思路:直接思路是两个串的LCS,不过这个题可以转化为LIS,因为说了序列中各个元素互不相同,所以可以来个映射算出第二个字符串中的字符对应第一个字符串中字符的位置(不存在即删去),然后算出这些位置的LIS即可 AC代码: #include #include #include #include #include #include #i...
分类:其他好文   时间:2015-05-04 15:35:09    阅读次数:107
leetcode || 142、Linked List Cycle II
problem: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? Hide Tags  Linked Lis...
分类:其他好文   时间:2015-05-04 11:58:22    阅读次数:133
模板 最长递增子序列
【模板】最长递增子序列一般情况: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int a[1005],dp[1005],n; 7 8 int LIS() 9 {10 int i,j,ans,m;11 ...
分类:其他好文   时间:2015-05-03 10:33:17    阅读次数:100
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!