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:终于过了!!粘我的代码,让后来者少走弯路啊!

Posted by libojie at 2009-02-21 20:40:57 on Problem 1657
In Reply To:终于过了!!粘我的代码,让后来者少走弯路啊! Posted by:bjtu1 at 2008-08-17 09:57:40
您的代码可能AC了,但并不是一个正确的代码。
注意这句:
else if(dist2==0&&dist1%2!=0){
	n1=dist2;
应改为n1=dist1,否则n1就变成0了。
另外,代码不必如此繁琐,只要对n1,n2,n3,n4分别判断,必要时合并,就可以缩短代码长度。
优化的关键在于将n4按奇偶性分别判断。

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