Problem p03578 (python)

Fixed submission:
from collections import Counter
N = int(input())
D = [int(i) for i in input().split()]
M = int(input())
T = [int(i) for i in input().split()]

cD = Counter(D)

for t in T:
    if cD.get(t,0) == 0:
        print('NO')
        exit()
    else:
        cD[t] -= 1

print("YES")

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i)-1 for i in input().split()]
Dlist = [0]*(max(D)+1)
for d in D:
    Dlist[d] += 1


M = int(input())
T = [int(i)-1 for i in input().split()]
Tlist = [0]*(max(T)+1)
for t in T:
    Tlist[t] += 1
 
flag = True
 
for i in T:
    if Tlist[i] > Dlist[i]:
        flag = False
        break
 
if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*max(D)
for d in D:
    Dlist[d-1] += 1


M = int(input())
T = [int(i) for i in input().split()]
if max(T) > max(D):
    print('NO')
    exit()

Tlist = [0]*max(T)
for t in T:
    Tlist[t-1] += 1
 
flag = True
 
for i in T:
    i -= 1
    if Tlist[i] > Dlist[i]:
        flag = False
        break
 
if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*1000000
for d in D:
    Dlist[d-1] += 1


M = int(input())
T = [int(i) for i in input().split()]
    
Tlist = [0]*1000000
for t in T:
    Tlist[t-1] += 1
 
flag = True
 
for i in range(len(Tlist)):
    if Tlist[i] > Dlist[i]:
        flag = False
        break
 
 
if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*max(D)
for d in D:
    Dlist[d-1] += 1


M = int(input())
T = [int(i) for i in input().split()]
if max(T) > max(D):
    print('NO')
    exit()
    
Tlist = [0]*max(T)
for t in T:
    Tlist[t-1] += 1
 
flag = True
 
for i in range(len(Tlist)):
    if Tlist[i] > Dlist[i]:
        flag = False
        break
 
 
if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*max(D)
for d in D:
    Dlist[d-1] += 1

M = int(input())
T = [int(i) for i in input().split()]
Tlist = [0]*max(T)
for t in T:
    Tlist[t-1] += 1

flag = True

for i in range(max(T)):
    if Tlist[i] > Dlist[i]:
        flag = False
        break


if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*max(D)
for d in D:
    Dlist[d-1] += 1

M = int(input())
T = [int(i) for i in input().split()]
Tlist = [0]*max(T)
for t in T:
    Tlist[t-1] += 1

flag = True

for i in range(len(Tlist)):
    if Tlist[i] > Dlist[i]:
        flag = False
        break


if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*(max(D))
for d in D:
    Dlist[d-1] += 1

M = int(input())
T = [int(i) for i in input().split()]
Tlist = [0]*(max(T))
for t in T:
    Tlist[t-1] += 1

flag = True

for i in range(len(Tlist)):
    if Tlist[i] > Dlist[i]:
        flag = False
        break


if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*(max(D))
for d in D:
    Dlist[d-1] += 1

M = int(input())
T = [int(i) for i in input().split()]
Tlist = [0]*(max(T))
for t in T:
    Tlist[t-1] += 1

flag = True

for i in range(len(Tlist)):
    if Tlist[i] > Dlist[i]:
        flag = False
        break


if flag:
    print('YES')
else:
    print('NO')