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

Fixed submission:
from sys import stdin

'''
def answer(A, x, y):
    if A < y < x:
        print("Yes")
    else:
        print("No")
'''


def main():
    A, B, C = [int(x) for x in stdin.readline().split()]
    if A < B:
        if A < C < B:
            print("Yes")
        else:
            print("No")
    else:
        if B < C < A:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def answer(B, C):
    if B > C:
        print("Yes")
    else:
        print("No")


def main():
    A, B, C = [int(x) for x in stdin.readline().split()]
    if A < B:
        answer(B, C)
    else:
        answer(C, B)


if __name__ == "__main__":
    main()
Problem p03109 (python)

Fixed submission:
def main():
    import datetime
    s = str(input())
    S = datetime.datetime.strptime(s, "%Y/%m/%d")
    if(S <= datetime.datetime(2019, 4, 30)):
        print("Heisei")
    else:
        print("TBD")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):


def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if lst[i][1] == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if str(lst[i][1]) == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if lst[i][1] == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if lst[i][1] == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()
Problem p03854 (python)

Fixed submission:

def main():
    S = input()
    while True:
        if S[-7:] == "dreamer":
            S = S[:-7]
        elif S[-6:] == "eraser":
            S = S[:-6]
        elif S[-5:] == "erase":
            S = S[:-5]
        elif S[-5:] == "dream":
            S = S[:-5]
        else:
            print("NO")
            break

        if len(S) == 0:
            print("YES")
            break


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    S = input()

    while True:
        result_1 = search('dreamer$', S)
        result_2 = search('eraser$', S)
        result_3 = search('erase$', S)
        result_4 = search('dream$', S)

        if result_1:
            S = S[:result_1.start()]
        elif result_2:
            S = S[:result_2.start()]
        elif result_3:
            S = S[:result_3.start()]
        elif result_4:
            S = S[:result_4.start()]
        else:
            print("NO")
            break

        if len(S) == 0:
            print("YES")
            break


if __name__ == "__main__":
    main()
Problem p02717 (python)

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

print(a,b,c)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A)
cnt = 0 

for a in A:
    if a >= S / (4*M):
        cnt += 1
    if cnt >= M:
        print("Yes")
    else:
        print("No")
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 * a * math.pi)

Buggy submission (verdict: Runtime Error):
import math

a= int(input)

print(2 * a * mathpi)
Problem p02706 (python)

Fixed submission:
N,M = map(int, input().split())
list_1 = list(map(int, input().split()))
 
i=0
sum=0
 
while i<M:
  sum=sum+list_1[i]
  i=i+1
  
if sum>N:
  print("-1")
  
else:
  print(abs(sum-N))

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
list_1 = list(map(int, input().split()))
 
i=0
sum=0
 
while i<=M:
  sum=sum+list_1[i]
  i=i+1
  
if sum>N:
  print("-1")
  
else:
  print(sum-N)

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

i=0
sum=0

while i<=M:
  sum=sum+list[i]
  i=i+1
  
if sum>N:
  print("-1")
  
else:
  print(sum-N)
Problem p02783 (python)

Fixed submission:
import math
H,A=(float(x) for x in input().split())
print(math.ceil(H/A))

Buggy submission (verdict: Runtime Error):
import math
A,H==(float(x) for x in input().split())
print(math.ceil(H/A))

Buggy submission (verdict: Runtime Error):
import math
A,H=input().split()
print(math.ceil(H/A))
Problem p02786 (python)

Fixed submission:
import numpy as np
import math

H = input()
H_bar=int(H)
counter=0
bunki=0

while H_bar!=1:
 H_bar=math.floor(H_bar/2)
 bunki=bunki+2**counter
 counter=counter+1
  
Sum=bunki+2**counter
print(Sum)

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

H = input()
H_bar=int(H)
counter=0
bunki=0

while H_bar!=1:
 H_bar=math.floor(H_bar/2)
 bunki=bunki+2**counter
 counter=counter+1
  
Sum=bunki+2**counter
print(Sum)
Problem p02789 (python)

Fixed submission:
a,b=input().split()
if(a==b):
  print("Yes")
if(a!=b):
  print("No")

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

if(a=b):
  print("Yes")
  
if(a!=b):
  print("No")

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

if(a=b):
  print("Yes")
  
if(a!=b):
  print("No")

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

if(a=b):
  print("Yes")
  
if(a!=b):
  print("No")
Problem p02975 (python)

Fixed submission:
n=input()
l=map(int,raw_input().split())
ans=0
for i in xrange (n):
  ans^=l[i]
if ans:
  print "No"
else:
  print "Yes"

Buggy submission (verdict: Runtime Error):
from sys import stdin
n=int(stdin.readline())
l=map(int,stdin.readline().split())
ans=0
for i in l:
  ans^=i
if ans:
  stdout.write("No")
else:
  stdout.write("Yes")

Buggy submission (verdict: Runtime Error):
n=input()
l=map(int,raw_input().split())
flag=0
for i in xrange (n-1):
  p=list(l)
  del p[i]
  del p[i+1]
  if (l[i]^l[i+1]) not in p:
    flag=1
    break
if flag:
  print "No"
else:
  print "Yes"
Problem p02767 (python)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
l1 = min(x)
l2 = max(x)
ans = 100000000
for i in range(l1, l2+1):
    sum = 0
    for j in x:
        sum += (i-j)**2
    if sum < ans:
        ans = sum
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int, input().split()))
l1 = min(x)
l2 = max(x)
ans = 0
for i in range(l1, l2+1):
    for j in x:
        sum += (i-j)**2
    if sum > ans:
        ans = sum
print(ans)
Problem p02706 (python)

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

w = sum(A)

r = N-w

if r<0:
  print(-1)
else:
  print(r)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split()) 
A = [list(map(int,input().split())) for i in range(M)]

w = sum(A)

r = N-w

if r<0:
  print(-1)
else:
  print(r)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split()) 
P = [list(map(int,input().split())) for i in range(M)]

w = sum(A)

r = N-w

if r<0:
  print(-1)
else:
  print(r)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [list(map(int,input().split())) for i in range(M)]

w = sum(A)

r = N-w

if r<0:
  print(-1)
else:
  print(r)

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

w = sum(A)

r = N-w

if r<0:
  print(-1)
else:
  print(r)
Problem p02717 (python)

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

d = a
a = b
b = d

d = a
a = c
c = d

print(a, b, c)

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

d = a
a = b
b = d

d = a
a = c
c = d

print(a, b, c)
Problem p02742 (python)

Fixed submission:
from sys import stdin
import math

h,w = [int(x) for x in stdin.readline().rstrip().split()]
if (h==1)|(w==1):
    ans = 1
else:
    ans = int(w/2)*h + (w%2)*math.ceil(h/2)
print(ans)

Buggy submission (verdict: Runtime Error):
h,w = [int(x) for x in stdin.readline().rstrip().split()]
import math
def bishop(h,w):
    if h == 1:
        ans = 1
    else:
        ans = int(w/2)*h + (w%2)*math.ceil(h/2)
    return ans
Problem p02713 (python)

Fixed submission:
from math import gcd
k = int(input())+1
ans = 0
for i in range(1,k):
    for j in range(1,k):
        for l in range(1,k):
            ans+=gcd(gcd(i,j),l)
print(ans)

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


dic = {}
ans = 0
n = int(input())
for i in range(n):
    for j in range(n):
        for k in range(n):
            key=(i+1)*(j+1)*(k+1)
            if key in dic:
                ans = ans+dic[key]
            else:
                val = gcd(gcd(i+1, j+1), k+1)
                dic[key] = val
                ans = ans + val
print(ans)
Problem p02952 (python)

Fixed submission:
a = int(input())
i = 1
cnt = 0
while i <= a:
  if len(str(i))%2 == 1:
    cnt += 1
  i += 1
 
print("{}".format(cnt))

Buggy submission (verdict: Runtime Error):
a = int(input())
i = 1
cnt = 0
while i <= a:
  if len(i)%2 == 1:
    cnt += 1
  i += 1

print("{}".format(cnt))
Problem p02705 (python)

Fixed submission:
import numpy as np
 
n = int(input())
 
                    
print(2*np.pi*n)

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

n = int(input())

                    
print(2*np.pi*n)
Problem p02718 (python)

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

ans = []
for i in range(m) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

if len(ans) == m :
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

ans = []
for i in range(m+1) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

if len(ans) == m :
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
print(a)
ans = []
for i in range(m+1) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

if len(ans) == m :
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = []
for i in range(1, m+1) :
  if a[i] < sum(a) / (4 * m) :
    continue
  else :
    ans.append(a[-1])

if len(ans) == m :
  print('Yes')
else :
  print('No')
Problem p02778 (python)

Fixed submission:
s = input()
print('x' * len(s))

Buggy submission (verdict: Runtime Error):
s = input()
print(x * len(s))
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
ans = a
count = 1
if b == 1 :
  count = 0
elif a >= b :
  count = 1
else :
  while True :
    count += 1
    ans += (a-1)
    if b <= ans:
      break
  
print(count)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = a
count = 1
if b = 0 :
  count = 0
elif a >= b :
  count = 1
else :
  while True :
    count += 1
    ans += (a-1)
    if b <= ans:
      break
  
print(count)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = a
count = 1
if b = 1 :
  count = 0
elif a >= b :
  count = 1
else :
  while True :
    count += 1
    ans += (a-1)
    if b <= ans:
      break
  
print(count)
Problem p03433 (python)

Fixed submission:
n = int(input())
a = int(input())
if int(n) < 500 :
  if a >= n :
    print("Yes")
  else :
    print("No")
  
elif n % 500 <= a :
  print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
n, a = map(int, input().split())
if int(n) < 500 :
  if a >= n :
    print("Yes")
  else :
    print("No")
  
elif n % 500 <= a :
  print("Yes")
else :
  print("No")
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if a*b % 2 :
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 1 <= a <=10000 and 1 <= b <= 10000:
  print(a, b)
  if (a*b) % 2:
    print("odd")
  else:
    print("even")
Problem p03814 (python)

Fixed submission:
s = list(input())
count = 0
index1 = s.index("A")
    
for num in s[::-1]:
  if num == "Z":  
    break
  else :
    count += 1

print(len(s) - (index1 + count))

Buggy submission (verdict: Runtime Error):
s = list(input())
for num in s :
  if num == "A":
    index1 = s.index(num)
    continue
  if num == "Z":
    index2 = s.index(num)
    break
    
print(index2 - index1 + 1)
Problem p02718 (python)

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

souwa = sum(A)
hyou = souwa/(4*m)
ninki = 0

for number in A:
  if number >= hyou:
    ninki = ninki + 1

if m <= ninki:
    print('Yes')
else:
    print('No')

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

souwa = sum(A)
print(souwa)

hyou = 1(4*souwa)i
ninki = 0

for i in range(A):
    if A(i)>hyou:
      ninki = ninki + 1

if m == souwa:
     print('Yes')
else:
    print('No')
Problem p02719 (python)

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

syou = n//k

zet = abs(n-k*syou)
if zet == 0:
  print(zet)
else:
  zet1 = abs(n-k*(syou+1))
  if zet > zet1:
    print(zet1)
  else: 
    print(zet)

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

test = n

while True:
  zet = abs(test-k)
  if zet == 0:
    print(zet)
    break
  if zet > test:
    print(f)
    break
  test = zet
Problem p02727 (python)

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = [int(_) for _ in input().split()]
q = [int(_) for _ in input().split()]
r = [int(_) for _ in input().split()]
 
p.sort()
q.sort()
r.sort()
 
x_list = p[-x:]
y_list = q[-y:]
all_apple = x_list + y_list + r
all_apple.sort()
 
print(sum(all_apple[-(x+y):]))

Buggy submission (verdict: Runtime Error):
import bisect
 
x, y, a, b, c = map(int, input().split())
p = [int(_) for _ in input().split()]
q = [int(_) for _ in input().split()]
r = [int(_) for _ in input().split()]
 
p.sort()
q.sort()
r.sort()

x_list = p[-x:]
y_list = q[-y:]
r_list = r[-(x+y):]
 
while (min(x_list[0], y_list[0]) < r_list[-1]):
    if x_list[0] > y_list[0]:
        i = bisect.bisect_right(r, y_list[0])
        y_list.pop(0)
        target = r_list.pop(i)
        bisect.insort(y_list, target)
    else:
        i = bisect.bisect_right(r_list, x_list[0])
        x_list.pop(0)
        target = r_list.pop(i)
        bisect.insort(x_list, target)
 
    if len(r_list) == 0:
        break
 
print(sum(x_list) + sum(y_list))

Buggy submission (verdict: Runtime Error):
import bisect

x, y, a, b, c = map(int, input().split())
p = [int(_) for _ in input().split()]
q = [int(_) for _ in input().split()]
r = [int(_) for _ in input().split()]

p.sort()
q.sort()
r.sort()

x_list = p[-x:]
y_list = q[-y:]

while (min(x_list[0], y_list[0]) < r[-1]):
    if x_list[0] > y_list[0]:
        i = bisect.bisect_left(r, y_list[0])
        y_list.pop(0)
        target = r.pop(i)
        bisect.insort(y_list, target)
    else:
        i = bisect.bisect_left(r, x_list[-1])
        x_list.pop(0)
        target = r.pop(i)
        bisect.insort(x_list, target)

    if len(r) == 0:
        break

print(sum(x_list) + sum(y_list))
Problem p02882 (python)

Fixed submission:
import math

a, b, water = map(int, input().split())
pool = a ** 2 * b

if water == pool:
    ans = 0
elif water > pool / 2:
    high = 2 * (pool - water) / (a ** 2)
    ans = 90 - math.degrees(math.atan(a / high))
elif water == pool / 2:
    ans = 45
else:
    high = 2 * water / (a * b)
    ans = 90 - math.degrees(math.atan(high / b))

print(ans)

Buggy submission (verdict: Runtime Error):
import math

a, b, water = map(int, input().split())
pool = a ** 2 * b

if water > pool / 2:
    high = 2 * (pool - water) / (a ** 2)
    ans = 90 - math.degrees(math.atan(a / high))
elif water == pool / 2:
    ans = 45
else:
    high = 2 * water / (a * b)
    ans = 90 - math.degrees(math.atan(high / b))

print(ans)
Problem p02705 (python)

Fixed submission:
a = int(input())
print (3.14*2*a)

Buggy submission (verdict: Runtime Error):
a=input()
print 3.14*2*a
Problem p02760 (python)

Fixed submission:
A = []
for i in range(3):
    A.append(list(map(int, input().split())))

N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

bingo = []
for t in range(N):
    for i in range(3):
        if b[t] in A[i]:
            j = A[i].index(b[t])
            #bingo.append((i, j))
            A[i][j] = True

answer = "No"
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2]:
        answer = "Yes"

for j in range(3):
    if A[0][j] == A[1][j] == A[2][j]:
        answer = "Yes"
if A[0][0] == A[1][1] == A[2][2]:
    answer = "Yes"

if A[2][0] == A[1][1] == A[0][2]:
    answer = "Yes"
    

print(answer)

Buggy submission (verdict: Runtime Error):
A = []
for i in range(3):
    A.append(list(map(int, input().split())))

N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

bingo = []
for t in range(N):
    for i in range(3):
        if b[t] in A[i]:
            j = A[i].index(b[t])
            #bingo.append((i, j))
            A[i][j] = True

for i in range(3):
    if A[i][0] == A[i][1] == A[i][2]:
        answer = "Yes"

for j in range(3):
    if A[0][j] == A[1][j] == A[2][j]:
        answer = "Yes"
if A[0][0] == A[1][1] == A[2][2]:
    answer = "Yes"

if A[2][0] == A[1][1] == A[0][2]:
    answer = "Yes"
    

print(answer)
Problem p02953 (python)

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

suc = "Yes"
maxN = H[0]
for i in range(N):
    if maxN - 1 > H[i]:
        suc = "No"
        break
    elif maxN < H[i]:
        maxN = H[i]
print(suc)

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

suc = 0
if N > 1:
    for i in range(N-1):
        if H[i] - 1 > H[i+1]:
            suc = -1
            break
        elif H[i] > H[i+1] > H[i+2]:
            suc = -1
            break

print("Yes") if suc == 0 else print("No")
Problem p03035 (python)

Fixed submission:
A,B = map(int, input().split())
if A <= 5:
  print(0)
elif A <= 12:
  print(B//2)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
A,B = map(int, input())
if A <= 5:
  print(0)
elif A <= 12:
  print(B/2)
else:
  print(B)
Problem p03076 (python)

Fixed submission:
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
if notdiv:
    for i in range(len(notdiv)):
        notdiv[i] %= 10
        notdiv[i] = 10 - notdiv[i]

    notdiv.sort()
    print(sum(lis) + plus - notdiv[-1])
else:
    print(sum(lis) + plus)

Buggy submission (verdict: Runtime Error):
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
for i in range(len(notdiv)):
    notdiv[i] %= 10
    notdiv[i] = 10 - notdiv[i]

notdiv.sort()
print(sum(lis) + plus - notdiv[-1])

Buggy submission (verdict: Runtime Error):
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
for i in range(5):
    notdiv[i] %= 10
    notdiv[i] = 10 - notdiv[i]


notdiv.sort()
print(sum(lis) + plus - notdiv[-1])

Buggy submission (verdict: Runtime Error):
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
for i in range(5):
    notdiv[i] %= 10
    notdiv[i] = 10 - notdiv[i]


notdiv.sort()
print(sum(lis) + plus - notdiv[-1])
Problem p03086 (python)

Fixed submission:
S = list(input())
st = [0]*len(S)
string = "ACGT"
for i in range(len(S)):
    if S[i] in string:
        st[i] += 1

st_1 = [1]*len(S)

count = []
temp = 0

for i in range(len(st)):
    if st[i] == st_1[i]:
        temp += 1
    else:
        count.append(temp)
        temp = 0
    if i+1 == len(st):
        count.append(temp)
        
#print(st)
if count:
    print(max(count))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
S = input()
ACGT = ["A","C","G","T"]
index = []
for i in range(len(S)):
    if S[i] not in ACGT:
        index.append(i)

diff = [index[0]]
for j in range(len(index)-1):
    diff.append(index[j+1] - index[j] - 1)

print(max(diff))
Problem p03106 (python)

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

A = []
B = []
for i in range(1,a+1):
    if a % i == 0:
        A.append(i)
for i in range(1,b+1):
    if b % i == 0:
        B.append(i)
common = list(set(A) & set(B))
common.sort(reverse=True)

print(common[k-1])

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

A = []
B = []
for i in range(1,a):
    if a % i == 0:
        A.append(i)
for i in range(1,b):
    if b % i == 0:
        B.append(i)
common = list(set(A) & set(B))
common.sort()
print(common[k-1])
Problem p03136 (python)

Fixed submission:
n = input()
EdgeLength=input().split()
#print(EdgeLength)
N = int(n)
EdgeLength = [int(i) for i in EdgeLength]

#list(map(int, EdgeLength))

EdgeLength.sort()
#print(EdgeLength)

sumL = sum(EdgeLength) - EdgeLength[N-1]
#print(sumL)


if EdgeLength[N-1] < sumL:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
EdgeLength=input()
edgeLength=[int(i) for i in EdgeLength]
N = int(n)

sorted(edgeLength)

sumL = 0
sumLength = [sumL += edgeLength[i] for i in range(N-1)]

if edgeLength[N] < sumL:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
EdgeLength=input()
edgeLength=[int(i) for i in EdgeLength]
N = int(n)

sorted.edgeLength()

sumL = 0
sumLength = [sumL += edgeLength[i] for i in range(1,N)]

if edgeLength[0] < sumL:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
EdgeLength=input()
edgeLength=[int(i) for i in EdgeLength]

sorted.edgeLength()

sumL = 0
sumLength = [sumL += edgeLength[i] for i in range(1,len(edgeLength))]

if edgeLength[0] < sumL:
    print("Yes")
else:
    print("No")