Snippets

cia_rana 言語不問:取り違えは何通り?

Created by cia_rana last modified
# 完全順列, 攪乱順列, derangement
p gets.to_i.times.inject([0,1]){|(a,b),i|[b,i*(a+b)]}[1]

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.