我的收藏夹

· · 个人记录

【树状数组】(基础) ()
【KMP】⚙ filepath: str = input() dic : list = [] while True: ipt = input() if ipt != "DONE": dic.append(ipt) file = open(filepath, "r") output = open("out.cpp", "w") code = file.read() for i in range(dic.len()): code.replace(dic[i], '_' * (i+1)) code_list = code.split('\n') output_str: str = "" for code in code_list: output_str += code.lstrip() if code and code[0] == '#': output_str += '\n' output.write(output_str)