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 1131. Copying

WA4!!HELP
Posted by elsukov43 3 Jun 2016 15:56
Wrong answer 4. HELP!!!!

Edited by author 03.06.2016 17:42

Edited by author 03.06.2016 17:42
Re: WA2!!HELP
Posted by morbidel 3 Jun 2016 16:32
What did you try? What's your solution/idea so far?
Re: WA4!!HELP
Posted by elsukov43 3 Jun 2016 16:43
#include "iostream"
using namespace std;


int main()
{
    int n, k, hours = 0, game = 1, free, i = 0, j = 0;
    cin >> n >> k;
    free = k;
    if (n == 1) hours = 0;
    else
    {
        while ((free > i) && (game < free) && (game <= n))
        {
            i++;
            n -= i;
            hours++;
            game += i;
        }
        while (j < n-1)
        {
            hours++;
            j += k;
        }
    }
    cout << hours << endl;

    return 0;
}

Edited by author 03.06.2016 17:44
Re: WA2!!HELP
Posted by elsukov43 3 Jun 2016 16:43
Wrong answer 4!

Edited by author 03.06.2016 17:30

Edited by author 03.06.2016 17:41
Re: WA2!!HELP
Posted by elsukov43 3 Jun 2016 17:31
pls help me!
Re: WA4!!HELP
Posted by MassterMax 20 Nov 2017 00:34
try 100 10
ans is 13