Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
five = int(input())
hand = int(input())
fives = int(input())
ans = int(input())
tmp = 0

for i in range(five):
  for j in range(hand):
    for k in range(fives):
   		ask = 500 * (i+1) + 100 * (j+1) + 50 * (k+1) 
  		if ask == ans:
       		tmp = tmp + 1

Fixed submission:
five = int(input()) + 1
hand = int(input()) + 1
fives = int(input()) + 1
ans = int(input()) 
tmp = 0
 
for i in range(five):
  for j in range(hand):
    for k in range(fives):
      ask = 500 * i + 100 * j + 50 * k
      if ans == ask:
        tmp = tmp + 1

print(tmp)

Buggy python submission (verdict: Runtime Error):
five = int(input())
hand = int(input())
fives = int(input())
ans = int(input())
tmp = 0

for i in range(five):
  for j in range(hand):
    for k in range(fives):
   		ask = 500 * i + 100 * j + 50 *k 
  		if ask == ans:
       		tmp = tmp + 1

Fixed submission:
five = int(input()) + 1
hand = int(input()) + 1
fives = int(input()) + 1
ans = int(input()) 
tmp = 0
 
for i in range(five):
  for j in range(hand):
    for k in range(fives):
      ask = 500 * i + 100 * j + 50 * k
      if ans == ask:
        tmp = tmp + 1

print(tmp)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
print('Even' if (a * b) % 2 == 0 else  'Odd')

Fixed submission:
a,b = map(int,input().split())
print('Even' if (a * b) % 2 == 0 else  'Odd')

Buggy python submission (verdict: Runtime Error):
a,b = input()
print('Even' if (a * b) % 2 == 1 else  'Odd')

Fixed submission:
a,b = map(int,input().split())
print('Even' if (a * b) % 2 == 0 else  'Odd')

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
print('Even' if (a * b) % 2 == 0 else  'Odd')

Fixed submission:
a,b = map(int,input().split())
print('Even' if (a * b) % 2 == 0 else  'Odd')

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
print('Even' if (a * b) % 2 == 1 else  'Odd')

Fixed submission:
a,b = map(int,input().split())
print('Even' if (a * b) % 2 == 0 else  'Odd')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
ranX = ranY = ranZ = -1
for x in (a+1):
  for y in (a+1-x):
    z = a - x - y
    if 1000 * x + 5000 * y + 1000 * z == b:
      ranX = x
      ranY = y
      ranZ = z

print(ranX,  ranY,  ranZ)
    

Fixed submission:
N, Y = map(int, input().split())
res10000 =res5000 = res1000 = -1

for x in range(N+1):
    for y in range(N+1-x):
        z = N-x-y # zは決まっているので、ループを減らして、計算量を減らす！
        if 10000*x + 5000*y + 1000*z == Y:
            res10000 = x
            res5000 = y
            res1000 = z

print(res10000, res5000, res1000)
Buggy python submission (verdict: Runtime Error):
import rs
li = input()
if re.match("^(dream|dreamer|erase|eraser)+$", li):
  print('YSE')
else:
  print('NO')

Fixed submission:
import re
S = input()
'''
メタ文字：
^ = 文字列の先頭、
| = OR
+ = 直前のパターンを1回以上繰り返し、
$ = 文字列の末尾
'''
if re.match("^(dream|dreamer|erase|eraser)+$", S):
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
import rs
li = input()
flag = 'No'

if re.match("^(dream|dreamer|erase|eraser)+$", li):
  flag = 'YES'
      
  
print(flag)

Fixed submission:
import re
S = input()
'''
メタ文字：
^ = 文字列の先頭、
| = OR
+ = 直前のパターンを1回以上繰り返し、
$ = 文字列の末尾
'''
if re.match("^(dream|dreamer|erase|eraser)+$", S):
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
li = list(input())
list = ['dream','dreamer','erase','eraser']
flag = 'No'
for x in list:
  for y in list:
    if x + y = li:
      flag = 'YES'
  
print(flag)

Fixed submission:
import re
S = input()
'''
メタ文字：
^ = 文字列の先頭、
| = OR
+ = 直前のパターンを1回以上繰り返し、
$ = 文字列の末尾
'''
if re.match("^(dream|dreamer|erase|eraser)+$", S):
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
N=()
M=()
A=()

N=int(input(""))
M=int(input(""))
      
for i in range (0,M):
      A=int(input(""))
      N=(N-A)
      
if N<0:
      print("-1")
else:
      print(N)

Fixed submission:
N=()
M=()
A=()

N, M = map(int, input().split())

A = list(map(int, input().split()))
for i in range(0,M): 
      N=N-A[i]
      
if N<0:
      print("-1")
else:
      print(N)

Buggy python submission (verdict: Runtime Error):
N=()
M=()
A=()

N=int(input(""))
M=int(input(""))
      
for i in range (0,M):
      A=int(input(""))
      N=(N-A)
      
if N<0:
      print("-1")
else:
      print(N)

Fixed submission:
N=()
M=()
A=()

N, M = map(int, input().split())

A = list(map(int, input().split()))
for i in range(0,M): 
      N=N-A[i]
      
if N<0:
      print("-1")
else:
      print(N)
Buggy python submission (verdict: Runtime Error):
n = list(input())
print(int(n[-3] + n[-2] + n[-1]))

Fixed submission:
n = int(input())
if n % 1000 == 0:
    print(0)
else:
    print(1000 - (n % 1000))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i
        if ans > 1000000000000000000:
            ans = -1
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i
        if ans > 1000000000000000000:
            ans = -1
            break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in a:
    ans *= i
if ans > 1000000000000000000:
    ans = -1
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i
        if ans > 1000000000000000000:
            ans = -1
            break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if x + y + z == s:
                ans += 1
print(ans)

Fixed submission:
k,s = map(int,input().split())
ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        if 0 <= s - x - y <= k:
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if x + y + z == s:
                ans += 1
print(ans)

Fixed submission:
k,s = map(int,input().split())
ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        if 0 <= s - x - y <= k:
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = list(input().split())
if s[1] == "+":
  print(int(s[0]) + int(s[2]))
if s[1] == "-":
  print(int(s[0]) - int(s[1]))

Fixed submission:
s = list(input().split())
if s[1] == "+":
  print(int(s[0]) + int(s[2]))
if s[1] == "-":
  print(int(s[0]) - int(s[2]))
Buggy python submission (verdict: Runtime Error):
import copy

n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
    p,x = map(int,input().split())
    l = t.copy()
    l[p-1] = x
    print(sum(l))

Fixed submission:
import copy

n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
    p,x = map(int,input().split())
    l = t.copy()
    l[p-1] = x
    print(sum(l))
Buggy python submission (verdict: Time Limit Exceeded):
a = 10**18
N = int(input())
A = list(map(int , input().split()))
ans = 1
for i in A:
    if 0 in A:
        ans = 0
        break
    ans *= i
    if ans > a:
        ans = -1
        break
print(ans)

Fixed submission:
#import functools
a = 10**18
N = int(input())
A = list(map(int , input().split()))
if 0 in A:
    ans = 0
else:
    ans = 1
for i in A:
    ans *= i
    if ans > a:
        ans = -1
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M, X = map(int, input().split())
C = [0] * N
AA = [list(map(int, input().split())) for i in range(N)]
for i in range(len(AA)):
    C[i] = AA[i][0]
    A[i] = AA[i][1:]
ans = sum(C) + 1
for p in range(2 ** N):
    Y = [0] * M
    cnt = 0
    for i, c in enumerate(C):
        if p % 2 == 1:
            cnt += c
            for j, a in enumerate(A[i]):
                Y[j] += a
        p //= 2
    ans = min(ans, cnt) if min(Y) >= X else ans
print(ans if ans <= sum(C) else -1)

Fixed submission:
N, M, X = map(int, input().split())
C = [0] * N
A = [0] * N
AA = [list(map(int, input().split())) for i in range(N)]
for i in range(len(AA)):
    C[i] = AA[i][0]
    A[i] = AA[i][1:]
ans = sum(C) + 1
for p in range(2 ** N):
    Y = [0] * M
    cnt = 0
    for i, c in enumerate(C):
        if p % 2 == 1:
            cnt += c
            for j, a in enumerate(A[i]):
                Y[j] += a
        p //= 2
    ans = min(ans, cnt) if min(Y) >= X else ans
print(ans if ans <= sum(C) else -1)

Buggy python submission (verdict: Runtime Error):
import itertools

N , M , X = (map(int , input().split()))
A = [list(map(int, input().split())) for i in range(N)]

p = []
p.extend([0]*N)
p.extend([1]*N)
mm = list(set(itertools.permutations(p , N)))

sum_list = [0]*N
c_list = [0]*len(mm)
ans = 10**18
for i in range(len(mm)):
    for j in range(len(mm[i])):
        if mm[i][j] == 1:
            c_list[i] += A[j][0]
            for k in range(M):
                sum_list[k] += A[j][k+1]
    if all([True if i >= X else False for i in sum_list]):
        ans = min(ans , c_list[i])
    sum_list = [0]*N
if ans == 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
N, M, X = map(int, input().split())
C = [0] * N
A = [0] * N
AA = [list(map(int, input().split())) for i in range(N)]
for i in range(len(AA)):
    C[i] = AA[i][0]
    A[i] = AA[i][1:]
ans = sum(C) + 1
for p in range(2 ** N):
    Y = [0] * M
    cnt = 0
    for i, c in enumerate(C):
        if p % 2 == 1:
            cnt += c
            for j, a in enumerate(A[i]):
                Y[j] += a
        p //= 2
    ans = min(ans, cnt) if min(Y) >= X else ans
print(ans if ans <= sum(C) else -1)
Buggy python submission (verdict: Runtime Error):
import itertools
N , M = (map(int , input().split()))
H = list(map(int , input().split()))
AB = [list(map(int, input().split())) for i in range(M)]
HH = {i+1 : H[i] for i in range(len(H))}
count = []
for i in AB:
    if HH[i[1]] > HH[i[0]]:
        count.append(i[1])
for i in HH:
    if i in CC:
        pass
    else:
        count.append(i)
print(len(list(set(count))))

Fixed submission:
N , M = (map(int , input().split()))
H = list(map(int , input().split()))
AB = [list(map(int, input().split())) for i in range(M)]
HH = {i+1 : H[i] for i in range(len(H))}

count = {i+1 : 0 for i in range(N)}
for i in AB:
    if HH[i[1]] > HH[i[0]]:
        count[i[0]] -= 1
    elif HH[i[1]] == HH[i[0]]:
        count[i[0]] -= 1
        count[i[1]] -= 1
    else:
        count[i[1]] -= 1
        
print(sum([1 for i in count.values() if i == 0]))
Buggy python submission (verdict: Runtime Error):
kk = K
while True:
    if kk >= A and kk <= 600:
        ans = 'OK'
        break
    elif  kk > 600:
        ans = 'NG'
        break
    else:
        kk = kk+K
print(ans)

Fixed submission:
K = int(input())
A , B = (map(int , input().split()))
kk = K
while True:
    if kk >= A and kk <= B:
        ans = 'OK'
        break
    elif  kk > B:
        ans = 'NG'
        break
    else:
        kk = kk+K
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N = (map(int , input().split()))
max_ = 0
for x in range(1,N+1):
    max_ = max(max_,((A*x)//B - A * (x//B)))
print(max_)

Fixed submission:
A,B,N = (map(int , input().split()))
min(B-1,N)
x = min(B-1,N)
print(((A*x)//B - A * (x//B)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
n_list = []
for i in range(N):
    n_list.append(input())
print(len(dict(Counter(n_list))))

Fixed submission:
from collections import Counter
N = int(input())
n_list = []
for i in range(N):
    n_list.append(input())
print(len(dict(Counter(n_list))))
Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
N_list = [i+1 for i in range(N)]
cumsum = list(itertools.accumulate(N_list))
aa = cumsum[-1]
t_list = [i for i in N_list if i%3 == 0 or i%5 == 0]
acumsum = list(itertools.accumulate(t_list))[-1]
print(aa - acumsum)

Fixed submission:
import itertools
N = int(input())
N_list = [i+1 for i in range(N)]
cumsum = list(itertools.accumulate(N_list))
aa = cumsum[-1]
t_list = [i for i in N_list if i%3 == 0 or i%5 == 0]
if len(t_list) != 0:
    acumsum = list(itertools.accumulate(t_list))[-1]
else:
    acumsum = 0
print(aa - acumsum)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
N = int(input())

ll = [i for i in range(1,N+1)]   
ans = 0

for i in ll:
    for j in ll:
        s = gcd(i,j)
        for k in ll:
            ans += gcd(s,k)
print(ans)

Fixed submission:
K = int(input())
ans = 0
from math import gcd
for i in range(1,K+1):
    for k in range(1,K+1):
        for j in range(1,K+1):
            ans += gcd(gcd(i, k),j)
            
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
N = int(input())

ll = [i for i in range(1,N+1)]   
ans = 0

def aaa(a):
    d = gcd(a[0],a[1])
    return gcd(d,a[2])

lll = []
for i in ll:
    for j in ll:
        for k in ll:
            lll.append((i ,j, k))

for ii in lll:
    ans += aaa(ii)
print(ans)

Fixed submission:
K = int(input())
ans = 0
from math import gcd
for i in range(1,K+1):
    for k in range(1,K+1):
        for j in range(1,K+1):
            ans += gcd(gcd(i, k),j)
            
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
N = int(input())

ll = [i for i in range(1,N+1)]   
ans = 0

def aaa(a):
    d = gcd(a[0],a[1])
    return gcd(d,a[2])

lll = []
for i in ll:
    for j in ll:
        for k in ll:
            lll.append((i ,j, k))

for ii in lll:
    ans += aaa(ii)
print(ans)

Fixed submission:
K = int(input())
ans = 0
from math import gcd
for i in range(1,K+1):
    for k in range(1,K+1):
        for j in range(1,K+1):
            ans += gcd(gcd(i, k),j)
            
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
A = list(map(int , input().split()))
bb = dict(Counter(A))
for j in A:
    bb[j] -= 1
    pattern_ = []
    for i in bb.values():
        pattern_.append((i*(i-1))//2)
    print(sum(pattern_))
    bb[j] += 1

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int , input().split()))
bb = dict(Counter(A))
pattern_ = 0
for i in bb.values():
    pattern_ += ((i*(i-1))//2)
for j in A:
    print(pattern_ - ((bb[j]-1)))
Buggy python submission (verdict: Runtime Error):
N , A , B = (map(int , input().split()))
a = ''
l = -(-N//(A + B))
for i in range(l):
    a += 'b'*A
    a += 'r'*B
    if len(a) >= N:
        break
print(list(a[:N]).count('b'))

Fixed submission:
N , A , B = (map(int , input().split()))
def divmod_(a ,b):
    q, mod = divmod(a ,b)
    return q, mod
c , d = divmod_(N ,A+B)
if (d - A) > 0:
    d = A
print((c * A) + d)

Buggy python submission (verdict: Runtime Error):
N , A , B = (map(int , input().split()))
a = ''
l = -(-N//(A + B))
for i in range(l):
    a += 'b'*A
    a += 'r'*B
print(list(a[:N]).count('b'))

Fixed submission:
N , A , B = (map(int , input().split()))
def divmod_(a ,b):
    q, mod = divmod(a ,b)
    return q, mod
c , d = divmod_(N ,A+B)
if (d - A) > 0:
    d = A
print((c * A) + d)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
for i in B:
    if i % 3 == 0 or i % 5 == 0:
         bcount += 1
if acount != bcount:
    print('DENIED')
elif account == 0:
    print('DENIED')
else:
    print('APPROVED')

Fixed submission:
N = int(input())
A = list(map(int , input().split()))
ans = []
bns = []
for i in A:
    if i % 2 == 0:
        ans.append(i)
for i in ans:
    if i % 3 == 0 or i % 5 == 0:
        bns.append(i)
if len(ans) == len(bns):
    print('APPROVED')
else:
    print('DENIED')
Buggy python submission (verdict: Time Limit Exceeded):
A = list(map(int , input().split()))
B = list(map(int , input().split()))
if A[0] < A[1]:
    print(0)
else:
    B.sort(reverse=True)
    for i in range(A[1]):
        B.remove(max(B))
    print(sum(B))

Fixed submission:
A = list(map(int , input().split()))
B = list(map(int , input().split()))
if A[0] < A[1]:
    print(0)
else:
    B.sort(reverse=True)
    del B[0:A[1]]
    print(sum(B))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int , input().split()))
count = 0
j_lis = []
for i in range(len(A)):
    if min(list(A[0:i+1])) >= A[i]:
        count += 1
print(count)

Fixed submission:
N = int(input())
A = list(map(int , input().split()))
count = 0
j = A[0]
for i in range(len(A)):
    j = min(j , A[i])
    if j >= A[i]:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
A = list(map(int , input().split()))
x = []
for i in range(A[1]):
    X=list(input().split())
    x.append(X)
di = {}
for i in x:
    di[int(i[0])] = []
for i in x:
    di[int(i[0])].append(i[1])
sei = 0
go = 0
for k ,v in di.items():
    if 'AC' in v:
        sei += 1
    go += v.index('AC')
print('{} {}'.format(sei,go))

Fixed submission:
A = list(map(int , input().split()))
x = []
for i in range(A[1]):
    X=list(input().split())
    x.append(X)
di = {}
for i in x:
    di[int(i[0])] = []
for i in x:
    di[int(i[0])].append(i[1])
sei = 0
go = 0
for k ,v in di.items():
    if 'AC' in v:
        sei += 1
    else:
        continue
    go += v.index('AC')
print('{} {}'.format(sei,go))
Buggy python submission (verdict: Runtime Error):
from sympy import sieve
X = int(input())
a = 100004
b = [i for i in sieve.primerange(X,a)]
print(b[0])

Fixed submission:
N = int(input())
n = 11**5
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)
print(min([i for i in primes if i >= N]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
T = input()
ans = ''
for i in range(N):
    ans += S[i]
    ans += T[i]
print(ans)

Fixed submission:
N = int(input())
ST = input().split()
ans = ''
for i in range(N):
    ans += ST[0][i]
    ans += ST[1][i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a = int(input())
b = int(math.sqrt(a))-1
for i in range(b):
    x = a/b
    if x.is_integer():
        break
    else:
        b -= 1
print(int(x + b -2))

Fixed submission:
import math
a = int(input())
b = int(math.sqrt(a))
for i in range(b):
    x = a/b
    if x.is_integer():
        break
    else:
        b -= 1
print(int(x + b -2))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(math.sqrt(a))-1
for i in range(b):
    x = a/b
    if x.is_integer():
        break
    else:
        b -= 1
print(int(x + b -2))

Fixed submission:
import math
a = int(input())
b = int(math.sqrt(a))
for i in range(b):
    x = a/b
    if x.is_integer():
        break
    else:
        b -= 1
print(int(x + b -2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
gr = itertools.groupby(S)
ans = len([1 for key, group in gr])
print(ans)

Fixed submission:
import itertools
N = int(input())
S = list(input())
gr = itertools.groupby(S)
ans = len([1 for key, group in gr])
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
for i in range(len(s_l)):
	if a == s_l[i]:
        try:
            print(s_l[i+1])
        except:
            print(s_l[-1])
        break

Fixed submission:
s_l = ['Sunny', 'Cloudy', 'Rainy' ]
a = input()
for i in range(len(s_l)):
    if a == s_l[i]:
        try:
            print(s_l[i+1])
        except:
            print(s_l[0])
        break

Buggy python submission (verdict: Runtime Error):
for i in range(len(s_l)):
    if a == s_l[i]:
        try:
            print(s_l[i+1])
        except:
            print(s_l[-1])
        break

Fixed submission:
s_l = ['Sunny', 'Cloudy', 'Rainy' ]
a = input()
for i in range(len(s_l)):
    if a == s_l[i]:
        try:
            print(s_l[i+1])
        except:
            print(s_l[0])
        break
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
inp = []
for i in range(a[2]):
    inp.append(int(input()))
n_dict = {}
for i in range(a[0]):
    n_dict[i+1] = a[1]
for i in range(a[2]):
    for k , v in n_dict.items():
        n_dict[k] -= 1
for i in range(a[2]):
    n_dict[inp[i]] += 1
for kk , vv in n_dict.items():
    if int(vv) <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
n = list(map(int , input().split()))

hito_dict = {(i+1) : ((n[2]-n[1])*-1) for i in range(n[0])}
for i in range(n[2]):
    d = int(input())
    hito_dict[d] = hito_dict[d] + 1
for j in range(n[0]):
    if hito_dict[j + 1] > 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
inp = []
for i in range(a[2]):
    inp.append(int(input()))
n_dict = {}
for i in range(a[0]):
    n_dict[i+1] = a[1]
for i in range(a[2]):
    for k , v in n_dict.items():
        if k != inp[i]:
            n_dict[k] -= 1
for kk , vv in n_dict.items():
    if int(vv) <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
n = list(map(int , input().split()))

hito_dict = {(i+1) : ((n[2]-n[1])*-1) for i in range(n[0])}
for i in range(n[2]):
    d = int(input())
    hito_dict[d] = hito_dict[d] + 1
for j in range(n[0]):
    if hito_dict[j + 1] > 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
inp = []
for i in range(a[2]):
    inp.append(int(input()))
n_dict = {}
for i in range(a[0]):
    n_dict[i+1] = a[1]
for i in range(a[2]):
    for k , v in n_dict.items():
        if k != inp[i]:
            n_dict[k] -= 1
for kk , vv in n_dict.items():
    if int(vv) <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
n = list(map(int , input().split()))

hito_dict = {(i+1) : ((n[2]-n[1])*-1) for i in range(n[0])}
for i in range(n[2]):
    d = int(input())
    hito_dict[d] = hito_dict[d] + 1
for j in range(n[0]):
    if hito_dict[j + 1] > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
sc = [list(input()) for i in range(N)]
for i in sc:
    i.sort()
count = 0
for i in range(0 , len(sc)-1):
    for j in range(i+1,len(sc)):
        if sc[i] == sc[j]:
            count += 1
print(count)

Fixed submission:
N = int(input())
words = dict()
count = 0
for i in range(N):
    s = ''.join(sorted(input()))
    if s in words:
        count += words[s]
        words[s] += 1
    else:
        words[s] = 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
a = int(input())
a_list = []
for i in range(a):
    a_list.append(int(input()))
b_list = copy.copy(a_list)
for i in range(len(a_list)):
    b_list.pop(i)
    print(max(b_list))
    b_list = copy.copy(a_list)

Fixed submission:
import sys
a = int(input())
a_list = []
for i in range(a):
    a_list.append(int(input()))
max_num = max(a_list)
if a_list.count(max_num) != 1:
    for i in range(a):
        print(max_num)
else:
    sec_num = sorted(a_list)[-2]
    for i in a_list:
        if i == max_num:
            print(sec_num)
        else:
            print(max_num)
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input.split())
print(min(B,N*A))

Fixed submission:
N,A,B = map(int,input().split())
print(min(B,N*A))