Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import itertools

n = int(input())
a = [int(input()) for i in range(n)]

max_list = [0] + list(itertools.accumulate(a, func=max))
max_list_r = [0, *itertools.accumulate(reversed(a), func=max)][::-1]
# print(max_list)
# print(max_list_r)
for i in range(n):
    print(max(max_list[i], max_list_r[i + 1]))


Fixed submission:
import itertools

n = int(input())
a = [int(input()) for i in range(n)]

max_list = [0] + list(itertools.accumulate(a, func=max))
max_list_r = ([0] +list(itertools.accumulate(reversed(a), func=max)))[::-1]
for i in range(n):
    print(max(max_list[i], max_list_r[i + 1]))

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

n = int(input())
a = [int(input()) for i in range(n)]
max_list = list(itertools.accumulate(a, func=max))
max_list_r = list(itertools.accumulate(reversed(a), func=max))

for i in range(n):
    print(max(max_list[i - 1], max_list_r[i - 1]))


Fixed submission:
import itertools

n = int(input())
a = [int(input()) for i in range(n)]

max_list = [0] + list(itertools.accumulate(a, func=max))
max_list_r = ([0] +list(itertools.accumulate(reversed(a), func=max)))[::-1]
for i in range(n):
    print(max(max_list[i], max_list_r[i + 1]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
sum_a = sum(a)
for i in range(n):
    tmp = a[i]
    a[i] = 0
    print(max(a))
    a[i] = tmp


Fixed submission:
import itertools

n = int(input())
a = [int(input()) for i in range(n)]

max_list = [0] + list(itertools.accumulate(a, func=max))
max_list_r = ([0] +list(itertools.accumulate(reversed(a), func=max)))[::-1]
for i in range(n):
    print(max(max_list[i], max_list_r[i + 1]))
Buggy python submission (verdict: Runtime Error):
import math


def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, k = map(int, input().split())
div_num = 10 ** 9 + 7
for i in range(1, k + 1):
    print(combi(n - k + 1, i) * combi(k - 1, i - 1) % div_num)


Fixed submission:
import math


def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, k = map(int, input().split())
div_num = 10 ** 9 + 7
for i in range(1, k + 1):
    if n - k + 1 >= i:
        print(combi(n - k + 1, i) * combi(k - 1, i - 1) % div_num)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())
tastes = range(l, n + l)
ijo = [taste for taste in tastes if taste >= 0]
under = [taste for taste in tastes if taste < 0]
if len(ijo) == 0:
    print(sum(under[:-1]))
elif len(under) == 0:
    print(sum(ijo[1:]))
else:
    print(sum(tastes))


Fixed submission:
s = input()
difficult = False
for i in range(3):
    if s[i] == s[i+1]:
        difficult = True

if difficult:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
import itertools

n, k = map(int, input().split())
a = map(int, input().split())
accum = [0] + list(itertools.accumulate(a))
count = 0
for i in range(n):
    for j in range(i + 1, n + 1):
        if accum[j] - accum[i] >= k:
            count += 1
print(count)


Fixed submission:
x,a=map(int,input().split())
ans = 0 if x<a else 10
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

n, k = map(int, input().split())
ans = 0
for i in range(1, n + 1):
    if k/i > 1:
        l = math.log2(k / i)
        a = math.ceil(l)
        ans += (1 / n) * ((1 / 2) ** a)
    else:
        ans += 1/n

print(ans)


Fixed submission:
import math

n, k = map(int, input().split())
ans = 0
for i in range(1, n + 1):
    if k/i > 1:
        l = math.log2(k / i)
        a = math.ceil(l)
        ans += (1 / n) * ((1 / 2) ** a)
    else:
        ans += 1/n

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
S = [input() for _ in range(n)]
cnt = 0
fb_cnt = 0
ba_cnt = 0
for s in S:
    idx = len(s) - 1
    for i in range(idx - 1):
        if s[i] == 'A' and s[i + 1] == 'B':
            cnt += 1
    if s[idx] == 'A':
        ba_cnt += 1
    if s[0] == 'B':
        fb_cnt += 1

min_cnt = min(fb_cnt, ba_cnt)
min_cnt = min_cnt - 1 if fb_cnt == ba_cnt else min_cnt
print(cnt + min_cnt)


Fixed submission:
n,k = map(int,input().split())
print(n-(k-1))

Buggy python submission (verdict: Runtime Error):
n = int(input())
S = [input() for _ in range(n)]
cnt = 0
fb_cnt = 0
ba_cnt = 0
for s in S:
    idx = len(s) - 1
    for i in range(idx - 1):
        if s[i] == 'A' and s[i + 1] == 'B':
            cnt += 1
    if s[idx] == 'A':
        ba_cnt += 1
    if s[0] == 'B':
        fb_cnt += 1

min_cnt = min(fb_cnt, ba_cnt)
min_cnt = min_cnt - 1 if n <= min_cnt else min_cnt
print(cnt + min_cnt)


Fixed submission:
n,k = map(int,input().split())
print(n-(k-1))
Buggy python submission (verdict: Time Limit Exceeded):
import collections

h, w = map(int, input().split())
grid = [list(input()) for _ in range(h)]

INF = 10 ** 8
dist = [[INF] * w for _ in range(h)]
dy = [1, 0, -1, 0]
dx = [0, 1, 0, -1]


def bfs():
    q = collections.deque()
    for i in range(h):
        for j in range(w):
            if grid[i][j] == '#':
                q.append((i, j))
                dist[i][j] = 0
                # grid[i][j] = str(0)

    while len(q):
        py, px = q.popleft()
        for i in range(4):
            ny = py + dy[i]
            nx = px + dx[i]
            if -1 < ny < h and -1 < nx < w and grid[ny][nx] == '.' and dist[ny][nx] == INF:
                q.append((ny, nx))
                dist[ny][nx] = dist[py][px] + 1
                # grid[ny][nx] = str(dist[py][px] + 1)

    return max(max(dist, key=lambda x: max(x)))


if __name__ == '__main__':
    print(bfs())
    # for g in grid:
    #     for s in g:
    #         print(s,end='')
    #     print()
    # print()
    # for d in dist:
    #     for i in d:
    #         print(i,end='')
    #     print()


Fixed submission:
import collections

h, w = map(int, input().split())
grid = [list(input()) for _ in range(h)]

INF = 10 ** 8
dist = [[INF] * w for _ in range(h)]
dy = [1, 0, -1, 0]
dx = [0, 1, 0, -1]


def bfs():
    q = collections.deque()
    for i in range(h):
        for j in range(w):
            if grid[i][j] == '#':
                q.append((i, j))
                dist[i][j] = 0
                # grid[i][j] = str(0)

    while len(q):
        py, px = q.popleft()
        for i in range(4):
            ny = py + dy[i]
            nx = px + dx[i]
            if -1 < ny < h and -1 < nx < w and grid[ny][nx] == '.' and dist[ny][nx] == INF:
                q.append((ny, nx))
                dist[ny][nx] = dist[py][px] + 1
                # grid[ny][nx] = str(dist[py][px] + 1)

    return max(max(dist, key=lambda x: max(x)))


if __name__ == '__main__':
    print(bfs())
    # for g in grid:
    #     for s in g:
    #         print(s,end='')
    #     print()
    # print()
    # for d in dist:
    #     for i in d:
    #         print(i,end='')
    #     print()
Buggy python submission (verdict: Time Limit Exceeded):
import re

s = input()
pattern = "(01)|(10)"
count = 0
diff = 1

while diff:
    ssub = re.sub(pattern, "", s)
    diff = len(s) - len(ssub)
    count += diff
    s = ssub


print(count)


Fixed submission:
import re

s = input()
zero = re.findall("0", s)
one = re.findall("1", s)
print(2 * min(len(zero), len(one)))

Buggy python submission (verdict: Time Limit Exceeded):
import re

s = input()
pattern = "(01)|(10)"
count = 0
f = True
while f:
    l = re.findall(pattern,s)
    count += len(l)*2
    s = re.sub(pattern, "", s)
    f = len(l)


print(count)

Fixed submission:
import re

s = input()
zero = re.findall("0", s)
one = re.findall("1", s)
print(2 * min(len(zero), len(one)))

Buggy python submission (verdict: Time Limit Exceeded):
import re

s = input()
pattern = "(01)|(10)"
count = 0
while re.search(pattern,s):
    l = re.findall(pattern,s)
    count += len(l)*2
    s = re.sub(pattern, "", s)

print(count)

Fixed submission:
import re

s = input()
zero = re.findall("0", s)
one = re.findall("1", s)
print(2 * min(len(zero), len(one)))

Buggy python submission (verdict: Time Limit Exceeded):
import re

s = input()
pattern = "(01)|(10)"
count = 0
while re.search(pattern,s):
    count += 2
    s = re.sub(pattern, "", s,1)

print(count)

Fixed submission:
import re

s = input()
zero = re.findall("0", s)
one = re.findall("1", s)
print(2 * min(len(zero), len(one)))
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())
l = list(map(int, input().split()))
gcd = l[0]
for i in range(len(l) - 1):
    gcd = math.gcd(gcd, l[i + 1])

print(gcd)


Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


n = int(input())
l = list(map(int, input().split()))
num = 0
for i in range(len(l)):
    num = gcd(num, l[i])

print(num)
Buggy python submission (verdict: Runtime Error):
n, m = tuple(map(int, input().split()))
list = list(map(int, input().split()))
list = sorted(list)

diff = []
for i in range(len(list) - 1):
    diff.append(list[i] - list[i+1])

abs_diff = []
for i in range(len(diff)):
    abs_diff.append(abs(diff[i]))

abs_diff = sorted(abs_diff)

if abs_diff != []:
    for _ in range(n - 1):
        abs_diff.pop(abs_diff.index(max(abs_diff)))

print(sum(abs_diff))

Fixed submission:
n, m = tuple(map(int, input().split()))
x = list(map(int, input().split()))
x = sorted(x)

diff = []

for i in range(len(x) - 1):
    diff.append(x[i + 1] - x[i])

diff = sorted(diff)

diff_sum = 0
diff_len = m - 1

for i in range(diff_len - (n - 1)):
    diff_sum += diff[i]

print(diff_sum)

Buggy python submission (verdict: Runtime Error):
n, m = tuple(map(int, input().split()))
list = list(map(int, input().split()))
list = sorted(list)
list2 = list.copy()

list.pop(-1)
list2.pop(0)

diff = []
for i in range(len(list)):
    diff.append(list[i] - list2[i])

abs_diff = []
for i in range(len(diff)):
    abs_diff.append(abs(diff[i]))

abs_diff = sorted(abs_diff)

if abs_diff != []:
    for _ in range(n - 1):
        abs_diff.pop(abs_diff.index(max(abs_diff)))

print(sum(abs_diff))

Fixed submission:
n, m = tuple(map(int, input().split()))
x = list(map(int, input().split()))
x = sorted(x)

diff = []

for i in range(len(x) - 1):
    diff.append(x[i + 1] - x[i])

diff = sorted(diff)

diff_sum = 0
diff_len = m - 1

for i in range(diff_len - (n - 1)):
    diff_sum += diff[i]

print(diff_sum)
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = [0] * N
march = 'MARCH'
for i in range(N):
    S = input()
    for j in range(len(march)):
        if S[0] == march[j]:
            l[j] += 1

tmp = []
lenl = len(l)
for i in range(lenl):
    for j in range(i + 1, lenl):
        for k in range(j + 1, lenl):
           tmp.append(l[i]*l[j]*l[k])

print(sum(tmp))

Fixed submission:
N = int(input())
march = 'MARCH'
l = [0] * len(march)
for i in range(N):
    S = input()
    for j in range(len(march)):
        if S[0] == march[j]:
            l[j] += 1

# print(l)
tmp = []
lenl = len(l)
for i in range(lenl):
    for j in range(i + 1, lenl):
        for k in range(j + 1, lenl):
           tmp.append(l[i]*l[j]*l[k])
# print('tmp',tmp)
print(sum(tmp))
Buggy python submission (verdict: Time Limit Exceeded):
n, y = map(int, input().split())
r = range(n+1)

ans = "-1 -1 -1"
for i in r:
    for j in r:
        k = (y-(10000*i+5000*j))//1000
        if k >= 0 and 10000*i+5000*j+1000*k == y and i+j+k == n:
            ans = "{} {} {}".format(i, j, k)

print(ans)


Fixed submission:
N, Y = map(int, input().split())
ans = '-1 -1 -1'
for i in range(N + 1):
    for j in range(N + 1):
        k = N - (i + j)
        if k >= 0 and 10000 * i + 5000 * j + 1000 * k == Y:
            ans = '{} {} {}'.format(i, j, k)
            break
    else:
        continue
    break
print(ans)

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
r = range(n+1)

ans = "-1 -1 -1"
for i in r:
    for j in r:
        k = (y-(10000*i+5000*j))//1000
        if k >= 0 and 10000*i+5000*j+1000*k == y and i+j+k == n:
            ans = f"{i} {j} {k}"

print(ans)


Fixed submission:
N, Y = map(int, input().split())
ans = '-1 -1 -1'
for i in range(N + 1):
    for j in range(N + 1):
        k = N - (i + j)
        if k >= 0 and 10000 * i + 5000 * j + 1000 * k == Y:
            ans = '{} {} {}'.format(i, j, k)
            break
    else:
        continue
    break
print(ans)

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
r = range(n+1)

ans = "-1 -1 -1"
for i in r:
    for j in r:
        k = (y-(10000*i+5000*j))//1000
        if k >= 0 and i+j+k == n:
            ans = f"{i} {j} {k}"

print(ans)


Fixed submission:
N, Y = map(int, input().split())
ans = '-1 -1 -1'
for i in range(N + 1):
    for j in range(N + 1):
        k = N - (i + j)
        if k >= 0 and 10000 * i + 5000 * j + 1000 * k == Y:
            ans = '{} {} {}'.format(i, j, k)
            break
    else:
        continue
    break
print(ans)

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
r = range(n+1)

ans = "-1 -1 -1"
for i in r:
    for j in r:
        k = (y-(10000*i+5000*j))//1000
        if k >= 0 and i+j+k <= n:
            ans = f"{i} {j} {k}"

print(ans)


Fixed submission:
N, Y = map(int, input().split())
ans = '-1 -1 -1'
for i in range(N + 1):
    for j in range(N + 1):
        k = N - (i + j)
        if k >= 0 and 10000 * i + 5000 * j + 1000 * k == Y:
            ans = '{} {} {}'.format(i, j, k)
            break
    else:
        continue
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
xi, yi, xii, yii = map(int, input().split())
dx = xii - xi
dy = yii - yi

x = xii
y = yii
for i in range(2):
    dx, dy = -dy, dx
    x += dx
    y += dy
    print(x, y, end=' ')


Fixed submission:
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    ans = min(ans*2,ans+k)
print(ans)
Buggy python submission (verdict: Runtime Error):
import collections
import sys

N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
two = [k for k, v in c.items() if v > 1]
four = [k for k, v in c.items() if v > 3]
if len(two) < 2 and not four:
    print(0)
    sys.exit(0)
two.sort(reverse=True)
four.sort(reverse=True)
tmp = 1
for i in range(2):
    tmp *= two[i]
max_four = max(four)
print(tmp if tmp > max_four else max_four)


Fixed submission:
import collections
import sys

N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
two = [k for k, v in c.items() if v > 1]
four = [k for k, v in c.items() if v > 3]
if len(two) < 2 and not four:
    print(0)
    sys.exit(0)

St = 0
Sf = 0
if two:
    two.sort(reverse=True)
    St = 1
    for i in range(2):
        St *= two[i]
if four:
    Sf = max(four) ** 2
print(St if St > Sf else Sf)
Buggy python submission (verdict: Runtime Error):
import math


def lcm(a, b):
    return a * b // math.gcd(a, b)


N = int(input())
T = [int(input()) for _ in range(N)]
tmp = 1
for i in range(N):
    tmp = lcm(tmp, T[i])
print(tmp)


Fixed submission:
import fractions


def lcm(a, b):
    n = fractions.gcd(a, b)
    return a * b // n if n > 0 else 0


N = int(input())
T = [int(input()) for _ in range(N)]
tmp = 1
for i in range(N):
    tmp = lcm(tmp, T[i])
print(tmp)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
tmp = 0
diffs = []
for i in range(N - 1):
    tmp += A[i]
    diffs.append(abs(sum(A) - tmp - tmp))
print(min(diffs))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
tmp = 0
ans = 10 ** 10
Asum = sum(A)
for i in range(N - 1):
    tmp += A[i]
    a = abs((Asum - tmp) - tmp)
    if ans > a:
        ans = a
print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x = 1:
  print(0)
else:
  print(1)

Fixed submission:
x = int(input())
if x == 1:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
input_lines = input().split()
num_lines = []
a = int(input_lines[0])
b = int(input_lines[1])
c = int(input_lines[2])
d = int1(input_lines[3])

num_lines.append(a*c)
num_lines.append(a*d)
num_lines.append(b*c)
num_lines.append(b*d)

print(max(num_lines))

Fixed submission:
input_lines = input().split()
num_lines = []
a = int(input_lines[0])
b = int(input_lines[1])
c = int(input_lines[2])
d = int(input_lines[3])

num_lines.append(a*c)
num_lines.append(a*d)
num_lines.append(b*c)
num_lines.append(b*d)

print(max(num_lines))
Buggy python submission (verdict: Time Limit Exceeded):
tmp = (input().split(' '))
n = int(tmp[0])
k = int(tmp[1])
tmp = input().split(' ')
grades = []
for i in range(len(tmp)):
  grades.append(int(tmp[i]))
  
curr_res = grades[0]
prev_res = grades[0]

for i in range(1,k):
  curr_res = curr_res * grades[i]
  
j = k
while j < n:
  prev_res = curr_res
  curr_res = curr_res/grades[j-k]
  curr_res = curr_res*grades[j]
  if curr_res > prev_res:
    print('Yes')
  else:
    print('No')
  j+=1
  

Fixed submission:
tmp = (input().split(' '))
n = int(tmp[0])
k = int(tmp[1])
tmp = input().split(' ')
map_tmp = map(int,tmp)
grades = list(map_tmp)
j = k
while j < n:
  curr_res = grades[j]
  prev_res = grades[j-k]
  if curr_res > prev_res:
    print('Yes')
  else:
    print('No')
  
  j+=1
Buggy python submission (verdict: Runtime Error):

def test(a):
	if tmp.isupper():
		return 'A'
	else:
		return 'a'
      
test(input())

Fixed submission:
def test(a):
	if a.isupper():
		print('A')
	else:
		print('a')

        
test(input())

Buggy python submission (verdict: Runtime Error):
tmp = input()
if tmp.isupper():
  print 'A'
else:
  print'a'

Fixed submission:
def test(a):
	if a.isupper():
		print('A')
	else:
		print('a')

        
test(input())
Buggy python submission (verdict: Runtime Error):
x=int(input())
if x==0:
    print('1')
else:
    print('0

Fixed submission:
x=int(input())
if x==0:
    print('1')
else:
    print('0')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
tot=0
while(n>0):
    dig=n%10
    tot=tot+dig
    n=n//10

if tot %9==0:
    print('Yes')
else:
    print('No')

Fixed submission:
k=sum(map(int, str(input())))
if k%9==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
import numpy as np

a = int(input())
print(2*a*math.pi)

Fixed submission:
# -*- coding: utf-8 -*-
import math

a = int(input())
print(2*a*math.pi)
Buggy python submission (verdict: Runtime Error):
# cook your dish here
n,k=input().split()
n=int(n)
k=int(k)
l=list(map(int,input().split()))
for j in range(n):
	if l[k+j]>l[j]:
    	print("Yes")
	else:
      print("No")
    if k+j==n-1:
      break
      
   


    


Fixed submission:
# cook your dish here
n,k=input().split()
n=int(n)
k=int(k)
l=list(map(int,input().split()))
for j in range(n):
    if k+j==n:
        break
    if l[k+j]>l[j]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
# cook your dish here
n,k=input().split()
n=int(n)
k=int(k)
l=list(map(int,input().split()))
m=[]
for j in range(n):
    s=1
    for i in range(j,j+k):
        s=s*l[i]
    if len(m)!=0:
        if s>m[-1]:
            print("Yes")
        else:
            print("No")
    m.append(s)        
                
    if j+k==n:
        break


    

Fixed submission:
# cook your dish here
n,k=input().split()
n=int(n)
k=int(k)
l=list(map(int,input().split()))
for j in range(n):
    if k+j==n:
        break
    if l[k+j]>l[j]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = list(map(int,input().split()))
ans = 1
for i in a_list:
    ans *= i
if ans <= 10**18:
    print(ans)
else:
    print(-1)

Fixed submission:
n = int(input())
a_list = list(map(int,input().split()))
if 0 in a_list:
    print(0)
    exit()
ans = 1
for i in a_list:
    ans *= i
    if ans > 10**18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
from decimal import decimal
a, b = map(decimal, input().split())
print(a*b)

Fixed submission:
a, b = map(int, input().replace(".","").split())
print(a*b//100)
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int,input().split())
n = 1
flag = True
while (k*n) <= b:
    if (k*n) >= a and (k*n) <= b:
        ans = "OK"
        break
    else:
        ans = "NG"
    n += 1
print(ans)

Fixed submission:
k = int(input())
a, b = map(int,input().split())
n = 1
ans = "NG"
while (k*n) <= b:
    if (k*n) >= a and (k*n) <= b:
        ans = "OK"
        break
    n += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
S = []
ans = []
for i in range(n):
    S.append(input())
for j in S:
    if j not in ans:
        ans.append(j)
print(len(ans))

Fixed submission:
n = int(input())
S = []
for i in range(n):
    S.append(input())
print(len(list(set(S))))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = a * b
if c % 2 == 1:
    print("Odd")
else:
    print("Even")

Fixed submission:
a, b = map(int, input().split())
c = (a * b) % 2
if c == 0:
    print('Even')
else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
cnt = 0
flag = True

while flag:
    ans = []
    for i in a:
        if i%2 == 1:
            flag = False
        else:
            ans.append(i/2)
    if len(ans) == n:
        cnt += 1
        a = ans

print(cnt)

Fixed submission:
a = str(input())
print(a.count('1'))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
cnt = 0
flag = True

while flag:
    ans = []
    for i in a:
        if i%2 == 1:
            flag = False
            break
        else:
            ans.append(i/2)
    if len(ans) == n:
        cnt += 1
        a = ans

print(cnt)

Fixed submission:
a = str(input())
print(a.count('1'))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
count = 0
flag = 1

while flag == 1:
    b = list(map(lambda x: x % 2, a))
    if b.count(1) == 0:
        a = list(map(lambda x: x / 2, a))
        count += 1
    else:
        flag = 0

print(count)

Fixed submission:
a = str(input())
print(a.count('1'))
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
def main():
  n = int(input())
  numList  = [int(input()) for _ in range(n)]
  maxVal = max(numList)
  workList = numList[:]
  workList.remove(maxVal)
  secondVal = max(workList)
  for num in numList:
    if num != maxVal:
      print(maxVal)
    else:
      print(secondVal)
      
if __name__ == '__main__':
    main()

Fixed submission:
r = int(input())
print(3 * r**2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
numList  = [input() for i in range(n)]
maxVal = max(numList)
workList = numList[:]
workList.remove(maxVal)
secondVal = max(workList)
for num in numList:
  if num != maxVal:
    print(maxVal)
  else:
    print(secondVal)

Fixed submission:
r = int(input())
print(3 * r**2)

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

max = (n - d) - d
count = 1

for i in range(1000):
  if max <= 1:
    break
  max = (max - (d*2) -1) 
  count += 1

print(count)

Fixed submission:
r = int(input())
print(3 * r**2)