Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = 1000
for i in range(n - 1):
    dp = [0] * 1000 * 200
    dp[0] = 0
    c = b
    for j in range(b + 1):
        dp[j + a[i]] = max(dp[j + a[i]], dp[j] + a[i + 1])
    for j in range(b + 1):
        c = max(c, dp[j] + b - j)
    b = c
print(b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
v = 1000
s = 0
for i in range(n - 1):
    if a[i] < a[i + 1]:
        s = v // a[i]
        v += (a[i + 1] - a[i]) * s
print(v)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = 1000
for i in range(n - 1):
    dp = [0] * 100000
    dp[0] = 0
    c = b
    for j in range(b + 1):
        dp[j + a[i]] = max(dp[j + a[i]], dp[j] + a[i + 1])
    for j in range(b + 1):
        c = max(c, dp[j] + b - j)
    b = c
print(b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
v = 1000
s = 0
for i in range(n - 1):
    if a[i] < a[i + 1]:
        s = v // a[i]
        v += (a[i + 1] - a[i]) * s
print(v)
Buggy python submission (verdict: Time Limit Exceeded):
n, a = int(input()), sorted(list(map(int, input().split())))
for i in range(int(input())):
    b, c = map(int, input().split())
    for j in range(n):
        if a[j] == b:
            a[j] = c
        elif a[j] > c:
            break
    a = sorted(a)
    print(sum(a))

Fixed submission:
n, a = int(input()), list(map(int, input().split()))
s = sum(a)
d = [0] * (10 ** 5 + 1)
for i in a:
    d[i] += 1
for i in range(int(input())):
    b, c = map(int, input().split())
    d[c] += d[b]
    s += (c - b) * d[b]
    print(s)
    d[b] = 0

Buggy python submission (verdict: Time Limit Exceeded):
n, a = int(input()), sorted(list(map(int, input().split())))
for i in range(int(input())):
    b, c = map(int, input().split())
    for j in range(n):
        if a[j] == b:
            a[j] = c
        if a[j] > c:
            break
    print(sum(a))

Fixed submission:
n, a = int(input()), list(map(int, input().split()))
s = sum(a)
d = [0] * (10 ** 5 + 1)
for i in a:
    d[i] += 1
for i in range(int(input())):
    b, c = map(int, input().split())
    d[c] += d[b]
    s += (c - b) * d[b]
    print(s)
    d[b] = 0

Buggy python submission (verdict: Time Limit Exceeded):
n, a = int(input()), list(map(int, input().split()))
for i in range(int(input())):
    b, c = map(int, input().split())
    for j in range(n):
        if a[j] == b:
            a[j] = c
    print(sum(a))

Fixed submission:
n, a = int(input()), list(map(int, input().split()))
s = sum(a)
d = [0] * (10 ** 5 + 1)
for i in a:
    d[i] += 1
for i in range(int(input())):
    b, c = map(int, input().split())
    d[c] += d[b]
    s += (c - b) * d[b]
    print(s)
    d[b] = 0

Buggy python submission (verdict: Time Limit Exceeded):
n, a = int(input()), list(map(int, input().split()))
for i in range(int(input())):
    b, c = map(int, input().split())
    a = [c if i == b else i for i in a]
    print(sum(a))

Fixed submission:
n, a = int(input()), list(map(int, input().split()))
s = sum(a)
d = [0] * (10 ** 5 + 1)
for i in a:
    d[i] += 1
for i in range(int(input())):
    b, c = map(int, input().split())
    d[c] += d[b]
    s += (c - b) * d[b]
    print(s)
    d[b] = 0
Buggy python submission (verdict: Runtime Error):
import sympy
n = int(input())
c = 0
for i, j in sympy.factorint(n).items():
    for k in range(j):
        if n % i ** (k + 1) == 0:
            n = n / i ** (k + 1)
            c = c + 1
        else:
            break
print(c)

Fixed submission:
def factorint(n):
    d = dict()
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            c = 0
            while n % i == 0:
                c += 1
                n /= i
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
c = 0
for i, j in factorint(n).items():
    for k in range(j):
        if n % i ** (k + 1) == 0:
            n = n / i ** (k + 1)
            c += 1
        else:
            break
print(c)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
while a * c:
    c -= b
    a -= d
print('Yes' if a else 'No')

Fixed submission:
a, b, c, d = map(int, input().split())
print('Yes' if (a - 1) // d >= (c - 1) // b else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
n, a = int(input()), list(map(int, input().split()))
for i in range(n):
    print(a.count(i + 1))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
c = [0] * n
for i in a:
    c[i - 1] += 1
[print(i) for i in c]
Buggy python submission (verdict: Runtime Error):
n = list(map(int,input().split()))
if sum(n)/9 == sum(n)//9:
	print("Yes")
else:
	print("No")


Fixed submission:
n = list(map(int,input()))
if sum(n)/9 == sum(n)//9:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
k = [5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(k[a-1])

Fixed submission:
a = int(input())
k = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(k[a-1])
Buggy python submission (verdict: Runtime Error):
temp = input()
return print(temp.count('R'))


Fixed submission:
weather = input()
rainyDay = weather.count('R')
if rainyDay < 2:
    print(rainyDay)
else:
    if weather[1] == 'R':
        print(rainyDay)
    else:
        print(1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
    A = sorted([int(i) for i in input().split()])
    res=1
    for x in A:
        res = res*x
        if res > 10 ** 18:
            res = -1
            break
    print(res)

Fixed submission:
res = 1

A = int(input())
N = sorted([int(x) for x in input().split()])

for x in N:
    res *= x
    if res > pow(10, 18):
        res = -1
        break

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
inputNum = int(input())
if inputNum in range(2, pow(10, 5)+1):
  input = input()
  inputArr = input.split()
  result = 1
  for n in range(inputNum):
    result = int(inputArr[n]) * result
  if result in range(0, pow(10, 18)+1):
    print(result)
  else:
    print(-1)

Fixed submission:
res = 1

A = int(input())
N = sorted([int(x) for x in input().split()])

for x in N:
    res *= x
    if res > pow(10, 18):
        res = -1
        break

print(res)
Buggy python submission (verdict: Runtime Error):
N , K = map(int,input().split())
S = str(input())
T =[] #０と１の個数を並べていったリスト
m = 1
for i in range(N-1):
    if S[i] == S[i + 1]:
        m = m + 1
    else:
        T.append(m)
        m = 1
T.append(m)
n = len(T)

left_1 = []
left_0 = []
if S[0] == str(1):
    if K >= (len(T) // 2):
        ans = N
    else:
        if len(T) % 2 == 0:
            i = 0
            while 2*i + 2*K + 1 <= n:
                left_1.append(sum(T[2*i:2*i+2*K+2]))
            left_1.append(sum(T[n - 2*K :n]))
            ans = max(left_1)
        else:
            i = 0
            while 2*i + 2*K + 1 <= n:
                left_1.append(sum(T[2*i:2*i+2*K+2]))
            ans = max(left_1)

else: # if S[0] == 0:
    if n % 2 == 0: 
        if K >= (len(T) / 2):
            ans = N
        else:
            left_0.append(sum(T[0:2*K]))
            i = 0
            while 2*i + 2*K + 2 <= n:
                left_1.append(sum(T[2*i + 1:2*i + 2*K + 3]))
            ans = max(left_0)
    
    else:
        if K >= (len(T)//2 + 1):
            ans = N
        else:
            left_0.append(sum(T[0:2*K]))
            left_0.append(sum(T[n-2*K:n]))
            while 2*i + 2*K + 2 <= n:
                left_1.append(sum(T[2*i + 1:2*i + 2*K + 3]))
            ans = max(left_0)

print (ans)
           


Fixed submission:
A,B = map(int,input().split())
if  A > B:
    print(2*A-1)
elif A == B:
    print(2*A)
else:
    print(2*B-1)
Buggy python submission (verdict: Runtime Error):
a = []
for _ in range(5):
  a.append(int(input()))
b =[]
c = []
for i in range(5):
  b[i] = a[i]
for i in range(5):
  while b[i] > 10:
  	b[i] = b[i] - 10
  if min(b[i]) == 10:
  	print(sum(a))
  else:
  	for i in range(5):
    	if b[i] == 10:
          c[i] = a[i]
        if b[i] != 10:
          c[i] = a[i] +10 -b[i]
        d = sum(c)
        mini = min(b)
        ans = d - 10 + mini
        print(ans)
    

Fixed submission:
a = []
for i in range(5):
  a.append(int(input()))
  
k =int(input())
if k >= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a = []
for _ in range(5):
  a.append(int(input()))
b =[]
c = []
for i in range(5):
  b[i] = a[i]
for i in range(5):
  while b[i] > 10:
  	b[i] = b[i] - 10
  if min(b[i]) == 10:
    return sum(a)
  else:
    for i in range(5):
    	if b[i] == 10:
          c[i] = a[i]
        else:
          c[i] = a[i] +10 -b[i]
        d = sum(c)
        mini = min(b)
        ans = d - 10 + mini
        return ans
    

Fixed submission:
a = []
for i in range(5):
  a.append(int(input()))
  
k =int(input())
if k >= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a = []
for i in range(0,4):
  a.append(input())
k =int(input())
if k <= (a[4] - a[0]):
  print("Yay!")
else:
  print(":(")
  



Fixed submission:
a = []
for i in range(5):
  a.append(int(input()))
  
k =int(input())
if k >= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a = []
for i in range(0,4):
  a.append(input())
k =int(input())
if k <= (a[4] - a[0]):
  print(Yay!)
else:
  print(:()
  


Fixed submission:
a = []
for i in range(5):
  a.append(int(input()))
  
k =int(input())
if k >= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a = []
for i in range(0,4):
  a.append(input())
k =int(input())
if k <= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')
  


Fixed submission:
a = []
for i in range(5):
  a.append(int(input()))
  
k =int(input())
if k >= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a = []
for i in range(0,4):
  a = a.append(input())
k =int(input())
if k <= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')
  

Fixed submission:
a = []
for i in range(5):
  a.append(int(input()))
  
k =int(input())
if k >= (a[4] - a[0]):
  print('Yay!')
else:
  print(':(')
Buggy python submission (verdict: Runtime Error):
a = []
for _ in range(5):
  a.append(int(input()))
b =[]
c = []
for i in range(5):
  b[i] = a[i]
for i in range(5):
  while b[i] > 10:
  	b[i] = b[i] - 10
  if min(b[i]) = 10:
    return sum(a)
  else:
    for i in range(5):
    	if b[i] = 10:
          c[i] = a[i]
        else:
          c[i] = a[i] +10 -b[i]
        d = sum(c)
        mini = min(b)
        ans = d - 10 + mini
        return ans
    
        
          
      
      

Fixed submission:
a = []
for i in range(5):
    a.append(int(input()))
b =[]
c = []
for i in range(5):
    b.append(int(a[i]))
for i in range(5):
    while b[i] > 10:
        b[i] = b[i] - 10
if min(b) == 10:
    ans = sum(a)
else:
    for i in range(5):
    	c.append(int(a[i]) +10 -int(b[i]))
    d = sum(c)
    mini = min(b)
    ans = d - 10 + mini
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
cyapa = []
for i in range (1,6):
    cyapa.append(int(input()))
city1 = N
city2 = 0
city3 = 0
city4 = 0
city5 = 0
city6 = 0
mi = 0
while city6 < N:
    city6 = city6 + min(city5,cyapa[4])
    city5 = city5 + min(city4,cyapa[3]) - min(city5,cyapa[4])
    city4 = city4 + min(city3,cyapa[2]) - min(city4,cyapa[3])
    city3 = city3 + min(city2,cyapa[1]) - min(city3,cyapa[2])
    city2 = city2 + min(city1,cyapa[0]) - min(city2,cyapa[1])
    city1 = city1 - min(city1,cyapa[0])
    mi = mi + 1
print(mi)

Fixed submission:
N = int(input())
cyapa = []
for i in range (1,6):
    cyapa.append(int(input()))
kasu = min(cyapa)
if kasu >= N:
    ans = 5
else:
    ans = 5 + (N-1)//kasu
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
cyapa = []
for i in range (1,6):
    cyapa.append(int(input()))
city1 = N
city2 = 0
city3 = 0
city4 = 0
city5 = 0
city6 = 0
mi = 0
while city6 < N:
    city6 = city6 + min(city5,cyapa[6])
    city5 = city5 + min(city4,cyapa[5]) - min(city5,cyapa[6])
    city4 = city4 + min(city3,cyapa[4]) - min(city4,cyapa[5])
    city3 = city3 + min(city2,cyapa[3]) - min(city3,cyapa[4])
    city2 = city2 + min(city1,cyapa[2]) - min(city2,cyapa[3])
    city1 = city1 - min(city1,cyapa[2])
    mi = mi + 1

Fixed submission:
N = int(input())
cyapa = []
for i in range (1,6):
    cyapa.append(int(input()))
kasu = min(cyapa)
if kasu >= N:
    ans = 5
else:
    ans = 5 + (N-1)//kasu
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

N =int(input())
A = list(map(int,input().split()))
print(reduce(math.gcd,A))

Fixed submission:
import fractions
from functools import reduce

N =int(input())
A = list(map(int,input().split()))
ans = A[0]
for i in range(1, N):
    ans = fractions.gcd(ans, A[i])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
Q=int(input())

for _ in range(Q):
    B,C=map(int,input().split())
    A=[C if i==B else i for i in A]
    print((sum(A)))

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
 
ans = sum(A)
d = Counter(A) #Counterで要素をまとめる
 
for i in range(Q):
    b, c = map(int,input().split())
    tmp = d[b] #bの総数を記憶
    d[b] = 0 #bの総数を0にする
    d[c] += tmp #cの総数にbの総数を足す
    ans += (c-b)*tmp #合計の補正
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
Gokei=[]

for _ in range(Q):
    B,C=map(int,input().split())
    i=0
    while B in A:
        A.remove(B)
        i+=1
    A.extend([C]*i)
    Gokei.append(sum(A))

for i in range(Q):
    print(Gokei[i])
    i+=1

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
 
ans = sum(A)
d = Counter(A) #Counterで要素をまとめる
 
for i in range(Q):
    b, c = map(int,input().split())
    tmp = d[b] #bの総数を記憶
    d[b] = 0 #bの総数を0にする
    d[c] += tmp #cの総数にbの総数を足す
    ans += (c-b)*tmp #合計の補正
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
Gokei=[]

for _ in range(Q):
    B,C=map(int,input().split())
    A=[C if i==B else i for i in A]
    Gokei.append(sum(A))

for i in range(Q):
    print(Gokei[i])
    i+=1

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
 
ans = sum(A)
d = Counter(A) #Counterで要素をまとめる
 
for i in range(Q):
    b, c = map(int,input().split())
    tmp = d[b] #bの総数を記憶
    d[b] = 0 #bの総数を0にする
    d[c] += tmp #cの総数にbの総数を足す
    ans += (c-b)*tmp #合計の補正
    print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
key=max(A)+1 #最大値もrange(a,key,a)で計算させるため
B=[0]*key #0~Aの最大値までのlistを作成
for a in A:
    for b in range(a,key,a):
    B[b]+=1 #aの倍数を全てにBリストで1を足す
ans=0
for a in A:
    if B[a]==1: #自身しか倍数にならなかった物
    ans+=1
print(ans)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
key=max(A)+1 #最大値もrange(a,key,a)で計算させるため
B=[0]*key #0~Aの最大値までのlistを作成
for a in A:
    for b in range(a,key,a):
        B[b]+=1 #aの倍数を全てにBリストで1を足す
ans=0
for a in A:
    if B[a]==1: #自身しか倍数にならなかった物
        ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
i=0

for _ in range(N):
    x=A[0]
    A.pop(0)
    if not any(x%b==0 for b in A):
        i+=1
    A.append(x)

print(i)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
key=max(A)+1 #最大値もrange(a,key,a)で計算させるため
B=[0]*key #0~Aの最大値までのlistを作成
for a in A:
    for b in range(a,key,a):
        B[b]+=1 #aの倍数を全てにBリストで1を足す
ans=0
for a in A:
    if B[a]==1: #自身しか倍数にならなかった物
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))

import collections
c=collections.Counter(A)

for i in range(N):
    print(c[i+1])

Fixed submission:
R=int(input())
import math
print(2*math.pi*R)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))

for i in range(N):
    print(A.count(i+1))

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

import collections
c=collections.Counter(A)

for i in range(N):
    print(c[i+1])
Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator

N, K = map(int, input().split())
performance = list(map(int, input().split()))
performance_A = []

for i in range(0, N-K+1):
  performance_A.append(performance[i:i+K])

for i in range(len(performance_A)-1):
  if functools.reduce(operator.mul, performance_A[i]) < functools.reduce(operator.mul, performance_A[i+1]):
    print("Yes")
  else:
    print("No")

Fixed submission:
import numpy as np
n, k = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(A)

for i in range(n-k):
  if A[k+i] > A[i]:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())

for i in range(X+1):
    if 2*i +4(X - i) == Y:
        print("Yes")
    else:
        print("No")


Fixed submission:
X, Y = map(int, input().split())

for i in range(X+1):
    if (2*i + 4*(X - i)) == Y:
        print("Yes")
        break
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, K    = map(int, input().split())
height  = list(map(int, input().split()))
road    = {}

#道がつながっている辞書を作成
for i in range(K):
    a, b = list(map(int, input().split()))
    try:
        road[a-1].append(b-1)
    except:
        road[a-1] = [b-1]
    try:
        road[b-1].append(a-1)
    except:
        road[b-1] = [a-1]

cnt = 0
for k, v in road.items():
  flag = True
  for i in set(v):
    if height[k] > height[i]:
      pass
    else:
      flag = False
  if flag is True:
    cnt += 1
print(cnt+(n-len(d.keys())))

Fixed submission:
N, K    = map(int, input().split())
height  = list(map(int, input().split()))
road    = {}

#道がつながっている辞書を作成
for i in range(K):
    a, b = list(map(int, input().split()))
    try:
        road[a-1].append(b-1)
    except:
        road[a-1] = [b-1]
    try:
        road[b-1].append(a-1)
    except:
        road[b-1] = [a-1]

cnt = 0
for k, v in road.items():
  flag = True
  for i in set(v):
    if height[k] > height[i]:
      pass
    else:
      flag = False
  if flag is True:
    cnt += 1
print(cnt+(N-len(road.keys())))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
a  = list(input().split())
fact_count = Counter(a)
for i in range(1, N+1)
	try:
    	print(fact_count[i])
	except:
    	print(0)

Fixed submission:
from collections import Counter
N = int(input())
a  = list(input().split())
fact_count = dict(Counter(a))
for i in range(1, N+1):
    try:
        print(fact_count[str(i)])
    except:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a  = list(input().split())

for i in range(1, N+1):
    print(a.count(str(i)))

Fixed submission:
from collections import Counter
N = int(input())
a  = list(input().split())
fact_count = dict(Counter(a))
for i in range(1, N+1):
    try:
        print(fact_count[str(i)])
    except:
        print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())
#sum_ = 1+N
sum_ = 0
for i in range(1, 1+N):
    for j in range(1, 1+N):
        for k in range(1, 1+N):
            a = math.gcd(i, j)
            sum_ += math.gcd(a, k)
            
print(sum_)

Fixed submission:
import math
N = int(input())
#sum_ = 1+N
sum_ = 0
for i in range(1, 1+N):
    for j in range(1, 1+N):
        a = math.gcd(i, j)
        for k in range(1, 1+N):
            sum_ += math.gcd(a, k)
            
print(sum_)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list[:M]:
  if voted < (1/(4*M))*a_total:
    print("No")
    break
else:
  print("Yes")

Fixed submission:
a, b, c = map(int, input().split())
#n=int(input())
#list_ = [input() for i in range(n)]
temp = a
a = b
b = temp
temp = a
a = c
c = temp

print(a,b,c)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_total = sum(a_list)
ld = sorted(a_list, reverse = True)
for i in ld[:M]:
    if i < (1/(4*M))*a_total:
    	print("No")
        break
else:
    print("Yes")

Fixed submission:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list[:M]:
  if voted < (1/(4*M))*a_total:
    print("No")
    break
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_total = sum(a_list)
ld = sorted(a_list, reverse = True)
for i inld[:M]:
    i < (1/(4*M))*a_total:
        print("No")
else:
    print("Yes")

Fixed submission:
N, M = map(int, input().split())
a_list =  list(map(int, input().split()))
a_list.sort(reverse = True)
a_total = sum(a_list)
count = 0
for voted in a_list[:M]:
  if voted < (1/(4*M))*a_total:
    print("No")
    break
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
words = stdin.readline().rstrip().split()
cards  = [int(x) for x in stdin.readline().rstrip().split()]
drop   = stdin.readline().rstrip()

if drop == words[0]:
    cards[0] -= 1
    print(str(cards[0]) + " " + str(cards[1]))
elif drop == words[1]:
    cards[1] -= 1
    print(str(cards[0]) + " " + str(cards[1]))

Fixed submission:
words = input().split()
cards  = [int(x) for x in input().split()]
drop   = input()

if drop == words[0]:
    cards[0] -= 1
    print(str(cards[0]) + " " + str(cards[1]))
elif drop == words[1]:
    cards[1] -= 1
    print(str(cards[0]) + " " + str(cards[1]))

Buggy python submission (verdict: Runtime Error):
words = stdin.readline().rstrip().split()
cards  = [int(x) for x in stdin.readline().rstrip().split()]
drop   = stdin.readline().rstrip()

if drop == words[0]:
    cards[0] -= 1
    print(cards[0] + " " + cards[1])
elif drop == words[1]:
    cards[1] -= 1
    print(cards[0] + " " + cards[1])

Fixed submission:
words = input().split()
cards  = [int(x) for x in input().split()]
drop   = input()

if drop == words[0]:
    cards[0] -= 1
    print(str(cards[0]) + " " + str(cards[1]))
elif drop == words[1]:
    cards[1] -= 1
    print(str(cards[0]) + " " + str(cards[1]))
Buggy python submission (verdict: Time Limit Exceeded):
count = int(input())
s = list()
for x in input().split():
    if x in s:
        print("NO")
        break
    else:
        s.append(x)
else:
    print("YES")

Fixed submission:
count = int(input())
A      = [int(x) for x in input().split()]

if len(set(A)) == len(A):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
participants = [k for i in range(n)]
a = []

for i in range(q):
    line = input()
    a.append(line)

for i in a:
    for j in range(n):
    	if (int(i)-1) != j:
    		participants[j] -= 1

for i in participants:
    if i <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
n, k, q = map(int, input().split())
points = [k-q for i in range(n)]

for i in range(q):
    num = int(input())
    points[num-1] += 1

for i in points:
    if i <= 0:
        print("No")
    else:
        print("Yes")