작성
·
81
0
from collections import defaultdict
n_list=defaultdict(int)
a,b=map(int,input().split())
answer=0
list_f=[]
for i in range(0,a):
name=input()
n_list[name]+=1
for i in range(0,b):
name=input()
if name in n_list:
answer+=1
list_f.append(name)
print(answer)
sorted(list_f)
for i in list_f:
print(i)
답변 1
0
n_list=dict()
a,b=map(int,input().split())
list_f=[]
for i in range(0,a):
name=input()
n_list[name]=0
n_list[name]+=1
for i in range(0,b):
name=input()
if name in n_list:
list_f.append(name)
print(len(list_f))
sorted(list_f)
for i in list_f:
print(i)