|
|
вернуться в форумWA4!!HELP Wrong answer 4. HELP!!!! Edited by author 03.06.2016 17:42 Edited by author 03.06.2016 17:42 Re: WA2!!HELP What did you try? What's your solution/idea so far? Re: WA4!!HELP #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 Wrong answer 4! Edited by author 03.06.2016 17:30 Edited by author 03.06.2016 17:41 Re: WA2!!HELP pls help me! Re: WA4!!HELP try 100 10 ans is 13 |
|
|