Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
n = int(n)
y = input()
list = y.split(' ')
nums = []

for i in range(n):
    i = i + 1
    nums.append(i)

for i in nums:
    i = str(i)
    print(list.count(i))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
nums = [0] * n

for i in a:
    nums[i-1] += 1

print("\n".join(map(str, nums)))

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
n = int(n)
y = input()
list = y.split(' ')

for i in range(n):
    i = i + 1
    i = str(i)
    count = list.count(i)
    print(count)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
nums = [0] * n

for i in a:
    nums[i-1] += 1

print("\n".join(map(str, nums)))

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
n = int(n)
y = input()
list = y.split(' ')

for i in range(n):
    i = i + 1
    i = str(i)
    print(list.count(i))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
nums = [0] * n

for i in a:
    nums[i-1] += 1

print("\n".join(map(str, nums)))

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
n = int(n)
y = input()
list = y.split(' ')

for i in range(n):
    i = i + 1
    i = str(i)
    print(y.count(i))    


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
nums = [0] * n

for i in a:
    nums[i-1] += 1

print("\n".join(map(str, nums)))
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
sum = 0

for i in range(1, k+1):
  for j in range(1, k+1):
    for k in range(1, k+1):
      sum += math.gcd(math.gcd(i, j), k)
      
print(sum)

Fixed submission:
from math import gcd
k = int(input())
sum = 0

for i in range(1, k+1):
  for j in range(1, k+1):
    for k in range(1, k+1):
      sum += gcd(gcd(i, j), k)
      
print(sum)
Buggy python submission (verdict: Runtime Error):
x = input()
y = input()
list = y.split()
even_list = []

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APROVED"
  else:
    result = "DENIED"
    break
    
print(result)


Fixed submission:
x = input()
y = input()
list = y.split()
even_list = []
result = ''

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
  else:
    result = "APPROVED"
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APPROVED"
  else:
    result = "DENIED"
    break
    
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
x = input()
a = int(x.split()[0])
b = int(x.split()[1])
k = int(x.split()[2])

for i in range(k):
  if a > 0:
    a = a - 1
  elif b > 0:
    b = b - 1

print(str(a) + ' ' + str(b))

Fixed submission:
x = input()
a = int(x.split()[0])
b = int(x.split()[1])
k = int(x.split()[2])
a_result = ''
b_result = ''

if k >= a:
  a_result = '0'
  k = k -a
else:
  a_result = str(a - k)
  k = 0

if k >= b:
  b_result = '0'
else:
  b_result = str(b - k)
  
print(a_result + ' ' + b_result)
Buggy python submission (verdict: Runtime Error):
s = input()
list = list(s)

for i in range(len(s) / 2):
  print(list[i])

Fixed submission:
x = input()
a1 = int(x.split()[0])
a2 = int(x.split()[1])
a3 = int(x.split()[2])

sum = a1 + a2 + a3

if sum >= 22:
    print('bust')
else:
    print('win')
Buggy python submission (verdict: Runtime Error):
x = input()
list = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']

for i in range(len(list)):
    theday = list[i]
    if x == theday:
        answer = list[i + 1]
print(answer)


Fixed submission:
x = input()
list = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']
 
for i in range(len(list) - 1):
    theday = list[i]
    if x == theday:
        answer = list[i + 1]
print(answer)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

for i in range(10):
  c = (a * i) - (i - 1)
  if c >= b:
    ans = i
    break
  
print(ans)

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

for i in range(20):
  c = (a * i) - (i - 1)
  if c >= b:
    ans = i
    break
  
print(ans)
Buggy python submission (verdict: Runtime Error):
t = int(input())
print("Yes" if 30 <= t "No")


Fixed submission:
t = int(input())
print("Yes" if 30 <= t else "No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
for _ in range(N):
    keihin = input()
    if keihin not in S:S.append(keihin)

print(len(S))

Fixed submission:
N = int(input())
S = []
for _ in range(N):
    S.append(input())

print(len(set(S)))

Buggy python submission (verdict: Runtime Error):
N = int(input().split())
S = []
for _ in range(N):
    keihin = input().split()
    if keihin not in S:S.append(keihin)

print(len(S))

Fixed submission:
N = int(input())
S = []
for _ in range(N):
    S.append(input())

print(len(set(S)))
Buggy python submission (verdict: Runtime Error):
for i in range(3):
    a = []
    for j in range(3):
      	a = input().split()
        a = [int(x) for x in a]
    A.append(a)
N = int(input())
C = []
for _ in range(3):
    C.append(np.zeros(3))
 
for _ in range(N):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if A[i][j] == b: C[i][j] = 1
 
for i in range(3):
    if sum(C[:][i]) == 3:
        print('Yes')
        break
    elif sum(C[i][:]) == 3:
        print('Yes')
        break
if C[1][1]+C[2][2]+C[0][0] == 3:
    print('Yes')
elif C[0][2]+C[1][1]+C[2][0] == 3:
    print('Yes')
else: print('No')

Fixed submission:
N = int(input())
print(int(N/2)+N%2)
Buggy python submission (verdict: Runtime Error):
input=list(input())
if(input[2]==input[3] and input[5]==input[6]):
  print("Yes")
else:
  print("No")

Fixed submission:
string=str(input())
if(string[2]==string[3] and string[4]==string[5]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

set_list = list(set(a_list))

if n-1 == len(set_list):
    for i in range(n):
        if i == n-1:
            print(0)
        else:
            print(1)
elif len(set_list) == 1:
    for i in range(n):
        if i == 0:
            print(n-1)
        else:
            print("0")
else:
    for i in range(n):
        if i+1 in set_list:
            print(a_list.count(i+1))
        else:
            print("0")

Fixed submission:
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

ans_list = [0 for i in range(n)]

for a in a_list:
    ans_list[a-1] = ans_list[a-1] + 1

for ans in ans_list:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

set_list = list(set(a_list))

if n-1 == len(set_list):
    for i in range(n):
        if i == n-1:
            print(0)
        else:
            print(1)
else:
    for i in range(n):
        if i+1 in set_list:
            print(a_list.count(i+1))
        else:
            print("0")

Fixed submission:
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

ans_list = [0 for i in range(n)]

for a in a_list:
    ans_list[a-1] = ans_list[a-1] + 1

for ans in ans_list:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

set_list = list(set(a_list))

for i in range(n):
    if i+1 in set_list:
        print(a_list.count(i+1))
    else:
        print("0")

Fixed submission:
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

ans_list = [0 for i in range(n)]

for a in a_list:
    ans_list[a-1] = ans_list[a-1] + 1

for ans in ans_list:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

for i in range(n):
    print(a_list.count(i+1))


Fixed submission:
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

ans_list = [0 for i in range(n)]

for a in a_list:
    ans_list[a-1] = ans_list[a-1] + 1

for ans in ans_list:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

line = input()
num = int(line)
total = 0

for i in range(num):
    for j in range(num):
        for k in range(num):
            ans = 0
            ans = math.gcd((math.gcd(i+1, j+1)), k+1)
            total = total + ans
print(total)

Fixed submission:
import math

line = input()
num = int(line)
total = 0

if num == 200:
    print("10813692")
elif num == 199:
    print("10611772")
elif num == 198:
    print("10493367")
elif num == 197:
    print("10290813")
elif num == 196:
    print("10174780")
elif num == 195:
    print("9997134")
elif num == 194:
    print("9827097")
elif num ==193:
    print("9686065")
elif num ==192:
    print("9574704")
elif num ==191:
    print("9376656")
elif num ==190:
    print("9267595")
elif num ==189:
    print("9105537")
elif num ==188:
    print("8949612")
elif num ==187:
    print("8802826")
elif num ==186:
    print("8684853")
elif num ==185:
    print("8523897")
elif num ==184:
    print("8403448")
elif num ==183:
    print("8253888")
elif num ==182:
    print("8130747")
elif num ==181:
    print("7984165")
elif num ==180:
    print("7886244")
elif num ==179:
    print("7689630")
elif num ==178:
    print("7593865")
elif num ==177:
    print("7475145")
elif num ==176:
    print("7359936")
elif num ==175:
    print("7215016")
else:
    for i in range(1, num+1):
        for j in range(1, num+1):
            for k in range(1, num+1):
                ans = 0
                ans = math.gcd((math.gcd(i, j)), k)
                total = total + ans
    print(total)
Buggy python submission (verdict: Runtime Error):
k = input()
k = int(k)

if 1 <= k and k <= 12:
    print(k)
elif 13 <= k and k <= 35:
    temp = k-9
    q = temp // 3
    p = temp % 3
    
    s = ""
    s = s + str(q)
    if p == 0:
        s = s + str(q+1)
    elif p == 1:
        s = s + str(q)
    elif p == 2:
        s = s + str(q-1)
print(s)

Fixed submission:
line = input()
n, k = line.split(" ")
n = int(n)
k = int(k)

temp = n % k
if temp == 0:
    print(0)
elif abs(temp - k) < temp:
    print(abs(temp - k))
elif abs(temp -k) > temp:
    print(temp)
Buggy python submission (verdict: Time Limit Exceeded):
line = input()
n, a, b = line.split(" ")
n = int(n)
a = int(a)
b = int(b)

num = 0
i = 0
while num <= n:
    num = num + a + b
    i = i + 1
br_num = a + b
if ((a + b)*i) - n <= b:
    print(a * i)
else:
    num1 = ((a + b)* i) - n
    num2 = a * i
    num3 = num1 - b
    print(num2 - num3)

Fixed submission:
line = input()
n, a, b = line.split(" ")
n = int(n)
a = int(a)
b = int(b)

num = 0
i = 0
i = int(n / (a + b)) + 1
if ((a + b)*i) - n <= b:
    print(a * i)
else:
    num1 = ((a + b)* i) - n
    num2 = a * i
    num3 = num1 - b
    print(num2 - num3)
Buggy python submission (verdict: Runtime Error):
import statistics

def cal_hp(p, num_list):
    total = 0
    for num in num_list:
        temp = (num - p) ** 2
        total = total + temp
    return total

line1 = input()
line2 = input()

num_list = line2.split(" ")
num_list = [int(n) for n in num_list]
ans_list = []

for i in range(0, max(num_list)+1):
    ans_list.append(cal_hp(i, num_list))
print(min(ans_list))


Fixed submission:
line = input()
n, r = line.split(" ")

if int(n) < 10:
    rate = int(r) + (100*(10-int(n)))
    print(rate)
else:
    print(int(r))
Buggy python submission (verdict: Time Limit Exceeded):
line1 = input()
line2 = input()
num_list = line2.split(" ")
flag = 0

for i in range(len(num_list)-1):
    search_num = num_list[0]
    num_list.pop(0)
    if search_num in num_list:
        flag = 1
        break
if flag == 1:
    print("NO")
else:
    print("YES")
        

Fixed submission:
line1 = input()
line2 = input()
num_list = line2.split(" ")

if len(num_list) == len(set(num_list)):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
h = input()
h = int(h)

def func_dame(h):
    if h == 1:
        return 1
    else:
        return 2 * func_dame(h/2) + 1
atack_num = 2 * func_dame(h / 2) + 1
print(atack_num)

Fixed submission:
def f(x):
    if x == 1:
        return 1
    else:
        return 2*f(int(x/2))+1

h = input()
h = int(h)
print(f(h))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(input().split())
x=1000000000000000000
res=1
for i in range(n):
  res=res*int(a[i])
if(res>x):
  print("-1")
else:
  print(res)

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

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=1000000000000000000
res=1
for i in range(n):
  x=int(input())
  res=res*x
if(res>x):
  print("-1")
else:
  print(res)


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

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=1000000000000000000
res=1
for i in range(n):
	res=res*int(input())
if(res>x):
	print("-1")
else:
	print(res)


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

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=1000000000000000000
res=1
for i in range(n):
  res=res*int(input())
if(res>x):
  print("-1")
else:
  print(res)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
res=1
if 0 in a:
  print("0")
else:
  for x in a:
    res=res*x
    if(res>1000000000000000000):
      res=-1
      break
  print(res)
Buggy python submission (verdict: Time Limit Exceeded):
def digits (n):
    digits = []
    while n != 0:
        r = n % 10
        digits.append(r)
        n = n // 10 
    return digits

def check (n):
    sum = 0
    for i in digits (n):
        sum += i
    return sum % 9 == 0

n = int(input())
result = check(n)

if result == True:
    result = "Yes"
else:
    result = "No"
print(result)

Fixed submission:
n = int(input())
result = n % 9

if result == 0:
    result = "Yes"
else:
    result = "No"
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
I = 1 
W = 10 ** 9 + 7
while I <= A:
    P *= I
    I += 1
P %= W
print(P)

Fixed submission:
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
I = 1 
W = 10 ** 9 + 7
while I <= A:
    P *= I
    I += 1
    P %= W
print(P)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
W = 10 ** 9 + 7
for i in range(A):
    P *= (i+1)
P %= W
print(P)

Fixed submission:
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
I = 1 
W = 10 ** 9 + 7
while I <= A:
    P *= I
    I += 1
    P %= W
print(P)

Buggy python submission (verdict: Time Limit Exceeded):
a = input()
A = int(a)
P = 1
W = 1000000007
for i in range(A):
    P *= (i+1)
P %= W
print(P)

Fixed submission:
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
I = 1 
W = 10 ** 9 + 7
while I <= A:
    P *= I
    I += 1
    P %= W
print(P)

Buggy python submission (verdict: Time Limit Exceeded):
a = input()
A = int(a)
P = 1
W = 1000000007
for i in range(A):
    P = P * (i+1)
P = P % W
print(P)

Fixed submission:
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
I = 1 
W = 10 ** 9 + 7
while I <= A:
    P *= I
    I += 1
    P %= W
print(P)

Buggy python submission (verdict: Time Limit Exceeded):
a = input()
A = int(a)
P = 1
W = 10 ** 9 + 7
for i in range(A):
    P = P * (i+1)
P = P % W
print(P)

Fixed submission:
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
I = 1 
W = 10 ** 9 + 7
while I <= A:
    P *= I
    I += 1
    P %= W
print(P)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

if(K%2 == 0):
    print("-1")
    exit()

A = 7
ans = 1
while(A < K): #O(6)
    A = A*10 + 7
    ans += 1

while(True):
    #print(A)
    A = A % K #1
    if(ans > K):
        print("-1")
    if(A==0): #1
        print(ans)
        exit()
    A = A * 10 + 7 # 1
    ans += 1# 1


Fixed submission:
K = int(input())

if(K%2 == 0):
    print("-1")
    exit()

A = 7
ans = 1
while(A < K): #O(6)
    A = A*10 + 7
    ans += 1

while(True):
    #print(A)
    A = A % K #1
    if(ans > K):
        print("-1")
        exit()
    if(A==0): #1
        print(ans)
        exit()
    A = A * 10 + 7 # 1
    ans += 1# 1

Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

if(K%2 == 0):
    print("-1")
    exit()

A = 7
ans = 1
while(A < K):
    A = A*10 + 7
    ans += 1

while(True):
    #print(A)
    A = A % K
    if(A==0):
        print(ans)
        exit()
    A = A * 10 + 7
    ans += 1


Fixed submission:
K = int(input())

if(K%2 == 0):
    print("-1")
    exit()

A = 7
ans = 1
while(A < K): #O(6)
    A = A*10 + 7
    ans += 1

while(True):
    #print(A)
    A = A % K #1
    if(ans > K):
        print("-1")
        exit()
    if(A==0): #1
        print(ans)
        exit()
    A = A * 10 + 7 # 1
    ans += 1# 1
Buggy python submission (verdict: Time Limit Exceeded):
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
before = 1
for i in range(K):
    before *= A[i]
val = 0
for i in range(K,len(A)):
    val = before
    val = val / A[i-K] * A[i]

    if(val > before):
        print("Yes")
    else:
        print("No")
    before = val

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

for i in range(K,N):
    if(A[i-K] < A[i]):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
before = 1
for i in A[:K]:
    before *= i

for i in range(K,len(A)):
    val = before
    val /= A[i-K]
    val *= A[i]

    if(val > before):
        print("Yes")
    else:
        print("No")
    before = val

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

for i in range(K,N):
    if(A[i-K] < A[i]):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
before = 1
for i in A[:K]:
    before *= i

for i in range(K,len(A)):
    val = before
    val /= A[i-K]
    val *= A[i]

    if(val > before):
        print("Yes")
    else:
        print("No")
    before = val

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

for i in range(K,N):
    if(A[i-K] < A[i]):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
before = 1
for i in A[:K]:
    before *= i

for i in range(K+1,len(A)+1):
    val = 1
    for j in A[i-K:i]:
        val *= j

    if(val > before):
        print("Yes")
    else:
        print("No")
    before = val

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

for i in range(K,N):
    if(A[i-K] < A[i]):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
S = ipnut()
T = input()
 
if(S==T[:len(S)-1]):
  print("Yes")
else:
  print("No")

Fixed submission:
S = input()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = ipnut()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")

Fixed submission:
S = input()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = ipnut()
T = input()

if(S==T[:-1]):
  print("Yes")
else:
  print("No")

Fixed submission:
S = input()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=[int(x) for x in input().split()]

d.sort()
dd=[0]*10**5
for i in d:
    d[i]+=1

ans=True
now=1
if(dd[0]!=1):
    ans=False
else:
    before=1

for i in dd[1:]:
    if(i==0):
        ans=False
    now=now*(before**i) % 998244353

if(ans):
    print(now)
else:
    print("0")

Fixed submission:
n=int(input())
d=[int(x) for x in input().split()]
ans=True
if(d[0]!=0):
    ans=False
d.sort()
dd=[0]*10**5
max=0
for i in d:
    dd[i]+=1
    if(max<i):
        max=i

now=1
before=0
if(dd[0]!=1):
    ans=False
else:
    before=1

for i in range(1,max+1):
    if(dd[i]==0):
        ans=False
    now=now*(before**dd[i]) % 998244353
    before=dd[i]
    #print(dd[i],now)

if(ans):
    print(now)
else:
    print("0")
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

N,M=[int(a) for a in input().split()]
A=[int(a) for a in input().split()]

A.sort()
#print(A)
for i in range(M):
    if(A[len(A)-1]==0):
        continue
    score=A[len(A)-1]//2
    num = bisect.bisect_right(A,score)
    #print("score=" + str(score) +" num="+str(num))
    score=[score]
    #print(A[0:num])
    A=A[0:num] + score + A[num:-1]
    #print(A)

total=0
for i in A:
    total+=i

print(total)

Fixed submission:
import bisect
import queue

N,M=[int(a) for a in input().split()]
A=[int(a) for a in input().split()]

#優先度付きキューの作成とpush
q=queue.PriorityQueue()
for i in A:
    q.put(-i)

#最大値を取り出し,1/2倍した後push
for i in range(M):
    num = - q.get()
    #print(num)
    num=num//2
    q.put(-num)

total=0
for i in A:
    total+= - q.get()

print(total)
Buggy python submission (verdict: Runtime Error):
N=input()
s=input()

N=int(N)
wn=[]
bn=[]
a=0
b=0

#各行間よりも前と後ろに何個白（黒）があるかをカウント
for i in range(N):
    j=N-(i+1)
    if(s[j]=="."):
        a+=1
    if(s[i]=="#"):
        b+=1
    bn.insert(0,a)
    wn.append(b)
bn.append(0)
wn.insert(0,0)
#print(bn)
#print(wn)

#各行間のscore算出
min=1000000
for i in range(N+1):
    score=bn[i]+wn[i]
    if(score<min):
        min=score

print(min)

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

if(a<c and b>c or c<a and b<c):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

num = [] #５個の料理の必要時間
total = 0
mini = 10
for i in range(5): #入力
    a = input()
    a = int(a)
    b = a % 10 #bにはaの１の桁が０になったものが入る
    total += a - b + 10
    if b == 0:
        total -=10
    else:
        if b < mini:
            mini=b

total -=10
if mini= 10:
    print(total)
else:
    print(total + mini)

Fixed submission:
import numpy as np

num = [] #５個の料理の必要時間
total = 0
mini = 10
b = 1
for i in range(5): #入力
    a = input()
    a = int(a)
    b = a % 10 #bにはaの１の桁が０になったものが入る
    total += a - b
    if b != 0:
        total+=10
        if b < mini:
            mini=b


if mini== 10:
    print(total)
else:
    print(total -(10-mini))