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

Fixed submission:
N=input()
answer="No"
for i in range(len(N)-2):
  if N[i]==N[i+1]:
    if N[i+1]==N[i+2]:
      answer="Yes"
print(answer)

Buggy submission (verdict: Runtime Error):
print("Yes" if (N[0]==N[1]==N[2])or(N[1]==N[2]==N[3]) else "No" )

Buggy submission (verdict: Runtime Error):
N=input()
answer="No"
for i in range(len(N)-2)
  if N[i]==N[i+1]:
    if N[i+1]==N[i+2]:
      answer="Yes"
print(answer)

Buggy submission (verdict: Runtime Error):
N=list(input())
answer="no"
for i in range(len(N)-2)
  if N[i]==N[i+1]:
    if N[i+1]==N[i+2]:
      answer="yes"
print(answer)

Buggy submission (verdict: Runtime Error):
N=list(input())
answer="no"
for i in range(len(N)-2)
  if N[i]==N[i+1]:
    if N[i+1]==N[i+2]:
      if N[i+2]==N[i+3]:
        answer="yes"
print(answer)
Problem p03556 (python)

Fixed submission:
N=int(input())
for i in range(1,N+1):
  if i**2>N:
    break
  answer=i**2
print(answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
while for i in range(1,N+1):
  if i**2>N:
    break
  answer=i**2
print(answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
while for i in N:
  if i**2>N:
    break
  answer=i**2
print(answer)
Problem p03671 (python)

Fixed submission:
*a,=map(int,input().split())
a.remove(max(a))
print(sum(a))

Buggy submission (verdict: Runtime Error):
*a,=map(int,input().split())
print(sum(a.remove(max(a)))

Buggy submission (verdict: Runtime Error):
*a,=map(int,input().split())
print(sum(a.remove(max(a))))
Problem p03777 (python)

Fixed submission:
a,b=input().split()
if a=="H":
  print(b)
else:
  if b=="H":
    print("D")
  else:
    print("H")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a="H":
  print(b)
else:
  if b="H":
    print("D")
  else:
    print("H")
Problem p03796 (python)

Fixed submission:
import math
N=int(input())
print(math.factorial(N)%(7+10**9))

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
print(math.factorial(N)/(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
print(int(math.factorial(N)%(7+1e9)))

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
print(math.factorial(N)%(7+1e9))

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
print(math.factorial(N)%(7+1e9)

Buggy submission (verdict: Runtime Error):
from math import factorial
N=int(input())
print(factorial(N)%(7+1e9)
Problem p03126 (python)

Fixed submission:
N,M = map(int, input().split())
K = list(map(int, input().split()))
del K[0]
for i in range(N - 1):
    k = list(map(int, input().split()))
    del k[0]
    K = list(set(k) & set(K))
print(len(K))

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
K = list(map(int, input().split()))
del K[0]
for i in range(N):
    k = list(map(int, input().split()))
    del k[0]
    K = list(set(k) & set(K))
print(len(K))
Problem p03102 (python)

Fixed submission:
N, M, C = map(int, input().split(' '))
B = list(map(int, input().split(' ')))
A = []
for i in range(N):
    A.append(list(map(int, input().split(' '))))
AB = []
for i in range(len(A)):
    matmul = C
    for j in range(len(B)):
        matmul += A[i][j] * B[j]
    AB.append(1 if matmul > 0 else 0)
print(sum(AB))

Buggy submission (verdict: Runtime Error):
import numpy as np

N, M, C = map(int, input().split(' '))
B = np.array(tuple(map(int, input().split(' ')))).reshape((-1, 1))
A = np.zeros((N, M))
for i in range(N):
    A[i, :] = np.array(tuple(map(int, input().split(' '))))

print(np.where((np.matmul(A, B) + C) > 0, 1, 0).sum())
Problem p03059 (python)

Fixed submission:
elem = input().split()
a = int(elem[0])
b = int(elem[1]) 
t = int(elem[2])
    
ans = (t // a) * b


print(ans)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a = []
tmp = input().split()
for i in range(n):
    a.append(int(tmp[i]))

if n == 2:
    if a[0] > a[1]:
        print(a[0])
    else:
        print(a[1])
    exit()

rev = []
rev.append(a[n-1])
prev_gcd = a[n-1]
for i in range(n-2, 0, -1):
    prev_gcd = math.gcd(prev_gcd, a[i])
    rev.append(prev_gcd)

ans = math.gcd(a[0], rev[-2])
if ans < rev[-1]:
    ans = rev[-1]
        
prev_gcd = a[0]
for i in range(1, n-1):
    prev_gcd = math.gcd(prev_gcd, a[i])
    cand_ans = math.gcd(prev_gcd, rev[-1 - i])
    if cand_ans > ans:
        ans = cand_ans

print(ans)
Problem p03206 (python)

Fixed submission:
import pdb


def main():
    num = int(input())

    ans = ""
    
    if num == 25:
        ans = "Christmas"
    elif num == 24:
        ans = "Christmas Eve"
    elif num == 23:
        ans = "Christmas Eve Eve"
    elif num == 22:
        ans = "Christmas Eve Eve Eve"
        
    print(ans)

        
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import pdb

def eat(n, x):
    ret = 0

    if x == 0:
        return 0, x

    if n == 0:
        x -= 1
        return 1, x

    if allnum[n] <= x:
        x -= allnum[n]
        return pnum[n], x
        
    
    x -= 1 # eat bread
    if x == 0:
        return 0, x

    # eat n-1 beager
    tmp, x = eat(n - 1, x)
    ret += tmp
    if x == 0:
        return ret, x

    # eat patty
    x -= 1
    ret += 1
    if x == 0:
        return ret, x

    # eat n-1 beager
    tmp, x = eat(n - 1, x)
    ret += tmp
    if x == 0:
        return ret, x

    x -= 1 # eat bread
        
    return ret, x


def main():
    tmp = input().split()
    n = int(tmp[0])
    x = int(tmp[1])
    global pnum
    global allnum
    pnum = [1]
    allnum = [1]
    for i  in range(1, 52):
        pnum.append(pnum[i-1] * 2 + 1)
        allnum.append(allnum[i-1] * 2 + 3)

    ans, tmp = eat(n, x)

    print("%d" % ans)

        
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import pdb
import sys
sys.setrecursionlimit(10000)

def eat(n, x):
    ret = 0

    if x == 0:
        return 0, x

    if n == 0:
        x -= 1
        return 1, x

    if allnum[n] <= x:
        x -= allnum[n]
        return pnum[n], x
        
    
    x -= 1 # eat bread
    if x == 0:
        return 0, x

    # eat n-1 beager
    tmp, x = eat(n - 1, x)
    ret += tmp
    if x == 0:
        return ret, x

    # eat patty
    x -= 1
    ret += 1
    if x == 0:
        return ret, x

    # eat n-1 beager
    tmp, x = eat(n - 1, x)
    ret += tmp
    if x == 0:
        return ret, x

    x -= 1 # eat bread
        
    return ret, x


def main():
    tmp = input().split()
    n = int(tmp[0])
    x = int(tmp[1])
    global pnum
    global allnum
    pnum = [1]
    allnum = [1]
    for i  in range(1, 52):
        pnum.append(pnum[i-1] * 2 + 1)
        allnum.append(allnum[i-1] * 2 + 3)

    ans, tmp = eat(n, x)

    print("%d" % ans)

        
if __name__ == '__main__':
    main()
Problem p03136 (python)

Fixed submission:
n = int(input())
lines = [int(x) for x in input().split()]
lines
lines = sorted(lines)
if lines[-1] < sum(lines[:-1]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int, input().split()))
nums.sort()
max = nums.pop(-1)
print(sum(nums))

if(sum(nums) > max):
    print("yes")
elif(sum(nums) <= max)
    print("no")
Problem p03060 (python)

Fixed submission:
def sub():
    N, Vs, Cs = [input() for _ in range(3)]
    N = int(N)
    Vs = [int(e) for e in Vs.split(" ")]
    Cs = [int(e) for e in Cs.split(" ")]
    ds = [v - c for v, c in zip(Vs, Cs)]
    ds = [d for d in ds if d > 0]
    print(sum(ds))


sub()

Buggy submission (verdict: Runtime Error):
def sub():
    N, Vs, Cs = [e for e in input().split(" ")]
    N = int(N)
    Vs = [int(e) for e in Vs.split(" ")]
    Cs = [int(e) for e in Cs.split(" ")]
    ds = [v - c for v, c in zip(Vs, Cs)]
    ds = [d for d in ds if d > 0]
    print(sum(ds))


sub()
Problem p03061 (python)

Fixed submission:
from functools import lru_cache, reduce


@lru_cache(maxsize=None)
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]
    # As = sorted(As, reverse=True)

    memG = 0
    # if N == 2:
    # memG = gcd(As[0], As[1])
    if N < 10:
        for i in range(N):
            tmp = As[:i] + As[i + 1 :]
            g = reduce(gcd, tmp)
            if g > memG:
                memG = g
    else:
        gLeft = {0: As[0], 1: gcd(As[0], As[1])}
        for i in range(2, N):
            gI = gcd(gLeft[i - 1], As[i])
            gLeft[i] = gI
        gRight = {N - 1: As[N - 1], N - 2: gcd(As[N - 1], As[N - 2])}
        for i in range(2, N):
            gI = gcd(gRight[N - i], As[N - 1 - i])
            gRight[N - 1 - i] = gI

        buf = []
        for i in range(N):
            leftG = None
            if (i - 1) in gLeft:
                leftG = gLeft[i - 1]
            rightG = None
            if (i + 1) in gRight:
                rightG = gRight[i + 1]
            # tmpG = None
            if leftG is None:
                leftG = rightG
            elif rightG is None:
                rightG = leftG
            buf.append(gcd(leftG, rightG))
            # tmpG = gcd(leftG, rightG)
            # if tmpG > memG:
            #     memG = tmpG
        memG = max(buf)

    print("{}".format(memG))


sub()

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]
    # As = sorted(As, reverse=True)

    memG = 0
    for i in range(N):
        tmp = As[:i] + As[i + 1 :]
        gI = gcd(tmp[0], tmp[1])
        tmp = tmp[2:]
        for t in tmp:
            gI = gcd(t, gI)
            if gI < memG:
                break
        if gI > memG:
            memG = gI
    print("{}".format(memG))


sub()

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


def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]

    memG = 0
    for i in range(N):
        tmp = As[:i] + As[i + 1 :]
        g = functools.reduce(math.gcd, tmp)
        if g > memG:
            memG = g
    print("{}".format(memG))


sub()
Problem p03062 (python)

Fixed submission:
def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]

    dp = {(-1, 0): 0, (-1, 1): -1e10}
    for i in range(0, N):
        dp[(i, 0)] = max(dp[(i - 1, 0)] + As[i], dp[(i - 1, 1)] - As[i])
        dp[(i, 1)] = max(dp[(i - 1, 0)] - As[i], dp[(i - 1, 1)] + As[i])
    print("{}".format(dp[(N - 1, 0)]))


sub()

Buggy submission (verdict: Runtime Error):
import math


def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]

    dp = {(-1, 0): 0, (-1, 1): -math.inf}
    for i in range(0, N):
        dp[(i, 0)] = max(dp[(i - 1, 0)] + As[i], dp[(i - 1, 1)] - As[i])
        dp[(i, 1)] = max(dp[(i - 1, 0)] - As[i], dp[(i - 1, 1)] + As[i])
    print("{}".format(dp[(N - 1, 0)]))


sub()

Buggy submission (verdict: Runtime Error):
import math
def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]
    
    dp = {(-1,0): 0, (-1,1): -math.inf}
    for i in range(0, N):
        dp[(i,0)] = max(dp[(i-1, 0)] + As[i], dp[(i-1,1)] - As[i])
        dp[(i,1)] = max(dp[(i-1, 0)] - As[i], dp[(i-1,1)] + As[i])
    print("{}".format(dp[(N-1,0)]))

sub()
Problem p03071 (python)

Fixed submission:
def sub():
    A, B = [int(e) for e in input().split(" ")]
    N = 0
    for _ in range(2):
        if A > B:
            N = N + A
            A = A -1
        else:
            N = N + B
            B = B - 1
    print("{}".format(N))

sub()

Buggy submission (verdict: Runtime Error):
def sub():
    N, K = [int(e) for e in input().split(" ")]
    ss = [int(e) for e in input()]
    # if len(set(ss)) == 1:
    #     print(len(ss))
    #     return

    dd = [ss[i+1] - ss[i] for i in range(N-1)]
    idd = [0] + [i+1 for i, d in enumerate(dd) if d != 0]
    # print(idd)
    maxScore = 0
    for i in range(len(idd)):
        if ss[i] == 0:
            ni = i + 2*K
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
        else:
            ni = i + 2*K + 1
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
        
    print(maxScore)

sub()
Problem p03074 (python)

Fixed submission:
def sub():
    N, K = [int(e) for e in input().split(" ")]
    ss = [int(e) for e in input()]
    # if len(set(ss)) == 1:
    #     print(len(ss))
    #     return

    dd = [ss[i+1] - ss[i] for i in range(N-1)]
    idd = [0] + [i+1 for i, d in enumerate(dd) if d != 0]
    # print(idd)
    maxScore = 0
    for i in range(len(idd)):
        if ss[idd[i]] == 0:
            ni = i + 2*K
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
        else:
            ni = i + 2*K + 1
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
        
    print(maxScore)

sub()

Buggy submission (verdict: Runtime Error):
def sub():
    N, K = [int(e) for e in input().split(" ")]
    ss = [int(e) for e in input()]
    if len(set(ss)) == 1:
        print(len(ss))
        return

    dd = [ss[i+1] - ss[i] for i in range(N-1)]
    idd = [0] + [i+1 for i, d in enumerate(dd) if d != 0]
    
    maxScore = 0
    for i in idd:
        if ss[i] == 0:
            ni = i + 2*K
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
        else:
            ni = i + 2*K + 1
            if ni < len(idd):
                score = idd[ni] - idd[i]
            else:
                score = N - idd[i]
            if score > maxScore:
                maxScore = score
    print(maxScore)

sub()
Problem p03285 (python)

Fixed submission:
n =int(raw_input())
lis=[]
for i in range(1,26):
    lis.append(4*i)
for i in range(1,15):
    lis.append(7*i)
for i in range(1,20):
    for j in range(1,20):
        lis.append(4*i+7*j)
if n in lis:
    print "Yes"
else:
    print "No"

Buggy submission (verdict: Runtime Error):
n =int(raw_input())
lis=[]
for i in range(1,26):
    lis.add(4*i)
for i in range(1,15):
    lis.add(7*i)
for i in range(1,20):
    for j in range(1,20):
        lis.add(4*i+7*j)
if n in lis:
    print "Yes"
else:
    print "No"
Problem p03251 (python)

Fixed submission:
n, m, X, Y = map(int, input().split())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
x_max = max(xs)
y_min = min(ys)
def get_war(x_max, y_min, X, Y):
    if y_min > x_max:
        for z in list(range(x_max+1, y_min + 1)):
            if (z > X) and (z <= Y):
                return 'No War'
            else:
                pass
        else:
            return 'War'
    else:
        return 'War'
print(get_war(x_max, y_min, X, Y))

Buggy submission (verdict: Runtime Error):
n, m, X, Y = map(int, input().split())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
x_max = max(xs)
y_min = min(ys)
if y_min > x_max:
    for z in list(range(x_max, y_min + 1)):
        if (z > X) and (z <= Y):
            print('No War')
            break
    else:
        print('War')
else:
    print(bvv)
Problem p03671 (python)

Fixed submission:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    p = get_ln_int_inputs()
    print(sum(p) - max(p))


main()

Buggy submission (verdict: Runtime Error):
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    n = get_ln_int_inputs()[0]
    a = get_ln_int_inputs()

    ilist = []

    t = n
    while t > 0:
        ilist.append(t)
        t -= 2
    t += 1
    while t < n:
        ilist.append(t)
        t += 2
    
    print(" ".join(str(a[i - 1]) for i in ilist))


main()
Problem p03693 (python)

Fixed submission:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    if int("".join(get_ln_inputs())) % 4 == 0:
        print("YES")
    else:
        print("NO")


main()

Buggy submission (verdict: Runtime Error):
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    get_ln_inputs()
    rates = get_ln_int_inputs()

    colors = list()
    for _ in range(8):
        colors.append(0)

    free_colors = 0
    for rate in rates:
        if rate >= 3200:
            free_colors += 1
        else:
            colors[rate // 400] = 1
    fixed_colors = sum(colors)

    print(str(fixed_colors) + " " + str(fixed_colors + free_colors))


main()
Problem p03447 (python)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())
sub = x - a
while sub >= b:
    sub -= b
print(sub)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = str(input()).split()
b = str(input()).split()
c = [a,b]
def max(x,y):
    if x > y:
    return x
    else:
    return y 
def mp(v,w):
    if v == 0 and w == 0:
        return int(c[v][w])
    elif v == 0:
        return mp(v,(w - 1)) + int(c[v][w])
    elif w == 0:
        return mp((v - 1),w) + int(c[v][w])
    else:
        return max(mp(v,(w - 1)),mp((v - 1),w)) + int(c[v][w])
print(mp(1,(n-1)))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
answer = 0
for i in range(0,(a + 1)):
    for j in range(0,(b + 1)):
        for k in range(0,(c + 1)):
            if x == 500 * i + 100 * j + 50 * k:
                answer += 1
print(answer)
Problem p03449 (python)

Fixed submission:
n = int(input())
a = str(input()).split()
b = str(input()).split()
c = [a,b]
d = [a,b]
def max(x,y):
    if x > y:
        return x
    else:
        return y 
for j in range(0,2):
    for k in range(0,n):
        if j == 0 and k == 0:
            d[j][k] = int(c[j][k])
        elif j  == 0:
            d[j][k] = d[j][k-1] + int(c[j][k])
        elif k == 0:
            d[j][k] = d[j-1][k] + int(c[j][k])
        else:
            d[j][k] = max(d[j][k-1],d[j-1][k]) + int(c[j][k])
print(d[1][n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = str(input()).split()
b = str(input()).split()
c = [a,b]
d = [a,b]
def max(x,y):
    if x > y:
        return x
    else:
        return y 
for j in range(0,2):
    for k in range(0,n):
        if j == 0 and k == 0:
            d[j][k] = int(c[j][k])
        elif j  == 0:
            d[j][k] = d[j][k-1] + int(c[j][k])
        elif k == 0:
            d[j][k] = d[j-1][k] + int(c[j][k])
        else:
            d[j][k] = max(d[j][k-1],d[j-1][k]) + int(c[j][k])
print(d[1][n-1])
 
   
n = int(input())
a = str(input()).split()
b = str(input()).split()
c = [a,b]
d = [a,b]
def max(x,y):
    if x > y:
    return x
    else:
    return y 
for j in range(0,2):
    for k in range(0,n):
        if j == 0 and k == 0:
            d[j][k] = int(c[j][k])
        elif j  == 0:
            d[j][k] = d[j][k-1] + int(c[j][k])
        elif k == 0:
            d[j][k] = d[j-1][k] + int(c[j][k])
        else:
            d[j][k] = max(d[j][k-1],d[j-1][k]) + int(c[j][k])
print(d[1][n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = str(input()).split()
b = str(input()).split()
c = [a,b]
d = [a,b]
def max(x,y):
    if x > y:
    return x
    else:
    return y 
for j in range(0,2):
    for k in range(0,n):
        if j == 0 and k == 0:
            d[j][k] = int(c[j][k])
        elif j  == 0:
            d[j][k] = d[j][k-1] + int(c[j][k])
        elif k == 0:
            d[j][k] = d[j-1][k] + int(c[j][k])
        else:
            d[j][k] = max(d[j][k-1],d[j-1][k]) + int(c[j][k])
print(d[1][n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = str(input()).split()
b = str(input()).split()
c = [a,b]
def max(x,y):
    if x > y:
    return x
    else:
    return y 
def mp(v,w):
    if v == 0 and w == 0:
        return int(c[v][w])
    elif v == 0:
        return mp(v,(w - 1)) + int(c[v][w])
    elif w == 0:
        return mp((v - 1),w) + int(c[v][w])
    else:
        return max(mp(v,(w - 1)),mp((v - 1),w)) + int(c[v][w])
print(mp(1,(n-1)))
Problem p03455 (python)

Fixed submission:
a = str(input()).split()
if ( int(a[0]) * int(a[1]) ) % 2 == 1:
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
a = str(input()).split
if ( int(a[0]) * int(a[1]) ) % 2 == 1:
    print('0dd')
else:
    print('Even')
Problem p03043 (python)

Fixed submission:
N, K = map(int, input().split())
proba = 0
for n in range(0, N+1):
    for ii in range(18):
        if n * (2 ** ii) >= K:
            proba += (1 / N) * (0.5 ** ii)
            break

print(proba)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
proba = 0
if K == 1:
    print(1)
else:
    for n in range(0, N+1):
        for ii in range(17):
            if n * (2 ** ii) >= K:
                proba += (1 / N) * (2 ** (-ii))
                break
            
	print(proba)
Problem p03105 (python)

Fixed submission:
A, B, C = map(int, input().split())
print(C if A * C < B else B //A)

Buggy submission (verdict: Runtime Error):
S = input()
print(min(len(re.findall('0', S)), len(re.findall('1', S))) * 2 if len(S) > 1 else 0)
Problem p03061 (python)

Fixed submission:
from fractions import gcd

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



# L[0] = 0
# L[i] (i=1, ..., N)にはA_1, ..., A_iの最大公約数が格納されている

L = []
L.append(0)

for i in range(N):
    L.append(gcd(L[i], A[i]))

#  for i in range(N+1):
    #  print(L[i])


# R[N+1] = 0
# R[i] (i=N, N-1, ..., 1)にはA_i, ..., A_Nの最大公約数が格納されている

R = [0] * (N+2)
# R = [0, 0, 0, ... , 0] (0がN+2個)

for i in range(N, 0, -1):
    R[i] = gcd(A[i-1], R[i+1])

#  for i in range(N+1, -1, -1):
    #  print(R[i])



# M[i] (i=0, ..., N-1)にはA_(i+1)を除いた整数の最大公約数が格納されている

M = []
for i in range(N):
    M.append(gcd(L[i], R[i+2]))

print(max(M))

Buggy submission (verdict: Runtime Error):
from math import gcd

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



# L[0] = 0
# L[i] (i=1, ..., N)にはA_1, ..., A_iの最大公約数が格納されている

L = []
L.append(A[0])

for i in range(N):
    L.append(gcd(L[i], A[i]))

#  for i in range(N+1):
    #  print(L[i])


# R[N+1] = 0
# R[i] (i=N, N-1, ..., 1)にはA_i, ..., A_Nの最大公約数が格納されている

R = [0] * (N+2)
# R = [0, 0, 0, ... , 0] (0がN+2個)
R[N+1] = A[N-1]

for i in range(N, 0, -1):
    R[i] = gcd(A[i-1], R[i+1])

#  for i in range(N+1, -1, -1):
    #  print(R[i])



# M[i] (i=0, ..., N-1)にはA_(i+1)を除いた整数の最大公約数が格納されている

M = []
for i in range(N):
    M.append(gcd(L[i], R[i+2]))

print(max(M))

Buggy submission (verdict: Runtime Error):
from math import gcd

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



# L[0] = 0
# L[i] (i=1, ..., N)にはA_1, ..., A_iの最大公約数が格納されている

L = []
L.append(0)

for i in range(N):
    L.append(gcd(L[i], A[i]))

#  for i in range(N+1):
    #  print(L[i])


# R[N+1] = 0
# R[i] (i=N, N-1, ..., 1)にはA_i, ..., A_Nの最大公約数が格納されている

R = [0] * (N+2)
# R = [0, 0, 0, ... , 0] (0がN+2個)

for i in range(N, 0, -1):
    R[i] = gcd(A[i-1], R[i+1])

#  for i in range(N+1, -1, -1):
    #  print(R[i])



# M[i] (i=0, ..., N-1)にはA_(i+1)を除いた整数の最大公約数が格納されている

M = []
for i in range(N):
    M.append(gcd(L[i], R[i+2]))

print(max(M))