ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1023. Buttons

Where is the error in the logic?
Posted by 3,14 13 May 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?
Posted by Виктор Крупко 13 May 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?
Posted by Megas 31 Aug 2007 21:24
I have tried to write such prog. But it gives WA#11.