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

Обсуждение задачи 1023. Пуговицы

Where is the error in the logic?
Послано 3,14 13 май 2005 12:21
Let "n + 1" is the number of turns which were made during the game. Then to make the make second player winner the set of inequalities should be correct:
   -
 |k - n <= L
< k - nL > 0
 | n mod 2 = 1
   -

So our task is to find max odd n, where k / n > k - n > 0
I wrote the program which solves this set of inequalities but got an error on the test #3.
Re: Where is the error in the logic?
Послано Виктор Крупко 13 май 2005 17:28
 I argued on another:
Let k is max how many it is possible to take, then the second can make so each time by both would be taken k+1
example:
k=5
1-3 2-3
1-5 2-1
And in a result it is necessary to find min k (n mod (k+1)=0)
It is easy
Good luck!!!
Re: Where is the error in the logic?
Послано Megas 31 авг 2007 21:24
I have tried to write such prog. But it gives WA#11.