hiho week 60 register

Ended

Participants:587

Verdict:Accepted
Score:100 / 100
Submitted:2015-08-25 20:52:46

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 <math.h>
#include<string>
#include<string.h>
#include<stdlib.h>
#include<queue>
#include<algorithm>
#include<unordered_map>
#include<stack>
#include<fstream>
#include<map>
#include<time.h>
using namespace std;
const int N = 2110;
int dp[N][N];
int f[N][N];
char s1[N];
char s2[N];
int main()
{
    s1[0] = s2[0] = 'a';
    memset(dp, 0, sizeof(dp));
    memset(f, 0, sizeof(f));
    scanf("%s", s1+1);
    scanf("%s", s2+1);
    int ans = 0;
    for(int i = 1; s1[i] != '\0'; i++)
        for(int j = 1; s2[j] != '\0'; j++)
        {
            if(s1[i] == s2[j])
                f[i][j] = f[i-1][j-1] + 1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX