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 Limit Exceed?求教各位神牛

Posted by lantianjidi at 2008-08-07 12:29:10 on Problem 1026
In Reply To:为什么会Output Limit Exceed?求教各位神牛 Posted by:00748154 at 2008-02-17 13:36:31
> 这就是我的代码,无数次OLE,当然VC里面是正常的~
> #include<iostream>
> #include<cstring>
> #include<memory>
> using namespace std;
> int main()
> {
> 	int p,len,k,n,i;
> 	int a[204],b[204];
> 	int num[204][204];
> 	char str[204],str0[204];
> 	while(cin>>n)
> 	{
> 		if(n==0)
> 			return 0;
> 		memset(b,0,sizeof(b));
> 		memset(num,0,sizeof(num));
> 		for(i=1;i<=n;i++)
> 		{
> 			cin>>a[i];
> 			num[i][0]=i;
> 		}
> 		for(i=1;i<=n;i++)
> 		{
> 			p=i;
> 			while(1)
> 			{
> 				b[p]++;
> 				i=a[i];//注意这个位置,与for循环中i相同,换另一个索引
> 				num[p][b[p]]=i;
> 				if(i==p)
> 					break;
> 			}
> 		}
> 		while(1)
> 		{
> 			cin>>k;
> 			if(k==0)
> 				break;
                       getchar();//加上输入空格的语句 
> 		    cin.getline(str,200);
> 		    len=strlen(str);
> 		    for(i=len;i<=n;i++)
> 			    str[i]=' ';
> 			for(i=1;i<=n;i++)
> 				str0[num[i][k%b[i]]]=str[i];
> 		    for(i=1;i<=n;i++)
> 			    cout<<str0[i];
> 		    cout<<endl;
> 		}
> 		cout<<endl;
> 	}
> }
> 
> 
> 
> 
> 

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