hiho week 60 register

Ended

Participants:587

Verdict:Accepted
Score:100 / 100
Submitted:2015-08-26 15:37:01

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
#include <iostream>
#include <string.h>
using namespace std;
#define MAX   2100
enum {NONE = -1, LEFT, UP, LEFT_UP};
int matrix[MAX][MAX] = {{0}};
int flag[MAX][MAX] = {{0}};
int f[MAX][MAX] = {{0}};
void LIS(const char * str1, const char *str2)
{
  int i, j;
  int len1 = strlen(str1);
  int len2 = strlen(str2);
  for (i = 0; i <= len1; i++)
    matrix[0][i] = 0;
  for (i = 0; i <= len2; i++)
    matrix[i][0] = 0;
  for (i = 0; i <= len1; i++) {
    for (j = 1; j <= len2; j++) {
      if (str1[i - 1] == str2[j - 1]) {
        f[i][j] = f[i - 1][j - 1] + 1;
      }
      else {
        f[i][j] = 0;
      }
    }
  }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX