摘要:
def kmp_match(tex, pat): n = len(tex) m = len(pat) tex = '0' + tex pat = '0' + pat pi = [] pi.append(0) pi.append(0) p = 0 for i in range(2, m + 1): ... 阅读全文
摘要:
def shai(n): prim = list() check = list([1] * (n + 1)) for i in range(2, n + 1): if(check[i] == 1): prim.append(i) print(i) for j in prim: if(... 阅读全文