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:有用C写过的没??怎么写不超时啊???我写的超时,郁闷,牛子指点下

Posted by runformydream at 2009-08-03 21:34:46 on Problem 2833
In Reply To:有用C写过的没??怎么写不超时啊???我写的超时,郁闷,牛子指点下 Posted by:bootshl at 2008-07-26 13:23:25
你没看题吧!!!!
题目说了size<5000000,所以n1,n2都很大的,你50的数组显然小了

最关键的是,你的算法错了
按照这个题目,由于数据量大,又限制了内存,所以开题目那么大的数组会MML,
正确的一个算法是用两个优先队列进行模拟,一个大顶,一个小顶,具体怎么做你自己再想下
PS:你没看懂题

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