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

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

3,14 Where is the error in the logic? [2] // Задача 1023. Пуговицы 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? [1] // Задача 1023. Пуговицы 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!!!
Megas Re: Where is the error in the logic? // Задача 1023. Пуговицы 31 авг 2007 21:24
I have tried to write such prog. But it gives WA#11.