Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import os
input = os.stdin.readline
A, B, C = map(int, input().split())

flag = False

for i in range(B + 1):
    if A * i %B == c:
        flag = True
        break

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


Fixed submission:
A, B, C = map(int, input().split())

flag = False

for i in range(B + 1):
    if A * i % B == C:
        flag = True
        break

print('YES' if flag else 'NO')
Buggy python submission (verdict: Time Limit Exceeded):
def divis(l):
    seq = []
    beg, end = 0, 0
    le = len(l)
    for i in range(1,le):
        end = i
        if l[i] < l[i-1]:
            seq.append(l[beg:end])
            beg = i
    seq.append(l[beg:end+1])
    return seq

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    a.reverse()
    cost = 0
    a = divis(a)
    a.sort()
    le = len(a)
    first = [a[i][-1] for i in range(le)]
    for i in range(le):
        for j in range(len(a[i])):
            cost += max(first[0:i+1]) - a[i][j]
    print(cost)
    return 0

if __name__ == "__main__":
    solve()

Fixed submission:
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    mi = 0
    le = len(a)
    cost = 0
    for i in range(le-1):
        if mi > a[i+1] or a[i] > a[i+1]:
            mi = max(a[i], mi)
            cost += mi - a[i+1]
    print(cost)
    return 0

if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    s = input()
    ans = 0
    hoge = []
    for i in s:
        if i == "R":
            ans += 1
            hoge.append(ans)
    print(min(hoge))
    return 0

if __name__ == "__main__":
    solve()

Fixed submission:
def solve():
    s = input()
    ans = 0
    hoge = [0]
    for i in s:
        if i == "R":
            ans += 1
            hoge.append(ans)
        else:
            ans = 0
    print(max(hoge))
    return 0

if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    ruiseki = [1]
    ruiseki2 = []
    for i in range(1, n+1):
        ruiseki.append(a[i-1]*ruiseki[i-1])
    for i in range(k-1, n):
        ruiseki2.append(ruiseki[i+1]//ruiseki[i-k+1])
    for i in range(n-k):
        if ruiseki2[i] < ruiseki2[i+1]:
            print("Yes")
        else:
            print("No")
    return 0

if __name__ == "__main__":
    solve()


Fixed submission:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(k, n):
        if a[i] > a[i-k]:
            print("Yes")
        else:
            print("No")
    return 0

if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    ruiseki = [1]
    for i in range(1, n+1):
        ruiseki.append(a[i-1]*ruiseki[i-1])
    for i in range(k-1, n-1):
        if ruiseki[i+1]//ruiseki[i-k+1] >= ruiseki[i+2]//ruiseki[i+2-k]:
            print("No")
        else:
            print("Yes")
    return 0

if __name__ == "__main__":
    solve()


Fixed submission:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(k, n):
        if a[i] > a[i-k]:
            print("Yes")
        else:
            print("No")
    return 0

if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <cmath>
using namespace std;
 
int main() {
	int n;
	cin >> n;
	for (int i = 1; i < n + 1; i++) {
		int cnt = 0;
		for (int x = 1; x < 100; x++) {
			for (int y = 1; y < sqrt(i - x); y++) {
				int rema = i - pow(x, 2) - pow(y, 2) - x * y;
				if (rema > 3) {
					for (int z = 1; z < rema; z++) {
						if (pow(z, 2) + (x + y) * z == rema) {
							cnt++;
							break;
						}
					}
				}
				else {
					break;
				}
			}
		}
		cout << cnt << endl;
	}
	return 0;
}

Fixed submission:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    l, r, d = map(int, input().split())
    ans = 0
    for i in range(l, r+1):
        if i % d == 0:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Runtime Error):
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    l, r, d = map(int, input().split())
    ans = 0
    for i in range(l, r+1):
        if i % d == 0:
            ans += 1
    priht(ans)
    return 0

if __name__ == "__main__":
    solve()



Fixed submission:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    l, r, d = map(int, input().split())
    ans = 0
    for i in range(l, r+1):
        if i % d == 0:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
c = 1
a = list(map(int,input().split()))
for i in range(N):
  c *= a[i]
  if i == N-1:
    if c > 1000000000000000000:
      print(-1)
      break
    else :
      print(c)

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

if 0 in A:
  print(0)
  exit()

for i in range(N):
  c *= A[i]
  if c > 10 ** 18:
    print(-1)
    exit()
print(c)
Buggy python submission (verdict: Runtime Error):
i = int(input())
count = 0
for i in range(i):
  a, b = input().split(' ')
  if a == b:
    count += 1
print('Yes' if count >= 3 else 'No'


Fixed submission:
i = int(input())
count = 0
res = False
for i in range(i):
  a, b = input().split(' ')
  if a == b:
    count += 1
  else:
    count = 0
  if count >= 3:
    res = True
print('Yes' if res else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-
X = int(input())

sosu_list = [2]

for num in range(3,X+1,2):
    if all(num%sosu != 0 for sosu in sosu_list):
        sosu_list.append(num)

if X == sosu_list[-1]:
    print(X)
else:
    if X % 2 ==0:
        X+=1
    while True:
        if all(X%sosu != 0 for sosu in sosu_list):
            print(X)
            break
        X += 2


Fixed submission:
# -*- coding:utf-8 -*-
X = int(input())

sosu_list = [2]

for num in range(3,X+1,2):
    if all(num%sosu != 0 for sosu in sosu_list):
        sosu_list.append(num)

if X == sosu_list[-1]:
    print(X)
else:
    if X % 2 ==0:
        X+=1
    while True:
        if all(X%sosu != 0 for sosu in sosu_list):
            print(X)
            break
        X += 2
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-
N = int(input())
a = list(map(int,input().split()))

ans_str = str(a.index(1)+1)

for i in range(1,N):
    ans_str += " "+ str(a.index(i+1)+1)
print(ans_str)

Fixed submission:
# -*- coding:utf-8 -*-
N = int(input())
a = list(map(int,input().split()))

L = {}

for i in range(N):
    L[i] = a[i]

sort_L = sorted(L.items(), key=lambda x:x[1])

for j in sort_L:
    print(j[0]+1, end =" ")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(A*B)

Fixed submission:
A, B = map(int,input().split())
print(A*B)
Buggy python submission (verdict: Runtime Error):
S, W = map(int.input(" ")) 
if W >= S :
    print("Unsafe")
else:
    print("Safe")

Fixed submission:
S, W = list(map(int, input().split()))
if W >= S :
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
A1=int(input())
A2= int(input())
A3= int(input())
if(A1+A2+A3>=22):
    print("bust")
else:
    print("win")

Fixed submission:
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Buggy python submission (verdict: Runtime Error):
A1 = int(input())
A2 = int(input())
A3 = int(input())
sum  = A1+A2+A3
if(sum>=22):
    print("bust")
else:
    print("win")

Fixed submission:
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")
Buggy python submission (verdict: Runtime Error):
data = [int(k) for k in input().split()]

A = data[0]
B = data[1]
K = data[2]

Abooks = [int(k) for k in input().split()]
Bbooks = [int(k) for k in input().split()]


time = 0
nbOfBooks = 0

while (time + Bbooks[0]) <= K or (time + Abooks[0])  <= K:
	
		
	if Abooks[0] >= Bbooks[0]:
		
		time += Bbooks[0]
		
		if len(Bbooks) == 1:
			Bbooks[0] = 10**9+1
		else:

			Bbooks.pop()
		
		nbOfBooks += 1

	else:
		
		time += Abooks[0]
		
		if len(Abooks) == 1:
			Abooks[0] = 10**9+1
		
		else:

			Abooks.pop()
		nbOfBooks += 1 


print(nbOfBooks)

Fixed submission:
nb = int(input())
print(str(nb + nb**2 + nb**3))
Buggy python submission (verdict: Time Limit Exceeded):
def main():

	nbOperation = 0

	sentenceS = input()
	sentenceToT = input()

	for i in range(len(sentenceS)):
		if sentenceS[i] != sentenceToT[i]:
			convertisseur = list(sentenceS)
			convertisseur[i] = sentenceToT[i]
			nbOperation += 1
			sentenceS = "".join(convertisseur)

	print(nbOperation)

main()

Fixed submission:
def main():

	nbOperation = 0

	sentenceS = list(input())
	sentenceToT = input()

	for i in range(len(sentenceS)):
		if sentenceS[i] != sentenceToT[i]:
			
			sentenceS[i] = sentenceToT[i]
			nbOperation += 1
			

	print(nbOperation)

main()

Buggy python submission (verdict: Time Limit Exceeded):
nbOperation = 0

sentenceS = input()
sentenceToT = input()

for i in range(len(sentenceS)):
	if sentenceS[i] != sentenceToT[i]:
		convertisseur = list(sentenceS)
		convertisseur[i] = sentenceToT[i]
		nbOperation += 1
		sentenceS = "".join(convertisseur)

print(nbOperation)


Fixed submission:
def main():

	nbOperation = 0

	sentenceS = list(input())
	sentenceToT = input()

	for i in range(len(sentenceS)):
		if sentenceS[i] != sentenceToT[i]:
			
			sentenceS[i] = sentenceToT[i]
			nbOperation += 1
			

	print(nbOperation)

main()
Buggy python submission (verdict: Runtime Error):
nb = int(input())
number = len(nb)-1

if nb[number] in [2, 4, 5, 7, 9]:
  print("hon")
elif nb[number] in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')

Fixed submission:
nb = input()
number = len(nb)-1

if int(nb[number]) in [2, 4, 5, 7, 9]:
  print("hon")
elif int(nb[number]) in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')
Buggy python submission (verdict: Runtime Error):
data = input().split()

seven = 0
five = 0

for i in range(data):
	if int(i) == 7:
		seven += 1
	elif int(i) == 5:
		five +=1

if seven == 1 and five == 2:
	print('YES')
else:
	print('NO')

Fixed submission:
data = input().split()

seven = 0
five = 0

for i in range(len(data)):
	if int(data[i]) == 7:
		seven += 1
	elif int(data[i]) == 5:
		five +=1

if seven == 1 and five == 2:
	print('YES')
else:
	print('NO')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = [0]*Q
C = [0]*Q
S = [0]*Q
for i in range(Q):
    B[i], C[i] = map(int, input().split())

for i in range(Q):
    A_replace = [C[i] if a == B[i] else a for a in A]

    A = A_replace
    S[i] = sum(A_replace)

for i in range(Q):
    print(S[i])




Fixed submission:
alpha = input()
if alpha.isupper():
    print("A")
else:
    print("a")
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
A, B = map(int, input().split())
a = 0
K_sum = K
while K <= B:
    if A<=K and K<=B:
        a = 1
        break
    K_sum += K

if a==1:
    print("OK")
else:
    print("NG")

Fixed submission:
K = int(input())
A, B = map(int, input().split())
mod = A % K
dif = B - A
if mod + dif >= K or mod==0:
    print("OK")
else:
    print("NG")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for _ in range(N)]  
uni_S = []
for s in S:
    if(s not in uni_S):
        uni_S.append(s)

print(len(uni_S))


Fixed submission:
N = int(input())
S = [input() for _ in range(N)]  
S.sort()
uni_count = 1
for i in range(N-1):
    if(S[i+1]!=S[i]):
        uni_count += 1
print(uni_count)
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
X=int(input())
if A<=X and X<=A+B:
	print("YES")
else :
	print("NO")

Fixed submission:
A, B, X = map(int, input().split())
if A<=X and X<=A+B:
	print("YES")
else :
	print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())

A = list(map(int, input().split()))

visitcount = dict()
n_point = list()

x = 1
count = 0
while(x not in set(visitcount)):
  visitcount[x] = count
  n_point.append(x)
  x = A[x-1]
  count += 1
  
period = count - visitcount[x]

if (K < visitcount[x]):
  print(n_point[K])
else:
  y = (K-visitcount[x]) % period
  print(n_point[visitcount[x] + y])


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

A = list(map(int, input().split()))

visitset = set()
visitcount = dict()
n_point = dict()

x = 1
count = 0
while(x not in visitset):
  visitset.add(x)
  visitcount[x] = count
  n_point[count] = x
  x = A[x-1]
  count += 1


period = count - visitcount[x]

if (K < visitcount[x]):
  print(n_point[K])
else:
  y = (K-visitcount[x]) % period
  print(n_point[visitcount[x] + y])

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

A = list(map(int, input().split()))

visitcount = dict()
n_point = list()

x = 1
count = 0
while(x not in set(visitcount)):
  visitcount[x] = count
  n_point.append(x)
  x = A[x-1]
  count += 1
  
period = count - visitcount[x]

if (K < visitcount[x]):
  print(n_point[K])
else:
  y = (K-visitcount[x]) % period
  print(n_point[visitcount[x] + y])
 



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

A = list(map(int, input().split()))

visitset = set()
visitcount = dict()
n_point = dict()

x = 1
count = 0
while(x not in visitset):
  visitset.add(x)
  visitcount[x] = count
  n_point[count] = x
  x = A[x-1]
  count += 1


period = count - visitcount[x]

if (K < visitcount[x]):
  print(n_point[K])
else:
  y = (K-visitcount[x]) % period
  print(n_point[visitcount[x] + y])
Buggy python submission (verdict: Time Limit Exceeded):
import math

N, X, Y = map(int, input().split())

distnum = [0 for i in range(N)]
dist = [[0 for i in range(N+1)] for j in range(N+1)]


for i in range(1, N+1):
  for j in range(i, N+1):
    dist[i][j] = min(abs(X-i) + 1 + abs(Y-j), abs(X-j)+1+abs(Y-i), abs(i-j))
    distnum[dist[i][j]] += 1

for i in range(1, N):
  print(distnum[i])

Fixed submission:
import math

N, X, Y = map(int, input().split())

distnum = [0 for i in range(N)]


for i in range(1, N+1):
  for j in range(i, N+1):
    dist = min(abs(X-i) + 1 + abs(Y-j), abs(X-j)+1+abs(Y-i), abs(i-j))
    distnum[dist] += 1

for i in range(1, N):
  print(distnum[i])
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input()))

x = -1
for i in range(10100):
  if (int(i*0.08) == A) and (int(i*0.1) == B):
    x = i
    break
  
print(x)

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

x = -1
for i in range(10100):
  if (int(i*0.08) == A) and (int(i*0.1) == B):
    x = i
    break
  
print(x)

Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input()))

x = -1
for i in range(10100)
  if (int(i*0.08) == A) and (int(i*0.1) == B):
    x = i
    break
  
print(x)

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

x = -1
for i in range(10100):
  if (int(i*0.08) == A) and (int(i*0.1) == B):
    x = i
    break
  
print(x)

Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input()))

x = -1
for i in range(100):
  if (int(i*1.08) == A) and (int(i*1.1) == B):
    x = i
    break
  
print(x)

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

x = -1
for i in range(10100):
  if (int(i*0.08) == A) and (int(i*0.1) == B):
    x = i
    break
  
print(x)
Buggy python submission (verdict: Runtime Error):
import fractions
import math
import heapq
import collections

A,B = map(int, input().split(" "))
G = fractions.gcd(A,B)

S = set()


def p_fac(N):
  ans = 2
  if (N % 2 == 0):
    ans += 1
    while(N % 2 ==0):
      N = N // 2
  a = 3
  while(a < N):
    if (N % a == 0):
      ans += 1
      while( N % a == 0):
        N = N // a
    a += 2

  return ans

print(p_fac(G))



Fixed submission:
N = int(input())

if N % 2 == 0:
  print(1/2)
else:
  n = N // 2 + 1
  print(n /N )
Buggy python submission (verdict: Runtime Error):
H, W, a, b = map(int, input().split())
x = '1' * (W-A)
y = '0' * (W-A)
x.rjust(W, "0")
y.rjust(W, "1")

for i in range(B):
  print(x)
for i in range(H-B):
  print(y)

Fixed submission:
H, W, A, B = map(int, input().split())
x = '1' * (W-A)
y = '0' * (W-A)
x = x.rjust(W, "0")
y = y.rjust(W, "1")

for i in range(B):
  print(x)
for i in range(H-B):
  print(y)
Buggy python submission (verdict: Runtime Error):
N , M = map(int, input().rstrip().split())
 
pricelist = list(map(int, input().split()))
#moneylist = input().rstrip().split()
#pricelist.append(price)
 
for i in range(M):
  pricelist.sort()
  pricelist[N-1] = pricelist[N-1] // 2

print(sum(pricelist)) 

Fixed submission:
weatherlist = ["Sunny", "Cloudy", "Rainy"]
 
weather = input().rstrip()
weathernum = weatherlist.index(weather)
 
tomorrownum = (weathernum +1) % 3

print(weatherlist[tomorrownum])

Buggy python submission (verdict: Runtime Error):
weatherlist = ["Sunny", "Cloudy", "Rainy"]
 
weather = input().rstrip()
weathernum = weatherlist.index(weather)
 
tomorrownum = weathernum % 3
 
print(weatherlist[tomorrownum + 1])

Fixed submission:
weatherlist = ["Sunny", "Cloudy", "Rainy"]
 
weather = input().rstrip()
weathernum = weatherlist.index(weather)
 
tomorrownum = (weathernum +1) % 3

print(weatherlist[tomorrownum])
Buggy python submission (verdict: Runtime Error):
strlist = input().rstrip().split("")
evenset = set()
oddset = set()
 
for i in range(len(strlist)):
  if i % 2 == 0:
    oddset.add(strlist[i])
  else:
    evenset.add(strlist[i])
 
if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")
 
else:
  print("No")

Fixed submission:
moji = input().rstrip()
mojilist = list(moji)
evenset = set()
oddset = set()

for i in range(len(mojilist)):
  if i % 2 == 0:
    oddset.add(mojilist[i])
  else:
    evenset.add(mojilist[i])

if ((oddset <= {"R","U","D"}) and (evenset <= {"L","U","D"})):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
strlist = input().rstrip().split("")
evenset = set()
oddset = set()
 
for i in range(len(strlist)):
  if i % 2 == 0:
    evenset.add(strlist[i])
  else:
    oddset.add(strlist[i])
 
if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")
 
else:
  print("No")

Fixed submission:
moji = input().rstrip()
mojilist = list(moji)
evenset = set()
oddset = set()

for i in range(len(mojilist)):
  if i % 2 == 0:
    oddset.add(mojilist[i])
  else:
    evenset.add(mojilist[i])

if ((oddset <= {"R","U","D"}) and (evenset <= {"L","U","D"})):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
strlist = input().rstrip().split("")
evenset = set()
oddset = set()

for i in range(len(strlist)):
  if i % 2 == 0:
    evenset.add(setlist[i])
  else:
    oddset.add(setlist[i])

if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")

else:
  print("No")



    



Fixed submission:
moji = input().rstrip()
mojilist = list(moji)
evenset = set()
oddset = set()

for i in range(len(mojilist)):
  if i % 2 == 0:
    oddset.add(mojilist[i])
  else:
    evenset.add(mojilist[i])

if ((oddset <= {"R","U","D"}) and (evenset <= {"L","U","D"})):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())


pointlist = [K for i in range(N)]
 
for i in range(Q):
  Aperson = int(input())
  for j in range(N):
    if j+1 != Aperson:
      pointlist[j] -= 1

for i in range(N):
  if pointlist[i] <= 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
N,K,Q = map(int,input().split())
judgepoint = Q - K

anslist = [0 for i in range(N)]
 
for i in range(Q):
  Aperson = int(input())
  anslist[Aperson -1] += 1

for i in range(N):
  if anslist[i] <= judgepoint:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
N, K, Q =　map(int, input().split(" "))
 
pointlist = [K for i in range(N)]
 
for i in range(Q):
  Aperson = int(input())
  for j in range(N):
    if j+1 != Aperson:
      pointlist[j] -= 1

for i in range(N):
  if pointlist[i] <= 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
N,K,Q = map(int,input().split())
judgepoint = Q - K

anslist = [0 for i in range(N)]
 
for i in range(Q):
  Aperson = int(input())
  anslist[Aperson -1] += 1

for i in range(N):
  if anslist[i] <= judgepoint:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
N, K, Q =　map(int, input().rstrip().split(" "))

pointlist = [K for i in range(N)]

for i in range(Q):
  Aperson = int(input())
  for j in range(N):
    if j+1 != Aperson:
      pointlist[j] -= 1

for i in range(N):
  if pointlist[i] <= 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
N,K,Q = map(int,input().split())
judgepoint = Q - K

anslist = [0 for i in range(N)]
 
for i in range(Q):
  Aperson = int(input())
  anslist[Aperson -1] += 1

for i in range(N):
  if anslist[i] <= judgepoint:
    print("No")
  else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N , M = map(int, input().rstrip().split())
 
pricelist = list(map(int, input().split()))
#moneylist = input().rstrip().split()
#pricelist.append(price)
 
for i in range(M):
  pricelist.sort()
  pricelist[N-1] = pricelist[N-1] // 2

print(sum(pricelist)) 

Fixed submission:
import heapq
N , M = map(int, input().rstrip().split())
 
pricelist = list(map(int, input().split()))
for i in range(N):
  pricelist[i] = pricelist[i] * (-1)
heapq.heapify(pricelist)

 
for i in range(M):
  minprice = heapq.heappop(pricelist)
  if minprice % 2 == 0:
    minprice = minprice // 2
  else:
    minprice = minprice // 2 + 1
  heapq.heappush(pricelist, minprice)

print(sum(pricelist)* (-1))

Buggy python submission (verdict: Time Limit Exceeded):
N , M = map(int, input().rstrip().split())

pricelist = list(map(int, input().split()))
#moneylist = input().rstrip().split()
#pricelist.append(price)

for i in range(M):
  maxprice = max(pricelist)
  num = pricelist.index(maxprice)
  pricelist[num] = maxprice // 2

print(sum(pricelist)) 



Fixed submission:
import heapq
N , M = map(int, input().rstrip().split())
 
pricelist = list(map(int, input().split()))
for i in range(N):
  pricelist[i] = pricelist[i] * (-1)
heapq.heapify(pricelist)

 
for i in range(M):
  minprice = heapq.heappop(pricelist)
  if minprice % 2 == 0:
    minprice = minprice // 2
  else:
    minprice = minprice // 2 + 1
  heapq.heappush(pricelist, minprice)

print(sum(pricelist)* (-1))
Buggy python submission (verdict: Runtime Error):
N = int(input())

shiritori_set = set()

shiritori = input()
head = shiritori[len(shiritori) -1]

ans = "Yes"

for i in range(N-1):
  shiritori = input()
  if (shirotori[0] == head and shiritori in shiritori_set):
    head = shiritori[len(shiritori)-1]
    shiritori_set.add(shiritori)
    continue
  else:
    ans = "No"
    break

print(ans)


  
  

Fixed submission:
N = int(input())

shiritori_set = set()

shiritori = input()
head = shiritori[len(shiritori) -1]

ans = "Yes"
shiritori_set.add(shiritori)
for i in range(N-1):
  shiritori = input()
  if shiritori[0] == head and shiritori not in shiritori_set:
    head = shiritori[len(shiritori)-1]
    shiritori_set.add(shiritori)
  else:
    ans = "No"
    break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int, input().split())
z= -1 * 10**9
for i in range(a,b+1):
    for j in range(c,d+1):
        p = (i * j)
        if p > z:
            z=p
print(z)

Fixed submission:
a,b,c,d=map(int, input().split())
p=[0]*4
p[0] = a * c
p[1] = a * d
p[2] = b * c
p[3] = b * d
z = max(p)
print(z)