Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:终于过了!!粘我的代码,让后来者少走弯路啊!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator