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

Обсуждение задачи 1003. Чётность

1003-Classical problem?
Послано svr 12 июн 2007 14:24
Got Ac by using serious algorithm of building spanning forest in bipartite graph of segment’s ends only.
All simple “sport’s” attempts are failed because of TLE.
Fist mistake in answers  found when meet chord [a,b] in some tree of the forest but dist[a]+dist[b]+ves([a,b]) is odd;
 Dist[]- Boolean function of distances from roots of trees to their nodes.
Basic operation- link of two trees when new arc [a,b] connects to different trees.
For each node v tree[v]- tree, containing v- helpful array.
For linking trees used vector<int>Smeg[5000]- as dynamic structure of the Graph.
And BFS when second tree linking to the first one.
Such difficult problem must be described somewhere except for timus or why >1000 authors had solved it.
P.S. Bad data y>len, x>y doesn’t presence in test1(I verified it).

Edited by author 12.06.2007 14:25
Re: 1003-Classical problem?
Послано MikleB 6 фев 2008 05:27
Я делал намного проще)) просто dfs на наличие циклов нечетной длины
Re: 1003-Classical problem?
Послано svr 6 фев 2008 22:03
Write your algo in psevdocod and I will mine!
It is most helpfull to find core of the problem.