nyoj 36 最长公共子序列

题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=36

基本动态规划水题~

代码记录一下:

#include "stdio.h"
#include "string.h"

#define N 1005
int dp[N][N];
char s1[N],s2[N];

int MAX(int x,int y) { return x>y?x:y; }

int main()
{
    int T;
    int len1,len2;
    int i,j;
    scanf("%d",&T);
    getchar();
    while(T--)
    {
        scanf("%s %s",s1+1,s2+1);
        len1 = strlen(s1+1);
        len2 = strlen(s2+1);
        memset(dp,0,sizeof(dp));
        for(i=1 ;i


你可能感兴趣的:(水~~~,算法)