Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
# si と sj のアナグラムは Counter(si)==Counter(sj) で求められる
# 組の数を数える
N=int(input())
S=[Counter(input()) for n in range(N)]
c=0
l=[]
for s in S:
    if s in l:
        continue
    else:
        l.append(s)
        n=S.count(s)
        c+=(n*(n-1))//2
print(c)



Fixed submission:
N=int(input())
S=["".join(sorted(input())) for n in range(N)]
d={}
for s in S:
    if s not in d:
        d[s]=1
    else:
        d[s]+=1
c=0
for k in d:
    n=d[k]
    c+=(n*(n-1))//2
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
# si と sj のアナグラムは Counter(si)==Counter(sj) で求められる
# 組の数を数える
N=int(input())
S=[Counter(input()) for n in range(N)]
c=0
l=[]
for s in S:
    if s in l:
        continue
    else:
        l.append(s)
        c+=(S.count(s)*(S.count(s)-1))//2
print(c)



Fixed submission:
N=int(input())
S=["".join(sorted(input())) for n in range(N)]
d={}
for s in S:
    if s not in d:
        d[s]=1
    else:
        d[s]+=1
c=0
for k in d:
    n=d[k]
    c+=(n*(n-1))//2
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
S=[Counter(input()) for n in range(N)]
c=0
l=[]
for s in S:
    if s in l:
        continue
    else:
        l.append(s)
    c+=(S.count(s)*(S.count(s)-1))//2
print(c)


Fixed submission:
N=int(input())
S=["".join(sorted(input())) for n in range(N)]
d={}
for s in S:
    if s not in d:
        d[s]=1
    else:
        d[s]+=1
c=0
for k in d:
    n=d[k]
    c+=(n*(n-1))//2
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
S=[Counter(input()) for n in range(N)]
c=0
for s in S:
    c+=(S.count(s)*(S.count(s)-1))//2
    S=[i for i in S if i!=s]
    if len(S)==0:
        break
print(c)

Fixed submission:
N=int(input())
S=["".join(sorted(input())) for n in range(N)]
d={}
for s in S:
    if s not in d:
        d[s]=1
    else:
        d[s]+=1
c=0
for k in d:
    n=d[k]
    c+=(n*(n-1))//2
print(c)
Buggy python submission (verdict: Runtime Error):
r=int(input())
return(3*r*r)

Fixed submission:
r=int(input())
print(3*r*r)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for n in range(N)]
m=max(A)
for i in range(N):
	print(m) if A[i]<m else print(max(A[:i]+A[i+1:]))


Fixed submission:
N=int(input())
A=[int(input()) for n in range(N)]
m=max(A)
n=sorted(A,reverse=True)[1]
for i in range(N):
    if A[i]<m:
        print(m)
    else:
        print(n)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for n in range(N)]
m=max(A)
for i in range(N):
	if A[i]<m:
		print(m)
	else:
		print(max(A[:i]+A[i+1:]))


Fixed submission:
N=int(input())
A=[int(input()) for n in range(N)]
m=max(A)
n=sorted(A,reverse=True)[1]
for i in range(N):
    if A[i]<m:
        print(m)
    else:
        print(n)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(input()) for n in range(N)]
#print(max(A[1:]))
#for i in range(1,N-1):
m=max(A)
for i in range(N):
	if A[i]<m:
    	print(m)
	else:
    	print(max(A[:i]+A[i+1:]))
#print(max(A[:N-1]))


Fixed submission:
N=int(input())
A=[int(input()) for n in range(N)]
m=max(A)
n=sorted(A,reverse=True)[1]
for i in range(N):
    if A[i]<m:
        print(m)
    else:
        print(n)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for n in range(N)]
print(max(A[1:]))
for i in range(1,N-1):
    print(max(A[:i]+A[i+1:]))
    #print(max(A[:i-1], A[i:]))
print(max(A[:N-1]))


Fixed submission:
N=int(input())
A=[int(input()) for n in range(N)]
m=max(A)
n=sorted(A,reverse=True)[1]
for i in range(N):
    if A[i]<m:
        print(m)
    else:
        print(n)
Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
# L <= i < j <= R
# (i*j)%2019 の最小値
M=[]
for i in range(L, R):
    for j in range(i+1, R+1):
        #print(i,j)
        M.append((i*j)%20119)
        if M[-1]==0:
			print(0)
		exit()
print(min(M))


Fixed submission:
L,R=map(int,input().split())
# L <= i < j <= R
# (i*j)%2019 の最小値
M=[]
for i in range(L, R):
    for j in range(i+1, R+1):
        #print(i,j)
        M.append((i*j)%2019)
        if M[-1]==0:
            print(0)
            exit()
print(min(M))
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
x=0
time=0
for i in range(N+1):
  if x<=X:
    time+=1
  if i<N:
    count+=1
print(time)


Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
x=0
time=0
for i in range(N+1):
  if x<=X:
    time+=1
  if i<N:
    x+=L[i]
print(time)

Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
x=0
time=0
while x<=X:
    x+=L[time]
    time+=1
print(time)


Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
x=0
time=0
for i in range(N+1):
  if x<=X:
    time+=1
  if i<N:
    x+=L[i]
print(time)
Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()

# 最初から数えておく
C=[1 if S[i:i+2]=='AC' else 0 for i in range(N-1)]
#print(C)
#exit()

#print()
#print("#"*20)
for q in range(Q):
    l,r=map(int,input().split())
    #print(S[l-1:r].count("AC"))
    print(sum(C[l-1:r-1]))



Fixed submission:
N,Q=map(int,input().split())
S=input()

# 最初から数えておく
#C=[1 if S[i:i+2]=='AC' else 0 for i in range(N-1)]
C=[0]*(N+1)
for i in range(N):
    C[i+1]=C[i]+(1 if S[i:i+2]=='AC' else 0)
#print(C)
#exit()

#print()
#print("#"*20)
for q in range(Q):
    l,r=map(int,input().split())
    #print(S[l-1:r].count("AC"))
    #print(sum(C[l-1:r-1]))
    print(C[r-1]-C[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
for q in range(Q):
    l,r=map(int,input().split())
    print(S[l-1:r].count("AC"))


Fixed submission:
N,Q=map(int,input().split())
S=input()

# 最初から数えておく
#C=[1 if S[i:i+2]=='AC' else 0 for i in range(N-1)]
C=[0]*(N+1)
for i in range(N):
    C[i+1]=C[i]+(1 if S[i:i+2]=='AC' else 0)
#print(C)
#exit()

#print()
#print("#"*20)
for q in range(Q):
    l,r=map(int,input().split())
    #print(S[l-1:r].count("AC"))
    #print(sum(C[l-1:r-1]))
    print(C[r-1]-C[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
#print()
#print("#"*20)
for q in range(Q):
    c=0
    l,r=map(int,input().split())
    for i in range(l-1,r-1):
        #print(S[i:i+2])
        if S[i:i+2]=="AC":
            c+=1
    print(c)



Fixed submission:
N,Q=map(int,input().split())
S=input()

# 最初から数えておく
#C=[1 if S[i:i+2]=='AC' else 0 for i in range(N-1)]
C=[0]*(N+1)
for i in range(N):
    C[i+1]=C[i]+(1 if S[i:i+2]=='AC' else 0)
#print(C)
#exit()

#print()
#print("#"*20)
for q in range(Q):
    l,r=map(int,input().split())
    #print(S[l-1:r].count("AC"))
    #print(sum(C[l-1:r-1]))
    print(C[r-1]-C[l-1])
Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
c=0
l=["01", "10"]
while len(S)>1:
    before=len(S)
    for i in range(before-1):
        #if S[i]+S[i+1]=="01" or S[i]+S[i+1]=="10":
        if S[i]+S[i+1] in l:
            c+=2
            #S.pop(i)
            #S.pop(i)
            del S[i:i+2]
            break
    if before==len(S):
        break
print(c)


Fixed submission:
S=input()
print(2*min(S.count("0"), S.count("1")))

Buggy python submission (verdict: Runtime Error):
S=list(input())
c=0
while len(S)>1:
    before=len(S)
    l=0
    # 双方向から見ればループ回数は半分になる？
    for i in range(before//2):
    #for i in range(before-1):
        if S[i]+S[i+1]=="01" or S[i]+S[i+1]=="10":
            c+=2
            #S.pop(i)
            #S.pop(i)
            del S[i:i+2]
            #break
            l=1
        if S[-i-1]+S[-i-2]=="10" or S[-i-1]+S[-i-2]=="01":
            c+=2
            if i==0:
                del S[-i-2:]
            else:
                del S[-i-2:-i]
            break
        if l:
          	break
    if before==len(S):
        break
print(c)




Fixed submission:
S=input()
print(2*min(S.count("0"), S.count("1")))

Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
c=0
while len(S)>1:
    before=len(S)
    # 双方向から見ればループ回数は半分になる？
    for i in range(before//2):
    #for i in range(before-1):
        if S[i]+S[i+1]=="01" or S[i]+S[i+1]=="10":
            c+=2
            #S.pop(i)
            #S.pop(i)
            del S[i:i+2]
            break
        if S[-i-1]+S[-i-2]=="10" or S[-i-1]+S[-i-2]=="01":
            c+=2
            if i==0:
                del S[-i-2:]
            else:
                del S[-i-2:-i]
            break
    if before==len(S):
        break
print(c)


Fixed submission:
S=input()
print(2*min(S.count("0"), S.count("1")))

Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
c=0
while len(S)>1:
    before=len(S)
    for i in range(before-1):
        if S[i]+S[i+1]=="01" or S[i]+S[i+1]=="10":
            c+=2
            #S.pop(i)
            #S.pop(i)
            del S[i:i+2]
            break
    if before==len(S):
        break
print(c)


Fixed submission:
S=input()
print(2*min(S.count("0"), S.count("1")))

Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
c=0
while len(S)>1:
    before=len(S)
    for i in range(len(S)-1):
        #print(S[i]+S[i+1])
        if S[i]+S[i+1]=="01" or S[i]+S[i+1]=="10":
            c+=2
            S.pop(i)
            S.pop(i)
            break
    after=len(S)
    if before==after:
        break

#print(S)
print(c)


Fixed submission:
S=input()
print(2*min(S.count("0"), S.count("1")))
Buggy python submission (verdict: Runtime Error):
train1=int(input())
train2=int(input())
bus1=int(input())
bus2=int(input())
print(min(train1,train2)+min(bus1+bus2))

Fixed submission:
train1=int(input())
train2=int(input())
bus1=int(input())
bus2=int(input())
print(min(train1,train2)+min(bus1,bus2))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
I=[]
for n in range(N):
    a=int(input())
    A.append(a)
I.append(1)
def t(I):
    #while 2 not in I:
    while 1:
        a=A[I[-1]-1]
        if a in I:
            return print(-1)
        if a==2:
            return print(len(I))
        I.append(a)
t(I)


Fixed submission:
N=int(input())
A=[int(input()) for n in range(N)]
def t(N,A):
    i=1
    for n in range(1,N+1):
        a=A[i-1]
        if a==2:
            return print(n)
        i=a
    return print(-1)
t(N,A)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
I=[]
for n in range(N):
    a=int(input())
    A.append(a)
I.append(1)
def t(I):
    while 2 not in I:
        a=A[I[-1]-1]
        if a in I:
            return print(-1)
        I.append(a)
    return print(len(I)-1)
t(I)


Fixed submission:
N=int(input())
A=[int(input()) for n in range(N)]
def t(N,A):
    i=1
    for n in range(1,N+1):
        a=A[i-1]
        if a==2:
            return print(n)
        i=a
    return print(-1)
t(N,A)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
def one_14(num):
  if num==1:
    return 14
a=one_14(a)
b=one_14(b)
if a > b:
  print("Alice")
elif b < a:
  print("Bob")
else:
  print("Draw")

Fixed submission:
a,b=map(int,input().split())
def one_14(num):
  if num==1:
    return 14
  else:
    return num
a=one_14(a)
b=one_14(b)
if a > b:
  print("Alice")
elif a < b:
  print("Bob")
else:
  print("Draw")
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())
c=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                c+=1
print(c)


Fixed submission:
K,S=map(int,input().split())
c=0
for x in range(K+1):
    for y in range(K+1):
        if S-x-y>=0 and S-x-y<=K:
            c+=1
        """
        for z in range(K+1):
            if x+y+z==S:
                c+=1
        """
print(c)
Buggy python submission (verdict: Runtime Error):
s=input()
a=s[0]
b=s[1]+s[2]
print(int(a)+int(b))


Fixed submission:
s=input()
s=s.split(" ")
a=s[0]
b=s[1]+s[2]
print(int(a)+int(b))
Buggy python submission (verdict: Runtime Error):
W,H,N=map(int,input().split())
X=[w for w in range(W+1)]
Y=[h for h in range(H+1)]
#print(X,Y)
for n in range(N):
    w,h,a=map(int,input().split())
    if a==1:
        X=[x for x in X if x>=w]
    elif a==2:
        X=[x for x in X if x<=w]
    elif a==3:
        Y=[y for y in Y if y>=h]
    else:
        Y=[y for y in Y if y<=h]
    #print(X,Y)
#print(max(0,(len(X)-1)*(len(Y)-1)))
print(max(0,(X[-1]-X[0])*(Y[-1]-Y[0])))


Fixed submission:
W,H,N=map(int,input().split())
X=[w for w in range(W+1)]
Y=[h for h in range(H+1)]
for n in range(N):
    w,h,a=map(int,input().split())
    if a==1:
        X=[x for x in X if x>=w]
    elif a==2:
        X=[x for x in X if x<=w]
    elif a==3:
        Y=[y for y in Y if y>=h]
    else:
        Y=[y for y in Y if y<=h]
if len(X)<2 or len(Y)<2:
  print(0)
else:
  print((len(X)-1)*(len(Y)-1))
Buggy python submission (verdict: Runtime Error):
days=int(input())
k=int(input())
yen_until_k=int(input())
yen_after_k=int(input())
if days <= k:
  print(days*yen_until_k)
else:
  print(k*yen_until_k+(n-k)*yen_after_k)

Fixed submission:
days=int(input())
k=int(input())
yen_until_k=int(input())
yen_after_k=int(input())
if days <= k:
  print(days*yen_until_k)
else:
  print(k*yen_until_k+(days-k)*yen_after_k)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

listans = [-1] * n
ans = 0

for i in range(m):
    s, c = map(int, input().split())
    if s == 1 and c == 0:
        ans = -1
    if listans[int(s)-1] != c:
        if listans[int(s)-1] == "0":
            listans[int(s)-1] = c
        else :
            ans = -1

if ans == 0:
    if n > 1 and listans[0] == "0":
        listans[0] = "1"
    ans = int("".join([str(li) for li in listans]))

print(ans)

Fixed submission:
n = int(input())

ans = n//2 + n%2

print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

listans = [-1] * n
ans = 0

for i in range(m):
    s, c = map(int, input().split())
    if s == 1 and c == 0:
        ans = -1
    if listans[int(s)-1] != c:
        if listans[int(s)-1] == "0":
            listans[int(s)-1] = c
        else :
            ans = -1

if ans == 0:
    if n > 1 and listans[0] == "0":
        listans[0] = "1"
    ans = int("".join([str(li) for li in listans]))

print(ans)

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

listans = ["0"] * n
ans = 0

for i in range(m):
    s, c = map(str, input().split())
    if n > 1 and s == "1" and c == "0":
        ans = -1
    if listans[int(s)-1] != c:
        if listans[int(s)-1] == "0":
            listans[int(s)-1] = c
        else :
            ans = -1

if ans == 0:
    if n > 1 and listans[0] == "0":
        listans[0] = "1"
    ans = int("".join(listans))

print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

listans = [0] * n
ans = 0

for i in range(m):
    s, c = map(str, input().split())
    if listans[int(s)-1] == 0:
        listans[int(s)-1] = int(c)
    elif listans[int(s)-1] != int(c):
        ans = -1

if listans[0] == 0:
    ans = -1
else :
    if ans == 0:
        ans = int("".join(listans))

print(ans)

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

listans = ["0"] * n
ans = 0

for i in range(m):
    s, c = map(str, input().split())
    if n > 1 and s == "1" and c == "0":
        ans = -1
    if listans[int(s)-1] != c:
        if listans[int(s)-1] == "0":
            listans[int(s)-1] = c
        else :
            ans = -1

if ans == 0:
    if n > 1 and listans[0] == "0":
        listans[0] = "1"
    ans = int("".join(listans))

print(ans)
Buggy python submission (verdict: Runtime Error):
day = input()

if day == 'SUN :
    print(7)
elif day == 'MON' :
    print(6)
elif day == 'TUE' :
    print(5)
elif day == 'WED' :
    print(4)
elif day == 'THU' :
    print(3)
elif day == 'FRI' :
    print(2)
elif day == 'SAT' :
    print(1)

Fixed submission:
day = input()

if day == 'SUN' :
    print(7)
elif day == 'MON' :
    print(6)
elif day == 'TUE' :
    print(5)
elif day == 'WED' :
    print(4)
elif day == 'THU' :
    print(3)
elif day == 'FRI' :
    print(2)
elif day == 'SAT' :
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
 
l.sort()
count = 0
 
for i in range(n) :
    for j in range(1, n - i) :
        for k in range(1, n - i - j) :
            if l[i] + l[i + j] > l[i + j + k] :
                count += 1
 
print(count)

Fixed submission:
from bisect import bisect_left

n = int(input())
l = list(map(int, input().split()))

l.sort()
count = 0

for i in range(n - 2) :
    for j in range(i + 1, n - 1) :
        idx = bisect_left(l, l[i] + l[j])
        count += idx - (j + 1)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))

l.sort()
count = 0

for i in range(n) :
    for j in range(1, n - i) :
        for k in range(1, n - i - j) :
            if l[i] + l[i + j] > l[i + j + k] :
                count += 1

print(count)

Fixed submission:
from bisect import bisect_left

n = int(input())
l = list(map(int, input().split()))

l.sort()
count = 0

for i in range(n - 2) :
    for j in range(i + 1, n - 1) :
        idx = bisect_left(l, l[i] + l[j])
        count += idx - (j + 1)

print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())


while b:
    a, b = b, a % b

# aが最大公約数になっている

if a == 1 :
    print(1)
    exit

def factorization(a):
    arr = []
    temp = a
    for i in range(2, int(-(-a**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([a, 1])

    return arr

print(len(factorization(a) + 1))

Fixed submission:
a, b = map(int, input().split())


while b:
    a, b = b, a % b

# aが最大公約数になっている

if a == 1 :
    print(1)
else :
    def factorization(a):
        arr = []
        temp = a
        for i in range(2, int(-(-a**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp //= i
                arr.append([i, cnt])

        if temp!=1:
            arr.append([temp, 1])

        if arr==[]:
            arr.append([a, 1])

        return arr

    print(int(len(factorization(a)) + 1))

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())


while b:
    a, b = b, a % b

# aが最大公約数になっている

if a == 1 :
    print(1)
    break

def factorization(a):
    arr = []
    temp = a
    for i in range(2, int(-(-a**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([a, 1])

    return arr

print(len(factorization(a) + 1))

Fixed submission:
a, b = map(int, input().split())


while b:
    a, b = b, a % b

# aが最大公約数になっている

if a == 1 :
    print(1)
else :
    def factorization(a):
        arr = []
        temp = a
        for i in range(2, int(-(-a**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp //= i
                arr.append([i, cnt])

        if temp!=1:
            arr.append([temp, 1])

        if arr==[]:
            arr.append([a, 1])

        return arr

    print(int(len(factorization(a)) + 1))
Buggy python submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
 
C = [0] * n
 
for a in range(q) :
    C[int(input())-1] += 1
 
sum_c = sum(C)
 
for i in range(n) :
    minus = sum_c - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')

Fixed submission:
w = input()

if w == 'Sunny' :
    print('Cloudy')
elif w == 'Cloudy' :
    print('Rainy')
else :
    print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())

C = [0] * n

for a in range(q) :
    C[int(input())-1] += 1

for i in range(n) :
    minus = sum(C) - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
 
C = [0] * n
 
for a in range(q) :
    C[int(input())-1] += 1
 
sum_c = sum(C)
 
for i in range(n) :
    minus = sum_c - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
S = []
A = []

for a in range(q) :
    A.append(int(input()))

for i in range(n) :
    S.append(int(k))
    if S[i] - len(A) + A.count(i+1) > 0 :
        print('Yes')
    else :
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
 
C = [0] * n
 
for a in range(q) :
    C[int(input())-1] += 1
 
sum_c = sum(C)
 
for i in range(n) :
    minus = sum_c - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
S = []
A = []

for a in range(q) :
    A.append(int(input()))

for i in range(n) :
    S.append(int(k))
    if S[i] - len(A) + A.count(i+1) > 0 :
        print('Yes')
    else :
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
 
C = [0] * n
 
for a in range(q) :
    C[int(input())-1] += 1
 
sum_c = sum(C)
 
for i in range(n) :
    minus = sum_c - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
S = []
A = []

for a in range(q) :
    A.append(int(input()))

for i in range(n) :
    S.append(int(k))
    S[i] = S[i] - len(A) + A.count(i+1)
    if S[i] > 0 :
        print('Yes')
    else :
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
 
C = [0] * n
 
for a in range(q) :
    C[int(input())-1] += 1
 
sum_c = sum(C)
 
for i in range(n) :
    minus = sum_c - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
S = []
A = []

for i in range(n) :
    S.append(int(k))

for a in range(q) :
    A.append(int(input()))

for i in range(n) :
    S[i] = S[i] - len(A) + A.count(i+1)

for i in range(n) :
    if S[i] > 0 :
        print('Yes')
    else :
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
 
C = [0] * n
 
for a in range(q) :
    C[int(input())-1] += 1
 
sum_c = sum(C)
 
for i in range(n) :
    minus = sum_c - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

sum = 0

for i in range(n) :
    sum += i

print(sum)

Fixed submission:
n = int(input())

print(n * (n - 1) // 2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
abc = []
ans = 0

for i in range(5) :
    abc.append(int(input()))

minabc = min(abc)
ans += n//minabc

if x >= n :
    print(5)
else :
    print(5 + ans)

Fixed submission:
n = int(input())
abc = []
ans = 0

for i in range(5) :
    abc.append(int(input()))

minabc = min(abc)
ans += n//minabc
if n % minabc != 0:
    ans += 1

if minabc >= n :
    print(5)
else :
    print(4 + ans)