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

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

code_blocks
مسئله مربوطه: ماراتون پینگ پنگ (#16) arrow_outward
verified
وضعیت داوری نهایی: پذیرفته شد
terminal
زبان برنامه‌نویسی: Python
schedule
ارسال‌کننده و زمان:
Ali Kheirandish (۱ سال پیش)
descriptionsolution.py ۲۱ خط • ۲۷۵ بایت
1import math
2
3n = int(input())
4
5counter = 1
6
7
8def nextone(n):
9 half = int(math.sqrt(n)) + 1
10 for i in range(2, half):
11 if n % i == 0:
12 n = int(n / i)
13 return n
14 return 1
15
16
17while n != 1:
18 n = nextone(n)
19 counter += 1
20
21print(counter)
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8