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


def int_as_array(num): return list(map(int, [y for y in str(num)]))


def array_as_int(arr): return int(''.join(map(str, arr)))


def read_int(): return int(input())


def read_array(): return list(map(int, input().split(' ')))


def array_to_string(arr, sep=' '): return sep.join(map(str, arr))


def matrix_to_string(arr, sep=' '): return '[\n' + '\n'.join(
    [sep.join(map(str, row)) for row in arr]) + '\n]'


def solve(string):
    if string[2] == string[3] and string[4] == string[5]:
        print('Yes')
    else:
        print('No')


T = read_int()

string = input()
solve(string)


Fixed submission:
"""
"""


def int_as_array(num): return list(map(int, [y for y in str(num)]))


def array_as_int(arr): return int(''.join(map(str, arr)))


def read_int(): return int(input())


def read_array(): return list(map(int, input().split(' ')))


def array_to_string(arr, sep=' '): return sep.join(map(str, arr))


def matrix_to_string(arr, sep=' '): return '[\n' + '\n'.join(
    [sep.join(map(str, row)) for row in arr]) + '\n]'


def solve(string):
    if string[2] == string[3] and string[4] == string[5]:
        print('Yes')
    else:
        print('No')


string = input()
solve(string)
Buggy python submission (verdict: Runtime Error):
"""
"""

from math import factorial


def int_as_array(num): return list(map(int, [y for y in str(num)]))


def array_as_int(arr): return int(''.join(map(str, arr)))


def read_int(): return int(input())


def read_array(): return list(map(int, input().split(' ')))


def array_to_string(arr, sep=' '): return sep.join(map(str, arr))


def matrix_to_string(arr, sep=' '): return '[\n' + '\n'.join(
    [sep.join(map(str, row)) for row in arr]) + '\n]'


def combine(n, r):
    return (factorial(n) / factorial(n - r)) * (1 / r)


def solve(N, M):
    choose_evens = combine(N, 2)
    choose_odds = combine(M, 2)
    return choose_evens + choose_odds


print('input()', input())
N, M = read_array()
print('N, M', N, M)
solve(N, M)


Fixed submission:
"""
"""

from math import factorial


def int_as_array(num): return list(map(int, [y for y in str(num)]))


def array_as_int(arr): return int(''.join(map(str, arr)))


def read_int(): return int(input())


def read_array(): return list(map(int, input().split(' ')))


def array_to_string(arr, sep=' '): return sep.join(map(str, arr))


def matrix_to_string(arr, sep=' '): return '[\n' + '\n'.join(
    [sep.join(map(str, row)) for row in arr]) + '\n]'


def combine(n, r):
    try:
        return (factorial(n) / factorial(n - r)) * (1 / r)
    except:
        return 0


def solve(N, M):
    choose_evens = combine(N, 2)
    choose_odds = combine(M, 2)
    return int(choose_evens + choose_odds)


N, M = read_array()
print(solve(N, M))
Buggy python submission (verdict: Time Limit Exceeded):
def solution():
	n = int(input())
	l = []
	for i in range(n):
		x = int(input())
		if x in l:
			del l[l.index(x)]
		else:
			l.append(x)

	print(len(l))

solution()

Fixed submission:
def solution():
	n = int(input())
	l = []
	for i in range(n):
		x = int(input())
		l.append(x)

	l.sort()

	i = 0
	ans = 0
	while i<(n-1):
		if l[i]==l[i+1]:
			i+=2
		else:
			i+=1
			ans+=1
	if i==n-1:
		ans+=1
			

	print(ans)

solution()
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

x = a * b
if x % 2 == 0:
  print("Even")
else:
  print("Odd")

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

x = i[0] * i[1]
if x % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

x = a * b
if x % 2 == 0:
  print("Even")
else:
  print("Odd")

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

x = i[0] * i[1]
if x % 2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
n = int(input())
A= map(int,input().split())
for i in range(n):
    if(A[i]%2==0):
        if(A[i]%5!=0 or A[i]%3!=0):
            print("DENIED")
            exit()
print("APPROVED")


Fixed submission:
n = int(input())
A=list(map(int,input().split()))
for i in range(n):
    if(A[i]%2==0):
        if(A[i]%5!=0 and A[i]%3!=0):
            print("DENIED")
            exit()
print("APPROVED")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int, input().split()))

result = 0

for i in range(N-1):
    ans = 0
    for j in range(N-i-1):
        if H[i + j] >= H[i + j + 1]: 
            ans += 1
        else:
            break
    if result <= ans:
        result = ans

print(result)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 0
result = 0

for i in range(N-1):
    if H[i] >= H[i+1] and i == N-2:
        ans += 1
        if result < ans:
            result = ans
    elif H[i] >= H[i+1]:
        ans +=1
    else:
        if result < ans:
            result = ans
        ans = 0

print(result)

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

result = []

for i in range(N-1):
    ans = 0
    for j in range(N-i-1):
        if H[i + j] >= H[i + j + 1]: 
            ans += 1
        else:
            break
    if ans >= (N-i-2):
        print(ans)
        exit()
    else:
        result.append(ans)

print(max(result))


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 0
result = 0

for i in range(N-1):
    if H[i] >= H[i+1] and i == N-2:
        ans += 1
        if result < ans:
            result = ans
    elif H[i] >= H[i+1]:
        ans +=1
    else:
        if result < ans:
            result = ans
        ans = 0

print(result)

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

result = []

for i in range(N-1):
    ans = 0
    for j in range(N-i-1):
        if H[i + j] >= H[i + j + 1]: 
            ans += 1
        else:
            break
    result.append(ans)

print(max(result))


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 0
result = 0

for i in range(N-1):
    if H[i] >= H[i+1] and i == N-2:
        ans += 1
        if result < ans:
            result = ans
    elif H[i] >= H[i+1]:
        ans +=1
    else:
        if result < ans:
            result = ans
        ans = 0

print(result)
Buggy python submission (verdict: Runtime Error):
k, n = map(float, input().split())
m = list(map(float, input().split()))
min = float(0)
half_k = k / 2
for i in range(n):
    first = m[i]
    last = m[i-1]
    len = last - first
    if len < 0:
        len = len + k
    if min < len:
        min = len
print(int(min))


Fixed submission:
k, n = map(float, input().split())
m = list(map(float, input().split()))
half_k = k / 2
min = float(1000000)
for i in range(int(n)):
    first = m[i]
    last = m[i-1]
    len = last - first
    if len < 0:
        len = len + k
    if min > len:
        min = len
print(int(min))
Buggy python submission (verdict: Runtime Error):
import math
a, b, c = map(int, input().split())

result = math.sqrt(a) + math.sqrt(b) < math.sqrt(c)

if result:
    print('Yes')
else:
    print('No')


Fixed submission:
l = [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
]
N = int(input())
print(l[N-1])
Buggy python submission (verdict: Runtime Error):
import math
from decimal import Decimal

a, b, c = map(int, input().split())

a = Decimal(str(a))
b = Decimal(str(b))
c = Decimal(str(c))
ab = Decimal(str(math.sqrt(a * b)))

if a + b + 2ab < c:
    print('Yes')
else:
    print('No')


Fixed submission:
a, b, c = map(int, input().split())
d = c - a - b
if d < 0:
    print('No')
elif 4*a*b < d**2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
s=str(inputs())
tmp = s.replace('hi','')
if tmp=='':
  print('Yes')
else:
  print('No')

Fixed submission:
s=str(input())
tmp = s.replace('hi','')
if tmp=='':
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import sys

a = [[0] * 3 for _ in range(3)]
a[0] = list(map(int, sys.stdin.readline().strip().split()))
a[1] = list(map(int, sys.stdin.readline().strip().split()))
a[2] = list(map(int, sys.stdin.readline().strip().split()))
n = int(sys.stdin.readline().strip())
b = [0] * n
for i in range(n):
    b[i] = int(sys.stdin.readline().strip())

    for row in range(3):
        for col in range(3):
            if a[row][col] == b[i]:
                a[row][col] = 0


def is_bingo(grid):
    # horizontal
    for row in range(3):
        if a[row][0] == a[row][1] == a[row][2] == 0:
            return True
    # vertical
    for col in range(3):
        if a[1][col] == a[2][col] == a[3][col] == 0:
            return True

    if a[0][0] == a[1][1] == a[2][2] == 0:
        return True
    if a[2][0] == a[1][1] == a[0][2] == 0:
        return True

    return False


if is_bingo(a):
    print('Yes')
else:
    print('No')




Fixed submission:
import sys

a = [[0] * 3 for _ in range(3)]
a[0] = list(map(int, sys.stdin.readline().strip().split()))
a[1] = list(map(int, sys.stdin.readline().strip().split()))
a[2] = list(map(int, sys.stdin.readline().strip().split()))
n = int(sys.stdin.readline().strip())
b = [0] * n
for i in range(n):
    b = int(sys.stdin.readline().strip())

    for row in range(3):
        for col in range(3):
            if a[row][col] == b:
                a[row][col] = 0


def is_bingo():
    # horizontal
    for r in range(3):
        if a[r][0] + a[r][1] + a[r][2] == 0:
            return True
    # vertical
    for c in range(3):
        if a[0][c] + a[1][c] + a[2][c] == 0:
            return True

    if a[0][0] + a[1][1] + a[2][2] == 0:
        return True
    if a[2][0] + a[1][1] + a[0][2] == 0:
        return True

    return False


if is_bingo():
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import heapq


def main():
    n, k = [int(s) for s in sys.stdin.readline().strip().split()]
    a = [int(s) for s in sys.stdin.readline().strip().split()]
    f = [int(s) for s in sys.stdin.readline().strip().split()]
    # n, k = 3, 5
    # a = [4, 2,1]
    # f = [2, 3, 1]

    a.sort(reverse=True)
    f.sort()

    heap = []
    for i in range(n):
        ai = a[i]
        fi = f[i]
        heap.append((- ai * fi, ai, fi))
    heapq.heapify(heap)

    for i in range(k):
        prod, ai, fi = heapq.heappop(heap)
        if prod == 0:
            break
        new_prod = - (ai - 1) * fi
        heapq.heappush(heap, (new_prod, ai-1, fi))

    print(- heap[0][0])


main()



Fixed submission:
import sys
import heapq


def main():
    n, k = [int(s) for s in sys.stdin.readline().strip().split()]
    a = [int(s) for s in sys.stdin.readline().strip().split()]
    f = [int(s) for s in sys.stdin.readline().strip().split()]
    # n, k = 3, 5
    # a = [4, 2,1]
    # f = [2, 3, 1]

    a.sort(reverse=True)
    f.sort()

    def possible(x1):
        improved = 0
        for i in range(n):
            before = a[i] * f[i]
            if before > x1:
                needed_to_be_reduced = before - x1
                if needed_to_be_reduced % f[i] == 0:
                    plus_one = 0
                else:
                    plus_one = 1
                improved += (needed_to_be_reduced // f[i]) + plus_one
                if improved > k:
                    return False
        return True

    def b_search():
        lo = 0
        hi = 10 ** 12
        # (lo, hi]
        # hi is always possible
        # lo might be possible

        while lo < hi:
            mid = (lo + hi) // 2
            if possible(mid):
                hi = mid
            else:
                lo = mid+1
        return hi

    ans = b_search()
    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys


def main():
    n = int(sys.stdin.readline().strip())
    l = [int(s) for s in sys.stdin.readline().strip().split()]
    # n = 4
    # l = [1, 2, 3, 4]

    l.sort()

    # [lo, hi)
    # Returns -1 if no valid item
    def b_search(lo, hi, limit):
        if lo >= hi:
            return -1
        if lo + 1 == hi:
            return lo
        assert lo + 1 < hi
        mid = (lo + hi) // 2
        if l[mid] < limit:
            return b_search(mid, hi, limit)
        else:
            return b_search(lo, mid, limit)

    ans = 0
    for i in range(n-2):
        for j in range(i+1, n-1):
            a_plus_b = l[i] + l[j]
            valid_longest_idx = b_search(j, n, a_plus_b)
            ans += valid_longest_idx - j

    print(ans)


main()


Fixed submission:
import sys


def main():
    n = int(sys.stdin.readline().strip())
    l = [int(s) for s in sys.stdin.readline().strip().split()]
    # n = 4
    # l = [1, 2, 3, 4]

    l.sort()

    # [lo, hi)
    # Returns -1 if no valid item
    def b_search(lo, hi, limit):
        while lo + 1 < hi:
            mid = (lo + hi) // 2
            if l[mid] < limit:
                lo = mid
            else:
                hi = mid
        if lo >= hi:
            return -1
        if lo + 1 == hi:
            return lo

    ans = 0
    for i in range(n-2):
        for j in range(i+1, n-1):
            a_plus_b = l[i] + l[j]
            valid_longest_idx = b_search(j, n, a_plus_b)
            ans += valid_longest_idx - j

    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections


def main():
    n = int(sys.stdin.readline().strip())
    s = sys.stdin.readline().strip()
    # s = 'strangeorange'

    index_sets = [set() for _ in range(26)]
    pointers = []

    longest = 0
    for i in range(len(s)):
        c = s[i]
        order = ord(c) - ord('a')
        index_set = index_sets[order]
        next_pointers = []
        for _ in range(len(pointers)):
            cur, length, origin = pointers.pop()
            if s[cur+1] == c and cur+1 != origin:
                next_pointers.append([cur+1, length+1, origin])
                longest = max(longest, length+1)
        pointers = next_pointers

        for index in index_set:
            longest = max(longest, 1)
            pointers.append([index, 1, i])
        index_sets[order].add(i)

    print(longest)


main()


Fixed submission:

import sys
import collections


def main():
    n = int(sys.stdin.readline().strip())
    s = sys.stdin.readline().strip()
    # s = 'strangeorange'
    dp = [[0] * n for _ in range(n)]

    for i in range(n):
        dp[i][i] = 1

    res = 0
    for i in range(n-1, -1, -1):
        for j in range(n-1, i, -1):
            if s[i] == s[j]:
                if j == n-1:
                    dp[i][j] = 1
                else:
                    dp[i][j] = dp[i+1][j+1]+1
                res = max(res, min(dp[i][j], j-i))
    print(res)


main()
Buggy python submission (verdict: Runtime Error):
given = input()
a, b = given.split()
if a % 2 and b % 2:
  print("Odd")
else:
  print("Even")

Fixed submission:
given = input()
s = given.split()

a = int(s[0])
b = int(s[1])

if a % 2 and b % 2:
  print("Odd")
else:
  print("Even")
Buggy python submission (verdict: Runtime Error):
    coin = int(input())
    fivet_yen = 0
    five_yen = 0
    if coin == 0:
        print(0)
    else:
    while(coin > 0):
        if coin >= 500:
            coin = coin - 500
            fivet_yen = fivet_yen + 1000
        else:
            if coin >= 5:
                coin = coin - 5
                five_yen   = five_yen + 5
            else:    
                coin = coin - 1


    print(fivet_yen + five_yen)
        
        
        

Fixed submission:
coin = int(input())
fivet_yen = 0
five_yen = 0
if coin == 0:
    print(0)
else:
   while(coin > 0):
    if coin >= 500:
        coin = coin - 500
        fivet_yen = fivet_yen + 1000
    else:
        if coin >= 5:
            coin = coin - 5
            five_yen   = five_yen + 5
        else:  
            coin = coin - 1
   print(fivet_yen + five_yen)
Buggy python submission (verdict: Runtime Error):
k,x= int(input()), int(input())

k = k * 500 

if k >= x:
  print("Yes")
else:
  print("No")

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

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
k,x= int(raw_input()), int(raw_input())

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

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

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
k,x= int(raw_input()), int(raw_input())

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

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

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
k = int(input())
x = int(input())

k = k * 500 

if k > x:
   	print("Yes")
else:
	print("No")

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

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
k = int(input())
x = int(input())

k = k * 500 

if k > x:
   	print("Yes")
else:
	print("No")

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

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):

value = map(int, input().strip().split())

def sumValue(values):
  sum_value = 0
  for value in values:
    sum_value = sum_value + value
  return sum_value


if sumVlaue(value) == 22:
  print("bust")
else:
  print("win")

Fixed submission:
value = map(int,input().strip().split())

def sumValue(values):
	sum_value = 0
	for value in values:
		sum_value = sum_value + value
	return sum_value

if sumValue(value) >= 22:
	print("bust")
else:
	print("win")
Buggy python submission (verdict: Runtime Error):
i=0
H, W=map(int,input().split())
if H%2==1:
  if W%2==1:
    i+=((W+1)//2)*((H+1)//2)+(W//2)*(H//2)
  else:
    i+=(W//2)*((H+1)//2)+((W//2)*(H//2)
else:
  if W%2==1:
    i+=((W+1)//2)*(H//2)+(W//2)*(H//2)
  else:
    i+=(W//2)*(H//2)+(W//2)*(H//2)
print(i)

Fixed submission:
i=0
H, W=map(int,input().split())
if H==1 or W==1:
  i=1
elif H%2==1:
  if W%2==1:
    i+=((W+1)//2)*((H+1)//2)+(W//2)*(H//2)
  elif W%2==0:
    i+=(W//2)*((H+1)//2)+(W//2)*(H//2)
elif H%2==0:
  if W%2==1:
    i+=((W+1)//2)*(H//2)+(W//2)*(H//2)
  elif W%2==0:
    i+=(W//2)*(H//2)+(W//2)*(H//2)
print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
balls = list(map(int, input().split()))

counter = {}
sum = 0
for b in set(balls):
  n = balls.count(b)
  counter[b] = n
  sum += n * (n-1) // 2

for b in balls:
  n_old = counter[b]
  c_old = n_old * (n_old - 1) // 2
  c_new = (n_old - 1) * (n_old - 2) // 2
  
  result = sum - c_old + c_new
  print(result)

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

counter = {}
for b in balls:
  counter[b] = counter.get(b, 0) + 1

sum = 0
for v in counter.values():
  sum += v * (v-1) // 2
  
for b in balls:
  n_old = counter[b]
  c_old = n_old * (n_old - 1) // 2
  c_new = (n_old - 1) * (n_old - 2) // 2
  
  result = sum - c_old + c_new
  print(result)

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

def calc_n_combinations(l):
  ball_unique = set(l)
  sum = 0
  for b in ball_unique:
    n = l.count(b)
    sum += n * (n-1) // 2
  return sum
 
results = []
c_all = calc_n_combinations(balls)
for b in balls:
  c_tmp = balls.count(b) - 1
  result = c_all - c_tmp
  print(result)

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

counter = {}
for b in balls:
  counter[b] = counter.get(b, 0) + 1

sum = 0
for v in counter.values():
  sum += v * (v-1) // 2
  
for b in balls:
  n_old = counter[b]
  c_old = n_old * (n_old - 1) // 2
  c_new = (n_old - 1) * (n_old - 2) // 2
  
  result = sum - c_old + c_new
  print(result)

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

def calc_n_combinations(l):
  ball_unique = set(l)
  sum = 0
  for b in ball_unique:
    n = l.count(b)
    sum += n * (n-1) // 2
  return sum
 
results = []
for i in range(len(balls)):
  tmp = balls.copy()
  tmp.pop(i)
  result = calc_n_combinations(tmp)
  print(result)

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

counter = {}
for b in balls:
  counter[b] = counter.get(b, 0) + 1

sum = 0
for v in counter.values():
  sum += v * (v-1) // 2
  
for b in balls:
  n_old = counter[b]
  c_old = n_old * (n_old - 1) // 2
  c_new = (n_old - 1) * (n_old - 2) // 2
  
  result = sum - c_old + c_new
  print(result)
Buggy python submission (verdict: Runtime Error):
    l = int(input())
    m = (l/3)**3
    print(m)

Fixed submission:
if __name__ == "__main__":
    l = int(input())
    m = (l/3)**3
    print(m)
Buggy python submission (verdict: Runtime Error):
    h, w = map(int, input().split())
    ki = int(h/2) + h%2
    gu = int(h/2)

    sum_ki = ki *(int(w/2) + w%2)
    sum_gu = gu * (int(w / 2) )
    print(sum_ki+sum_gu)

Fixed submission:
def b():
    h, w = map(int, input().split())
    if (h == 1) or (w == 1):
        print("1")
    else:
        ki = int(h / 2) + h % 2
        gu = int(h / 2)

        sum_ki = ki * (int(w / 2) + w % 2)
        sum_gu = gu * (int(w / 2))
        print(sum_ki + sum_gu)


def c():
    a, b, c = map(int, input().split())
    ab = 4 * a * b
    a_b_c = c - (a + b)
    a_b_c_2 = a_b_c ** 2
    if a_b_c <= 0:
        print("No")
    else:
        if ab < a_b_c_2:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    b()

Buggy python submission (verdict: Runtime Error):
    h, w = map(int, input().split())
    # h,w=1000000000, 1000000000
    ki = int(h/2) + h%2
    gu = int(h/2)

    sum_ki = ki *(int(w/2) + w%2)
    sum_gu = gu * (int(w / 2) )
    print(sum_ki+sum_gu)

Fixed submission:
def b():
    h, w = map(int, input().split())
    if (h == 1) or (w == 1):
        print("1")
    else:
        ki = int(h / 2) + h % 2
        gu = int(h / 2)

        sum_ki = ki * (int(w / 2) + w % 2)
        sum_gu = gu * (int(w / 2))
        print(sum_ki + sum_gu)


def c():
    a, b, c = map(int, input().split())
    ab = 4 * a * b
    a_b_c = c - (a + b)
    a_b_c_2 = a_b_c ** 2
    if a_b_c <= 0:
        print("No")
    else:
        if ab < a_b_c_2:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    b()
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

s_val = int(s, 2)


s1 = 0
s2 = 0
for i in range(len(s)):
    if i%2==0:
        s1 += 2**i
    elif i%2==1:
        s2 += 2**i

num = min(str(bin(s_val^s1)).count('1'), str(bin(s_val^s2)).count('1'))
print(num)

Fixed submission:
s = input()

s_val = int(s, 2)


s1 = ''
s2 = ''
for i in range(len(s)):
    if i%2==0:
        s1 = s1 + '1'
        s2 = s2 + '0'
    else:
        s1 = s1 + '0'
        s2 = s2 + '1'

num = min(str(bin(s_val^int(s1,2))).count('1'), str(bin(s_val^int(s2,2))).count('1'))
print(num)

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


a =[ int(i) for i in list(s)]
s_val = 0
for n_bit, bit in enumerate(a[::-1]):
    s_val += bit *(2**n_bit)


s1 = 0
for i in range(len(s)):
    if i%2==0:
        s1 += 2**i
        
s2 = 0
for i in range(len(s)):
    if i%2==1:
        s2 += 2**i

num = min(str(bin(s_val^s1)).count('1'), str(bin(s_val^s2)).count('1'))
print(num)

Fixed submission:
s = input()

s_val = int(s, 2)


s1 = ''
s2 = ''
for i in range(len(s)):
    if i%2==0:
        s1 = s1 + '1'
        s2 = s2 + '0'
    else:
        s1 = s1 + '0'
        s2 = s2 + '1'

num = min(str(bin(s_val^int(s1,2))).count('1'), str(bin(s_val^int(s2,2))).count('1'))
print(num)