hiho week 60 register

Ended

Participants:587

Verdict:Accepted
Score:100 / 100
Submitted:2015-08-23 00:20:06

Lang:GCC

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 <stdio.h>
#include <string.h>
#define MAXN 2222
int dp1[MAXN][MAXN],dp[MAXN][MAXN],f[MAXN][MAXN];
char sa[MAXN],sb[MAXN];
int max(int x,int y){
    return x>y?x:y;
}
int main(){
    int i=0,j;
    char c;
    while ((c=getchar())!='\n'){
        sa[i++]=c;
    }
    sa[i]=0;
    i=0;
    while ((c=getchar())!='\n'&&c!=EOF){
        sb[i++]=c;
    }
    sb[i]=0;
    //printf("%s\n",sa);
    //printf("%s\n",sb);
    int la=strlen(sa),lb=strlen(sb);
    for (i=0;i<la;++i)
        for (j=0;j<lb;++j)
            if (sa[i]==sb[j]){
                if (i==0||j==0)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX