|
|
вернуться в форумProbably wrong example and checking in task. 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. 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. |
|
|