poj1458
来源:互联网 发布:我知你好未再百度 编辑:程序博客网 时间:2024/06/05 18:05
#include <iostream>#include <cstdio>#include <cstring>#include <climits>#include <algorithm>using namespace std;char a[1000],b[1000];int dp[1000][1000];int solve(){ memset(dp,0,sizeof(dp)); int i,j; for(i=0;*(a+i)!='\0';++i) for(j=0;*(b+j)!='\0';++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]); return dp[i][j];}int main(){ while(scanf("%s",a)!=EOF) { scanf("%s",b); printf("%d\n",solve()); } return 0;}
0 0
- poj1458
- POJ1458
- poj1458
- poj1458
- poj1458
- poj1458
- poj1458
- poj1458
- poj1458
- poj1458
- POj1458
- POJ1458
- poj1458
- poj1458
- poj1458
- POJ1458 LCS
- poj1458 dp
- 【DP】poj1458
- SpringAop 原理及源码 随笔记录
- 编译错误:用户定义类型未定义(IUnknown)
- 比较时间字符串的问题
- How to fix: “UnicodeDecodeError: 'ascii' codec can't decode byte”
- junit+spring Test.jar 单元测试
- poj1458
- java 集合之List
- hdu 2336 无题II 【二分+二分匹配】
- 链表删除指定的值
- 创建版本库
- 卸载豌豆荚后显示devices not found
- Python实现加解密
- no matching editors or conversion strategy found 异常_解决办法
- linux驱动参数及参数的设置及修改