POJ-1458
来源:互联网 发布:java中间件框架 编辑:程序博客网 时间:2024/06/03 02:26
#include<iostream>#include<stdio.h>#include<algorithm>#include<string.h>using namespace std;int dp[1005][1005];char a[500],b[500];int main(){ while(~scanf("%s%s",a,b)) {int i,j; int lena=strlen(a); int lenb=strlen(b); for(int i=0;i<lena;i++){ for(int j=0;j<lenb;j++){ if(a[i]==b[j]) dp[i+1][j+1]=dp[i][j]+1; else dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j]); } } cout<<dp[lena][lenb]<<endl;for(i=0;i<=lena;i++)for(j=0;j<=lenb;j++) dp[i][j]=0; } return 0;}
0 0
- poj 1458
- poj 1458
- POJ 1458
- poj 1458
- poj--1458
- poj 1458
- poj 1458
- poj 1458
- POJ-1458
- POJ 1458
- Common Subsequence--poj--1458
- poj 1458 Common Subsequence
- poj 1458 Common Subsequence
- Poj 1458 Common Subsequence
- poj 1458 C++解法
- POJ 1458题解
- POJ 1458 Common Subsequence
- poj 1458 Common Subsequence
- Mac环境下的React-Native环境配置流程(主要解决问题Could not install the app on the device)
- 二叉树的最大深度与最小深度
- POJ-1321
- mysql 如何将一个数据库中某个表中某个字段导入另外一个数据库里指定表里
- Properties工具类获取配置文件数据
- POJ-1458
- google codejam 2008 round2
- POJ-1905
- Spring3.2和jdk1.8之间的兼容性错误
- String,StringBuffer与StringBuilder的区别
- 输入一组单词(区分大小写),统计首字母相同的单词的个数
- C++cin方法小结
- elasticsearch中ik分词的使用
- POJ-1915