This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
from math import sqrt
n = int(input())
divs = []
for i in range(2, floor(sqrt(n))+1):
if n%i==0:
divs.append(i)
if i != n//i:
divs.append(n//i)
divs.sort()
divs.append(n)
sus = [set() for i in range(n+1)]
sus[1].add(0)
for i in range(1,n+1):
for j in divs:
if n%(i*j): continue
for k in sus[i]:
sus[i*j].add(k+j-1)
print(len(sus[-1]))
print(" ".join(map(str, sorted(list(sus[-1])))))
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |