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

那些用c++和kruskal+并查集TLE的童鞋可以参考一下

Posted by CPPTestID at 2015-01-26 19:10:19 on Problem 3723
楼主当初是cin输入超时 改成scanf就好
poj貌似不支持ios::sync_with_stdio(false);的优化
至于不是输入超时的
那可能是你算法太复杂 常数因子太大
之前这题有人TLE 也是kruskal+并查集 输入用的scanf
估计他超时在他的并查集用的动态分配内存
建议改成大数组的形式

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