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

Обсуждение задачи 1198. Коррупция

subj
Try to use cash.
Why cash?
More explanations may be?
At me too a problem on 21 test.

Please, Help to solve this problem
What do U mean "cash"? How to do it?
Will it be quicker?
Thanks.
It's obviously a directed graph. We find its strongly-connected-components. Now if one of the vertices in one component satisfies the problem the other vertices in its component do. so we merge each component into one vertex. the remaining graph is a DAG (directed acyclic graph). the component which its in-degree is zero is the answer. and if there are more than one component with in-degree==zero then we have no answer because the graph is not connected.