최대공약수, 최소공배수
```py def gcd(a, b): while b: a, b = b, a % b return a
```py def gcd(a, b): while b: a, b = b, a % b return a
```py def prim(s, V): result = 0 mst = [0] * (V + 1) mst[s] = 1
조합 def combi(arr, r): for i in range(len(arr)): if r == 1: yield [arr[i]] else: for next in combi(arr[i + 1:], r ...
최대 힙 ```py def enq(v): global last last += 1 arr[last] = v c = last p = c // 2 while p >= 1 and arr[p] < arr[c]: arr[p]...
```py def partitionH(start, end): pivot = start lp = start + 1 rp = end while lp <= rp: while lp <= end and arr[pivot] >= ar...