hiho week 60 register

Ended

Participants:587

Verdict:Accepted
Score:100 / 100
Submitted:2015-08-23 22:06:27

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*************************************************************************
    > File Name: hiho60.cpp
    > Author: jluchuang
    > Mail: jlu_chuang@163.com 
    > Created Time: 20150823  205057
 ************************************************************************/
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int get_max(int a, int b) {
    return (a > b) ? a : b ;
} 
int matchingContentLength(string str1, string str2){
    if(str1.length() < 3 || str2.length() < 3) { 
        return 0;
    }
    int len1 = str1.length();
    int len2 = str2.length();
    vector < vector<int> > dp(len1, vector<int>(len2, 0));
    vector < vector<int> > commonLen(len1, vector<int>(len2, 0));
    // Initialize commentLen
    for(int i = 0; i < len1; i++) {
        if(str1[i] == str2[0]) { 
            commonLen[i][0] = 1; 
        }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX