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:为什么会TLE?已经是O(n^2logn)的了啊!

Posted by bin3 at 2007-07-03 14:57:12 on Problem 1118
In Reply To:为什么会TLE?已经是O(n^2logn)的了啊! Posted by:caizhicong0503 at 2007-03-19 21:53:24
此题貌似以EOF结束输入,改为while(scanf("%d", &n)==1&&n)就WA了,你在
for(j=1;j<k;j++){
				if(p[j]==p[j-1])	t++;
				else{
					if(Max<t)	Max=t;
					t=1;
				}
			}
外再加一句
if(Max<t)	Max=t;
就可以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