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

大虾们,我要崩溃了,VC运行可以,为啥就是无法AC呢?

Posted by huangjing1987 at 2009-08-22 17:08:30 on Problem 1007
#include<iostream>
using namespace std;
int main()
{
	char f[60][90];
	long p[60]={0},q;
	int a,b;

	cin>>a>>b;
	for(int i=0;i<b;i++)
	{	
		for(int j=0;j<a;j++)
		{
			cin>>f[i][j];
		}
		f[i][a]=NULL;
		for(int k=0;k<a-1;k++)
			for(int l=k+1;l<a;l++)
			{
				if((f[i][k]=='C')&&(f[i][l]=='A'))
				{
					p[i]++;
				}else
				if((f[i][k]=='G')&&((f[i][l]=='C')||(f[i][l]=='A')))
				{
					p[i]++;
				}else
				if((f[i][k]=='T')&&((f[i][l]=='C')||(f[i][l]=='A')||(f[i][l]=='G')))
				{
					p[i]++;
				}
			}		
	}

	for(int x=0;x<b;x++)
	{
			q=x;
		for(int y=0;y<b;y++)
		{
			if(((p[q]>p[y])||(p[q]==-1))&&(p[y]!=-1))
			{
				q=y;
			}

		}
		cout<<f[q]<<endl;
		p[q]=-1;
	
	}
	return 0;
}

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