#Python 2, (削除) 54 (削除ここまで) 46 bytes
Python 2, (削除) 54 (削除ここまで) 46 bytes
This is a very very very! fast, iterative solution.
n=r=input();k=2
while k<n:r=r*n+k;k+=1
print r
There's no recursion, so it works for large input. Here's the result of n = 17000 (takes 1-2 seconds):
#Python 2, (削除) 54 (削除ここまで) 46 bytes
This is a very very very! fast, iterative solution.
n=r=input();k=2
while k<n:r=r*n+k;k+=1
print r
There's no recursion, so it works for large input. Here's the result of n = 17000 (takes 1-2 seconds):
Python 2, (削除) 54 (削除ここまで) 46 bytes
This is a very very very! fast, iterative solution.
n=r=input();k=2
while k<n:r=r*n+k;k+=1
print r
There's no recursion, so it works for large input. Here's the result of n = 17000 (takes 1-2 seconds):
#Python 2, 54(削除) 54 (削除ここまで) 46 bytes
This is a veryveryvery! fast, iterative solution.
lambda n:n**~-n+sum(n**~-i*n=r=input(n-i)for i;k=2
while ink<n:r=r*n+k;k+=1
print range(1,n-1))r
There's no recursion, so it works for large input. Here's the result of n = 17000 (takes 1-2 seconds):
#Python 2, 54 bytes
This is a very fast, iterative solution.
lambda n:n**~-n+sum(n**~-i*(n-i)for i in range(1,n-1))
There's no recursion, so it works for large input. Here's the result of n = 17000:
#Python 2, (削除) 54 (削除ここまで) 46 bytes
This is a veryveryvery! fast, iterative solution.
n=r=input();k=2
while k<n:r=r*n+k;k+=1
print r
There's no recursion, so it works for large input. Here's the result of n = 17000 (takes 1-2 seconds):
#Python 2, 54 bytes
This is a very fast, iterative solution.
lambda n:n**~-n+sum(n**~-i*(n-i)for i in range(1,n-1))
There's no recursion, so it works for large input. Here's the result of n = 17000: