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

Обсуждение задачи 1063. Домино

please give a hint!
Послано Ilya Semenov (NSU) 4 мар 2001 13:28
I only use bruteforce and I constantly get WA at first easy
tests (execution time is 0.01).
All the test I was able to imagine passed OK with no
corrections to the code...

I assume dominoe graph is ok when 1) there are no more than
two 'even' verteces AND 2) the graph is connected.

in main() I call func(0)
where func(int) is (simplified)

void func(int p) {
    if(p==6) return;
    if(ok()) save_this();
    for(i=1;i<=6;i++)for(j=i;j<=6;j++) {
        place_dominoe(i,j);
        func(p+1);
        remove_dominoe(i,j);
    }
}
Re: please give a hint!
Послано Petko Minkov 4 мар 2001 18:21
> I only use bruteforce and I constantly get WA at first
easy
> tests (execution time is 0.01).
> All the test I was able to imagine passed OK with no
> corrections to the code...
>
> I assume dominoe graph is ok when 1) there are no more
than
> two 'even' verteces AND 2) the graph is connected.
>


> in main() I call func(0)
> where func(int) is (simplified)
>
> void func(int p) {
>     if(p==6) return;
>     if(ok()) save_this();
>     for(i=1;i<=6;i++)for(j=i;j<=6;j++) {
>         place_dominoe(i,j);
>         func(p+1);
>         remove_dominoe(i,j);
>     }
> }
>

if the graph is connected and two odd(!) or no odd vertices,
so the graph is Euler one.
Shame on me!! I should have carefully read the output format specification! (-)
Послано Ilya Semenov (NSU) 5 мар 2001 10:53
Re: Shame on me!! I should have carefully read the output format specification! (-)
Послано Denis Koshman 1 авг 2008 15:30
The graph should be connected only with regard to non-isolated nodes.