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

Kruskal C++TLE G++ 300ms+ 水过 分享几点优化

Posted by flywarrior at 2012-09-12 00:46:59 on Problem 1751
1.不用计算距离 , 即 不用sqrt() 因为这道题没有要求算距离
2.建边时for(i,0,n){ for(j,i+1,n){...}}
3.已有的边直接把它们用并查集并到一块 不用什么把它们距离设为0在加进去

但是我不知道为什么C++ 会TLE,向大神们请教下为什么?
代码:http://fayaa.com/code/view/27227/
ps:我不是贴代码,我是想知道为什么C++会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