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

Обсуждение задачи 1208. Соревнование легендарных команд

How I solved it! :D
Послано GastonFontenla 20 авг 2015 13:31
Hi! After 3 algorithms, I finally nailed it!. Don't try coloring, doesn't work. What I did:

First, convert the teams onto nodes, and create ONE bidirectional edge between two teams when these team are sharing one or two contestants. Then, I make a pair array, and save, in decreasing order, the grades of the nodes ant their "names" (I used  numbers). When I have that ordered array, I delete the nodes when have more than zero adjacent nodes. If have zero adjacent, means that the team is non-sharing any contestant. When you deleted a node, don't need to reorder the grades array. Finally, return the total initial nodes minus the times that I had deleted teams. Hope it helps you. Bye!