Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #факторизация с помощью решета Эратосфена a[i] = 0 если число простое, a[i] = j - делителю числа
- n = 100000
- a = [0] * (n + 1)
- i = 2
- while i * i <= n:
- if not a[i]:
- for j in range(i * i, n + 1, i):
- a[j] = i
- i+= 1
- y = int(input())
- b = []
- while a[y]:
- b.append(a[y])
- y //= a[y]
- b.append(y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement