ひまつぶし
ひまつぶし def maxof(xs, fn): ma = fn(xs[0]) for x in xs: tmp = fn(x) if ma < tmp: ma = tmp return tmp def radix_sort(xs, M): bs = [[] for i in range(M)] N = maxof(xs, len) checks = [0 for _ in range(M)] for x in xs: bs[int(x[-1])].append(…
ひまつぶし def maxof(xs, fn): ma = fn(xs[0]) for x in xs: tmp = fn(x) if ma < tmp: ma = tmp return tmp def radix_sort(xs, M): bs = [[] for i in range(M)] N = maxof(xs, len) checks = [0 for _ in range(M)] for x in xs: bs[int(x[-1])].append(…