ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1106. Две команды

Some hints how to solve it
Послано Moonstone 7 июн 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
Послано ile 26 июн 2010 01:17


Edited by author 26.06.2010 04:17
Re: Some hints how to solve it
Послано suhanov 2 май 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
Послано sylap 16 окт 2012 22:27
If someone has no friends, there is no answer !!
Re: Some hints how to solve it
Послано ViktYusk 28 авг 2016 01:16
suhanov писал(a) 2 мая 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)