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

Fixed submission:
N, A, B = map(int, input().split())
if (B - A) & 1:
    print("Borys")
else:
    print("Alice")

Buggy submission (verdict: Runtime Error):
def solve(A):
    current_max = 2
    current_min = 2
    for a_k in reversed(A):
        if current_max < a_k:
            print('-1')
            return

        current_max = (current_max // a_k) * a_k + (a_k - 1)
        current_min = ((current_min - 1) // a_k + 1) * a_k
        current_min = max(current_min, a_k)

    print("{} {}".format(current_min, current_max))
    return


if __name__ == '__main__':
    K = int(input())
    A = list(map(int, input().split()))
    solve(A)
Problem p03211 (python)

Fixed submission:
S = input()


ans = 753

for i in range(len(S) - 2) :
    N = int(S[i:i+3])
    M = abs(753 - N)
    if ans > M :
        ans = M

print(ans)

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


ans = 753

for i in range(len(S) - 2) :
    N = int(S[i:3])
    M = abs(753 - N)
    if ans > M :
        ans = M

print(ans)
Problem p03109 (python)

Fixed submission:
from datetime import datetime
s = input()
t = datetime.strptime(s, '%Y/%m/%d')
thres = datetime(2019, 4, 30)
print('Heisei' if t <= thres else 'TBD')

Buggy submission (verdict: Runtime Error):
from datetime import datetime
s = input()
t = datetime.strptime(s, '%y/%m/%d')
thres = datetime(2019, 4, 30)
print('heisei' if t <= thres else 'TBD')
Problem p02844 (python)

Fixed submission:
n = int(input())
s = input()

candidates = [0 for i in range(10 ** 3)]

count = 0
for i in range(1000):
    tmp_pass = '{:03}'.format(i)

    index_0 = s.find(tmp_pass[0])
    if index_0 != -1 and index_0 < len(s) - 2:
        s_1 = s[index_0 + 1:]
        index_1 = s_1.find(tmp_pass[1])
        if index_1 != -1 and index_1 < len(s_1) - 1:
            s_2 = s_1[index_1 + 1:]
            # print(tmp_pass)
            # print(s_2)
            # index_2 = s_2.find(tmp_pass[2])
            # print(index_2)
            if s_2.find(tmp_pass[2]) != -1:
                count += 1

print(count)

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

candidates = [0 for i in range(10 ** 3)]

count = 0
for i in range(1000):
    tmp_pass = f'{i:03}'

    index_0 = s.find(tmp_pass[0])
    if index_0 != -1 and index_0 < len(s) - 2:
        s_1 = s[index_0 + 1:]
        index_1 = s_1.find(tmp_pass[1])
        if index_1 != -1 and index_1 < len(s_1) - 1:
            s_2 = s_1[index_1 + 1:]
            # print(tmp_pass)
            # print(s_2)
            # index_2 = s_2.find(tmp_pass[2])
            # print(index_2)
            if s_2.find(tmp_pass[2]) != -1:
                count += 1

print(count)

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

candidates = [0 for i in range(10 ** 3)]

count = 0
for i in range(1000):
    tmp_pass = f'{i:03}'

    index_0 = s.find(tmp_pass[0])
    if index_0 != -1 and index_0 < len(s) - 2:
        s_1 = s[index_0 + 1:]
        index_1 = s_1.find(tmp_pass[1])
        if index_1 != -1 and index_1 < len(s_1) - 1:
            s_2 = s_1[index_1 + 1:]
            # print(tmp_pass)
            # print(s_2)
            # index_2 = s_2.find(tmp_pass[2])
            # print(index_2)
            if s_2.find(tmp_pass[2]) != -1:
                count += 1

print(count)
Problem p02748 (python)

Fixed submission:
A, B, M = map(int, raw_input().split())
a_s = map(int, raw_input().split())
b_s = map(int, raw_input().split())
w = [[0] * B] * A
cost = 10 ** 30
for _ in xrange(M):
    x, y, c = map(int, raw_input().split())
    cost = min(cost, a_s[x-1] + b_s[y-1] - c)
    w[x-1][y-1] = max(w[x-1][y-1], c)

a_s = sorted(enumerate(a_s), key=lambda t: t[1])
b_s = sorted(enumerate(b_s), key=lambda t: t[1])
for i, a in a_s:
    if a + b_s[0][1] >= cost:
        break
    for j, b in b_s:
        if w[i][j] > 0:
            break
        cost = min(cost, a + b)

print cost

Buggy submission (verdict: Runtime Error):
a_s = sorted(enumerate(map(int, raw_input().split())), key=lambda t: t[1])
b_s = sorted(enumerate(map(int, raw_input().split())), key=lambda t: t[1])
w = [[0] * B] * A
max_w = 0
for _ in xrange(M):
    x, y, c = map(int, raw_input().split())
    w[x-1][y-1] = c
    max_w = max(max_w, c)

cost = 10 ** 20
for i, a in a_s:
    if a + b_s[0][1] - max_w > cost:
        break
    for j, b in b_s:
        cost = min(cost, a + b - w[i][j])
        if a + b - max_w > cost:
            break

print cost
Problem p02705 (python)

Fixed submission:
import math

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

Buggy submission (verdict: Runtime Error):
import math

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

Buggy submission (verdict: Runtime Error):
import math

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

Buggy submission (verdict: Runtime Error):
import math.h

int a=input()
print(a*math.pi)
Problem p02706 (python)

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

a_sum = sum(a);

if n - a_sum < 0:
    print(-1)
else:
    print(n-a_sum)

Buggy submission (verdict: Runtime Error):
n,m = input().split();
a = input().split();

a_sum = sum(a);

if n - a_sum < 0:
    print(-1)
else:
    print(n-a_sum)

Buggy submission (verdict: Runtime Error):
n,m = input().split();
a = input().split();

a_sum = sum(a);

rest_day = int(n) - a_sum

if rest_day < 0:
    rest_day = -1

return rest_day

Buggy submission (verdict: Runtime Error):

n,m = input().split();
a = input().splite();

a_sum = sum(a);

rest_day = int(n) - a_sum

if rest_day < 0:
    rest_day = -1

return rest_day

Buggy submission (verdict: Runtime Error):

n,m = input().split();
a = input().splite();

a_sum = sum(a);

rest_day = n - a_sum

if rest_day > 0:
    return rest_day
else: return -1
Problem p02830 (python)

Fixed submission:
N = int(input())
Str_input = str(input())
S = Str_input.split()[0]
T = Str_input.split()[1]
ans = ''
for i in range(N):
    ans = ans + S[i:i+1] + T[i:i+1]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
T = str(input())
ans = ''
for i in range(N):
    ans = ans + S[i:i+1] + T[i:i+1]
print(ans)
Problem p02730 (python)

Fixed submission:
s=input()
n=len(s)
s1=s[0:(n-1)//2]
s2=s[(n+1)//2:n]
if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
n1=(n-1)/2
n2=(n+1)/2
s1=s[0:n1]
s2=s[n2:n]
if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
s1=s[0:(n-1)/2]
s2=s[(n+1)/2:n]
if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
s1=s[0:(n-3)/2]
s2=s[(n+1)/2:n-1]
if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
  print("Yes")
else:
  print("No")
Problem p02772 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
checker=0
count=0
for i in range(len(a)):
  if a[i]%2==0:
    checker+=1
    if a[i]%3==0 or a[i]%5==0:
      count+=1
if checker==count:
  print("APPROVED")
else:
  print("DENIED")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
checker=0
count=0
for i in range(len(a)):
  if a[i]%2==0:
    checker+=1
    if a[i]%3==0 or a[i]%5==0:
      count+=1
if checker==count:
  print("APPROVED")
else:
  print("DENIED)
Problem p02784 (python)

Fixed submission:
h,n=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)>=h:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
a=list(map(int,input().split())
if sum(a)>=h:
  print("Yes")
else:
  print("No")
Problem p02801 (python)

Fixed submission:
letter=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in range(len(alphabet)):
  if alphabet[i]==letter:
    print(alphabet[i+1])

Buggy submission (verdict: Runtime Error):
letter=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in range(len(alphabet)):
  if alphabet[i]=＝letter:
    print(alphabet[i+1])

Buggy submission (verdict: Runtime Error):
letter=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in range(len(alphabet)):
  if alphabet[i]=letter:
    print(alphabet[i+1])

Buggy submission (verdict: Runtime Error):
letter=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
alphabet[i]=letter
print(alphabet[i+1])
Problem p02812 (python)

Fixed submission:
n=int(input())
s=input()
count=0
for i in range(n-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
count=0
for i in range(len(n)-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
count=0
for i in range(len(n)-3):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    count+=1
print(count)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
print(input().count(1))

Buggy submission (verdict: Runtime Error):
print(input().count(1)
Problem p02861 (python)

Fixed submission:
from math import sqrt
from math import factorial
 
n = int(input())
t = []
for i in range(n):
  t.append(list(map(int,input().split())))
l = [[0]*n for j in range(n)]
for k in range(n):
  for m in range(n):
      l[k][m] = sqrt((t[k][0]-t[m][0])**2+(t[k][1]-t[m][1])**2)
ans = 0
for i in range(n):
  s = sum(l[i])
  ans += s*factorial(n-1)
z = ans/factorial(n)
print(z)

Buggy submission (verdict: Runtime Error):
from math import sqrt
from math import factorial
n = int(input())
t = []
for i in range(n):
  t.append(list(map(int,input().split())))
l = [[0]*n for j in range(n)]
for k in range(n):
  for m in range(n):
    if k != m:
      d = sqrt((t[k][0]-t[m][0])**2+(t[k][1]-t[m][1])**2)
      l[k][m] = d
print(int(sum(l)*factorial(n-2)*2/n))
Problem p02865 (python)

Fixed submission:
n = int(input())
if n%2 == 0:
  ans = int(n/2 - 1)
else:
  ans = int((n-1)/2)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%2 = 0:
  answer = n/2-1
else:
  answer = (n-1)/2
print(answer)
Problem p02921 (python)

Fixed submission:
S = input()
L = input()
n = 0
for i in range(3):
  if S[i] == L[i]:
    n += 1
print(n)

Buggy submission (verdict: Runtime Error):
S = list(map(int,input().split()))
L = list(map(int,input().split()))
n = 0
for i in range(3):
  if S[i] == L[i]:
    n += 1
print(n)

Buggy submission (verdict: Runtime Error):
S = list(map(int,input()split()))
L = list(map(int,input()split()))
n = 0
for i in range(3):
  if S[i] == L[i]:
    n += 1
print(n)
Problem p02923 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l = [0]
k = 0
for i in range(n-1):
  if a[i]>=a[i+1]:
    l[k] += 1   
  else:
    k += 1
    l.append(0)
print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l =[0]
k = 0
for i in range(n):
  if a[i]>=a[i+1]:
    l[k] += 1   
  else:
    k += 1
    l.append(0)
print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l =[]
k = 0
for i in range(n):
  if a[i]>=a[i-1]:
    if not l[k]:
      l.append(1)
    else:
      l[k] += 1
  else:
    k += 1
print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l =[]
k = 0
for i in range(n):
  if a[i]>=a[i-1]:
    if l[k]:
      l[k] += 1
    else:
      l.append(1)
  else:
    k += 1
print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input()split()))
l =[]
k = 0
for i in range(n):
  if a[i]>=a[i-1]:
    l[k] += 1
  else:
    k += 1
print(max(l))
Problem p02924 (python)

Fixed submission:
n = int(input())
a = n*(n-1)//2
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input)
print(sum([i for i in range(n)]))
Problem p02700 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
r1 = a//d
if a%d==0:
  pass
else:
  r1 += 1
r2 = c//b
if c%b==0:
  pass
else:
  r2 += 1
if r1>=r2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
r1 = a//d
rem1 = a%d
r2 = c//b
rem2 = c%b
if r1>=r2:
  print('Yes')
 else:
  print('No')
Problem p03455 (python)

Fixed submission:
x, y = map(int, input().split())
if x * y % 2:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
if x * y % 2:
  print('Odd')
elif:
  print('Even')

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
if x * y % 2 = 1:
  print('Odd')
elif
  print('Even')
Problem p03471 (python)

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

for i in reversed(range(n + 1)):
    for j in reversed(range(n - i + 1)):
        k = n - i - j
        if 10000 * i + 5000 * j + 1000 * k == y:
            print(i, j, k)
            exit()
else:
    print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
ichi = y // 10000

for i in reversed(range(ichi + 1)):
    gos = (y - 10000 * ichi) // 5000
    for j in reversed(range(gos+1)):
        rest = y - 10000 * i - 5000 * j
        k = n - i - j
        if rest % 1000 == 0 and rest // 1000 = k:
            print(i, j, k)
            exit()
else:
    print(-1, -1, -1)
Problem p02748 (python)

Fixed submission:
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
minA = a[0]
for reizou in a[1:]:
    if reizou < minA:
        minA = reizou
minB = b[0]
for renzi in b:
    if renzi < minB:
        minB = renzi
kakaku = minA + minB
for i in range(M):
    x,y,c = map(int,input().split())
    sumKakaku = a[x-1] + b[y-1] - c
    if sumKakaku < kakaku:
        kakaku = sumKakaku

print(kakaku)

Buggy submission (verdict: Runtime Error):
import math
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
minA = math.inf
minB = math.inf
for reizou in a:
    if reizou < minA:
        minA = reizou
for renzi in b:
    if renzi < minB:
        minB = renzi
min = minA + minB
for i in range(M):
    x,y,c = map(int,input().split())
    sum = a[x-1] + b[y-1] - c
    if sum < min:
        min = sum

print(sum)
Problem p02900 (python)

Fixed submission:
import fractions
import sys
A, B = map(int,input().split())

GCD = fractions.gcd(A,B)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

l = factorization(GCD)
if len(l) == 1 and l[0][0] == 1:
    print(len(l))
else:
    print(len(l)+1)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int,input().split())

GCD = fractions.gcd(A,B)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

l = factorization(GCD)
if len(l) == 1:
    print(len(l))
else:
    print(len(l)+1)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int,input().split())

GCD = math.gcd(A,B)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

l = factorization(GCD)
if len(l) == 1:
    print(len(l))
else:
    print(len(l)+1)
Problem p03001 (python)

Fixed submission:
w,h,x,y = map(int, input().split())
men = float(w * h / 2)
if (2*x == w) and (2*y == h):
    han = 1
else:
    han = 0
print("{} {}".format(men,han))

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int, input().split())
men = float(w * h / 2)
r1 = float(w/x)
r2 = float(h/y)
if (r1 == 2) and (r2 == 2):
    han = 1
else:
    han = 0
print("{} {}".format(men,han))

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int, input().split())
men = float(w * h / 2)
r1 = float(w/x)
r2 = float(h/y)
if w/x == h/y:
    han = 1
else:
    han = 0
print("{} {}".format(men,han))

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int, input().split())
men = float(w * h / 2)
if w/x == h/y:
    han = 1
else:
    han = 0
print("{} {}".format(men,han))
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
import itertools
def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i > 1]

n = int(input())
A = sieve(55555)
A.remove(2)
A.remove(3)
A.remove(5)
A.remove(7)
B = [2,3,5,7]
C = []
for i in A:
    if len(B) == n:
        break
    B.append(i)
    C = list(itertools.combinations(B,5))
    for j in C:
        if sum(j) in A:
            B.remove(i)
            break
for i in B:
    print(i,end=' ')
Problem p03417 (python)

Fixed submission:
N, M = map(int, input().split())
print(abs(N-2)*abs(M-2))

Buggy submission (verdict: Runtime Error):
    N,M = map(int, input().split())
    print(abs(N-2) * abs(M-2))

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
print(abs(N-2) * ans(M-2))
Problem p03425 (python)

Fixed submission:
N = int(input())
A = []
for i in range(N):
    A.append(input())
k = 0
c = [ 0,0,0,0,0]
for i in A:
  if i[0] == 'M':
    c[0] += 1
  if i[0] == 'A':
    c[1] += 1
  if i[0] == 'R':
    c[2] += 1
  if i[0] == 'C':
    c[3] += 1
  if i[0] == 'H':
    c[4] += 1


if not c.count(0) >= 3:
  k += c[0] * c[1] * c[2] + c[0] * c[1] * c[3] + c[0] * c[1] * c[4] + c[0] * c[2] * c[3] + c[0] * c[2] * c[4] + c[0] * c[3] * c[4] + c[1] * c[2] * c[3] + c[1] * c[2] * c[4] + c[1] * c[3] * c[4] + c[2] * c[3] * c[4] 

print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [i for i in range(N) input()]
k = 0
c = [ 0,0,0,0,0]
for i in A:
  if i[0] == m:
    c[0] += 1
  if i[0] == a:
    c[1] += 1
  if i[0] == r:
    c[2] += 1
  if i[0] == c:
    c[3] += 1
  if i[0] == h:
    c[4] += 1

if c.count(0) >= 3:
  k += c[0] * c[1] * c[2] + c[0] * c[1] * c[3] + c[0] * c[1] * c[4] + c[0] * c[2] * c[3] + c[0] * c[2] * c[4] + c[0] * c[3] * c[4] + c[1] * c[2] * c[3] + c[1] * c[2] * c[4] + c[1] * c[3] * c[4] + c[2] * c[3] * c[4] 

print(k)
Problem p03435 (python)

Fixed submission:
c=[]
for i in range(3):
  A = list(map(int, input().split()))
  c.append(A)
if c[0][0] + c[1][1]+ c[2][2] == c[1][0] + c[2][1] + c[0][2] == c[2][0] + c[0][1] + c[1][2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
c=[]
for i in range(3):
  c += [map(int,input())]
 
if c[0][0] + c[1][1]+ c[2][2] == c[1][0] + c[2][1] + c[0][2] == c[2][0] + c[0][1] + c[1][2]:
  print('Yes')
else:
  print('No')
Problem p02714 (python)

Fixed submission:
n = int(input())
s = input()

rs = {}
gs = {}
bs = {}

for i, e in enumerate(s):
  if e == 'R':
    rs[i] = ''
  if e == 'G':
    gs[i] = ''
  if e == 'B':
    bs[i] = ''
    
saidai = len(rs) * len(gs) * len(bs)
if saidai == 0:
  print('0')
else:
  a = max(bs.keys())
  b = min(bs.keys())
  for i in rs.keys():
    for j in gs.keys():
      mi = i if i < j else j
      ma = j if i < j else i
      p = [mi - (ma - mi), mi + (ma - mi)/2, ma + (ma - mi)]
      for e in p:
        if e%1 != 0 or e < b or e > a:
          continue
        if e in bs:
          saidai -= 1
  print(int(saidai))

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

rs = {}
gs = {}
bs = {}

for i, e in enumerate(s):
  if e == 'R':
    rs[i] = ''
  if e == 'G':
    gs[i] = ''
  if e == 'B':
    bs[i] = ''

a = max(bs.keys())
b = min(bs.keys())
      
saidai = len(rs) * len(gs) * len(bs)
if saidai == 0:
  print('0')
else:
  for i in rs.keys():
    for j in gs.keys():
      mi = i if i < j else j
      ma = j if i < j else i
      p = [mi - (ma - mi), mi + (ma - mi)/2, ma + (ma - mi)]
      for e in p:
        if e%1 != 0 or e < b or e > a:
          continue
        if e in bs:
          saidai -= 1
  print(int(saidai))
Problem p02717 (python)

Fixed submission:
a, b, c = input().split()
print(c, a, b)

Buggy submission (verdict: Runtime Error):
def main():
  n, k, c = map(int, input().split())
  ss = list(input())
  
  wd = [i for i, e in enumerate(ss) if e == 'o']
  wd_flg = [True for _ in wd]
  
  used = [0]
  cur = wd[0]
  if k != 1:
    for i, e in enumerate(wd):
      if e > cur + c:
        used.append(i)
        cur = e
        if len(used) == k:
          break
          
  used_rev = [len(wd)-1]
  cur = wd[-1]
  if k != 1: 
    for i, e in enumerate(wd[::-1]):
      if e < cur - c:
        used_rev.append(len(wd) - 1 - i)
        cur = e
        if len(used_rev) == k:
          break
  
  for i in used:
    if i not in used_rev:
      continue
    if used.index(i) + used_rev.index(i) >= k:
      continue
    else:
      print(wd[i]+1)
  
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n, k, c = map(int, input().split())
ss = list(input())

wd = [i for i, e in enumerate(ss) if e == 'o']
wd_flg = [True for _ in wd]

used = [0]
cur = wd[0]
if k != 1:
  for i, e in enumerate(wd):
    if e > cur + c:
      used.append(i)
      cur = e
      if len(used) == k:
        break
        
used_rev = [len(wd)-1]
cur = wd[-1]
if k != 1: 
  for i, e in enumerate(wd[::-1]):
    if e < cur - c:
      used_rev.append(len(wd) - 1 - i)
      cur = e
      if len(used_rev) == k:
        break

for i in used:
  if i not in used_rev:
    continue
  if used.index(i) + used_rev.index(i) >= k:
    continue
  else:
    print(wd[i]+1)
Problem p02730 (python)

Fixed submission:

s = input()
len_s = len(s)
if s[:int((len_s-1) /2)] != s[int((len_s-1) / 2 +1):]:
    print('No')
else:
    tmp = s[:int((len_s -1 ) /2)]
    if len(tmp) == 1:
        print('Yes')
    else:
        if len(tmp ) %2 == 1:
            if tmp[:int((len(tmp) - 1) / 2)] == tmp[int((len(tmp) - 1) / 2 + 1):][::-1]:
                print('Yes')
            else:
                print('No')
        else:
            if tmp[:int(len(tmp) / 2)] == tmp[int(len(tmp) / 2):][::-1]:
                print('Yes')
            else:
                print('No')

Buggy submission (verdict: Runtime Error):

s = input()
len_s = len(s)
if s[:int((len_ s -1 ) /2)] != s[int((len_ s -1 ) / 2 +1):]:
    print('No')
else:
    tmp = s[:int((len_ s -1 ) /2)]
    if len(tmp) == 1:
        print('Yes')
    else:
        if len(tmp ) %2 == 1:
            if tmp[:int((len(tmp) - 1) / 2)] == tmp[int((len(tmp) - 1) / 2 + 1):][::-1]:
                print('Yes')
            else:
                print('No')
        else:
            if tmp[:int(len(tmp) / 2)] == tmp[int(len(tmp) / 2):][::-1]:
                print('Yes')
            else:
                print('No')

Buggy submission (verdict: Runtime Error):
s = input()
len_s = len(s)
if s[:int((len_s-1)/2)] != s[int((len_s-1)/2+1):]:
    print('No')
else:
    tmp = s[:int((len_s-1)/2)]
    if len(tmp) == 1:
        print('Yes')
    else:
        if len(tmp)%2 == 1:
	        if tmp[:int((len(tmp) - 1) / 2)] == tmp[int((len(tmp) - 1) / 2 + 1):][::-1]:
            	print('Yes')
        	else:
            	print('No')
        else:
            if tmp[:int(len(tmp) / 2)] == tmp[int(len(tmp) / 2):][::-1]:
            	print('Yes')
        	else:
            	print('No')
Problem p02731 (python)

Fixed submission:
l = float(input())
print((l/3)**3)

Buggy submission (verdict: Runtime Error):
l = float(input())
print((l/3)^3)
Problem p03206 (python)

Fixed submission:
a = input()
if a == "25":
    print("Christmas")
elif a == "24":
    print("Christmas Eve")
elif a == "23":
    print("Christmas Eve Eve")
else: print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
N = input()
p = []
for i in range(N):
    p.append(input())

print(sum(p)-max(p)//2)