Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

YM的short

Posted by without2002 at 2008-05-18 21:29:58 on Problem 1159 and last updated at 2008-05-18 21:32:28
#include<stdio.h>
//#include<string.h>

short s[5001][5001];
char str[5001];
//char temp[5001];
/*
int f(int n)
{
	int i,j;
//	for(i=n-1,j=0;i>=0;j++,i--)
//		temp[j]=str[i];
	for(i=0;i<n;i++)
		s[0][i]=0;
	for(i=0;i<n;i++)
		s[i][0]=0;
//	temp[n]='\0';
//	puts(temp);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(str[i-1]==str[n-j])
				s[i][j]=s[i-1][j-1]+1;
			else
				s[i][j]=s[i-1][j]>s[i][j-1]?s[i-1][j]:s[i][j-1];
		//	printf("%d ",s[i][j]);
		
		}
	//	printf("\n");
	}
	return n-s[n][n];
}
*/


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator