Problem p03408 (python)

Fixed submission:
from collections import Counter, defaultdict
n = int(input())
s= []
t = defaultdict(int)
for _ in range(n):
    s.append(input())
u = Counter(s)
m = int(input())
for _ in range(m):
    word = input()
    t[word] -= 1
    if word in u.keys():
        u[word] -= 1

ans = u.most_common(1)[0][1]
t = sorted(t.items(), key=lambda x:x[1], reverse=True)[0][1]
t = max(t, 0)
print(max(ans,t))

Buggy submission (verdict: Runtime Error):
from collections import Counter, defaultdict
n = int(input())
s= []
t = defaultdict(int)
for _ in range(n):
    s.append(input())
u = Counter(s)
m = int(input())
for _ in range(m):
    word = input()
    t[word] -= 1
    if word in u.keys():
        u[word] -= 1

ans = u.most_common(1)[0][1]
t = t.most_common(1)[0][1]
print(max(ans, t))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s, t = []
for _ in range(n):
    s.append(input())
u = Counter(s)
m = int(input())
for _ in range(m):
    word = input()
    if word in u.keys():
        u[word] -= 1

ans = u.most_common(1)[0][1]
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s, t = [], []
for _ in range(n):
    s.append(input())
m = int(input())
for _ in range(m):
    t.append(input())
u = Counter(s) - Counter(t)
ans = u.most_common(1)[0][1]
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s, t = [], []
for _ in range(n):
    s.append(input())
m = int(input())
for _ in range(n):
    t.append(input())
u = Counter(s) - Counter(t)
ans = u.most_common(1)[0][1]
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s, t = [], []
for _ in range(n):
    s.append(input())
m = int(input())
for _ in range(n):
    t.append(input())
u = Counter(s) - Counter(t)
ans = u.most_common(1)
print(ans[1])

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s = Counter(int)
for _ in n:
    word = str(input())
    s[word] += 1
m = int(input())
for _ in m:
    word = str(input())
    if word in s.keys():
        s[word] -= 1
ans = s.most_common(1)
print(ans[1])

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s = Counter(int)
for _ in n:
    word = str(input())
    s[word] += 1
m = int(input())
for _ in m:
    word = str(input())
    if word in s.keys():
        s[word] -= 1
print(s.most_common(1)[1])

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s = Counter(int)
for _ in n:
    word = str(input())
    s[word] += 1
m = int(input())
for _ in m:
    word = str(input())
    if word in s.keys():
        s[word] -= 1
print(s.most_common(1))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s, t = Counter(int)
for _ in n:
    word = str(input())
    s[word] += 1
m = int(input())
for _ in m:
    word = str(input())
    s[word] -= 1
print(s.most_common(1))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s, t = Counter(int)
for _ in n:
    word = input()
    s[word] += 1
m = int(input())
for _ in m:
    word = input()
    s[word] -= 1
print(s.most_common(1))