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

Moonstone Some hints how to solve it [4] // Problem 1106. Two Teams 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).
ile Re: Some hints how to solve it [3] // Problem 1106. Two Teams 26 Jun 2010 01:17


Edited by author 26.06.2010 04:17
suhanov Re: Some hints how to solve it [2] // Problem 1106. Two Teams 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:)
sylap Re: Some hints how to solve it // Problem 1106. Two Teams 16 Oct 2012 22:27
If someone has no friends, there is no answer !!
ViktYusk Re: Some hints how to solve it // Problem 1106. Two Teams 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)