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

Fixed submission:

X = int(input(""))

X500 = X//500
X_a = X%500

X5 = X_a//5

happy = X500*1000 + X5*5

print(happy)

Buggy submission (verdict: Runtime Error):

KN = input("").split()
A = input("").split()

K = int(KN[0])
N = int(KN[1])
A_0 = int(A[0])
A_N = int(A[N-1])
L = A_0

for j in range(N):
    A_i = int(A[j+1])
    A_m = int(A[j])
    if A_i - A_m > L:
        L == A_i - A_m

if L > K - A_N + A_0:
    print(K-L)
else:
    print(K - A_N + A_0)
Problem p02732 (python)

Fixed submission:
from collections import Counter
N = int(input(""))
A = list(map(int,input().split()))
X = 0

A_e = list(set(A))

x = Counter(A)

for i in A_e:
    if x[i] >= 2:
        xc2 = x[i]*(x[i]-1)/2
        X = X + xc2

for k in A:
    print(int(X-x[k]+1))

Buggy submission (verdict: Runtime Error):
    n = int(input())
    a = list(map(int, input().split()))
    b = [0 for _ in range(max(a)+1)]
    for x in a:
        b[x] += 1
    c = sum([x*(x-1)//2 for x in b])
    for i in range(n):
        print(c-b[a[i]]+1)
Problem p02756 (python)

Fixed submission:
from collections import deque

def main():
    S = deque(input())
    
    Q = int(input())
    count = 1

    for i in range(Q):
        n = input()
        if n == "1":
            #qi[i][0] = 1
            count += 1
        else:
            q= list(n.split())
            if (count % 2 == 1 and q[1] == "1") or(count % 2 == 0 and q[1] == "2"):
                S.appendleft(q[2])
            else:
                S.append(q[2]) 

    if count % 2 == 0:
        S.reverse()
    print(''.join(S))

if __name__ == "__main__":
    main()

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
"""
import numpy as np

def main():
    S = input()
    Q = int(input())
    #qi = [[0 for j in range(3)] for i in range(Q)]
    qi = np.zeros((Q, 3))
    for i in range(Q):
        n = input()
        if n != 1:
            qi[i]= n.split()
        else:
            qi[i][0] = 1

    for i in range(Q):

        if qi[i][0] == "1":
            S = S[::-1]
        elif qi[i][0] == "2":
            if qi[i][1] == "1":
                S = str(qi[i][2]) + S
            elif qi[i][1] == "2":
                S = S + str(qi[i][2]) 
    print(S)

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

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N,M = LI()
    s = [0]*M
    c = [0]*M
    n = [0]*3
    for i in range(M):
        Sn,Cn = LI()
        s[i] = Sn
        c[i] = Cn

    if N == 1:
        ans = [0]
    elif N == 2:
        ans = [1, 0]
    elif N == 3:
        ans = [1, 0, 0]

    for k in range(0, M):
        if ans[s[k]-1] != c[k]:
            n[s[k]-1] += 1
        ans[s[k]-1] = c[k]


    if (ans[0] == 0 and N != 1) or  n[0]>=2 or n[1]>=2 or n[2]>=2:
        print(-1)
    else:
        ans = map(str,ans)
        print(''.join(ans))




if __name__ == "__main__":
	main()

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N,M = LI()
    s = [0]*M
    c = [0]*M
    n = 0
    for i in range(M):
        Sn,Cn = LI()
        s[i] = Sn
        c[i] = Cn

    ans = [0]*N
    for k in range(0, M):
        if ans[s[k-1]] == 0:
            ans[s[k]-1]=c[k]
        else:
            n += 1
    if ans[0] == 0 or n!=0:
        print(-1)
    else:
        ans = map(str,ans)
        print(''.join(ans))




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

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

if n < k:
    print(min(n,k - n))
else:
    if n % k == 0:
        print(0)
    else:
        print(min(n % k,abs((n % k) - k)))

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

if n < k:
    if k - n > n:
        print(n)
    else:
        print(k - n)
else:
    if n % k == 0:
        print(0)
    else:
        print(math.gcd(n, k))

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

if n < k:
    if k - n > n:
        print(n)
    else:
        print(k - n)
else:
    if n % k == 0:
        print(0)
    else:
        print(math.gcd(n, k))
Problem p02727 (python)

Fixed submission:
x,y,a,b,c = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
res = 0

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

p = p[:x]
q = q[:y]

p_sum = sum(p)
q_sum = sum(q)

p_num = -1
q_num = -1

for i in r:
    if p_num >= (len(p) * -1):
        p_temp = (p_sum - p[p_num] + i)
    else:
        p_temp = -1
    if q_num >= (len(q) * -1):
        q_temp = (q_sum - q[q_num] + i)
    else:
        q_temp = -1

    if p_temp >= p_sum or q_temp >= q_sum:        
        if p_temp - p_sum > q_temp - q_sum:
            p_sum = p_temp
            p_num -= 1        
        else:
            q_sum = q_temp
            q_num -= 1        
    else:
        break
    




print(p_sum + q_sum)

Buggy submission (verdict: Runtime Error):
x,y,a,b,c = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
res = 0

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

p = p[:x]
q = q[:y]

p_sum = sum(p)
q_sum = sum(q)

for i in r:
    p_temp = (p_sum - p[-1] + i)
    q_temp = (q_sum - q[-1] + i)
    if p_temp >= p_sum or q_temp >= q_sum:        
        if p_temp - p_sum > q_temp - q_sum:
            p_sum = p_temp
            p.pop(-1)        
        else:
            q_sum = q_temp
            q.pop(-1)

print(p_sum + q_sum)
Problem p02797 (python)

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

n,k,s = list(map(int,input().split()))
a = []
count = 0
st = ""

for i in range(k):
    a.append(s)

for i in range(n-k):
    if s < 2:
        a.append(s+1)
    else:
        a.append(s-1)
    
for i in range(n):
    if st == "":
        st = str(a[count])
    else:
        st += " " + str(a[count])
    count += 1

print(st)

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

n,k,s = list(map(int,input().split()))
a = []
count = 0
st = ""

for i in range(k):
    a.append(s)

for i in range(n-k):
    a.append(s-1)

if s-1 == 0:
    a = [1]

for i in range(n):
    if st == "":
        st = str(a[count])
    else:
        st += " " + str(a[count])
    count += 1

print(st)

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

n,k,s = list(map(int,input().split()))
a = []
count = 0
st = ""

for i in range(k):
    a.append(s)

for i in range(n-k):
    a.append(s-1)

if s-1 == 0:
    a = []
    a.append(1)

for i in range(n):
    if st == "":
        st = str(a[count])
    else:
        st += " " + str(a[count])
    count += 1

print(st)
Problem p02801 (python)

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

a = str(input())

alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

print(alpha[alpha.index(a)+1])

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

from collections import OrderedDict

n = int(input())
dic = OrderedDict()

for i in range(n):
    l,d = list(map(str,input().split()))
    dic[l] = d

a = str(input())

flag = False
time = 0

for key,value in dic.items():
    if flag == False:
        if key == a:
            flag = True
    else:
        time += int(value)

print(time)
Problem p02813 (python)

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

import itertools

n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))

a = list(range(1,n+1,1))
count = 1

res1 = 0
res2 = 0

temp = []

for i in itertools.permutations(a):
    for j in range(n):
        temp.append(i[j])
    if temp == p and (res1 == 0):
        res1 = count
    if temp == q and (res2 == 0):
        res2 = count
    count += 1
    temp = []

print(abs(res1-res2))

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

import itertools

n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))

a = list(range(1,n+1,1))
count = 1

for i in itertools.permutations(a, n):
    if (i[0] == p[0]) and (i[1] == p[1]) and (i[2] == p[2]):
        res1 = count
    if (i[0] == q[0]) and (i[1] == q[1]) and (i[2] == q[2]):
        res2 = count
    count += 1

print(abs(res1-res2))
Problem p02608 (python)

Fixed submission:
n = int(input())
ans = [0 for a in range(10050)]


for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      
      if v<10050:
        ans[v]+=1

for i in range(n):
  print(ans[i+1])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = [0 for _ in range(10050)]

for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i;
            
            if v<10050:
            ans[v]+=1

for i in range(n):
    print(ans[i+1])
Problem p02639 (python)

Fixed submission:
n_list = input().split()

print(n_list.index('0') + 1)

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

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

p_list = [int(n) for n in input().split()]

X_near = np.array(list(range(int(np.ceil(X - N/2)), int(np.floor(X + N/2)) + 1)))

remain_list = []

for i in X_near:
    if i not in p_list:
        remain_list.append(i)
        
remain_array = np.array(remain_list)
min_bool = np.abs(X - remain_array).min() == np.abs(X - remain_array)
print(remain_array[min_bool].min())
Problem p02642 (python)

Fixed submission:
N = int(input())
 
A_list = [int(n) for n in input().split()]
 
import numpy as np
 
A_array = np.array(A_list)
sort_A = np.sort(A_array)

n_array = np.zeros(10**6)
  
for a in sort_A:
    
    if n_array[a - 1] >= 2:
        continue
        
    a_times = np.array(range(a, 10**6+1, a))
    
    n_array[(a_times -1).astype(int)] += 1

print((n_array[sort_A - 1] == 1).sum())

Buggy submission (verdict: Runtime Error):
N = int(input())
 
A_list = [int(n) for n in input().split()]
 
import numpy as np
 
A_array = np.array(A_list)
sort_A = np.sort(A_array)
 
XX = list()
 
for n in range(len(sort_A) - 1):
    
    r_list = list()
    
    for m in range(n+1):
        r_list.append(sort_A[n + 1] % sort_A[m] == 0)
       
    XX.append(np.array(r_list).sum() == 0)
    
XX_array = np.array(XX)        

if sort_A[0] == sort_A[1]:
    print(XX_array.sum())
    
else:
    print(XX_array.sum()+1)
Problem p02645 (python)

Fixed submission:
S = input()
nick = str()
for n in range(3):
  nick = nick + S[n]    

print(nick)

Buggy submission (verdict: Runtime Error):
import numpy as np 
 
N,K = map(int, input().split())
 
A_array = np.array(list(map(int, input().split())))
 
if K > 500:
   K = 500

for k in range(K):
 
    B_list = list()
 
    inf_array = np.array(range(N)) + 0.5 - A_array
    sup_array = np.array(range(N)) + 1.5 + A_array
        
    B_list = [((inf_array <= m+1) & (m+1<=sup_array)).sum() for m in range(N)]
 
    A_array = np.array(B_list)
    
print(' '.join(map(str, A_array)))

Buggy submission (verdict: Runtime Error):
import numpy as np 
 
N,K = map(int, input().split())
 
A_array = np.array(list(map(int, input().split())))
 
if K > 1000:
   K = 1000

for k in range(K):
 
    B_list = list()
 
    inf_array = np.array(range(N)) + 0.5 - A_array
    sup_array = np.array(range(N)) + 1.5 + A_array
        
    B_list = [((inf_array <= m+1) & (m+1<=sup_array)).sum() for m in range(N)]
 
    A_array = np.array(B_list)
    
print(' '.join(map(str, A_array)))

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

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

A_array = np.array(list(map(int, input().split())))

if K > 1000:
  K = 1000

for k in range(K):

    B_list = list()

    inf_array = np.array(range(N)) + 0.5 - A_array
    sup_array = np.array(range(N)) + 1.5 + A_array
        
    B_list = [((inf_array <= m+1) & (m+1<=sup_array)).sum() for m in range(N)]

    A_array = np.array(B_list)
    
print(' '.join(map(str, A_array)))
Problem p02618 (python)

Fixed submission:
d = int(input())

c = list(map(int,input().split()))

s = []

for _ in range(d):
    temp = list(map(int,input().split()))

    s.append(temp)

for i in range(d):
    print(s[i].index(max(s[i])) + 1)

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

c = list(map(int,input().split()))

s = []

for _ in range(d):
    temp = list(map(int,input().split()))

    s.append(temp)

last = [0] * 26

for i in range(d):
    temp = [x - c[i] * day for i, (x, day) in  enumerate(zip(s[i], last))]

    print(temp.index(max(temp)) + 1)

    last = [x + 1 for x in last]

    last[i] = 0
Problem p02641 (python)

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

if n != 0:
    p = list(map(int,input().split()))
else:
    p = []

result = []

i = 0

while len(result) == 0:
    if not (x - i in p):
        result.append(x - i)
    if not (x + i in p):
        result.append(x + i)
    
    i += 1

print(int(min(result)))

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

if n != 0:
    p = list(map(int,input().split()))
else:
    p = []

result = []

i = 0

while len(result) == 0:
    if not (x - i in p):
        result.append(x - i)
    if not (x + i in p):
        result.append(x + i)
    
    i += 1

print(int(min(result)))
Problem p02642 (python)

Fixed submission:
n = int(input())

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

a.sort()

dp = [True] * (a[-1] + 1)

ans = 0

m = a[-1]

for i, x in enumerate(a[:-1]):
    if not a[i+1] == x and dp[x]:
        ans += 1
    for b in range(x, m + 1, x):
        dp[b] = False

if dp[a[-1]]:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):

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

a.sort()

max_a = a[-1]
is_available = [True] * (max_a + 1)

ans = 0

for i, x in enumerate(a[:-1]):
    if not a[i+1] == x and is_available[x]:
        ans += 1
    for b in range(x, m + 1, x):
        is_available[b] = False

if is_available[a[-1]]:
    ans += 1

print(ans)

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

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

a.sort()

dp = [True] * a[-1]

ans = 0

m = a[-1]

for i, x in enumerate(a[:-1]):
    if not a[i+1] == x and dp[x]:
        ans += 1
    for b in range(x, m + 1, x):
        dp[b] = False

if dp[a[-1]]:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())

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

a.sort()

for i in range(len(a)):
    if dp[i] == True:
        for j, x in enumerate(a[i+1:], 1):
            if dp[i + j] == True:
                if a[i + j] % a[i] == 0:
                    dp[i + j] = False

num_dict = dict(collections.Counter(a))

result = [x for x, y in zip(a, dp) if (y == True) and (num_dict[x] == 1)]

print(len(result))

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

n = int(input())

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

a.sort()

temp = a[-1] / 2

if a[0] != 1:
    a = np.array(a)

    i = 0

    while i < len(a):
        b = a / a[i]

        a = a[(b != b.astype(int)) | (b == 1)]

        i += 1

        if a[i] > temp:
            break

    u, counts = np.unique(a, return_counts=True)

    print(sum(counts == 1))

elif (len(a) > 1) and (a[0] == a[1]):
    print(0)
else:
    print(1)

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

n = int(input())

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

a.sort()

temp = np.sqrt(a[-1])

if a[0] != 1:
    a = np.array(a)

    i = 0

    while i < len(a):
        b = a / a[i]

        a = a[(b != b.astype(int)) | (b == 1)]

        i += 1

        if a[i] > temp:
            break

    u, counts = np.unique(a, return_counts=True)

    print(sum(counts == 1))

elif (len(a) > 1) and (a[0] == a[1]):
    print(0)
else:
    print(1)
Problem p02647 (python)

Fixed submission:
from itertools import accumulate

n, k = map(int,input().split())

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

for j in range(k):
    if j > 41:
        break

    b = [0] * n

    for i in range(n):
        b[max(0, i - a[i])] += 1
        
        if i + a[i] + 1 < n:
            b[i + a[i] + 1] -= 1

    a = list(accumulate(b))

print(*a)

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

n, k = map(int,input().split())

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

light = np.zeros((n, n), dtype=int)

for _ in range(k):
    for i, arr in enumerate(light):
        x_1, x_2 = i - a[i], i + a[i] + 1

        if x_1 < 0:
            x_1 = 0

        arr[x_1:x_2] = 1
    a = light.sum(axis=0)

print(*list(a))

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

n, k = map(int,input().split())

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

light = np.zeros((n, n))

for _ in range(k):
    for i, arr in enumerate(light):
        x_1, x_2 = i - a[i], i + a[i] + 1

        if x_1 < 0:
            x_1 = 0

        arr[x_1:x_2] = 1
    a = light.sum(axis=0).astype(int)

print(*list(a))
Problem p02665 (python)

Fixed submission:
n = int(input())

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

cumsum_a = a.copy()

for i in range(n-1, -1, -1):
    cumsum_a[i] += cumsum_a[i+1]

ans = 0
childable_node = 1

for i in range(n + 1):
    if a[i] > childable_node:
        ans = -1
        break

    ans += childable_node

    if i < n:
        b_max1 = 2 * (childable_node - a[i])
        b_max2 = cumsum_a[i + 1]
        childable_node = min(b_max1, b_max2)

print(ans)

Buggy submission (verdict: Runtime Error):
import math, numpy

n = int(input())

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

l = [0] * (n + 1)
l[0] = 1

cumsum_a = numpy.cumsum(a[::-1])[::-1]

if (n > 0) and (a[0] > 0):
    print(-1)
else:
    for i in range(1, n):
        b_max1 = 2 * (l[i - 1] - a[i - 1])
        b_max2 = cumsum_a[i]

        if a[i] > 2 ** i - math.ceil(l[i-1]/2):
            l = -1
            break

        l[i] = min(b_max1, b_max2)

    if l != -1:
        l[-1] = a[-1]
        print(sum(l))
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
import math, numpy

n = int(input())

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

l = [0] * n
l[0] = 1

cumsum_a = numpy.cumsum(a[::-1])[::-1]

if (n > 0) and (a[0] > 0):
    print(-1)
else:
    for i in range(1, n):
        b_max1 = 2 * (l[i - 1] - a[i - 1])
        b_max2 = cumsum_a[i]

        if a[i] > 2 ** i - math.ceil(l[i-1]/2):
            l = -1
            break

        l[i] = min(b_max1, b_max2)

    if l != -1:
        l[-1] = a[-1]
        print(sum(l))
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
import math, numpy

n = int(input())

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

l = [1]

cumsum_a = numpy.cumsum(a[::-1])[::-1]

if (n > 0) and (a[0] > 0):
    print(-1)
else:
    for i in range(1, n):
        b_max1 = 2 * (l[i - 1] - a[i - 1])
        b_max2 = cumsum_a[i]

        if a[i] > 2 ** i - math.ceil(l[i-1]/2):
            l = -1
            break

        l.append(min(b_max1, b_max2))

    if l != -1:
        l.append(a[-1])
        print(sum(l))
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())

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

l = [1]

for i in range(1, n):
    b_max1 = 2 * (l[i - 1] - a[i - 1])
    b_max2 = sum(a[i:])

    if a[i] > 2 ** i - math.ceil(l[i-1]/2):
        l = -1
        break

    l.append(min(b_max1, b_max2))

if l != -1:
    l.append(a[-1])
    print(sum(l))
else:
    print(-1)

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

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

l = [1]

for i in range(1, n):
    b_max1 = 2 * (l[i - 1] - a[i - 1])
    b_max2 = sum(a[i:])

    if b_max1 <= 0:
        l = -1

    l.append(min(b_max1, b_max2))

l.append(a[-1])

print(sum(l))

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

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

l = [1]

for i in range(1, n):
    b_max1 = 2 * (l[i - 1] - a[i - 1])
    b_max2 = sum(a[i:])

    if b_max1 <= 0:
        l = -1

    print(a[i + 1:])

    print(i, b_max1, b_max2)

    l.append(min(b_max1, b_max2))

l.append(a[-1])

print(sum(l))
Problem p02694 (python)

Fixed submission:

import math

x = int(input())

n = 100

i = 0

while n < x:
    n = math.floor(n * 1.01)
    i += 1

print(i)

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

n = 100

i = 0

while n < x:
    n = math.floor(n * 1.01)
    i += 1

print(i)
Problem p02741 (python)

Fixed submission:
l = [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]

k = int(input()) - 1

print(l[k])

Buggy submission (verdict: Runtime Error):
l = [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]

k = int(input())

print(l[k])
Problem p02743 (python)

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

d = c - a - b

if (4*a*b < d*d) and (0 < d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
 
a, b, c = input().split()
a, b, c = int(a), int(b), int(c)
 
if 4*a*b < (c - a - b)**2:
  if (c - a - b) < 0:
    print("No")
  else:
	print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math

a, b, c = input().split()
a, b, c = int(a), int(b), int(c)

if 2 * a * b < (c - a  b) ** 2:
  print("Yes")
else:
  print("No")
Problem p02583 (python)

Fixed submission:
# coding: utf-8
from pdb import set_trace
#from collections import Counter
import itertools

N = int(input())
L = list(map(int, input().split(" ")))
# print(L)

# C = dict(Counter(L))
# L = sorted(list(set(L)), reverse=True)

# if N<3 or len(L)<3:
#     print(0)
#     exit()
# li = []
# for xa, a in enumerate(L[:-2]):
#     for xb, b in enumerate(L[xa+1:-1]):
#         for xc, c in enumerate(L[xa+2:]):
#             if a+b<c:
#                 break
#             if a+b>c and b+c>a and c+a>b and a!=b and b!=c and c!=a:
#                 _li = sorted([xa, xb+xa+1, xc+xa+2])
#                 if _li in li:
#                     continue
#                 li.append(_li)
# cnt = 0
# for l in li:
#     a = C[L[l[0]]]
#     b = C[L[l[1]]]
#     c = C[L[l[2]]]
#     cnt += (a * b * c)
# print(cnt)
cnt = 0
TRI = list(itertools.combinations(L, 3))
for tri in TRI:
    a, b, c = tri
    if a==b or b==c or c==a:
        continue
    elif a+b>c and a+c>b and b+c>a:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
from pdb import set_trace

N = int(input())
L = list(map(int, input().split(" ")))

if N<3:
    print(0)
    exit()
LN = [i for i in range(N)]
cnt = []
for xa, a in enumerate(L[:-2]):
    for xb, b in enumerate(L[xa+1:-1]):
        for xc, c in enumerate(L[xa+2:]):
            if a+b>c and b+c>a and c+a>b and a!=b and b!=c and c!=a:
                li = sorted([xa, xb+xa+1, xc+xa+2])
                if li in cnt:
                    continue
                cnt.append(li)
print(len(li))