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

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
counts = 0
for A in range(a + 1):
    for B in range(b + 1):
        for C in range(c + 1):
            if (500 * A + 100 * B + 50 * C) == x:
                counts += 1
print(counts)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
counts = 0
for A in range(a + 1):
    for B in range(b + 1):
        for C in range(c + 1):
            if (500 * a + 100 * b + 50 * c) == X:
                counts += 1
print(counts)
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, b = int(input().split())
if a % b == 0:
  print("odd")
else:
  print("even")

Buggy submission (verdict: Runtime Error):
a = 20
b = map(int, input().split())
print("Odd" if a % b == 0)

Buggy submission (verdict: Runtime Error):
a = 20
b = map(int, input().split())
print("Odd" if a * b % 2 else "Even")

Buggy submission (verdict: Runtime Error):
a = 20
b = int(input())
print("even" if a % b == 0 else "odd")

Buggy submission (verdict: Runtime Error):
a = 20
b = int(input())
if a % b == 0:
    print("even")
else:
    print("odd")

Buggy submission (verdict: Runtime Error):
a = 20
b = int(input())
if a % b == 0 and a % b != 0:
    print("even")
else:
    print("odd")

Buggy submission (verdict: Runtime Error):
a = 10
b = int(input())
if a % b == 0:
    print("even")
elif a % b != 0:
    print("odd")

Buggy submission (verdict: Runtime Error):
a = 20
b = int(input)
if a % b == 0:
  print("even")
elif a % b != 0:
  print("odd")
Problem p03478 (python)

Fixed submission:
n,a,b = map(int, input().split())
print(sum(i for i in range(1, n+1) if a <= sum(map(int, str(i))) <= b))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split()))
print(sum(i for i in range(1 + n+1) if a <= sum(map(int, str(i)) <=b)))

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

def find_sum(x):
    count = 0
    while x > 0:
        count += x % 10
        x = x // 10

    return count

for i in range(1, n+1):
    count = find_sum(i)
    if A <= count <= B:
        ans += n

print(ans)
Problem p03854 (python)

Fixed submission:
import re
S = input()
'''
メタ文字：
^ = 文字列の先頭、
| = OR
+ = 直前のパターンを1回以上繰り返し、
$ = 文字列の末尾
'''
if re.match("^(dream|dreamer|erase|eraser)+$", S):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
S = input()
if re.match("^(dream|dreamer|erase|eraser)+$", S):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if re.match("^(dream|dreamer|erase|eraser)+$", s):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import re
s = input()
if re.match("^(dream|dreamer|erase|eraser)+$, s):
    print("Yes")
else:
    print("No")
Problem p02761 (python)

Fixed submission:
def main():
    n, m = [int(e) for e in input().split()]
    if n == 1 and m == 0:
        print(0)
        exit()

    if m == 0:
        print(10**(n - 1))
        exit()

    S, C = zip(*[[int(e) for e in input().split()] for i in range(m)])

    ans = 0
    D = {}
    for si, ci in zip(S, C):
        if D.get(si) == ci:
            continue

        if n != 1 and si == 1 and ci == 0:
            print(-1)
            exit()

        if D.get(si) is not None:
            print(-1)
            exit()

        ans += 10**(n - si) * ci
        D[si] = ci

    if len(str(ans)) > n:
        print(-1)
        exit()

    if len(str(ans)) < n:
        ans += 10**(n - 1)

    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m = [int(e) for e in input().split()]
    S, C = zip(*[[int(e) for e in input().split()] for i in range(m)])

    ans = 0
    D = {}
    for si, ci in zip(S, C):
        if D.get(si) == ci:
            continue

        if D.get(si) is not None:
            print(-1)
            exit()

        ans += 10**(n - si) * ci
        D[si] = ci

    if len(str(ans)) != n:
        print(-1)
        exit()

    print(ans)

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

Fixed submission:
from collections import deque, defaultdict


def main():
    n, q = [int(e) for e in input().split()]
    AB = [[int(e) for e in input().split()] for i in range(n - 1)]
    PX = [[int(e) for e in input().split()] for i in range(q)]

    G = defaultdict(set)
    for a, b in AB:
        G[a].add(b)
        G[b].add(a)

    Ans = [0] * (n + 1)
    for p, x in PX:
        Ans[p] += x

    Q = deque([1])
    Visited = [False] * (n + 1)
    Visited[1] = True
    while len(Q) > 0:
        v = Q.popleft()
        for vc in G[v]:
            if Visited[vc]:
                continue

            Ans[vc] += Ans[v]
            Q.append(vc)
            Visited[vc] = True

    print(*Ans[1:])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n, q = [int(e) for e in input().split()]
    AB = [[int(e) for e in input().split()] for i in range(n - 1)]
    PX = [[int(e) for e in input().split()] for i in range(q)]

    V = dict()
    for a, b in AB:
        V[b] = a

    S = [0] * (n + 1)
    for p, x in PX:
        S[p] += x

    Ans = [0] * n
    Ans[0] = S[1]
    for i in range(1, n):
        Ans[i] += S[i + 1] + Ans[V[i + 1] - 1]

    print(*Ans)


if __name__ == '__main__':
    main()
Problem p03111 (python)

Fixed submission:
n, a, b, c = [int(e) for e in input().split()]
L = [int(input()) for i in range(n)]

def dfs(A, B, C, O, lst, mi):
    if len(lst) == 0:
        if len(A) == 0 or len(B) == 0 or len(C) == 0:
            return mi

        mp = 0
        mp += (len(A) - 1)*10 + abs(a - sum(A))
        mp += (len(B) - 1)*10 + abs(b - sum(B))
        mp += (len(C) - 1)*10 + abs(c - sum(C))
        return min(mp, mi)

    l = lst.pop()
    mi = dfs(A + [l], B.copy(), C.copy(), O.copy(), lst.copy(), mi)
    mi = dfs(A.copy(), B + [l], C.copy(), O.copy(), lst.copy(), mi)
    mi = dfs(A.copy(), B.copy(), C + [l], O.copy(), lst.copy(), mi)
    mi = dfs(A.copy(), B.copy(), C.copy(), O + [l], lst.copy(), mi)

    return mi

def main():
    print(dfs([], [], [], [], L.copy(), float('inf')))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
n, a, b, c = [int(e) for e in input().split()]
L = [int(input()) for i in range(n)]

def dfs(A, B, C, O, lst, mi):
    if len(lst) == 0:
        if len(A) == 0 or len(B) == 0 or len(C) == 0:
            return mi

        mp = 0
        mp += (len(A) - 1)*10 + abs(a - sum(A))
        mp += (len(B) - 1)*10 + abs(b - sum(B))
        mp += (len(C) - 1)*10 + abs(c - sum(C))
        return min(mp, mi)

    l = lst.pop()
    mi = dfs(A + [l], B.copy(), C.copy(), O.copy(), lst.copy(), mi)
    mi = dfs(A.copy(), B + [l], C.copy(), O.copy(), lst.copy(), mi)
    mi = dfs(A.copy(), B.copy(), C + [l], O.copy(), lst.copy(), mi)
    mi = dfs(A.copy(), B.copy(), C.copy(), O + [l], lst.copy(), mi)

    return mi

def main():
    print(dfs([], [], [], [], L.copy(), float('inf')))

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

Fixed submission:
import fractions

def main():
    n, x = [int(e) for e in input().split()]
    X = [int(e) for e in input().split()]

    ans = abs(x - X[0])
    for xi in X:
        ans = fractions.gcd(abs(x - xi), ans)

    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    n, x = [int(e) for e in input().split()]
    X = [int(e) for e in input().split()]

    ans = abs(x - X[0])
    for xi in X:
        ans = math.gcd(abs(x - xi), ans)

    print(ans)

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

Fixed submission:
import statistics

def main():
    n = int(input())
    A = [int(e) for e in input().split()]

    B = [a - ai - 1 for ai, a in enumerate(A)]
    m = int(statistics.median(B))
    ans = sum([abs(b - m) for b in B])
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import statistics

def main():
    n = int(input())
    A = [int(e) for e in input().split()]

    B = [a - ai - 1 for ai, a in enumerate(A)]
    m = int(statistics.median(B))
    ans = sum([abs(b - m) for b in B])
    print(ans)

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

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

flag = True
for i in range(n):
    if a[i+1] != 0:
        flag = False
        break

if n != 0 and a[0] != 0:
    print(-1)
    exit()
elif n == 0 and a[0] == 1:
    print(1)
    exit()

nleaf = 1
ans = 0
v = list()

for i in range(n):
    nleaf -= a[i]
    v.append(nleaf)
    nleaf *= 2

if nleaf < a[n]:
    print(-1)
    exit()

nleaf = a[n]
ans += a[n]
for i in range(n-1, -1, -1):
    if v[i]*2 < nleaf:
        print(-1)
        exit()
    if v[i] > nleaf:
        v[i] = nleaf
    nleaf = v[i] + a[i]
    ans += nleaf
print(ans)

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

flag = True
for i in range(n):
    if a[i+1] != 0:
        flag = False
        break

if n != 0 and a[0] != 0:
    print(-1)
    exit()
elif n == 0 and a[0] == 1:
    print(1)
    exit()

nleaf = 1
ans = 0
v = list()

for i in range(n):
    nleaf -= a[i]
    v.append(nleaf)
    nleaf *= 2

if nleaf < a[i]:
    print(-1)
    exit()

nleaf = a[n]
ans += a[n]
for i in range(n-1, -1, -1):
    if v[i]*2 < nleaf:
        print(-1)
        exit()
    if v[i] > nleaf:
        v[i] = nleaf
    nleaf = v[i] + a[i]
    ans += nleaf
print(ans)
Problem p03086 (python)

Fixed submission:
ACGT = ["A", "C" ,"G", "T"]
s = input()
ans = 0
temp = 0
for i in s:
  ok = False
  for j in ACGT:
    if i == j:
      ok = True
      temp += 1
  if ok == False:
    ans = max(ans, temp)
    temp = 0
ans = max(ans, temp)
print(ans)

Buggy submission (verdict: Runtime Error):
ACGT = ["A", "C" ,"G", "T"]
s = input()
ans = 0, temp = 0
for i in s:
  ok = False
  for j in ACGT:
    if i == j:
      ok = True
      temp += 1
  if ok == False:
    ans = max(ans, temp)
    temp = 0
ans = max(ans, temp)
print(ans)
Problem p03136 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
if sum(l) > 2*max(l):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = map(int,input().split())
if sum(l) > 2*max(l):
    print("Yes")
else:
    print("No")
Problem p03456 (python)

Fixed submission:
a,b = map(str,input().split())
cnt = 0
for i in range(1,400):
    if int(a+b) == i*i:
        print("Yes")
        cnt = 1
        break
if cnt == 0:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
cnt = 0
for i in range(1,400):
    if int(a+b) == i*i:
        print("Yes")
        cnt = 1
        break
if cnt == 0:
    prnt("No")

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
cnt = 0
for i in range(1,101):
    if int(a+b) == i*i:
        print("Yes")
        cnt = 1
        break
if cnt == 0:
    prnt("No")
Problem p02898 (python)

Fixed submission:
n,k = list(map(int, input().split()))
h = list(map(int, input().split()))
count = 0
for i in range(len(h)):
    if h[i] >= k:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n,k = list(map(int, input().split()))
h = list(map(int, input().split()))
count = 0
for i in range(h):
    if h[i] >= k:
        count += 1
print(count)
Problem p03136 (python)

Fixed submission:
corners = int(input())
sides = list(map(int, input().split()))
re_sides = sorted(sides, reverse=True)
nums = 0
for i in range(corners-1):
    nums += re_sides[i+1]
if nums > re_sides[0]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
corners = input()
sides = list(map(int, input().split))
sides = sorted(sides)
for i in (corners-1):
    nums += sides[i+1]
if nums > sides[0]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
corners = input()
sides = list(map(int, input().split))
sides = sorted(sides)
for i in (corners-1):
    nums += sides[i+1]
if nums > sides[0]:
    print("Yes")
else:
    print("No")
Problem p02588 (python)

Fixed submission:
from math import *
#import sys 
#cin = sys.stdin()

cnt = [[0] * 20 for i in range(20)]

ans = 0
for _ in range(int(input())):
    t = input().strip().split('.')
    if (len(t) > 1):
        b = int(t[0])*1000000000 + int(t[1]) * 10 ** (9 - len(t[1]))
    else:
        b = int(t[0]) * 1000000000
    x, y = 0, 0
    while (b % 2 == 0) and (x <= 18):
        x += 1
        b //= 2
    while (b % 5 == 0) and (y <= 18):
        y += 1
        b //= 5
    #print(x, y)
    for i in range(20):
        for j in range(20):
            if (i + x >= 18) and (j + y >= 18):
                ans += cnt[i][j]
    cnt[x][y] += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from math import *
import sys 
cin = sys.stdin()

cnt = [[0] * 19 for i in range(19)]

ans = 0
for _ in range(int(input())):
    t = float(input())
    b = int(t * 1000000000.0)
    x, y = 0, 0
    while b % 2 == 0 and x < 18:
        x += 1
        b //= 2
    while b % 5 == 0 and y < 18:
        y += 1
        b //= 5
    #print(x, y)
    for i in range(19):
        for j in range(19):
            if i + x >= 18 and j + y >= 18:
                ans += cnt[i][j]
    cnt[x][y] += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from math import *

cnt = [[0] * 19 for i in range(19)]

ans = 0
for _ in range(int(input())):
    t = float(input())
    b = int(t * 1000000000.0)
    x, y = 0, 0
    while b % 2 == 0 and x <= 18:
        x += 1
        b //= 2
    while b % 5 == 0 and y <= 18:
        y += 1
        b //= 5
    #print(x, y)
    for i in range(19):
        for j in range(19):
            if i + x >= 18 and j + y >= 18:
                ans += cnt[i][j]
    cnt[x][y] += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from math import *

cnt = [[0] * 19 for i in range(19)]

ans = 0
for _ in range(int(input())):
    t = float(input())
    b = int(t * 1000000000.0)
    x, y = 0, 0
    while b % 2 == 0 and x <= 18:
        x += 1
        b //= 2
    while b % 5 == 0 and x <= 18:
        y += 1
        b //= 5
    #print(x, y)
    for i in range(19):
        for j in range(19):
            if i + x >= 18 and j + y >= 18:
                ans += cnt[i][j]
    cnt[x][y] += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from math import *

cnt = [[0] * 25 for i in range(25)]

ans = 0
for _ in range(int(input())):
    t = float(input())
    b = int(t * 1000000000.0)
    x, y = 0, 0
    while b % 2 == 0:
        x += 1
        b //= 2
    while b % 5 == 0:
        y += 1
        b //= 5
    print(x, y)
    for i in range(25):
        for j in range(25):
            if i + x >= 18 and j + y >= 18:
                ans += cnt[i][j]
    cnt[x][y] += 1
print(ans)
Problem p02613 (python)

Fixed submission:
N = int(input())
S = []
for _ in range(N): S.append(input())

print('AC x', S.count('AC'))
print('WA x', S.count('WA'))
print('TLE x', S.count('TLE'))
print('RE x', S.count('RE'))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N): S.append(input()))

print('AC x', S.count('AC'))
print('WA x', S.count('WA'))
print('TLE x', S.count('TLE'))
print('RE x', S.count('RE'))
Problem p02675 (python)

Fixed submission:
import sys
from collections import deque
import bisect
import math
import itertools
from queue import deque
from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)

N = inp()
r = -1
if 0 < N < 10:
    r = N
else:
    r = int(str(N)[-1])

if r in [2, 4, 5, 7, 9]:
    print('hon')
elif r in [0, 1, 6, 8]:
    print('pon')
else:
    print('bon')

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
import bisect
import math
import itertools
from queue import deque
from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)

N = inp()
r = int(str(N)[:-1])

if r in [2, 4, 5, 7]:
    print('hon')
elif r in [0, 1, 6, 8]:
    print('pon')
else:
    print('bon')
Problem p02713 (python)

Fixed submission:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10 ** -7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)


def gcd_3(x, y, z):
    return gcd(gcd(x, y), z)

K = inp()

dic = {} # key: (i, j, k), el: gcd(i, j, k)
ans = 0
for i in range(1, K + 1):
    for j in range(i, K + 1):
        tmp = gcd(i, j)
        for k in range(j, K + 1):
            a = gcd(tmp, k)
            if i == j == k:
                ans += a
            elif i == j or j == k:
                ans += a * 3
            else:
                ans += a * 3 * 2
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10 ** -7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)


def gcd_3(x, y, z):
    return gcd(gcd(x, y), z)

K = inp()

dic = {} # key: (i, j, k), el: gcd(i, j, k)
ans = 0
for i in range(1, K + 1):
    for j in range(i, K + 1):
        tmp = gcd(i, j)
        for k in range(j, K + 1):
            a = gcd(tmp, k)
            if i == j == k:
                ans += a
            elif i == j or j == k:
                ans += a * 3
            else:
                ans += a * 3 * 2
print(ans)
Problem p02714 (python)

Fixed submission:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N = inp()
S = input()

"""
    Conditions:
        1. S[i] \ne S[j] and S[j] \ne S[k] and S[k] \ne S[i]
        2. j - i \ne k - j
"""

r = S.count('R')
g = S.count('G')
b = S.count('B')
# 条件1を満たす組は rgb 個。それから「条件1を満たしてかつ条件 2 を満たさない」組を引く。条件を満たさないもののほうが多い。


cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        k = j + (j - i) # => k - j == j - i
        if k > N - 1: break
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            cnt += 1

print(r * g * b - cnt)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N = inp()
S = input()

"""
    Conditions:
        1. S[i] \ne S[j] and S[j] \ne S[k] and S[k] \ne S[i]
        2. j - i \ne k - j
"""

r = S.count('R')
g = S.count('G')
b = S.count('B')
# 条件1を満たす組は rgb 個。それから「条件1を満たしてかつ条件 2 を満たさない」組を引く。条件を満たさないもののほうが多い。


cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        k = j + (j - i) # => k - j == j - i
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            cnt += 1

print(r * g * b - cnt)
Problem p02717 (python)

Fixed submission:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)


X, Y, Z = inp_list()
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
def inp_list(): return list(map(int, sys.stdin.readline().split()))


X, Y, Z = inp_list()
print(Z, X, Y)
Problem p02719 (python)

Fixed submission:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N, K = inp_list()

mod = N % K
sho = N // K

if mod == 0:
    print(0)
else:
    ans = min(abs(sho * K - N), abs((sho + 1) * K - N))
    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N, M = inp_list()
A = inp_list()
A.sort(reverse=True)
total = sum(A)

bd = total // (4 * M) + 1
if A[M - 1] <= bd:
    print('No')
else:
    print('Yes')
Problem p02743 (python)

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

x = c - a - b
if x > 0 and 4 * a * b < x ** 2:
    print('Yes')
else:
    print('No')

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

if 4 * a * b < (c - a - b) ** 2):
    print('Yes')
else:
    print('No')