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

Fixed submission:
a = input()
d = 'TBD'
if int(a[0:4]) ==2019:
  if int(a[5:7]) == 4:
    if int(a[8:10]) <=30:
      d = 'Heisei'
  elif int(a[5:7]) <=3:
    d = 'Heisei'
elif int(a[0:4]) <= 2018:
  d = 'Heisei'
print(d)

Buggy submission (verdict: Runtime Error):
a = input()
d = 'Heisei'
if int(a[0:4]) ==2019:
  if int(a[5:7]) == 4:
    if int(a[8:10]) == 30:
      break
    elif int(a[8:10]) <30:
      d = 'TBD'
    else:
      break
  elif int(a[5:7]) <=3:
    d = 'TBD'
  else:
    break
elif int(a[0:4]) <= 2018:
  d = 'TBD'
else:
  break
print(d)
Problem p03110 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(n):
  a, b = map(str, input().split())
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a) * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
  a, b = map(str, input().split())
  if b = 'JPY':
    ans += int(a)
  else:
    ans += int(a) * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
  a, b = map(int, input().split())
  if b = 'JPY':
    ans += a
  else:
    ans += a * 380000
print(ans)
Problem p03206 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
if a = 22:
  print('Christmas Eve Eve Eve')
elif a = 23:
  print('Christmas Eve Eve')
elif a = 24:
  print('Christmas Eve')
else:
  print('Christmas')
Problem p03239 (python)

Fixed submission:
n, t = map(int, input().split())
ans =[]
for i in range(n):
  a, b = map(int, input().split())
  if b <= t:
    ans.append(a)
if len(ans) ==0:
  print('TLE')
else:
  print(min(ans))

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
ans =[]
for i in range(n):
  a, b = map(int, input().split())
  if b <= t:
    ans.append(a)
print(min(ans))
Problem p03243 (python)

Fixed submission:
n = input()
for i in range(int(n), 1000):
  if str(i).count(str(i)[0]) == 3:
    print(i)
    exit()

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(int(n), 1000):
  if i.count(n[0]) == 3:
    print(i)
    exit()
Problem p03378 (python)

Fixed submission:
n, m, x = map(int, input().split())
a = list(map(int, input().split()))
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<x])))

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
a = map(int, input().split())
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<x]))
Problem p03386 (python)

Fixed submission:
4,5,6,7,8,9,10
a, b , k = map(int, input().split())
if k > (b-a)//2:
  for i in range(a, b+1):
    print(i)
else:
  for i in range(a, a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l = list(range(a,b+1))
la = l[0:k]
lb = l[-k:]

lc = list(set(la + lb))
lc.sort()
for i in range(len(lc)):
  print(lc[i])
Problem p03424 (python)

Fixed submission:
n = int(input())
k = len(set(map(str, input().split())))
if k == 4:
  print('Four')
else:
  print('Three')

Buggy submission (verdict: Runtime Error):
n = int(input())
k = len(set(map(str, input().split())))
if k = 4:
  print('Four')
else:
  print('Three')
Problem p03469 (python)

Fixed submission:
a = input()
a = a.replace('2017','2018')
print(a)

Buggy submission (verdict: Runtime Error):
a = input()
a[3] = '8'
print(a)
Problem p03556 (python)

Fixed submission:
import math
print(math.floor(math.sqrt(int(input())))**2)

Buggy submission (verdict: Runtime Error):
import math
print(math.floor(math.sqrt(int(input())))
Problem p03609 (python)

Fixed submission:
x, t = map(int, input().split())
if x - t < 0:
  print(0)
else:
  print(x-t)

Buggy submission (verdict: Runtime Error):
x, t = map(int, input.split())
if x - t < 0:
  print(0)
else:
  print(x-t)
Problem p03623 (python)

Fixed submission:
x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
  print('B')
else:
  print('A')

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input())
if abs(x-a) > abs(x-b):
  print('B')
else:
  print('A')
Problem p03697 (python)

Fixed submission:
a, b = map(int,input().split())
if a + b >= 10:
  print('error')
else:
  print(a+b)

Buggy submission (verdict: Runtime Error):
a, b = map(int,input())
if a + b >= 10:
  print('error')
else:
  print(a+b)

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if a + b >= 10:
  print('error')
else:
  print(a+b)
Problem p03777 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(str, input().split())
if a = 'H':
  print(b)
else:
  if b = 'H':
    print('D')
  else:
    print('H')
Problem p03962 (python)

Fixed submission:
a = list(map(int, input().split()))
print(len(set(a)))

Buggy submission (verdict: Runtime Error):
a = list(map(int, input()))
print(len(set(a)))
Problem p04012 (python)

Fixed submission:
a = str(input())
al = 'abcdefghijklmnopqrstuvwxyz'
for i in range(26):
  if a.count(al[i]) % 2 != 0:
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
a = input()
al = 'abcdefghijklmnopqrstuvwxyz'
for a in range(26):
  if a.count(al[i]) % 2 != 0:
    print('No')
    exit()
print('Yes')
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
sc = []
tf = True
tff = False
for i in range(M):
  sc.append(list(map(int, input().strip().split())))
if len(sc) == 0:
  if N == 1:
    print(0)
  else:
    print("1"+"0"*(N-1))
else:
  num = []
  for i in range(N):
    num.append(0)
  sc.sort()
  if N == 1 and sc[0][0] == 1 and sc[0][1] == 0:
    tff = True
  for i in range(M-1):
    if sc[i][0] == sc[i+1][0] and sc[i][1] != sc[i+1][1]:
      tf = False
  for i in sc:
    if i[0] == 1 and i[1] == 0:
      tf = False
    else:
      num[i[0]-1] = i[1]
  if tf and num[0] == 0:
    num[0] = 1
  string = ""
  for i in num:
    string += str(i)
  if tff == True:
    print(0)
  elif tf == True:
    print(string)
  else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
sc = []
tf = True
tff = False
for i in range(M):
  sc.append(list(map(int, input().strip().split())))
num = []
for i in range(N):
  num.append(0)
sc.sort()
if N == 1 and sc[0][0] == 1 and sc[0][1] == 0:
  tff = True
for i in range(M-1):
  if sc[i][0] == sc[i+1][0] and sc[i][1] != sc[i+1][1]:
    tf = False
for i in sc:
  if i[0] == 1 and i[1] == 0:
    tf = False
  else:
    num[i[0]-1] = i[1]
if tf and num[0] == 0:
  num[0] = 1
string = ""
for i in num:
  string += str(i)
if tff == True:
  print(0)
elif tf == True:
  print(string)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
sc = []
tf = True
for i in range(M):
  sc.append(list(map(int, input().strip().split()))
num = []
for i in range(N):
  num.append(0)
for i in sc:
  if i[0] == N and i[1] == 0:
    tf = False
  else:
    num[i[0]-1] = i[1]
if tf:
  num[0] = 1
string = ""
for i in num:
  string += str(i)
if tf:
  print(string)
else:
  print(-1)
Problem p02767 (python)

Fixed submission:
N = int(input())
X = list(map(int, input().strip().split()))
total = 0
points = 0
for i in X:
  total += i
avg = int(round(total/N))
for i in X:
  points += (i-avg)**2
print(points)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().strip().split()))
total = 0
points = 0 
for i in X:
  total += i
avg = int(round(total/N))
for i in X:
  points += (a-avg)^^2
print(points)
Problem p02952 (python)

Fixed submission:
N = input().strip()
N = N + "."  # for removing the leading zeroes just in case
N.strip("0")
N = N[:-1]
total = 0
for i in range(1, len(N), 2):
    total += int("1"+"0"*i) - int("1"+"0"*(i-1))
if len(N) % 2 == 0:
    total += 0
else:
    total += int(N) - (int("1" + "0" * (len(N) - 1))) + 1
print(total)

Buggy submission (verdict: Runtime Error):
N = input().strip()
N = N + "."
N.strip("0")
N = N[:-1]
total = 0
for i in range(1, len(N), 2):
    total += int("1"+"0"*i) - int("1"+"0"*(i-1))
if len(N) % 2 == 0:
    pass
else:
    total += int(N[1:])+1
print(total)

Buggy submission (verdict: Runtime Error):
N = input().strip()
total = 0
for i in range(1, len(N), 2):
    total += 10**i - 10**(i-1)
if len(N) % 2 == 0:
    pass
else:
    total += int(N[1:])+1
print(total)
Problem p02687 (python)

Fixed submission:
S = input()
if S == "ARC":
    print('ABC')
else:
    print('ARC')

Buggy submission (verdict: Runtime Error):
S = input()
if S = "ARC":
    print('ABC')
else:
    print('ARC')
Problem p02582 (python)

Fixed submission:
a=input()
f=[0]*3
for i in range(3):
  if a[i]== 'R':
    if i ==0:
      f[0]=1
    else:
      f[i]=f[i-1]+1
  else:
    f[i]=0
print(max(f))

Buggy submission (verdict: Runtime Error):
a=input()
max=[]
for i in range(3):
  if a[i]== 'R':
    if i ==0:
      max[0]=1
    else:
      max[i]=max[i-1]+1
  else:
    max[i]=0
print(sum(max))
Problem p02609 (python)

Fixed submission:
n = int(input())
s = input()
pw, pw1, pw2 = [0] * n, [0] * n, [0] * n
pw[0], pw1[0], pw2[0] = 1, 1, 1
v, mod1, mod2 = 0, 0, 0
for i in range(n):
    if s[i] == '1':
        v += 1
for i in range(1, n):
    pw1[i] = int(pw1[i - 1] * 2) % (v + 1)
    if v >= 2:
        pw2[i] = int(pw2[i - 1] * 2) % (v - 1)
for i in range(n):
    if s[i] == '1':
        mod1 = (mod1 + pw1[n - i - 1]) % (v + 1)
        if v >= 2:
            mod2 = (mod2 + pw2[n - i - 1]) % (v - 1)    
for i in range(n):
    copy, x, cnt = 0, v, 1
    
    if s[i] == '0':
        x += 1
        copy = (mod1 + pw1[n - i - 1]) % x
    else:
        x -= 1
        if x >= 1:
            copy = (mod2 - pw2[n - i - 1]) % x
        else:
            copy = -1
    if copy == -1:
        print(0)
    else:
        x = bin(copy).count('1')
        while copy > 0:
            copy %= x
            x = bin(copy).count('1')
            cnt += 1
        print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
a = 0
for i in range(n):
    if s[i] == '1':
        a += int(pow(2, n - i - 1))
for i in range(n):
    add = int(pow(2, n - i - 1))
    if s[i] == '1':
        add *= -1
    copy = a + add
    x = bin(copy).count('1')
    cnt = 1
    while copy % x != 0:
        copy %= x
        x = bin(copy).count('1')
        cnt += 1
    print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
a = 0
for i in range(n):
    if s[i] == '1':
        a += int(pow(2, n - i - 1))
for i in range(n):
    add = int(pow(2, n - i - 1))
    if s[i] == '1':
        add *= -1
    copy = a + add
    x = bin(copy).count('1')
    cnt = 1
    while copy % x != 0:
        copy %= x
        x = bin(copy).count('1')
        cnt += 1
    print(cnt)
Problem p02796 (python)

Fixed submission:
# 参考
# https://atcoder.jp/contests/keyence2020/submissions/9575705
#------------------------------------------

n = int(input())
robots = []

for i in range(n):
    x, l = map(int, input().split())
    robots.append([x + l, x - l])
    
#robotsという配列には
#・[0]に右側の手で届く範囲
#・[1]に左側の手で届く範囲
#が格納されている。
    
robots.sort()

r = - 10 ** 9 - 1
cnt = 0
for i in range(n):
    if r <= robots[i][1]:#この式で、左側に腕を伸ばした時にぶつからないことを指している
        cnt += 1
        r = robots[i][0]#最小値には右側に腕を伸ばした場合を代入
print(cnt)

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

N = int(input())
X = [0] * N
L = [0] * N

cnt = N

for i in range(N):
    X[i], L[i] = map(int, input().split())
    
index_sort = np.argsort(X)
X_sort = sorted(X)

L_sort = [0] * N

for i in range(N):
  L_sort[i] = L[ index_sort[i] ]

if(N >= 3):
  for i in range(1, N - 1):
    if( abs(X_sort[i] - X_sort[i-1]) <= L_sort[i] or
       abs(X_sort[i+1] - X_sort[i]) <= L_sort[i+1]):
      X_sort[i]=X_sort[i-1]
      L_sort[i]=L_sort[i-1]
      cnt -= 1
      
if( X_sort[1] - X_sort[0] < L_sort[0] or
    X_sort[1] - X_sort[0] < L_sort[1]):
  if( X_sort[1] != X_sort[0] ):
    cnt -= 1
print(cnt)

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

N = int(input())
X = [0] * N
L = [0] * N

cnt = N

for i in range(N):
    X[i], L[i] = map(int, input().split())
    
index_sort = np.argsort(X)
X_sort = sorted(X)

L_sort = [0] * N

for i in range(N):
  L_sort[i] = L[ index_sort[i] ]

if(N >= 3):
  for i in range(1, N - 1):
    if( abs(X_sort[i] - X_sort[i-1]) <= L_sort[i] or
       abs(X_sort[i+1] - X_sort[i]) <= L_sort[i+1]):
      X_sort[i]=X_sort[i-1]
      L_sort[i]=L_sort[i-1]
      cnt -= 1
      
if( X_sort[1] - X_sort[0] < L_sort[0] or
    X_sort[1] - X_sort[0] < L_sort[1]):
  if( X_sort[1] != X_sort[0] ):
    cnt -= 1
print(cnt)
Problem p02856 (python)

Fixed submission:
#https://atcoder.jp/contests/ddcc2020-qual/submissions/8587774

M = int(input())
dc = [list(map(int, input().split())) for _ in range(M)]
 
d = [dc[i][0] for i in range(M)]
c = [dc[i][1] for i in range(M)]
 
ans = sum(c) - 1
s = 0
 
for i in range(M):
    s += c[i] * d[i]
    if s % 9 != 0:
        ans += s // 9
        s = s % 9
    else:
        ans += s//9 - 1 
        s = 9
print(ans)

Buggy submission (verdict: Runtime Error):
m = int(input())
dc = [list(map(int, input().split())) for _ in range(m)]
 
d = [dc[i][0] for i in range(m)]
c = [dc[i][1] for i in range(m)]
  
cnt = sum(c) - 1
add_two = 0
 
for i in range(m):
  add_two += d[i] * c[i]
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9
 
print(cnt)

Buggy submission (verdict: Runtime Error):
m = int(input())
dc = [list(map(int, input().split())) for _ in range(m)]
 
d = [dc[i][0] for i in range(m)]
c = [dc[i][1] for i in range(m)]
  
cnt = sum(c) - 1
add_two = 0

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

Buggy submission (verdict: Runtime Error):
m = int(input())
dc = []

sum_c = 0
before_num = 0
add_two = 0
kuriage = 0

dc = [list(map(int, input().split())) for _ in range(m)]
 
d = [dc[i][0] for i in range(m)]
c = [dc[i][1] for i in range(m)]
  
cnt =sum(c) - 1

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

Buggy submission (verdict: Runtime Error):
import math

m = int(input())
dc = []

sum_c = 0
before_num = 0
add_two = 0
kuriage = 0

for i in range(m):
  array = list( map(int, input().split()) )
  dc.append(array)
  sum_c += int(dc[i][1])
  
cnt = sum_c - 1

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9 - 1
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

Buggy submission (verdict: Runtime Error):
import math

m = int(input())
dc = []

sum_c = 0
before_num = 0
add_two = 0
kuriage = 0

for i in range(m):
  array = list( map(int, input().split()) )
  dc.append(array)
  sum_c += int(dc[i][1])
  
cnt = sum_c - 1

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)
Problem p02957 (python)

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

if ((a+b)%2==0):
  cnt = int((a+b)/2)
  print( cnt )
else:
  print("IMPOSSIBLE")

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

if ((a+b)%2==0):
  print( int((a+b)/2) )
else:
  print("IMPOSSIBLE")
Problem p03469 (python)

Fixed submission:
print(input(2018)[4:])

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

s[3] = '7'

print(s)
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())
print(N * N - A)

Buggy submission (verdict: Runtime Error):
N = int(input(N))
A = int(input(A))
print(N * N - A)
Problem p02606 (python)

Fixed submission:
L,R,D=map(int,input().split())
A=0
for i in range(L,R+1):
  if i%D==0:
    A+=1
print(A)

Buggy submission (verdict: Runtime Error):
L,R,D=map(int,input.split())
A=0
for i in range(L,R+1):
  if i%D==0:
    A+=1
print(A)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=1
for i in range(N):
  ans*=A[i]
if ans<=10**18:
  print(ans)
else:
  print(-1)
Problem p02700 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
X = 0
Y = 0
while A > 0:
  A = A-D
  X+=1
while C > 0:
  C = C-B
  Y+=1
if X>=Y:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
X = 0
Y = o
while A > 0:
  A = A-D
  X+=1
while C > 0:
  C = C-B
  Y+=1
if X>=Y:
  print("Yes")
else:
  print("No")
Problem p02717 (python)

Fixed submission:
X,Y,Z=map(int,input().split())
print(Z,X,Y)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
c=sorted(a)
if c[n-m] >=b//(4*m):
  print("Yes")
else:
  print("No")
Problem p02718 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
a.sort(reverse=True)
if a[m-1]*4*m >=b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
a.sort(reverse=True)
if c[n-1] >b//(4*m):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
c=sorted(a)
if c[n-m+1] >b//(4*m):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
c=sorted(a)
if c[n-m+1] >b//(4*m):
  print("Yes")
else:
  prinnt("No")
Problem p02741 (python)

Fixed submission:
K=int(input())
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(list[K-1])

Buggy submission (verdict: Runtime Error):
K=int(input())
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(list[K])

Buggy submission (verdict: Runtime Error):
K=input()
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(list[K])
Problem p02767 (python)

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
ans = 100000000
for j in range(1,100):
  res = 0
  for i in range(N):
    res += (X[i]-j)**2
  ans=min(ans,res)
print(ans)

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

ans = 100000000

for p in range(X[0], X[N]): #Pの位置
  sum = 0
  for x in X: #Xの要素を１つずつ取得
    sum += (x - p)**2
  ans = min(sum, ans)

print(ans)
Problem p02801 (python)

Fixed submission:
print(chr(ord(input())+1))

Buggy submission (verdict: Runtime Error):
print(chr(ord(input()))+1)
Problem p02818 (python)

Fixed submission:
A,B,K=map(int,input().split())
if A>=K:
  print(A-K,B)
elif K>A and A+B>=K:
  print(0,B-K+A)
else:
  print(0,0)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input(),split())
if A>=K:
  print(A-K,B)
elif K>A and A+B>=K:
  print(0,B-K+A)
else:
  print(0,0)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input(),spliT())
if A>=K:
  print(A-K,B)
elif K>A and A+B>=K:
  print(0,B-K+A)
else:
  print(0,0)
Problem p02823 (python)

Fixed submission:
N,A,B=map(int,input().split())
if (A+B)%2==0:
  print((B-A)//2)
else:
  print(min(A-1,N-B)+1+(B-A-1)//2)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
if (A+B)%2==0:
  print((B-A)//2)
else:
  if (A-1)<=(N-B):
    print((2A-1)+(B-A)//2)
  else:
    print((2B-1)+(B-A)//2)
Problem p02887 (python)

Fixed submission:
N=int(input())
S=list(input())
if N == 1:
  print(1)
if N>=2:
  if S[0] == S[1]:
    S[0]==" "
  for i in range(1,N):
    if S[i-1]==S[i]:
      S[i-1]=" "
  A=[]
  for i in range(N):
        if S[i]!=" ":
              A.append(S[i])
  print(len(A))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(input())
if N == 1:
  print(1)
if N>=2:
  if S[0] == S[1]:
    S[0]==" "
  for i in range(1,N):
    if S[i-1]==S[i]:
      S[i-1]=" "
  A=[]
  for i in range(N):
        if S[i]!=" ":
        A.append(S[i])
        print(len(A))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(input())
if S[0] == S[1]:
  S[0]==" "
for i in range(2,N):
  if S[i-1]==S[i]:
    S[i-1]=" "
A=[]
for i in range(N):
      if S[i]!=" ":
            A.append(S[i])
print(len(A))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(input())
if S[0] == S[1]:
  S[0]==" "
for i in range(1,N):
  if S[i-1]==S[i]:
    S[i-1]=" "
A=[]
for i in range(N):
      if S[i]!=" ":
            A.append(S[i])
print(len(A))
Problem p02899 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
X = [0 for _ in range(N)]

for i in range(N):
    X[A[i] - 1] = i + 1

L = " ".join([str(i) for i in X])
print(L)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans = 1
X = []
for i in range(N):
  if A[i] == ans:
    ans += 1
    X.append(i+1)
L=' '.join(X)
print(X)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans = 1
X = []
for i in range(N):
  if A[i] == ans:
    ans += 1
    uno.append(i+1)
L=' '.join(X)
print(X)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans = 1
uno = []
for i in range(N):
  if A[i] == ans:
    ans += 1
    uno.append(i+1)
L=" ".join(uno)
print(L)
Problem p02934 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(N):
  ans+=1/A[i]
print(1/ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=/A[0]
for i in range(1,N-1):
  ans+=1/A[i]
print(1/ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map,int().split())
ans=/A[0]
for i in range(1,N-1):
  ans+=1/A[i]
print(1/ans)
Problem p02945 (python)

Fixed submission:
A,B=map(int,input().split())
x=[A+B,A-B,A*B]
print(max(x))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split)
x=[A+B,A-B,A*B]
print(max(x))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split)
print(max([A+B,A-B,A*B]))
Problem p02993 (python)

Fixed submission:
S=list(input())
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3] :
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
S=list(int(input()))
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3] or S[3]==S[4]:
  print("Bad")
else:
  print("Good")
Problem p03085 (python)

Fixed submission:
S=input()
if S=="A":
  print("T")
elif S=="T":
  print("A")
elif S=="G":
  print("C")
else:
  print("G")

Buggy submission (verdict: Runtime Error):
S=input()
if S="A":
  print("T")
elif S="T":
  print("A")
elif S="G":
  print("C")
else:
  print("G")
Problem p03243 (python)

Fixed submission:
N=int(input())
X=set(str(N))
Y=len(X)
if Y==1:
  print(N)
if Y!=1:
  Z=0
  for i in range(111,1000,111):
    if N-i<0:
      Z+=i
      break
  print(Z)

Buggy submission (verdict: Runtime Error):
N=int(input())
X=set(str(N))
Y=len(X)
if Y==1
  print(N)
if Y!=1:
  Z=0
  for i in range(111,1000,111):
    if N-i<0:
      Z+=i
      break
  print(Z)
Problem p03260 (python)

Fixed submission:
A,B=map(int,input().split())
if A % 2 != 0 and B % 2 !=0 :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A % 2 == 1 and B % 2 ==1:
  print("Yes")
eise:
  print("No")
Problem p03264 (python)

Fixed submission:
K=int(input())
if K % 2 ==0:
  print(int(K*K/4))
else:
  print(int((K+1)*(K-1)/4))

Buggy submission (verdict: Runtime Error):
K=input()
if K % 2 ==0:
  print(int(K*K/2/2))
else:
  print(int((K+1)*(K-1)/2/2))
Problem p03296 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count = 0
for i in range(N-1):
  if A[i]==A[i+1]:
    A[i+1]=0
    count +=1
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count = 0
for i in range(N-1):
  if A[i]=A[i+1]:
    A[i+1]=0
    count +=1
print(count)