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

Test #13 (Java 1.8)
Posted by Landsknecht 7 Mar 2016 13:24
Guys, I have no idea why it doesn't pass this test. Any suggestions?


public static int getMinutes(int n, int k) {
        if (k == 1){
            return n * 2;
        } else if ( k >= n)  {
            return 2;
        } else if (n > k) {
            return n - k + 2;
        }
        return 0;
    }
Re: Test #13 (Java 1.8)
Posted by Jane Soboleva (SumNU) 7 Mar 2016 13:59
Some old topics already have a formula, it's somewhat more complicated.
Like http://acm.timus.ru/forum/thread.aspx?id=28149&upd=634820862722440446