I find the longest common subsequence. May be there any numbers that are longer than "long long int".

for example:

in:

2 3

1 2

2 3 4

out:

Twin Towers #1

Number of Tiles : 1

in2

1 2

1

2 3

out2:

Twin Towers #2

Number of Tiles : 0

Is there any error in my input/output.

Thank.

My program is here:

#include <stdio.h>

void nuluj(long long m,long long n, long long p[][101]) {

for (long i=0; i<=m; i++)

for (long j=0; j<=n; j++)

p

*[j]=0;*

}

long long pole[101][101];

int main() {

long long z=0;

long long m,n;

long long a[101],b[101];

scanf("%lli %llin",&m,&n);

while (m!=0&&n!=0) {

z++;

for (long i=1; i<=m; i++) scanf("%lli",&a

}

long long pole[101][101];

int main() {

long long z=0;

long long m,n;

long long a[101],b[101];

scanf("%lli %llin",&m,&n);

while (m!=0&&n!=0) {

z++;

for (long i=1; i<=m; i++) scanf("%lli",&a

*);*

for (long k=1; k<=n; k++) scanf("%lli",&b[k]);

nuluj(m,n,&pole[0]);

for (long j=1; j<=m; j++) {

if (a[j]==b[1]) pole[1][j]=1;

}

for (long r=2; r<=n; r++)

for (long s=1; s<=m; s++) {

if (a[s]==b[r]) {pole[r][s]=pole[r-1][s-1]+1;}

else {

if (pole[r-1][s]>pole[r][s-1]) pole[r][s]=pole[r-1][s];

else

pole[r][s]=pole[r][s-1];

}

}

printf("Twin Towers #%llin",z);

printf("Number of Tiles : %llinn",pole[n][m]);

scanf("%lli %llin",&m,&n);

}

return 0;

}for (long k=1; k<=n; k++) scanf("%lli",&b[k]);

nuluj(m,n,&pole[0]);

for (long j=1; j<=m; j++) {

if (a[j]==b[1]) pole[1][j]=1;

}

for (long r=2; r<=n; r++)

for (long s=1; s<=m; s++) {

if (a[s]==b[r]) {pole[r][s]=pole[r-1][s-1]+1;}

else {

if (pole[r-1][s]>pole[r][s-1]) pole[r][s]=pole[r-1][s];

else

pole[r][s]=pole[r][s-1];

}

}

printf("Twin Towers #%llin",z);

printf("Number of Tiles : %llinn",pole[n][m]);

scanf("%lli %llin",&m,&n);

}

return 0;

}