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

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

Ilya Semenov (NSU) please give a hint! [3] // Задача 1063. Домино 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);
    }
}
Petko Minkov Re: please give a hint! [2] // Задача 1063. Домино 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.
The graph should be connected only with regard to non-isolated nodes.