How do we optimize code?

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

arr = input().split()
M = int(arr[0])
N = int(arr[2])

X = 1
elevator = 1
start_n = 0

while start_n != N:
    if X < M:
        X += 1
        start_n += 1

    else:
        elevator += 1
        X = 1

print(elevator)

How can I make it faster?

python

2022-09-20 15:13

1 Answers

It looks like NYPC question number three If so, please drop the article.


2022-09-20 15:13

If you have any answers or tips


© 2022 pinfo. All rights reserved.