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:求解sort和stable_sort的区别?

Posted by 416221843 at 2017-07-09 13:24:40 on Problem 1679
In Reply To:Re:求解sort和stable_sort的区别? Posted by:416221843 at 2017-07-09 13:15:41
> 同问..讨论区所有数据都过 蜜汁wa好久 改成stable_sort就ac了..
突然想到 我的算法是先求最小生成树 依次不取第k条(0<k<n)边 再求n-1次 如果这n-1次有和最小生成树相等的 则不唯一 
因为是无向边 每次不取第k边时 边数+2 稳定排序保证相反的2条边一定在一起 +2就刚好跳过这个无向边 但直接根据权sort 权相等的边顺序会乱 +2时就可能跳过的不是方向相反的一对边 

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