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

Fixed submission:
import math

a,b,t = (int(i) for i in input().split())

result = math.floor(((t+0.5)/a))*b

print(result)

Buggy submission (verdict: Runtime Error):
import sys

def gcd(x, y):
    while (y != 0):
        x, y = y, x%y
    return (x)

n = int(input())
a = list(map(int, input().split()))

result = sys.maxsize

a[0] = a[1]

for i in range(1):
    for j in range(i+1,n):
        if(a[i]>result and result < 1000000001):
            a[i]=result
        if(a[i] >= a[j]):
            result = gcd(a[i], a[j])
        elif(a[i] < a[j]):
           result = gcd(a[j], a[i])
        if (result == 1):
            break

print(result)

Buggy submission (verdict: Runtime Error):
def gcd(x, y):
    while (y != 0):
        x, y = y, x%y
    return (x)

n = int(input())
a = list(map(int, input().split()))

result = 1000000000
a[0] = a[1]

for i in range(1):
    for j in range(i+1,n):
        if(a[i]>result):
            a[i]=result
        if(a[i] >= a[j]):
            result = gcd(a[i], a[j])
        elif(a[i] < a[j]):
           result = gcd(a[j], a[i])
        if (result == 1):
            break

print(result)

Buggy submission (verdict: Runtime Error):
def gcd(x, y):
    while (y != 0):
        x, y = y, x%y
    return (x)

n = int(input())
a = list(map(int, input().split()))

result = 1000000000
a[0] = a[1]

for i in range(1):
    for j in range(i+1,n):
        if(a[j]>result):
            a[i]=result
        if(a[i] >= a[j]):
            result = gcd(a[i], a[j])
        elif(a[i] < a[j]):
           result = gcd(a[j], a[i])
        if (result == 1):
            break

print(result)
Problem p03067 (python)

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

if (a < c and c < b):
  print("Yes")
elif (b < c and c < a):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import re

n = int(input())
s = input()
k = int(input())

keychar = s[k-1]
mask = "*"
mask2 = "1"

masked = re.sub(r'%s'%keychar, mask2, s)
masked = re.sub(r'[a-z]', mask, masked)
masked = re.sub(r'%s'%mask2, keychar, masked)
print(masked)
Problem p03076 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

mod_list = []

a_mod = a % 10
if a_mod == 0:
    a_total = a
else:
    a_total = a + (10 - a_mod)
    mod_list.append(a_mod)

b_mod = b % 10
if b_mod == 0:
    b_total = b
else:
    b_total = b + (10 - b_mod)
    mod_list.append(b_mod)

c_mod = c % 10
if c_mod == 0:
    c_total = c
else:
    c_total = c + (10 - c_mod)
    mod_list.append(c_mod)

d_mod = d % 10
if d_mod == 0:
    d_total = d
else:
    d_total = d + (10 - d_mod)
    mod_list.append(d_mod)

e_mod = e % 10
if e_mod == 0:
    e_total = e
else:
    e_total = e + (10 - e_mod)
    mod_list.append(e_mod)

min_mod = 0
if len(mod_list) != 0:
    min_mod = min(mod_list)

if min_mod == 0:
    cut_time = 0
else:
    cut_time = 10 - min(mod_list)

print(a_total + b_total + c_total + d_total + e_total - cut_time)

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

mod_list = []

a_mod = a % 10
if a_mod == 0:
    a_total = a
else:
    a_total = a + (10 - a_mod)
    mod_list.append(a_mod)

b_mod = b % 10
if b_mod == 0:
    b_total = b
else:
    b_total = b + (10 - b_mod)
    mod_list.append(b_mod)

c_mod = c % 10
if c_mod == 0:
    c_total = c
else:
    c_total = c + (10 - c_mod)
    mod_list.append(c_mod)

d_mod = d % 10
if d_mod == 0:
    d_total = d
else:
    d_total = d + (10 - d_mod)
    mod_list.append(d_mod)

e_mod = e % 10
if e_mod == 0:
    e_total = e
else:
    e_total = e + (10 - e_mod)
    mod_list.append(e_mod)

min_mod = 0
min_mod = min(mod_list)

if min_mod == 0:
    cut_time = 0
else:
    cut_time = 10 - min(mod_list)

print(a_total + b_total + c_total + d_total + e_total - cut_time)
Problem p03106 (python)

Fixed submission:
a,b,k = map(int,input().split())
x=0
y=[0]
c=min(a,b)

if a==1 or b==1:
    print(1)
    exit()
    
for d in range(1,c+1):
    if a%d==0 and b%d==0:
            y.append(d)

print(y[-k])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
x=0
y=[0]
c=min(a,b)

if a==1 or b==1:
    print(1)
    exit()
    
for d in range(1,c):
    if a%d==0 and b%d==0:
            y.append(d)

print(y[k])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
x=0
y=[0]
c=min(a,b)

if a==1 or b==1:
    print(1)
    exit()
    
for d in range(1,c):
    if a%d==0 and b%d==0:
            y.append(d)

print(y[k])
print(y)
Problem p03131 (python)

Fixed submission:
k, a, b = map(int, input().split())
x=k+1
y=0
if b>a:
    c=b-a
    k-=a-1
    y=c*(k//2-1)+b+(k%2)
print(max(x,y))

Buggy submission (verdict: Runtime Error):
k, a, b = map(int, input().split())
x=k+1
y=0
if b>a:
    c=b-a
    k=k-a-1
    y=c*(k//2-1)+b+(k%2)
print(max(x.y))

Buggy submission (verdict: Runtime Error):
k,a,b = map(int,input().split())
n=1
e=0
for i in range(k):
    if (k-i)%2==0:
        
        if e=1:
            n=n+b
            continue
        if n>=a:
            e=1
            n=n-a
            continue
    else
        n=n+1
        continue
print(n)

Buggy submission (verdict: Runtime Error):
k,a,b = map(int,input().split())
n=1
e=0
for i in range(k):
    if (k-i)%2=0:
        
        if e=1:
            n=n+b
            continue
        if n>=a:
            e=1
            n=n-a
            continue
    else
        n=n+1
        continue
print(n)
Problem p03280 (python)

Fixed submission:
a,b=map(int,input().split())
print((a-1)*(b-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(sprit()))
print((a-1)(b-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(,sprit()))
print((a-1)(b-1))
Problem p03129 (python)

Fixed submission:
in_ = input()
n, k = map(int, in_.split())

if (k == 1):
    print("YES")
    exit()

if ((n % 2) == 1):
    n += 1

if (2 <= (n / k)):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
in_ = input()
n, k = in_.split()

if ((n - 1) <= 0):
  print("NO")
  exit()

if (1 <= (n - 1) / k):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
in_ = input()
n, k = in_.split()
if (1 <= (n - 1) / k):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = input()
k = input()
if (2 < n / k):
  print("Yes")
else:
  print("No")
Problem p03059 (python)

Fixed submission:
a,b,t=map(int,input().split())
print((t//a)*b)

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

N = int(input())
V = map(int, input().split())
C = map(int, input().split())

gain = 0
for i in range(0,N):
    if(V[i]>C[i]):
        gain += V[i] - C[i]

print(gain)
Problem p03060 (python)

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in range(n):
  if v[i]>c[i]:
    ans+=v[i]-c[i]
print(ans)

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

N = int(input())
V = map(int, input().split())
C = map(int, input().split())

gain = 0
for i in range(0,N):
    if(V[i]>C[i]):
        gain += V[i] - C[i]

print(gain)
Problem p03125 (python)

Fixed submission:
a,b=map(int,input().split())
if b%a==0:
	print(a+b)
else:
	print(b-a)

Buggy submission (verdict: Runtime Error):
s=input()
if int(s[5:7])<5:
	print('Heisei')
else:
	print('TBD')
Problem p03206 (python)

Fixed submission:
d=int(input())
if d==25:
	print('Christmas')
elif d==24:
    print('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
else:
    print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
d=int(input())
if d==25:
	print('Christmas')
elif d==24:
    print('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
else d==22:
    print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
d=int(input())
if d==25:
	print('Christmas')
elif d==24:
    print('Christmas Eve ')
elif d==23:
    print('Christmas Eve Eve')
else d==22:
    print('Christmas Eve Eve Eve ')

Buggy submission (verdict: Runtime Error):
d=int(input())
if d==25:
	print('Christmas')
else d==24:
    print('Christmas Eve ')
else d==23:
    print('Christmas Eve Eve')
else d==22:
    print('Christmas Eve Eve Eve ')
Problem p03280 (python)

Fixed submission:
a,b=map(int,input().split())
print((a-1)*(b-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
print((a-1)*(b-1))
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if a<=8 and b<=8:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a<=8&b<=8:
  print('Yay!')
else
  print(':(')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())

if a<9&&b<9:
	print('Yay!')
else:
    print(':(')
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(a-b)<=d and abs(a-c)<=d:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if abs(a-b)<=d or abs(a-c)<=d:
  print('Yes')
else:
  print('No')
Problem p03543 (python)

Fixed submission:
N = input()

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()
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print(Yes)
else:
  print(No)
Problem p03671 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(a+b+c-max(a,b,c))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input())
print(a+b+c-max(a,b,c))
Problem p03737 (python)

Fixed submission:
a,b,c=map(str,input().split())
A=a.upper()
B=b.upper()
C=c.upper()
print(A[0]+B[0]+C[0])

Buggy submission (verdict: Runtime Error):
a,b,c=map(input().split())
A=a.upper()
B=b.upper()
C=c.upper()
print(A[0]+B[0]+C[0])
Problem p03795 (python)

Fixed submission:
n=int(input())
x=800*n
y=(n//15)*200
print(x-y)

Buggy submission (verdict: Runtime Error):
n=int(inpt())
x=800*n
y=(n//15)*200
print(x-y)
Problem p03852 (python)

Fixed submission:
c=input()
if c=='a' or c=='i' or c=='u' or c=='e' or c=='o':
  print('vowel')
else:
  print('consonant')

Buggy submission (verdict: Runtime Error):
c=input()
if c='a' or c='i' or c='u' or c='e' or c='o':
  print('vowel')
else:
  print('consonant')

Buggy submission (verdict: Runtime Error):
c=input()
if c=='a' or c=='i' or c=='u' or c=='e' or c=='o':
  print(vowel)
else:
  print(consonant)

Buggy submission (verdict: Runtime Error):
c=input()
if c='a' or c='i' or c='u' or c='e' or c='o':
  print(vowel)
else:
  print(consonant)
Problem p03050 (python)

Fixed submission:
import sys
input = sys.stdin.readline

import numpy as np

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

N = int(input())
if N == 1 or N == 2:
    print("0")
else:
    N_divisors = make_divisors(N)

    N_length = len(N_divisors)
    N_length_half = N_length // 2
    N_length_mod = N_length % 2

    N_length_half_temp = 0

    if N_length_mod == 1:
        N_length_half_temp = N_length_half + 1
    else:
        N_length_half_temp = N_length_half
    if N_divisors[N_length_half_temp]-1 == N_divisors[N_length_half_temp-1]:
        N_length_half_temp += 1
    print(sum(N_divisors[N_length_half_temp:]) - (N_length - N_length_half_temp))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

import sympy

N = int(input())
if N == 1 or N == 2:
    print("0")
    sys.exit()

N_divisors = sympy.divisors(N)

N_length = len(N_divisors)
N_length_half = N_length // 2
N_length_mod = N_length % 2

N_length_half_temp = 0

if N_length_mod == 1:
    N_length_half_temp = N_length_half + 1
else:
    N_length_half_temp = N_length_half

print(N_divisors)
print(sum(N_divisors[N_length_half_temp:]) - (N_length - N_length_half_temp))
Problem p03573 (python)

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

Buggy submission (verdict: Runtime Error):
if(A == B):
    print(C)
elif(B == C):
    print(A)
else:
    print(B)
Problem p03587 (python)

Fixed submission:
s = input()
ans = 0
for i in range(len(s)):
    if(s[i] == '1'):
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import Fraction as F
N = int(input())
left = F(4, N)
for i in range(1, 3500):
    if(left > F(1, i)):
        h = i
        break
for i in range(1, 3500):
    if(left > F(1, h) + F(1, i)):
        n = i
        break
for i in range(1, 3500):
    if(left == F(1, h) + F(1, n) + F(1, i)):
        w = i
        break
print(h, n, w)

Buggy submission (verdict: Runtime Error):
from fractions import F
N = int(input())
left = F(4, N)
for i in range(1, 3500):
    if(left > F(1, i)):
        h = i
        break
for i in range(1, 3500):
    if(left > F(1, h) + F(1, i)):
        n = i
        break
for i in range(1, 3500):
    if(left > F(1, h) + F(1, n) + F(1, i)):
        w = i
        break
print(h, n, w)
Problem p03672 (python)

Fixed submission:
S = input()
for i in range(len(S) - 1, 0, -1):
    if(S[0:i//2] == S[i//2:i]):
        print(i)
        break

Buggy submission (verdict: Runtime Error):
    S = input()
    for i in range(len(S) - 1, 0, -1):
        if(S[0:i//2] == S[i//2:i]):
            print(i)
            break
Problem p03693 (python)

Fixed submission:
r, g, b = map(int, input().split())
num = r * 100 + g * 10 + b
if(num % 4 == 0):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = map(int, raw_input().split())
num = r * 100 + g * 10 + b
if(num % 4 == 0):
    print("Yes")
else:
    print("No")
Problem p03711 (python)

Fixed submission:
group = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]

x, y = map(int, input().split())
for i in range(0,2):
    if(group[i].count(x) > 0 and group[i].count(y) > 0):
        print("Yes")
        exit()
print("No")

Buggy submission (verdict: Runtime Error):
group = [[1,3,5,7,8,10,12],[4,6,9,11]]

x, y = map(int, raw_input().split())
for i in range(0,1):
    if(group[i].count(x) > 0 and group[i].count(y) > 0):
        print("Yes")
        exit()
print("No")
Problem p03712 (python)

Fixed submission:
y, x = map(int, input().split())
image = ["#" * (x+2)]
for y in range(0,y):
    image.append("#"  + input() + "#")
image.append("#" * (x+2))
for img in image:
    print(img)

Buggy submission (verdict: Runtime Error):
    y, x = map(int, input().split())
    image = ["#" * (x+2)]
    for y in range(0,y):
        image.append("#"  + input() + "#")
    image.append("#" * (x+2))
    for img in image:
        print(img)
Problem p03455 (python)

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


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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a*b % 2 == 0:
    print('Even')
else:
    print('Odd')

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

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

Buggy submission (verdict: Runtime Error):
if a*b%2==0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
if a*b%2==0:
  print("Even")
else:
  print("Odd")
Problem p03493 (python)

Fixed submission:
n = input()
cun = 0
for i in n:
    if i == '1':
        cun += 1
print(cun)

Buggy submission (verdict: Runtime Error):
n=input()
cun=0
for i in n:
  if i=='1':
    con++
print(con)
Problem p03103 (python)

Fixed submission:
#!/usr/bin/env python3
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]

AB.sort()

ans = 0
for i, j in AB:
	ans += i * min(M, j)
	M -= min(M, j)

print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
N, M = map(int, input().split())
AB = [list(map(int, input().split())), for i in range(N)]

AB.sort()

ans = 0
for i, j in AB
	ans += i * min(M, j)
	M -= min(M, j)

print(ans)
Problem p03037 (python)

Fixed submission:
N, M = map(int, input().split())        
                                        
x = []                                  
for i in range(M):                      
    l,r = map(int, input().split())     
    x.append([l, r])                    
                                        
                                        
cand = list(range(1, N+1))              
                                        
for i, p in enumerate(x):               
    l,r = p                             
    if (r < cand[0]) or (l > cand[-1]): 
        del cand[0:]                    
        break                           
                                        
    if cand[0] < l:                     
        del cand[:(l - cand[0])]        
    if cand[-1] > r:                    
        del cand[(r-cand[0]+1):]        
                                        
print(len(cand))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())    
                                    
x = []                              
for i in range(M):                  
    l,r = map(int, input().split()) 
    x.append([l, r])                
                                    
                                    
cand = list(range(1, N+1))          
                                    
for i, p in enumerate(x):           
    l,r = p                         
    if cand[0] < l:                 
        del cand[:(l - cand[0])]    
    if cand[-1] > r:                
        del cand[(r-cand[0]+1):]    
                                    
print(len(cand))
Problem p03043 (python)

Fixed submission:
import math
N, K = map(int, input().strip().split())

ret = 0

for i in range(N):
    if (i + 1) < K:
        ret += (1.0 / N) * (0.5 ** (math.ceil(math.log2(K / (i+1)))))
    else:
        ret += (1.0 / N)
print(ret)

Buggy submission (verdict: Runtime Error):
N = int(input().strip())
x = [[] for x in range(N)]
for i in range(N-1):
     u, v, w = list(map(int, input().split()))
     x[u-1].append([v-1, w])
     x[v-1].append([u-1,w])



ret = {}
done = []

queue = [0]

for i in range(N):
    curr = queue.pop()
    if curr == 0:
        ret[0] = 0

    for neigh in x[curr]:
        if neigh in done:
            continue
        if neigh[1] % 2 == 0:
            ret[neigh[0]] = ret[curr]
        else:
            ret[neigh[0]] = 0 if ret[curr] == 1 else 1

        queue.append(neigh[0])
    done.append(curr)


for i in range(N):
    print(ret[i])
Problem p03919 (python)

Fixed submission:
a_,b_ = map(int, (raw_input().strip().split(" ")))
foo = []
for i,a in enumerate(range(a_)):
    foo = raw_input().strip().split(" ")
    for j in range(b_):
        if foo[j] == 'snuke':
            print(chr(65 + j) + str(i + 1))

Buggy submission (verdict: Runtime Error):
a_,b_ = map(int, (raw_input().strip().split(" ")))

foo = []
for i,a in enumerate(range(a_)):
    foo = raw_input().strip().split(" ")
    for j in range(b_):
        if foo[j] == 'snuke':
            print('A'+ str(i + 1))

Buggy submission (verdict: Runtime Error):
a_,b_ = map(int, (raw_input().strip().split(" ")))
foo = []
for i,a in enumerate(range(a_)):
    foo = raw_input().strip().split(" ")
    for j in range(b_):
        if foo[j] == 'snuke':
            print(chr(65 + j) + str(i + 1))

Buggy submission (verdict: Runtime Error):
a_,b_ = map(int, (raw_input().strip().split(" ")))

foo = []
for i,a in enumerate(range(a_)):
    foo = raw_input().strip().split(" ")
    for j in range(b_):
        if foo[j] == 'snuke':
            print(chr(65 + j) + str(i + 1))
Problem p03920 (python)

Fixed submission:
a = int(input().strip())
import sys
sys.setrecursionlimit(1000000)
tmp = []
res = []
ind = 1

def bar(foo,hoge):
    if(foo == 0):
        return
    if foo == 1:
        res.append(1)
        return
    elif foo == 2:
        res.append(2)
        return
    for i in reversed(range(hoge)):
        if (tmp[i] <= foo):
            res.append(i + 1)
            bar(foo - (i + 1) , i)
            return
        
        
    
for i in range(10000000):
    ind = ind + i
    tmp.append(ind)
    if ind >= a :
        bar(a, i + 1 )
        break
for i in res:
    print(i)

Buggy submission (verdict: Runtime Error):
a = int(input().strip())

tmp = []
res = []
ind = 1

def bar(foo,hoge):
    if(foo == 0):
        return
    if foo == 1:
        res.append(1)
        return
    elif foo == 2:
        res.append(2)
        return
    for i in reversed(range(hoge)):
        if (tmp[i] <= foo):
            res.append(i + 1)
            bar(foo - (i + 1) , i)
            return
        
        
    
for i in range(10000000):
    ind = ind + i
    tmp.append(ind)
    if ind >= a :
        bar(a, i + 1 )
        break
for i in res:
    print(i)
Problem p03043 (python)

Fixed submission:
import numpy as np
import math

N, K= map(int, input().split())

if N > K: 
    prob_base = (N-K) / N
    prob = 0
    
    for i in range(1, K+1):
        x = math.ceil(np.log2(K/i))
        prob += (1/N) * (1/2)**x
        
    print(prob_base + prob)
    
else:
    prob = 0
    for i in range(1, N+1):
        x = math.ceil(np.log2(K/i))
        prob += (1/N) * (1/2)**x
        
    print(prob)

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

N, K= map(int, input().split())

if N > K:
  prob_base = (N-K) / N
  prob = 0
  for i in range(1, N-K+1):
    x = math.ceil(np.log2(K/i))
    prob += (1/N) * (1/2)**x
  
  print(prob_base + prob)

else:
  for i in range(1, N+1):
    x = math.ceil(np.log2(K/i))
    prob += (1/N) * (1/2)**x
  
  print(prob)
Problem p03047 (python)

Fixed submission:
N, K= map(int, input().split())

print(N-K+1)

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

import numpy as np

sum = 0

for n in range(1, int(np.sqrt(N))+1):
    x = (N - n ) // n
    if (N - n) % n == 0 and n**2 < N:
        sum += x

print(sum)
Problem p03061 (python)

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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

index = list(range(N))
L = index.copy()

L[0] = 0
for i in index[:-1]:
    #print(i)
    L[i+1] = gcd(L[i], A[i])

R = index.copy()
R.append(0)
for i in reversed(index):
    #print(i)
    R[i] = gcd(R[i+1], A[i])

# confirm
#print(L)
#print(R)

M = []
for j in range(len(L)):
    m = gcd(L[j], R[j+1])
    #print(m)
    M.append(m)

# Confirm
#print(M)

# Answer
print(max(M))

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

import math
from functools import reduce

def gcd(num_list):
    return reduce(math.gcd, num_list)

kys = []

for i in range(N):
    B = A.copy()
    B.pop(i)
    kys.append(gcd(B))

print(max(kys))

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

import math
from functools import reduce

def gcd(num_list):
    return reduce(math.gcd, num_list)

kys = []

for i in range(N):
    B = A.copy()
    B.pop(i)
    kys.append(gcd(B))

print(max(kys))
Problem p03455 (python)

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

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

Buggy submission (verdict: Runtime Error):
a b = map(int, input().split())

if a//b == 0:
  print('Even')
else:
  print('Odd')
Problem p03324 (python)

Fixed submission:
D, N = [int(i) for i in input().split()]

list_ = []
for k in range(1, 101):
    str_ = str(k) + "00"*D
    int_ = int(str_)
    list_.append(int_)

if N == 100 and D == 0:
    print(101)
elif N == 100 and D == 1:
    print(10100)
elif N == 100 and D == 2:
    print(1010000)
else:
    print(list_[N-1])

Buggy submission (verdict: Runtime Error):
D, N = [int(i) for i in input().split()]

list_ = []
for k in range(1, 100):
    str_ = str(k) + "00"*D
    int_ = int(str_)
    list_.append(int_)

print(list_[N-1])