Skip to content

Instantly share code, notes, and snippets.

View buvanenko's full-sized avatar
🌗
чили лили бу

Gleb Buvanenko buvanenko

🌗
чили лили бу
View GitHub Profile
from functools import reduce as red; from math import \
(factorial as fact, comb);import sys;from decimal import \
(getcontext as c,Decimal as dc);(a:=range,
b:=int(sys. argv[1]));c\
().prec=b; ber=lambda\
e,f=[dc(1)]: [f.append(
1-sum(comb(h ,g)*f[g]/(h
- g + 1) for g in a(h)))for
h in a(1, e + 1)] and abs(
f[-1]);print ((2 * fact(b) /