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

Обсуждение задачи 1155. Дуоны

Is it right?
Послано Burunduk1 9 май 2005 12:23
My solution:
1. (A+C+F+H)-(B+D+E+G)=const => if const!=0 then IMPOSSIBLE
2. While we have to destroy some we do two operations. (3,4)
   3. If we can do one of (AB, BC, CD, DA, EF, FG, GH, HE, AE, BF, CG, DH)- we do it.
   4. If AG => BF+ AB- GF-
      If BH => CG+ BC- HG-
      If CE => DH+ CD- EH-
      If DF => AE+ DA- FE-

Why it gets WA #5?
Is it wrong algorithm or wrong realization?

My code:

Here was nearly AC code :)

Edited by author 30.05.2005 05:31
Or give me some tests
Послано Burunduk1 10 май 2005 15:09
Re: Or give me some tests
Послано bug27 10 май 2005 17:17
though I don't know what "2. While we have to destroy some we do two operations. (3,4)" mean, I think you solution is right,because I got AC in the same way.maybe there's some bugs in your code.
not perfectly
Послано Dilyan 13 май 2005 23:30
2, 3 and 4 are right.
1 is wrong. const may be different from 0 when there is a solution
Re: not perfectly
Послано Burunduk1 14 май 2005 02:43
Are you sure? Can you give me example?

I can prove it:
We process operation with pair of vertexes.
The one is in {A,C,F,H} another is in {B,D,E,G}.
So (A+C+F+H)-(B+D+E+G)=const
Supose we already annighilated all 'troubles' then
A=B=C=D=E=F=G=H=0 => const=0 =>
If const is not equal to zero we can't annighilate all 'troubles' => IMPOSSIBLE

What is wrong in it?
Now it is AC
Послано Burunduk1 30 май 2005 05:29
Algorithm is Ok, but in my code was one misprint.