POJ 1458 LCS模板
来源:互联网 发布:并发测试软件 编辑:程序博客网 时间:2024/05/18 03:27
LCS模板 存一个
#include "stdio.h"#include "string.h"int main(){ char a[1010],b[1010]; int i,j,Max,dp[1010]; while (scanf("%s",a)!=EOF) { scanf("%s",b); memset(dp,0,sizeof(dp)); for (i=0;b[i];i++) { Max=0; for (j=0;a[j];j++) { if (dp[j]>Max) Max=dp[j]; else if (a[j]==b[i]) { if (dp[j]<Max+1) dp[j]=Max+1; } } } Max=0; for (i=0;a[i];i++) if (dp[i]>Max) Max=dp[i]; printf("%d\n",Max); } return 0;}
0 0
- POJ 1458 LCS模板
- poj 1458 Common Subsequence --- LCS模板
- poj 1458 Common Subsequence(lcs模板)
- POJ-1458 Common Subsequence 【LCS模板】
- 最长公共子序列 LCS(模板) poj 1458
- poj 1458 LCS
- [DP-LCS] POJ 1458
- poj 1159 Common Subsequence LCS模板
- LCS模板
- LCS模板
- lcs 模板
- LCS模板
- lcs模板
- LCS模板
- Poj 1458 Common Subsequence(LCS)
- POJ 1458 Common Subsequence(lcs)
- POJ 1458--Common Subsequence【LCS】
- POJ - 1458 - Common Subsequence (LCS)
- CSS中可以继承和不可继承的属性
- struts2 Interceptor配置与使用 .
- HDOJ 题目1566&题目1544 S-Nim(sg博弈模板)
- CocoaPods安装和使用教程
- misc设备驱动模型及实例解析
- POJ 1458 LCS模板
- MySQL慢查询开启和使用
- android之android.intent.category.DEFAULT的用途和使用
- Glut处理鼠标事件
- android 点击空白 隐藏软键盘
- Spring_5_组件自动扫描机制
- cellsrvstat
- 栈、队列系列之实现一个包含min函数的栈
- Android 性能优化