Submission #147151

#TimeUsernameProblemLanguageResultExecution timeMemory
147151jh05013Toys (CEOI18_toy)Pypy 2
100 / 100
1986 ms89928 KiB
range = xrange n = int(raw_input()) div = set() for i in range(1, 100000): if n%i: continue div|= {i, n//i} div = sorted(div) dp = {} def add(n): if n == 1: return {0} if n in dp: return dp[n] ans = set() for d in div: if d == 1 or n%d: continue ans|= {d-1+x for x in add(n//d)} dp[n] = ans return ans S = add(n) print(len(S)) for x in sorted(S): print x,
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...