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
欢迎参加IJCAI 2020麻将智能体竞赛,大奖等你拿!Welcome to IJCAI 2020 Mahjong AI competition with amazing prizes! | 北京大学《ACM/ICPC大学生程序设计竞赛训练》暑期课面向全球招生!

69s-->460ms......

Posted by userfriendly at 2009-03-20 21:06:25 on Problem 3277
In Reply To:我想写个线段树把1151和这个一起A了,结果在这个上面TLE了。。。 :P Posted by:userfriendly at 2009-03-19 20:05:33
重写以后弄40000的测试数据跑了69秒,搞了半天,最后在线段树insert方法里面加入了以下一句
if(st[t*2+1]==st[t*2+2])
	st[t]=st[t*2+1];
就是把可以合并的区间合并起来,把时间效率从最坏提到平均。
再跑数据,460ms。。。。。。。。。。。。。

感叹。

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