题解 | #数据分类处理#
数据分类处理
http://www.nowcoder.com/practice/9a763ed59c7243bd8ab706b2da52b7fd
def func(i): li = [] for index,value in enumerate(lst_i): if str(i) in value: li.extend([str(index),value]) return li def main(): lst = [] for i in lst_r: li = func(i) if li: li = [str(i)]+[str(len(li)//2)]+li lst += li print(" ".join([str(len(lst))]+lst)) while True: try: lst_i = input().split()[1:] lst_r = [int(i) for i in input().split()][1:] lst_r = list(set(lst_r)) lst_r.sort() main() except: break