E - LIS Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Description The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very concerned a…
POJ 3903 Stock Exchange (E - LIS 最长上升子序列) 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87125#problem/E 题目: Description The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John…
E - LIS Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very…
Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest increasing subsequence is [2, 3, 7, 101], therefore the length is 4. Note that there may be more than o…
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The game can be played by two or more than two players. It consi…
正好训练赛来了一道最长递减序列问题,所以好好研究了一下最长递增序列问题. B - Testing the CATCHER Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1887 Description A military contractor for the Department of Defense has just complet…
Common Subsequence POJ-1458 //最长公共子序列问题 #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<string> using namespace std; string a,b; int dp[1003][1003]; int main(){ while(cin>>a>>b){…
优化链接 [https://blog.csdn.net/George__Yu/article/details/75896330] #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int a[10010]; int dp[10010]; //LIS int main() { int n; while(scanf("%d",&n)!=EOF…
LCS最长公共子序列 模板代码: #include <iostream> #include <string.h> #include <string> using namespace std; int dp[110][110]; int main() { string a,b; memset(dp,0,sizeof(dp)); cin>>a>>b; int lena = a.size(); int lenb = b.size(); for(int…