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

Обсуждение задачи 1128. Деление на группы

(to anyone who got AC): Is "NO SOLUTION" impossible for your AC?
Послано Locomotive 7 мар 2003 12:22
Re: (to anyone who got AC): Is "NO SOLUTION" impossible for your AC?
Послано Tiberiu Danet 7 мар 2003 13:02
Yes.
SO may you tell me a test which its answer "NO SOLUTION"?
Послано Locomotive 7 мар 2003 20:15
> Yes.
Re: SO may you tell me a test which its answer "NO SOLUTION"?
Послано Tiberiu Danet 8 мар 2003 01:52
You asked if "No solution" is impossible. My answer was yes. So I'm
saying that such a test doesn't exist.
+^^+
Послано Locomotive 8 мар 2003 16:58
Thanks! it was matter of bad English for such an Iranian Boy...
Can you help me a little bit more?
which algorithm i should use?
DFS and BFS dont help...
Brute Force doesn`t seem beauty ;)!
Please Help Me
Best
Aidin_n7@hotmail.com
Re: +^^+
Послано Tiberiu Danet 9 мар 2003 20:16
First put every child into the first team.
Then while there exists a child who has more than one opponent in his
team, just move him to the other team.
but i think it wont be so simple r u sure it is correct?
Послано Locomotive 9 мар 2003 23:48
Thanks! me and also my friends got AC :P
Послано Locomotive 10 мар 2003 18:13
>
Re: Thanks! me and also my friends got AC :P
Послано charles.king 1 апр 2004 08:19
I don't know how. Could you explain it for me? Thank you very much!
Re: +^^+
Послано lamer 27 мар 2005 19:38
Can you give me a code, plz?
Re: +^^+
Послано Sandro 12 июл 2005 17:46
The idea really works. But did you prove that this algo is correct? (Why will it finish the work in a finite number of steps?)
It seems so...
Послано Spatarel Dan Constantin 26 мар 2006 19:12


Edited by author 27.03.2006 01:16
It seems so...
Послано Spatarel Dan Constantin 26 мар 2006 19:23
Re: +^^+
Послано shrek 6 ноя 2006 11:42
It works because in each step number of edges between the two parts increases and obviously it can't be more than E.
Nice idea, and very nice proof [-]
Послано Chmel_Tolstiy 27 июл 2007 14:11
Nice idea, and very nice proof [-] +1 !
Послано Eric Alejandro Destefains 14 авг 2009 02:15
XD
Re: +^^+
Послано svr 26 ноя 2011 08:40
This proof incomplete and doesn't shed light to the point.
We should add next: if person Q on the left side have >=2 enemy on the left
then he don't have more than 1 enemies in persons on the right
because in other case he would have >=4 enemies.

Edited by author 26.11.2011 08:42
termination proof
Послано Aneto 13 янв 2013 01:48
It is clear that if proposed algorithm terminates then we have found a solution. But does it allways terminate? I will try to add my 5 cents by giving a short yet complete proof of termination.

Let us first introduce the decreasing measure M. We define M to be equal to the number of edges of the graph on the same(!) side. Algorithm terminates if measure decreases with each iteration of algorithm. Let us consider 3 possible situations:

1) We change side of a child with 3 enemies on his side. Then M decreases by 3.
2a) We change side of a child with 2 enemies on his side and 0 enemies on other side. Then measure decreases by 2.
2b) We change side of a child with 2 enemies on his side and 1 enemy on other side. Then M decreases by 2 and increases by 1.
3) If child has only one enemy on his side, then we do nothing.

According to described cases M will decrease after each iteration. Hence, algorithm terminates.

Hope this helps :)