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 |
a hint如何不通过比较得出两个数x,y中的较大者和较小者? 如果你会这个就能明白题目的转化了 然后分别x轴和y轴求哈密顿距离,想想相邻两个值的联系就可以排序后o(n)得出 ps.给出解答 让a=x+y,b=abs(x-y); max=(a+b)/2,min=(a-b)/2 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator