arrow_forward همه ارسال‌ها

جزئیات ارسال کد#219

code_blocks
مسئله مربوطه: ماراتون پینگ پنگ (#16) arrow_outward
verified
وضعیت داوری نهایی: محدودیت زمان تست 5
terminal
زبان برنامه‌نویسی: Python
schedule
ارسال‌کننده و زمان:
Mujtablue io (۳ سال پیش)
descriptionsolution.py ۱۷ خط • ۳۸۹ بایت
1def pong(receive: int) -> int:
2 potential_service = receive - 1
3 for service in range(potential_service, 0, -1):
4 if not bool(receive % service):
5 return service
6
7
8bounce = 1
9def ping(ball: int, bounce: int) -> int:
10 while ball > 1:
11 bounce += 1
12 ball = pong(ball)
13 return bounce
14
15
16ball = int(input())
17print(ping(ball, bounce))
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8