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

Обсуждение задачи 1425. Ферзь 2

Anybody can help? i got wa#10
Послано Dan.hu 27 фев 2007 17:53
Re: Anybody can help? i got wa#10
Послано KIRILL(ArcSTU) 28 фев 2007 03:30
Try this tests

5 100
1 1 1 1 1
-------
196120

5 100
50 50 50 50 50
-------
858180

4 100
1 1 1 1 1
--------
112912


Re: Anybody can help? i got wa#10
Послано svr 28 фев 2007 07:52
How many new positions maximal number may be?
It seems that it is not very much.
Therefore we may don't use clear combinatorical approach
but just build each new position acording roules of
king moving , put it in set and set itself esclude multuples. This is not mathematic but just
context's way. If new positions number too much
and we have TLE we may count mathematically simple
subset as two roork's moving and for rest use set's
approach.
But going this way I have TLE14

Edited by author 28.02.2007 10:01
Re: Anybody can help? i got wa#10
Послано svr 28 фев 2007 10:06
Not Tle14,MLE14
Re: Anybody can help? i got wa#10
Послано KIRILL(ArcSTU) 28 фев 2007 13:43
Max answer is 858180 I think
5 100
50 50 50 50 50
Probably it's 16 test
Potentially queen can reach ~3000000 cells, but
many of them coincide. I just choose different from this
I hash 5 byte to 4