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

WA#8 Time Limit(Python)
Posted by PlotnikovPhilipp 24 Oct 2019 17:51
Не могу понять, что не так.
# -*- coding: utf-8 -*-
n, k = [int(i) for i in input().split()]
currentAmount = 1
result = 0
while currentAmount < n:
    if currentAmount <= k:
        currentAmount += currentAmount
    elif currentAmount > k:
        currentAmount += k
    result += 1
print(result)

Edited by author 24.10.2019 17:58