Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02995 (python)

Fixed submission:
import math

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

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

a, b, c, d = map(int, input().split())
ran = b - a + 1

def count(x):
    r = ran if a % x == 0 else ran - (x - a % x)
    return r // x if r % x == 0 else r // x + 1

count1 = count(c)
count2 = count(d)
e = lcm(c, d)
count3 = count(e)
print(ran - (count1 + count2 - count3))

Buggy submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())
ran = b - a + 1
if a % c == 0:
    count1 = math.ceil(ran / c)
else:
    count1 = math.ceil((ran - (c - a % c)) / c)
if a % d == 0:
    count2 = math.ceil(ran / d)
else:
    count2 = math.ceil((ran - (d - a % d)) / d)
e = c * d / math.gcd(c, d)
if a % e == 0:
    count3 = math.ceil(ran / e)
else:
    count3 = math.ceil((ran - (e - a % e)) / e)
print(ran - (count1 + count2 - count3))
Problem p03006 (python)

Fixed submission:
import sys
import itertools

n = int(input())
xy_list = [list(map(int, input().split())) for _ in range(n)]
if n == 1:
    print(1)
    sys.exit()

counts = dict()
for (x1, y1), (x2, y2) in itertools.combinations(xy_list, 2):
    for pq in ((x2 - x1, y2 - y1), (x1 - x2, y1 - y2)):
        counts.setdefault(pq, 0)
        counts[pq] += 1
max_count = max(counts.values())
print(n - max_count)

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
xy_list = [list(map(int, input().split())) for _ in range(n)]
counts = dict()
for (x1, y1), (x2, y2) in itertools.combinations(xy_list, 2):
    for pq in ((x2 - x1, y2 - y1), (x1 - x2, y1 - y2)):
        counts.setdefault(pq, 0)
        counts[pq] += 1
max_count = max(counts.values())
print(n - max_count)
Problem p03061 (python)

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

n = input()
a_list = map(int, raw_input().split())

gs1 = [None] * n
gs1[0] = a_list[0]
for i in xrange(1, n):
    gs1[i] = gcd(gs1[i - 1], a_list[i])

gs2 = [None] * n
gs2[n - 1] = a_list[n - 1]
for i in reversed(xrange(n - 1)):
    gs2[i] = gcd(gs2[i + 1], a_list[i])

max_g = 0
for exclude in xrange(n):
    if exclude == 0:
        g = gs2[1]
    elif exclude == n - 1:
        g = gs1[n - 2]
    else:
        g = gcd(gs1[exclude - 1], gs2[exclude + 1])
    if g > max_g:
        max_g = g
print(max_g)

Buggy submission (verdict: Runtime Error):
memo = {}

def gcd(a, b):
    if (a, b) in memo.keys():
        return memo[(a, b)]
    if b == 0:
        return a
    return gcd(b, a % b)

n = input()
a_list = list(map(int, input().split()))
max_g = 0
for exclude in range(n):
    g = a_list[0] if exclude > 0 else a_list[1]
    for i, a in enumerate(a_list):
        if i == 0 or i == exclude:
            continue
        g_new = gcd(g, a)
        if (g, a) not in memo:
            memo[(g, a)] = g_new
        g = g_new
        if g <= max_g:
            break
    if g > max_g:
        max_g = g
print(max_g)

Buggy submission (verdict: Runtime Error):
memo = {}

def gcd(a, b):
    if (a, b) in memo.keys():
        return memo.get[(a, b)]
    if b == 0:
        return a
    return gcd(b, a % b)

n = input()
a_list = map(int, raw_input().split())
max_g = 0
for exclude in xrange(n):
    g = a_list[0] if exclude > 0 else a_list[1]
    for i in xrange(1, n):
        if i == exclude:
            continue
        g_new = gcd(g, a_list[i])
        memo[(g, a_list[i])] = g_new
        g = g_new
        if g <= max_g:
            break
    if g > max_g:
        max_g = g
print(max_g)
Problem p03471 (python)

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

li = map(str, [-1] * 3)

if N * 10000 >= price and N * 1000 <= price:
    x = price // 10000
    for i in range(x + 1):
        y = (price - i * 10000) // 5000
        for j in range(y + 1):
            if N >= i + j and price == i * 10000 + j * 5000 + (N - i - j) * 1000:
                li = map(str, [i, j, N - i - j])

print(" ".join(li))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from sympy import *

x, y, z = symbols('x y z')
N, price = list(map(int, input().split()))

if N * 10000 < price or N * 1000 > price:
    li = map(str, [-1] * 3)
else:
    temp = 10000 * N
    x, y = 0, 0

    for i in range(N):
        if x < 0:
            break;
        if temp == price:
            break;
        elif temp > price:
            y += 1
            temp -= 9000
        else:
            x += 1
            y -= 1
            temp += 4000
    li = map(str, [N - x - y, x, y]) if y >= 0 else map(str, [-1] * 3)

print(" ".join(li))
Problem p02748 (python)

Fixed submission:
A,B,M = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = []
for _ in range(M):
    tmp = [int(x) for x in input().split()]
    c.append(tmp)

ans = min(a)+min(b)
for x in c:
    ans = min((a[x[0]-1]+b[x[1]-1]-x[2]),ans)

print(ans)

Buggy submission (verdict: Runtime Error):
A,B,M = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = []
for _ in range(M):
    tmp = [int(x) for x in input().split()]
    c.append(tmp)

ans = min(a)+min(b)
for i in range(M):
    ans = min((a[i-1]+b[i-1]-c[i][2]),ans)

print(ans)
Problem p02768 (python)

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

INF = (10**9 + 7)

def c(n,r,p):
    r = min(r,n-r)
    numer = 1
    denom = 1
    for i in range(1,r+1):
        numer = numer * (n+1-i) % p
        denom = denom * i % p
    return numer * pow(denom,p-2,p) % p

ans = pow(2,n,INF) - 1 - c(n,a,INF) - c(n,b,INF)

while ans < 0:
    ans += INF
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = [int(x) for x in input().split()]

INF = (10**9 + 7)

def f(n):
    if n == 1:
        return 1
    return (f(n-1) * 2) + 1

if n == 2:
    print(0)
else:
    ans = f(n) - f(a) - f(b)
    print(ans % INF)
Problem p02924 (python)

Fixed submission:
n = int(input())

print(n * (n-1) // 2)

Buggy submission (verdict: Runtime Error):
n = int(input())

ans = 0

l = list(range(1,n))
l.insert(0, n)

for i,x in enumerate(l):
    ans += x % (i+1)

print(ans)
Problem p03001 (python)

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

if 2 * x == X and 2 * y == H:
    print((X * H) / 2, 1)
else:
    print((X * H) / 2, 0)

Buggy submission (verdict: Runtime Error):
w,h,x,y = [int(x) for x in input().split()]

if w % x == 0 and h % y == 0:
    print((w*h)/2, 1)
else:
    print((w*h)/2, 0)
Problem p03076 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a,b,c,d,e]

lst2 = []

for x in lst:
    amari = x % 10
    if amari == 0:
        pass
    else:
        lst2.append(10 - amari)

if not lst2:
    pass
else:
    lst2.remove(max(lst2))
print(sum(lst)+sum(lst2))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a,b,c,d,e]

lst2 = []

for x in lst:
    amari = x % 10
    if amari == 0:
        pass
    else:
        lst2.append(10 - amari)

lst2.remove(max(lst2))
print(sum(lst)+sum(lst2))
Problem p03087 (python)

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

t = [0]*(n+1)
for i in range(n):
    t[i+1] = t[i] + (1 if s[i:i+2] == "AC" else 0)

for _ in range(q):
    l,r = [int(x) for x in input().split()]
    print(t[r-1]-t[l-1])

Buggy submission (verdict: Runtime Error):
n,q = [int(x) for x in input().split()]
s = input()
lst = []
for _ in range(q):
    l,r = [int(x) for x in input().split()]
    lst.append([l,r])

cnt = 0
for i in range(q):
    for x in range(lst[i][0]-1, lst[i][1]):
        if s[x] == "A" and s[x+1] == "C":
            if x+1 < lst[i][1]:
                cnt += 1
    print(cnt)
    cnt = 0
Problem p03353 (python)

Fixed submission:
s = list(input())
k = int(input())

l = []
for i in range(len(s)):
    for y in range(k):
#        print(''.join(s[i:i+y+1]))
        if not ''.join(s[i:i+y+1]) in l:
            l.append(''.join(s[i:i+y+1]))

l.sort()
if not l:
    print(s[0])
else:
    print(l[k-1])

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())

l = []
for i in range(len(s)-1):
    for y in range(i+1,len(s)+1):
        if not ''.join(s[i:y]) in l:
            l.append(''.join(s[i:y]))

l.sort()
if len(s) == 1:
    print(s[0])
else:
    print(l[k-1])

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

l = []
for i in range(len(s)-1):
    for y in range(i+1,len(s)+1):
        if not str(s[i:y]) in l:
            l.append(str(s[i:y]))

l.sort()
if len(s) == 1:
    print(s)
else:
    print(l[k-1])
Problem p03380 (python)

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

base = max(a)
tmp = 10**9
tmp_i = 0
for x in a:
    if x == base:
        pass
    elif abs(base - 2*x) < tmp:
        tmp = abs(base - 2*x)
        tmp_i = x

print(base, tmp_i)

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
a = [int(x) for x in input().split()]


base = max(a)
ans = 0
ans_set = []
for x in a:
    if x == base:
        pass
    elif len(list(itertools.combinations(range(base), x))) > ans:
        ans = len(list(itertools.combinations(range(base), x)))
        ans_set = [base, x]
print(*ans_set)

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
a = [int(x) for x in input().split()]


base = max(a)
ans = 0
ans_set = []
for x in a:
    if x == base:
        pass
    elif len(list(itertools.combinations(range(1, base+1), x))) > ans:
        ans = len(list(itertools.combinations(range(1, base+1), x)))
        ans_set = [base, x]
print(*ans_set)
Problem p03393 (python)

Fixed submission:
s = input()

a = list('abcdefghijklmnopqrstuvwxyz')

if s == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
elif len(s) < 26:
    for x in a:
        if s.count(x) == 0:
            print(s + x)
            break
else:
    end = False
    for i in range(25)[::-1]:
        if end:
            break
        for j in range(i+1,26)[::-1]:
            if s[i] < s[j]:
                print(s[:i]+s[j])
                end = True
                break

Buggy submission (verdict: Runtime Error):
s = input()

a = list('abcdefghijklmnopqrstuvwxyz')

if s == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
elif len(s) < 26:
    for x in a:
        if s.count(x) == 0:
            print(s + x)
            break
else:
    print(c)
    #for i in range(len(s)):
    #    if a[i] != s[i]:
    #        ans = s[:i-1] + chr(ord(s[i-1])+1)
    #        break
    #print(ans)

Buggy submission (verdict: Runtime Error):
s = input()

a = list('abcdefghijklmnopqrstuvwxyz')

if s == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
elif len(s) < 26:
    for x in a:
        if s.count(x) == 0:
            print(s + x)
            break
else:
    for i in range(len(s)):
        if a[i] != s[i]:
            ans = s[:i-1] + chr(ord(s[i-1])+1)
            break
    print(ans)

Buggy submission (verdict: Runtime Error):
s = input()

a = list('abcdefghijklmnopqrstuvwxyz')

if s == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
elif len(s) < 26:
    for x in a:
        if s.count(x) == 0:
            print(s + x)
            break
else:
    for i in range(26):
        if a[i] != s[i]:
            ans = s[:i-1] + chr(ord(s[i-1])+1)
            break
    print(ans)
Problem p03910 (python)

Fixed submission:
n = int(input())

if n == 1:
    print(1)
elif n == 2:
    print(2)
else:
    for x in range(1,n):
        tmp = (1+x)*x//2
        if tmp >= n:
            l = x
            break

    d = tmp - n
    for x in range(1,l+1):
        if x != d:
            print(x)

Buggy submission (verdict: Runtime Error):
n = int(input())

if n == 1:
    print(1)
else:
    for x in range(1,n):
        tmp = (1+x)*x//2
        if tmp >= n:
            l = x
            break

    d = tmp - n
    for x in range(1,l+1):
        if x != d:
            print(x)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
if s == t[:-1]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
def power_func(a,n,p):
  bi=str(format(n,"b"))#2進表現に
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 998244353
N = 10 ** 6
fact = [1, 1] + [0] * (N-2)
factinv = [1, 1] + [0] * (N-2)
inv = [0, 1] + [0] * (N-2)

for i in range(2, N + 1):
    fact[i] = (fact[i-1] * i) % p
    inv[i] = (-inv[p % i] * (p // i)) % p
    factinv[i] = (factinv[i-1] * inv[i-1]) % p

n, m, k = [int(i) for i in input().split()]

ret = 0
for i in range(k+1):
  ret += ((cmb(n-1, i, p) * m % p) * (power_func(m-1, n-1-i, p))) % p
print(ret % p)
Problem p02995 (python)

Fixed submission:
import sys
import fractions

def main():
    # a = sys.stdin.readline().strip()
    a, b, c, d = [int(i) for i in sys.stdin.readline().strip().split()]
    # [[int(i) for i in sys.stdin.readline().strip().split()] for _ in range(2)]
    n = b - a + 1
    # print(n)
    if a % c == 0:
        mi_c = a // c
    else:
        mi_c = a // c + 1
    ma_c = b // c
    n -= (ma_c - mi_c + 1)
    # print(ma_c, mi_c, n)

    if a % d == 0:
        mi_d = a // d
    else:
        mi_d = a // d + 1
    ma_d = b // d
    n -= (ma_d - mi_d + 1)
    # print(ma_d, mi_d, n)

    cd = (c * d) // fractions.gcd(c, d)
    if a % cd == 0:
        mi_cd = a // cd
    else:
        mi_cd = a // cd + 1
    ma_cd = b // cd
    n += (ma_cd - mi_cd + 1)
    # print(ma_cd, mi_cd, n)
    print(n)
    
main()

Buggy submission (verdict: Runtime Error):
import sys
import math

def main():
    # a = sys.stdin.readline().strip()
    a, b, c, d = [int(i) for i in sys.stdin.readline().strip().split()]
    # [[int(i) for i in sys.stdin.readline().strip().split()] for _ in range(2)]
    n = b - a + 1
    # print(n)
    if a % c == 0:
        mi_c = a // c
    else:
        mi_c = a // c + 1
    ma_c = b // c
    n -= (ma_c - mi_c + 1)
    # print(ma_c, mi_c, n)

    if a % d == 0:
        mi_d = a // d
    else:
        mi_d = a // d + 1
    ma_d = b // d
    n -= (ma_d - mi_d + 1)
    # print(ma_d, mi_d, n)

    cd = (c * d) // math.gcd(c, d)
    if a % cd == 0:
        mi_cd = a // cd
    else:
        mi_cd = a // cd + 1
    ma_cd = b // cd
    n += (ma_cd - mi_cd + 1)
    # print(ma_cd, mi_cd, n)
    print(n)
    
main()
Problem p02997 (python)

Fixed submission:
import sys
import itertools

def main():
    n, k = [int(i) for i in sys.stdin.readline().strip().split()]
    max_k = (n-1) * (n-2) // 2
    if max_k < k:
        print('-1')
        return
    
    pairs = [(1, i) for i in range(2, n+1)]
    l = max_k
    for c in itertools.combinations(list(range(2, n+1)), 2):
        if l == k:
            break
        pairs.append(c)
        l -= 1
    print(len(pairs))
    for p in pairs:
        print(p[0], p[1])
    return


main()

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

def main():
    n, k = [int(i) for i in sys.stdin.readline().strip().split()]
    max_k = (n-1) * (n-2) // 2
    if max_n < k:
        print('-1')
        return
    
    pairs = [(1, i) for i in range(2, n+1)]
    l = max_k
    for c in itertools.combinations(list(range(2, n+1)), 2):
        if l == k:
            break
        pairs.append(c)
        max_k -= 1
    print(len(pairs))
    for p in pairs:
        print(p[0], p[1])
    return


main()
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m=map(int,input().split())
angle=abs(m*6-(h*30+m/60*30))
print(math.sqrt(a*a+b*b-2*a*b*math.cos(angle/180*math.pi)))

Buggy submission (verdict: Runtime Error):
import math
a,b,h,m=map(int,input().split())
angle=abs(m*6-(h*30+m/60*30))
print(math.sqrt(a*a+b*b-2*a*b*math.cos(angle/180*pi)))
Problem p02717 (python)

Fixed submission:
from sys import stdin

a,b,c=map(int,input().split())
print(str(c)+" "+str(a)+" "+str(b))

Buggy submission (verdict: Runtime Error):
from sys import stdin

a,b,c=map(int,input().split())
print(str(c)+" "+str(a)+" "str(c))
Problem p02921 (python)

Fixed submission:
from sys import stdin
import queue
import sys

s=input()
t=input()
ans=0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import queue
import sys

s,t=input().split()
ans=0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
print(ans)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()

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

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
num = 0
 
for i in range(K):
    if(A >  i):
        num+=1
    elif(A+B >  i):
        continue
    else:
        num-=1
 
print(num)
Problem p02677 (python)

Fixed submission:
import math
     
A,B,H,M = map(int, input().split())
     
hourdegrees = ( H * 60 + M ) * (0.5)
mindegrees = M*(6)
      
if mindegrees < hourdegrees:
  degree = hourdegrees - mindegrees
elif mindegrees > hourdegrees:
  degree = mindegrees - hourdegrees
elif mindegrees == hourdegrees:
  degree = 0
      
distance = math.sqrt(A ** 2 + B ** 2 -2 * A * B * math.cos(math.radians(degree) ) )
print(distance)

Buggy submission (verdict: Runtime Error):
import math

A,B,H,M = map(int, input().split())

hourdegrees = ( H * 60 + M ) * (0.5)
mindegrees = M*(6)
  
if mindegrees < hourdegrees:
  degree = hourdegrees - mindegrees
elif mindegrees > hourdegrees:
  degree = mindegrees - hourdegrees
  
distance = math.sqrt(A ** 2 + B ** 2 -2 * A * B * math.cos(math.radians(degree) ) )
print(distance)

Buggy submission (verdict: Runtime Error):
import math

A,B,H,M = map(int, input().split())

hourdegrees = H*(30)
mindegrees = M*(6)


if hourdegrees > 180:
  hourdegrees-=180
  
if mindegrees < hourdegrees:
  degree = hourdegrees - mindegrees
elif mindegrees > hourdegrees:
  degree = mindegrees - hourdegrees
  
distance = math.sqrt(A ** 2 + B ** 2 -2 * A * B * math.cos(math.radians(degree) ) )
print(distance)
Problem p02700 (python)

Fixed submission:
TH,TS,AH,AS = map(int,input().split())
while True:
  AH -= TS
  if AH <= 0:
    print('Yes')
    break
  else:
    TH -= AS
    if TH <= 0:
      print('No')
      break

Buggy submission (verdict: Runtime Error):
TH,TS,AH,AS = map(int,input().split())
while Ture:
  AH -= TS
  if AH <= 0:
    print('Yes')
    break
  else:
    TH -= AS
    if TH <= 0:
      print('No')
      break

Buggy submission (verdict: Runtime Error):
th,ts,ah,as = map(int,input().split())
while Ture:
  ah -= ts
  if ah <= 0:
    print('Yes')
    break
  else:
    th -= as
    if th <= 0:
      print('No')
      break
Problem p02694 (python)

Fixed submission:
X = int(input())
m = 100
count = 0
import math
while m < X:
  m = m * 101 //100
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
X = int(input())
m = 100
count = 0
while i in 32:
  m = math.floor(m * 1.01)
  if m > X:
    count = i + 1
    break
print(count)
Problem p02969 (python)

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

Buggy submission (verdict: Runtime Error):
r = input()
print(3 * r**2)

Buggy submission (verdict: Runtime Error):
r = input()
print(3 * a**2)
Problem p03448 (python)

Fixed submission:
u = [int(input()) for i in range(4)]
A,B,C,X = u[0],u[1],u[2],u[3]
count=[]
a ,b = 0,0
i = 0
while X-500*a >=0 and a<= A:
    X_1 = X-500*a
    while X_1-100*b>= 0 and b<= B:
        X_2 = X_1-100*b
        if X_2 % 50 == 0 and X_2 / 50 <= C:
            i += 1
        else:
             pass
        b += 1
    b = 0
    count.append(i)
    a += 1
    i=0
print(sum(count))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
N,A,B = a[0],a[1],a[2]
k = 1
x = True
while x:
    if 10**(k-1) <= N and N < 10**k:
        x = False
    else:
        k += 1
u = 1
M = 0
while u <= k:
    if u == 1:
        v = 1
        while v <= 9:
            if v>= A and v <= B and v <= N:
               M += v
            v += 1
    elif u == 2:
        v,w = 1,0
        while v <= 9:
            while w <= 9:
                 if v+w <=B and v+w >= A and 10*v+w<=N:
                     M += 10*v +w
                 w += 1
            w=0
            v += 1
    else:
        v,w,x =1,0,0
        while v<=9:
            while w <= 9:
                while x <= 9:
                    if v+w+x >= A and v+w+x <= B and 100*v+10*w+x<=N:
                        M += 100*v + 10*w + x
                    x += 1
                x=0
                w += 1
            w=0
            v += 1
    u += 1
print(M)
Problem p03494 (python)

Fixed submission:
def div_count(a):
  i= 0
  while a%2 == 0:
    a = a/2
    i+=1
  return i
N = int(input())
numbers = list(map(int,input().split()))
count=[]
for u in range(N):
  count.append(div_count(numbers[u]))
print(min(count))

Buggy submission (verdict: Runtime Error):
def div_count(a):
  i= 0
  while a%2 == 0:
    a = a/2
    i+=1
  return i
N = int(input())
list = int(input().split())
count=[]
for u in range(N):
  count.append(div_count(list[u]))
print(max(count))

Buggy submission (verdict: Runtime Error):
N = input()
list = input.split()
i = 0
def div_list(your_list=list):
     for v in range(N):
       if list[v] % 2 == 0:
          list_a[v] = list[v] / 2
          if v== N-1:
             i+= 1
             div_list(list_a)
      
       else:
            break
      return i
print(div_list())
Problem p03632 (python)

Fixed submission:
A,B,C,D = (int(i) for i in input().split())
Alice_time = set(range(A,B+1))
Bob_time = set(range(C,D+1))
common_time = Alice_time & Bob_time
common_time_list = list(common_time)
common_time_list_sorted = sorted(common_time_list)
if len(common_time_list_sorted) > 1:
    print(common_time_list_sorted[-1]-common_time_list_sorted[0])
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A,B,C,D = (int(i) for i in input().split())
Alice_time = set(range(A,B+1))
Bob_time = set(range(C,D+1))
common_time = Alice_time & Bob_time
common_time_list = list(common_time)
common_time_list_sorted = sorted(common_time_list)
print(common_time_list_sorted[-1]-common_time_list_sorted[0])
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
l=[1]           
seen={}
k=1
for i in range (K):
  if not k in seen.keys():
      seen[k]=i
      k=A[k-1]
      l.append(k)
  else:
    r_start=seen[k]
    roop=i-r_start
    K=(K-r_start)%roop+r_start
    break
ans=l[K]
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
l=[]           
seen={}
k=1
for i in range (K):
  l.append(k)
  if not k in seen.keys():
      seen[k]=i
      k=A[k-1]
  else:
    r_start=seen[k]
    roop=i-r_start
    c=K//roop
    K=K-roop*c
    break
ans=l[K]
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
l=[]           
seen={}
k=1
for i in range (K):
  if not k in seen.keys():
      l.append(k)
      seen[k]=i
      k=A[k-1]
  else:
    r_start=seen[k]
    roop=i-r_start
    c=K//roop
    K=K-roop*c
    break
ans=l[K]
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
l=[]           
seen = {}
k=A[0]
for i in range (K):
  if not k in seen.keys():
      l.append(k)
      seen[k]=i
      k=A[k-1]

  else:
    r_start=seen[k]
    roop=i-r_start
    break
c=K//roop
K=K-roop*c
ans=l[K-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
l=[]           
seen = {}
k=A[0]
for i in range (K):
  if not k in seen.keys():
      l.append(k)
      seen[k]=i
      k=A[k-1]

  else:
    r_start=seen[k]
    roop=i-r_start
    break
K=4
c=K//roop
K=K-roop*c
ans=l[K]
print(ans)

Buggy submission (verdict: Runtime Error):
print(kari)