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

Fixed submission:
n = int(input())
a = list(input())
b = list(input())
c = list(input())

count = 0

for i in range(n):
    if a[i] == b[i] and b[i] == c[i]:
        continue
    elif a[i] == b[i] or b[i] == c[i] or a[i] == c[i]:
        count += 1
    else:
        count += 2

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a,b,c = input(),input(),input()

count = 0
for i in range(n):
    count += len(set(a[i],b[i],c[i]))-1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a,b,c = input(),input(),input()

count = 0
for i in range(n):
    count += len(set(a[i],b[i],c[i]))-1
print(count)
Problem p03386 (python)

Fixed submission:
import math
a,b,k = map(int, input().split())
res = []
if 2*k > b-a:
    k = math.ceil((b-a)/2)+1
for i in range(k):
    res.append(a+i)
    res.append(b-i)

for s in sorted(set(res)):
    print(s)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
num_list = [i for i in range(a,b+1)]
res = []
if k > b:
    k = b-1
for i in range(k):
    res.append(num_list[i])
    res.append(num_list[-(i+1)])

for s in sorted(set(res)):
    print(s)
Problem p03632 (python)

Fixed submission:
a,b,c,d = map(int, input().split())
if b <= c or d <= a:
    print(0)
else:
    print(min(b,d)-max(a,c))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
if b <= c or d <= a:
    print(0)
else:
    if
    print(min(b,d)-max(a,c))
Problem p03720 (python)

Fixed submission:
from itertools import chain
n,m = map(int,input().split())
ab_list = [list(map(int, input().split())) for _ in range(m)]
tmp_list = sorted(list(chain(*ab_list)))
tmp_dic = {}
for i in range(1,n+1):
    tmp_dic[i]=0
for val in tmp_list:
    tmp_dic[val] += 1
for k,v in tmp_dic.items():
    print(v)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ab_list = [list(map(int, input().split())) for _ in range(m)]
tmp_list = sorted(list(chain(*ab_list)))
tmp_dic = {}
for i in range(1,n+1):
    tmp_dic[i]=0
for val in tmp_list:
    tmp_dic[val] += 1
for k,v in tmp_dic.items():
    print(v)
Problem p02886 (python)

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

result = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        result += d[i] * d[j]
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = map(int, input().split())
 
result = 0
 
for x in range(1, n + 1):
  for y in range(x + 1, n + 1):
    result += d[x-1] * d[y-1]
    
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = map(int, input().split())

result = 0

for x in range(1, n + 1):
  for y in range(x + 1, n + 1):
    result = d[x-1] * d[y-1]
    
print(result)
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
answer = 0
tap = 1
while tap < b:
    tap += a - 1
    answer += 1

print(answer)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
answer = 0
tap = 1
while t < b:
    t += a - 1
    answer += 1

print(answer)
Problem p02952 (python)

Fixed submission:
n = int(input())
answer = 0
for i in range(1, n + 1):
    if not len(str(i)) % 2 == 0:
        answer += 1
print(answer)

Buggy submission (verdict: Runtime Error):
n = input()
answer = 0
for i in range(1, n+1):
  str(i)
  if len(i) % 2 != 0:
    answer += 1
    
print(answer)

Buggy submission (verdict: Runtime Error):
n = input()
answer = 0
for i in range(1, n+1):
  if len(str(i)) % 2 != 0:
	answer += 1
    
print(answer)

Buggy submission (verdict: Runtime Error):
n = input()
answer = 0
for i in range(1, n+1):
  if len(str(i)) % 2 == 0:
    continue
  else:
    answer += 1
    
print(answer)
Problem p02953 (python)

Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
for i in range(n-2,-1,-1):
  if arr[i]>arr[i+1]:
    arr[i]-=1
    if arr[i]>arr[i+1]:
      print('No')
      break
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n-1, -1, -1):
    if h_list[i]>h_list[i-1]:
        h_list[i-1] -= 1
        if h_list[i] < h_list[i-1]:
            print('No')
            break
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n-1, -1, -1):
    if h_list[i]>h_list[i-1]:
        h_list[i-1] -= 1
        if h_list[i] < h_list[i-1]:
            print('No')
            break
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h_list = [int(e) for e in input().split()]
answer = 'Yes'

for i in range(n):
    if h_list[i] > h_list[i+1]:
        h_list[i] -= 1
    if h_list[i] > h_list[i+1]:
        answer = 'No'
        break

print(answer)

Buggy submission (verdict: Runtime Error):
n = int(input())
h_list = [int(e) for e in input().split()]
answer = 'Yes'

for i in range(n):
    if h_list[n] <= h_list[n+1]:
        continue
    else:
        h_list[n] -= 1
        if h_list[n] > h_list[n+1]:
            answer = 'No'
            break

print(answer)
Problem p03047 (python)

Fixed submission:
n, k = list(int(x) for x in input().split())

ans = 0

for i in range(1, n + 1):
    x = i + (k - 1)
    if x <= n:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
ans = n - (k - 1)
print(ans)
Problem p02885 (python)

Fixed submission:
A,B = map(int,(input()).split())
 
c = A - 2 * B
if c > 0:
  print(c)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A = int(input('横方向の窓の長さ'))
B = int(input('横方向のカーテンの長さ'))

c = A - 2 * B
if c > 0:
  print(c)
else:
  print(0)
Problem p02922 (python)

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

count = 0
n = 1
while True:
  if n >= b:
    break
  n += a - 1
  count += 1
  
print(count)

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

count = 0
n = 1
while True:
  if n >= b:
    break
  n += a -1
  count += 1
  
print(count)
Problem p02923 (python)

Fixed submission:
N = int(input())
heights = list(map(int, input().split(" ")))
diffs = [a - b for a, b in zip(heights[:-1], heights[1:])]

max = 0
count = 0
for d in diffs:
  if d >= 0:
    count += 1
  else:
    if max < count:
      max = count
    count = 0
if max < count:
  max = count
print(max)

Buggy submission (verdict: Runtime Error):
N = int(input())
heights = map(int, input().split(" "))
diffs = [b - a for a, b in zip(heights[:-1], heights[1:])]

max = 0
count = 0
for d in diffs:
  if d >= 0:
    count += 1
  else:
    if max < count:
      max = count
    count = 0
Problem p02934 (python)

Fixed submission:
N = int(input())
numbers = map(int, input().split(" "))
invs = map(lambda x: 1.0 / x, numbers)
print(1.0 / sum(invs))

Buggy submission (verdict: Runtime Error):
N = int(input())
as = map(int, input().split())
invs = map(lambda x: 1.0 / x, as)
print(1.0 / sum(invs))
Problem p02885 (python)

Fixed submission:
# https://atcoder.jp/contests/abc143/tasks/abc143_a
# -*- coding: utf-8 -*-

stu_bangou = list(map(int, input().strip().split()))

if stu_bangou[0] < (stu_bangou[1] * 2):
    print(0)
else:
    print(stu_bangou[0] - (stu_bangou[1] * 2))

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc143/tasks/abc143_a
# -*- coding: utf-8 -*-

stu_bangou = list(map(int, input().strip().split()))

print(stu_bangou[0] - (stu_bangou[1] * 2))# https://atcoder.jp/contests/abc143/tasks/abc143_a
# -*- coding: utf-8 -*-

stu_bangou = list(map(int, input().strip().split()))

if stu_bangou[0] < (stu_bangou[1] * 2):
    print(0)
else:
    print(stu_bangou[0] - (stu_bangou[1] * 2))
Problem p02923 (python)

Fixed submission:
# -*- coding: utf-8 -*-

N_cnt = int(input().strip())
H_ary = list(map(int, input().strip().split()))

step_cnt = 0
most_step = 0
for i in range(1,N_cnt):
    if H_ary[i] <= H_ary[i-1]:
        step_cnt += 1
        if most_step < step_cnt:
            most_step = step_cnt
    else:
        step_cnt = 0

print(most_step)

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

A,B = map(int, input().split())
print(math.ceil((B-1)/(A-1)))

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

A,B = map(int, input().split())
print(math.ceil((b-1)/(a-1)))
Problem p02921 (python)

Fixed submission:
s=list(input())
t=list(input())
count=0
for i in range(3):
  if s[i]==t[i]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
s=list(input())
t=list(input())
count=0
for i im range(3):
  if s[i]==t[i]:
    count+=1
print(count)
Problem p02957 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
if n*a<=b:
  print(n*a)
elif n*a>=b:
  print(b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a+b)%2 == 1:
  print('IMPOSSIBLE')
  else:
    print((a+b)//2)
Problem p02993 (python)

Fixed submission:
s=list(str(input()))
count=0
for i in range(3):
  if s[i]==s[i+1]:
    count+=1

if count==0:
  print('Good')
else:
    print('Bad')

Buggy submission (verdict: Runtime Error):
s=list(str(input()))
count=0
for i in range(3):
  if s[i]==s[i+1]:
    count+=1

if count==0:
  print('Good')
  else:
    print('Bad')
Problem p02885 (python)

Fixed submission:
A,B = map(int, input().split())
#B = int(input())

if A <= 2 * B:
  print(0)
else:
  print(A-(2*B))

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

if A <= 2 * B:
  print(0)
else:
  print(A-
Problem p02972 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a.insert(0,0)
b = [0] * (N + 1)
ans = []
count = 0
for i in reversed(range(1,N + 1)):
  if a[i] == 1:
    sumi = 0
    j = 2
    while True:
      if (i * j) > N:
        break
      sumi += b[i * j]
      j += 1
    if sumi % 2 == 0:
      b[i] = 1
      count += 1
      ans.append(int(i))
  else:
    sumi = 0
    j = 2
    while True:
      if (i * j) > N:
        break
      sumi += b[i * j]
      j += 1
    if sumi % 2 == 1:
      b[i] = 1
      count += 1
      ans.append(int(i))
ans.sort()
print(count)
print(' '.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
import copy

N = int(input())
a = list(map(int, input().split()))
b = [0] * N
ans = []
count = 0
for i in reversed(range(N)):
  if i > N / 2:
    if a[i] == 1:
      b[i] = 1
      count += 1
      ans.append(int(i+1))
  elif  i == 0:
    if a[i] == 1:
      if (count % 2) == 0:
#        print("hello")
        b[i] = 1
        count += 1
        ans.append(int(i+1))
  else:
    if a[i] == 1:
      sumi = 0
      j = 2
      while True:
        sumi += b[i * j]
        j += 1
        if (i * j) > N:
          break
      if sumi % 2 == 0:
        b[i] = 1
        count += 1
        ans.append(int(i+1))
print(count)
print(' '.join(map(str, ans)))
Problem p03029 (python)

Fixed submission:
A,P =(int(x) for x in input().split())
answer = int((A*3+P)/2)
print(answer)

Buggy submission (verdict: Runtime Error):
A,P=map(input().split())
answer = int((A*3+P)/2)
print(answer)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = []
a = 0

if N == 1:
    print('0')
    exit()

for i in range(N-1):
    if H[i] >= H[i+1]:
        a += 1
    else:
        a = 0
    ans.append(a)

print(max(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = []
a = 0

if N == 1:
    print('0')
    exit()

for i in range(N-2):
    if H[t] >= H[t+1]:
        a += 1
    else:
        a = 0
    ans.append(a)

print(max(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = []
a = 0

for i in range(N-2):
    if H[t] >= H[t+1]:
        a += 1
    else:
        a = 0
    ans.append(a)
    
print(max(ans))
Problem p03624 (python)

Fixed submission:
s = list(input())
s_ = list('abcdefghijklmnopqrstuvwxyz')

s = list(set(s))
s.sort()

for i in range(len(s)):
    if s[i] != s_[i]:
        print(s_[i])
        exit()
if len(s) < 26: print(s_[len(s)])
else: print('None')

Buggy submission (verdict: Runtime Error):
s = list(input())
s_ = list('abcdefghijklmnopqrstuvwxyz')

s = list(set(s))
s.sort()

for i in range(len(s)):
    if s[i] != s_[i]:
        print(s_[i])
        exit()
    elif i == len(s) - 1:
        print(s_[i+1])
        exit()
print('None')

Buggy submission (verdict: Runtime Error):
s = list(input())
s_ = list('abcdefghijklmnopqrstuvwxyz')

s = list(set(s))
s.sort()

for i in range(26):
    if s[i] != s_[i]:
        print(s_[i])
        exit()
print('None')
Problem p02911 (python)

Fixed submission:
n, k, q = map(int, input().split())
L = [k for i in range(n)]
a = [int(input()) for i in range(q)]

for i in a:
    L[i-1] = L[i-1] + 1

for i in range(len(L)):
    if q  < L[i]:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
L=[k for i in range(N)]
a=[int(input()) for i in range(q)]

for i in a:
    L[i-1]=L[i-1]+1

for i in range(len(L)):
    if q<L[i]:
        print("YES")
    else:
        print("NO")
Problem p03147 (python)

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

incFlg = True   #登る場合はTure,　降る場合はFalse
before_height = 0
sum = 0

for i in range(len(a)-1):
    #降る場合
    if a[i] > a[i+1]:
        #その前が登り
        if incFlg:
            sum += a[i] - before_height
            incFlg = False
        #その前が下り
        else:
            before_height = a[i]
    #登る場合
    else:
        if not incFlg:
            before_height = a[i]
        incFlg = True

if incFlg:
    sum += a[len(a)-1] - before_height

print(sum)

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

incFlg = True   #登る場合はTure,　降る場合はFalse
before_height = 0
sum = 0

for i in range(len(a)-1):
    #降る場合
    if a[i] > a[i+1]:
        #その前が登り
        if incFlg:
            sum += a[i] - before_height
            incFlg = False
        #その前が下り
        else:
            # before_height = a[i]
    #登る場合
    else:
        if not incFlg:
            before_height = a[i]
        incFlg = True

if incFlg:
    sum += a[len(a)-1] - before_height

print(sum)
Problem p03251 (python)

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

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

if max(xl + [x]) < min(yl + [y]):
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
n, m, x, y = map(int, input().split())

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

if max(xl + x) < min(yl + y):
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
n, m, x, y = map(int, input().split())

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

xmax = sorted(x, key=None ,reverse=True)[0]
ymin = sorted(y)[0]

if max(x + xl) < min(y + yl):
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
n, m, x, y = map(int, input().split())

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

xmax = sorted(x, key=None ,reverse=True)[0]
ymin = sorted(y)[0]

if max(x, xl) < min(y, yl):
    print("No War")
else:
    print("War")
Problem p03262 (python)

Fixed submission:
def gcd(a, b):
    while a:
        a, b = b % a, a
    return b
 
 
def main():
    n, y = map(int, input().split())
    xs = list(map(int, input().split()))
    res = abs(y - xs[0])
    for x in xs[1:]:
        res = gcd(res, abs(y - x))
    print(res)
 
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

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

    return x

diff = []

for j in l:
    diff.append(abs(j - x))

ans = diff[0]

for d in range(d[1:]):
    ans = gcd(ans, d)

print(ans)
Problem p03109 (python)

Fixed submission:
s = input()
print('Heisei' if s <= '2019/04/30' else 'TBD')

Buggy submission (verdict: Runtime Error):
s = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')
Problem p02952 (python)

Fixed submission:
N=int(input())
count=0
for i in range(1,N+1):
  if len(str(i))%2!=0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
count=0
for i in range(1,N):
  if len(i)%2!=0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N=input()
count=0
for i in range(1,N):
  if len(i)%2!=0:
    count+=1
print(count)
Problem p02999 (python)

Fixed submission:
X,A=(int(i) for i in input().split())
if X<A:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
N,X=(int(i) for i in input().split())
L=[int(i) for i in input().split()]
for i in range(1,N+1):
  if sum(L[:i])>X:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
N,X=(int(i) for i in input().split())
L=[int(i) for i in input().split()]
for i in range(1,N+1):
    if sum(L[:i])>X:
        print(i)
        break
Problem p03029 (python)

Fixed submission:
A,P=(int(i) for i in input().split())
print(int((3*A+P)/2))

Buggy submission (verdict: Runtime Error):
A,P=int(i) for i in input().split()
print((3*A+P)/2)
Problem p03067 (python)

Fixed submission:
A,B,C=(int(i) for i in input().split())
if B<=C<=A or A<=C<=B:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C=(int(i) for i in input().split())
2.if B<=C<=A or A<=C<=B:
3.  print("Yes")
4.else:
5.  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C=(int(i) for i in input().split())
2.if A<=C and C<=B:
3.  print("Yes")
4.else:
5.  print("No")
Problem p03076 (python)

Fixed submission:
import numpy as np
A=[int(input()) for i in range(5)]
B=[]
for i in range(5):
    if int(str(A[i])[-1])!=0 and len(str(A[i]))>2:
        B.append(int(str(A[i])[:-2]+str(int(str(A[i])[-2])+1)+'0'))
    elif int(str(A[i])[-1])!=0 and len(str(A[i]))==2:
        B.append(int(str(int(str(A[i])[0])+1)+'0'))
    elif int(str(A[i])[-1])!=0 and len(str(A[i]))==1:
        B.append(10)
    else:
        B.append(int(A[i]))
a=np.array(A)
b=np.array(B)
np.array(B)-np.array(A)
tmp=np.sort(b-a)
print(sum(tmp)+sum(a)-tmp[-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
A=[int(input()) for i in range(5)]
B=[]
for i in range(5):
    if int(str(A[i])[-1])!=0 and len(str(A[i]))>2:
        B.append(int(str(A[i])[:-3]+str(A[i]+1)+'0'))
    elif int(str(A[i])[-1])!=0 and len(str(A[i]))==2:
        B.append(int(str(int(str(A[i])[0])+1)+'0'))
    elif int(str(A[i])[-1])!=0 and len(str(A[i]))==1:
        B.append(10)
    else:
        B.append(int(A[i]))
a=np.array(A)
b=np.array(B)
np.array(B)-np.array(A)
tmp=np.sort(b-a)
return sum(tmp)+sum(a)-tmp[-1]
Problem p03085 (python)

Fixed submission:
b=input()
if b=='A':
    print('T')
elif b=='T':
    print('A')
elif b=='C':
    print('G')
else:
    print('C')

Buggy submission (verdict: Runtime Error):
b=input()
if b=='A':
    print('T')
elif b=='T'
    print('A')
elif b=='C'
    print('G')
else:
    print('C')
Problem p03086 (python)

Fixed submission:
S=input()
count=0
result=0
for i in S:
    if i in 'AGTC':
        count+=1
        result=max(result,count)
    else:
        count=0
print(result)

Buggy submission (verdict: Runtime Error):
S=input()
count=0
result=[]
for i in S:
  if i=='A' or i=='T' or i=='G' or i=='C':
    count+=1
  else:
    result.append(count)
    count=0
print(max(result))

Buggy submission (verdict: Runtime Error):
S=input()
count=0
result=[]
for i in S:
    if i=='A' or i=='T' or i=='G' or i=='C':
        count+=1
    else:
        result.append(count)
        count=0
print(max(result))
Problem p03105 (python)

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

Buggy submission (verdict: Runtime Error):
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        result.append(i)
result.reverse()
print(result[K-1])

Buggy submission (verdict: Runtime Error):
A,B,C=(int(i) for i in input().split())
if A*C<=B:
  print(C)
else:
  print(int(B/A)
Problem p03106 (python)

Fixed submission:
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,101):
    if A%i==0 and B%i==0:
        result.append(i)
result.reverse()
print(result[K-1])

Buggy submission (verdict: Runtime Error):
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,min(A,B)):
    if A%i==0 and B%i==0:
        result.append(i)
result.reverse()
print(result[K-1])

Buggy submission (verdict: Runtime Error):
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,min(A,B)):
    if A%i==0 and B%i==0:
        result.append(i)
print(result[K-1])

Buggy submission (verdict: Runtime Error):
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,max(A,B)):
  if A%i==0 and B%i==0:
    result.append(i)
print(result[K-1])

Buggy submission (verdict: Runtime Error):
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        result.append(i)
print(result[K-1])
Problem p03125 (python)

Fixed submission:
A,B=(int(i) for i in input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A,B=(int(i) for i in input().split())
2.if B%A==0:
3.  print(A+B)
4.else:
5.  print(B-A)

Buggy submission (verdict: Runtime Error):
A,B=(int(i) for i in input().split(""))
if B%A==0:
  print(A+B)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A,B=int(i) for i in input().split()
if B%A==0:
  print(A+B)
else:
  print(B-A)
Problem p03145 (python)

Fixed submission:
A,B,C=(int(i) for i in input().split())
print(int(A*B/2))

Buggy submission (verdict: Runtime Error):
N = int(input())
h = [0] + [int(i) for i in input().split()]
result = 0
for i in range(1, len(h)):
  if h[i] > h[i-1]:
    result += h[i] - h[i-1]
print(result)
Problem p03219 (python)

Fixed submission:
X,Y=(int(i) for i in input().split())
print(int(X+Y/2))

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
T,A=(int(i) for i in input().split())
H=[int(i) for i in input().split()]
T=np.array([T for i in range(N)])
print(abs(A-(T-H*0.006)).argmin())
Problem p03220 (python)

Fixed submission:
import numpy as np
N=int(input())
T,A=(int(i) for i in input().split())
H=np.array([int(i) for i in input().split()])
T=np.array([T for i in range(N)])
print(abs(A-(T-H*0.006)).argmin()+1)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
T,A=(int(i) for i in input().split())
H=[int(i) for i in input().split()]
H=np.array([1000,2000])
T=np.array([T for i in range(N)])
print(abs(A-(T-H*0.006)).argmin())
Problem p03238 (python)

Fixed submission:
N=int(input())
if N==1:
    print("Hello World")
else:
    A=int(input())
    B=int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if N==1:
  print("Hello World")
else:
  print(A+B)
Problem p03261 (python)

Fixed submission:
N=int(input())
W=[input() for i in range(N)]
for i in range(N-1):
    if W[i] in W[i+1:]:
        print("No")
        break
    elif W[i][-1]!=W[i+1][0]:
        print("No")
        break
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N=int(i)
W=[int(input()) for i in range(N)]
for i in range(N-1):
  if W[i:].find(W[i])==True:
    print("No")
  elif W[i][-1]!=W[i+1][0]:
    print("No")
else:
  print("Yes")
Problem p03456 (python)

Fixed submission:
a,b=(i for i in input().split())
tmp=int(a+b)
if tmp**0.5==int(tmp**0.5):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b= i for i in input().split()
for i in range(100):
	if int(a+b)/(i*i)==1:
      print("Yes")
print("No")
Problem p03501 (python)

Fixed submission:
N,A,B=(int(i) for i in input().split())
if A*N<B:
    print(A*N)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
N,A,B=int(i) for i in input().split()
if A*N<B:
  print(A*N)
else:
  print(B)