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

请教该算法的正确性(我好像可以证明,但一直WA),感激不尽

Posted by ghost_wei at 2006-08-17 19:14:47 on Problem 2942
先找出连通块,对每一个连通块,如果该连通块含奇回路,那么该连通块的所有点都可行。
这样找奇回路:从任一点开始进行标号,如果某节点被标为1,则与之相邻的将被标为2。反之亦然。如果有点既被标为1,又被标为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