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

They above r saying : it's very difficult (more than u think) .. :>

Posted by JUDAS at 2006-02-09 21:36:41 on Problem 2520
In Reply To:why tle???????????? Posted by:suby at 2006-01-12 10:09:34
> #include <stdio.h>
> #include <math.h>
> #include <string.h>
> #include <limits.h>
> char s1[50010],s2[50010];
> int n1,n2;
> int t[50003],b[50003];
> int d[4][4]={{0,5,5,5},{5,0,4,5},{5,4,0,5},{5,5,5,0}};
> int main()
> {
> 	int i,j,check;
> 	while(scanf("%s",s1)!=EOF)
> 	{
> 		if(scanf("%s",s2)==EOF)
> 			break;
> 		n1=(int)strlen(s1);
> 		n2=(int)strlen(s2);
> 		for(i=0;i<n1;i++)
> 		{
> 			switch(s1[i])
> 			{
> 			case 'A':
> 				s1[i]=0;
> 				break;
> 			case 'G':
> 				s1[i]=1;
> 				break;
> 			case 'C':
> 				s1[i]=2;
> 				break;
> 			case 'T':
> 				s1[i]=3;
> 				break;
> 			}
> 		}
> 		for(i=0;i<n2;i++)
> 		{
> 			switch(s2[i])
> 			{
> 			case 'A':
> 				s2[i]=0;
> 				break;
> 			case 'G':
> 				s2[i]=1;
> 				break;
> 			case 'C':
> 				s2[i]=2;
> 				break;
> 			case 'T':
> 				s2[i]=3;
> 				break;
> 			}
> 		}
> 		check=10;
> 		i=0;
> 		j=i-n1/check;
> 		if(j<0)
> 			j=0;
> 		for(;j<=i+n1/check && j<=n2;j++)
> 		{
> 			b[j]=100000000;
> 		}
> 		b[0]=0;
> 		for(i=0;i<=n1;i++)
> 		{
> 			j=i-n1/check;
> 			if(j<0)
> 				j=0;
> 			for(;j<=i+n1/check && j<=n2;j++)
> 			{
> 				t[j]=b[j];
> 			}
> 			j=i+1-n1/check;
> 			if(j<0)
> 				j=0;
> 			for(;j<=i+1+n1/check && j<=n2;j++)
> 			{
> 				b[j]=100000000;
> 			}
> 			j=i-n1/check;
> 			if(j<0)
> 				j=0;
> 			for(;j<=i+n1/check && j<=n2;j++)
> 			{
> 				if(i<n1 && j<n2 && b[j+1]>d[s1[i]][s2[j]]+t[j])
> 					b[j+1]=d[s1[i]][s2[j]]+t[j];
> 				if(b[j]>3+t[j])
> 					b[j]=3+t[j];
> 				if(t[j+1]>3+t[j])
> 					t[j+1]=3+t[j];
> 			}
> 		}
> 		printf("%d\n",t[n2]);
> 	}
> 	return 0;
> }
> 
> this is my code.
> 
> please help me

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