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

Re:为什么一直是output limited exceed啊!那为高手帮忙看看,谢谢了!

Posted by mccxj at 2006-04-25 01:59:54 on Problem 1056
In Reply To:为什么一直是output limited exceed啊!那为高手帮忙看看,谢谢了! Posted by:lianxi at 2005-04-22 19:27:19
Source

Problem Id:1056  User Id:mccxj 
Memory:196K  Time:0MS
Language:G++  Result:Accepted

Source 

#include <iostream.h>
#include <string.h>

int set=1;
char get[10][15];
int i,j,k;
int count=1;

void fun()
{
	for(i=0;i<count-1;i++)
	{
		for (j=i+1;j<count;j++)
		{
			for(k=0;get[i][k]!='\0'&&get[j][k]!='\0';k++)
			{
				if (get[i][k]!=get[j][k]) break;
			}
			if (get[i][k]=='\0'||get[j][k]=='\0')
			{
				cout<<"Set "<<set++<<" is not immediately decodable"<<endl;
				count=1;
				return;
			}			
		}
	}
	cout<<"Set "<<set++<<" is immediately decodable"<<endl;
	count=1;
	return;
}

int main()
{
	while (cin>>get[0])
	{
		for(i=1;;i++)
		{
			cin>>get[i];
			if (strcmp(get[i],"9")==0) break;
			count++;
		}
	//	cout<<count<<endl;
		fun();
	}
	return 0;
}

懒得自己打。。copy了你的。改了。。ac

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