Merged in DR v1.0.0.2

This commit is contained in:
codemann8
2022-03-27 14:56:16 -05:00
35 changed files with 2376 additions and 693 deletions

View File

@@ -1,12 +1,11 @@
#!/usr/bin/env python3
import os
import re
import operator as op
import subprocess
import sys
import xml.etree.ElementTree as ET
from collections import defaultdict
from functools import reduce
from math import factorial
from itertools import count
@@ -133,12 +132,9 @@ def kth_combination(k, l, r):
def ncr(n, r):
if r == 0:
if r == 0 or r >= n:
return 1
r = min(r, n-r)
numerator = reduce(op.mul, range(n, n-r, -1), 1)
denominator = reduce(op.mul, range(1, r+1), 1)
return numerator / denominator
return factorial(n) // factorial(r) // factorial(n-r)
entrance_offsets = {