ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1106. Two Teams

Some hints how to solve it
Posted by Moonstone 7 Jun 2010 19:11
1. Answer always exists.
2. Use DFS for all unmarked vertices and mark them: if current vertex is marked as x, all next must be marked as (x + 1) % 2. (0->1, 1->0)
3. Then just print all vertices marked by 0 (or 1).
Re: Some hints how to solve it
Posted by ile 26 Jun 2010 01:17


Edited by author 26.06.2010 04:17
Re: Some hints how to solve it
Posted by suhanov 2 May 2011 01:16
I think, it doesn't need to use DFS. If the edge hasn't incident edges that belong to the first team, we add this edge to the fisrt team. That's all:)
Re: Some hints how to solve it
Posted by sylap 16 Oct 2012 22:27
If someone has no friends, there is no answer !!
Re: Some hints how to solve it
Posted by ViktYusk 28 Aug 2016 01:16
suhanov wrote 2 May 2011 01:16
I think, it doesn't need to use DFS. If the edge hasn't incident edges that belong to the first team, we add this edge to the fisrt team. That's all:)
Thanks, you very helped me)