답안 #785367

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
785367 2023-07-17T08:45:03 Z beaconmc Toys (CEOI18_toy) PyPy 3
0 / 100
53 ms 20432 KB
from math import isqrt
n = int(input())

divs = []
for i in range(2, isqrt(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])))))
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 20432 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 20432 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 20432 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 20432 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 20432 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -