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 1820. Ural Steaks

Probably wrong example and checking in task.
Posted by Roman Mikhailov 21 Sep 2012 15:08
The cook must cook the one steak during 2 minutes (each side during 1 minute). Right?

In example n = 3, k = 2, then:
* at first step he cook 2 stake during 2 minutes;
* at second step he cook 1 stake during 2 minutes;
Answer = 2 + 2 (minutes), but in example 3?

If try to send solution based on above logic, checker answered with mistake.

Probably checking occurs on this way (all test passed):

answer == (k >= n) ? 2 : n * 2 / k + ((n*2 % k == 0) ? 0 : 1)

but, more correctly (in my opinion) variant:

answer == (k >= n) ? 2 : n * 2 / k + ((n % k == 0) ? 0 : 1)
Re: Probably wrong example and checking in task.
Posted by Bogatyr 23 Sep 2012 17:56
Your solution to n=3, k=2 is not optimal.   Hint: examine different orderings, trying to keep the frying pan as full as possible all the time.   In your solution, you have the frying pan half empty twice.