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

这题是不是把所有可能的对角线全部算出来,然后再判断相同长度的对角线能不能组成正方形?

Posted by newpoo at 2007-01-05 17:21:27 on Problem 2002
我用n^2时间求所有可能的对角线,并把它插入到hash_multimap里面,同时保存所有可能的对角线长度

然后依次用这些可能的长度去查询hasm_multimap,每次得到m个长度相同的对角线

再然后用m^2的时间去判断这m个对交线可以组成多少个正方行

但是总是TLE,有没有更好的方法啊?



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