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

Fixed submission:
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
s=str(input())
if(len(s)==2):
    print(s)
else:
    print(s[::-1])
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Buggy submission (verdict: Runtime Error):
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=1
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
s=str(input())
if(len(s)==2):
    print(s)
else:
    print(s[::-1])
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()
Problem p02618 (python)

Fixed submission:
import copy
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]

cl = sum(c)
D = [0]*26
ans = [0]*d
T = [0]*d

for i in range(d):
    count = 0
    for j in range(26):
        D[j] += 1
    for j in range(26):
        sas = 0
        S = s[i][j]
        C = c[j]
        Ds = copy.copy(D)
        Ds[j] = 0
        dc = 0
        for k in range(26):
            dc += Ds[k]*c[k]
        sas = S - dc + sum(T[:i])
        if sas > count:
            count = sas
            ans[i] = j+1
            T[i] = count

for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
# t = []
# for _ in range(d):
#     t.append(int(input()))

cl = sum(c)
D = [0]*26
ans = [0]*d
T = [0]*d

for i in range(d):
    count = 0
    for j in range(26):
        D[j] += 1
    for j in range(d):
        sas = 0
        S = s[i][j-1]
        C = c[j-1]
        D[j-1] = 0
        dc = 0
        for k in range(26):
            dc += D[k]*c[k]
        sas = S - dc + sum(T[:i])
        if sas > count:
            count = sas
            ans[i] = j
            T[i] = sas
            
for i in ans:
    print(i)
Problem p02642 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = ([0]*1000001)
a.sort()
for i in a:
    s[i] += 1
ans = 0
for j in range(1000001):
    if s[j] == 1:
        ans += 1
    if s[j] > 0:
        for k in range(j, 1000001, j):
            s[k] = 0
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = ([0]*1000000)
a.sort()
for i in a:
    s[i] += 1
ans = 0
for j in range(1000000):
    if s[j] == 1:
        ans += 1
    if s[j] > 0:
        for k in range(j, 1000000, j):
            s[k] = 0
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = ([0]*100)
a.sort()
for i in a:
    s[i] += 1
ans = 0
for j in range(100):
    if s[j] == 1:
        ans += 1
    if s[j] > 0:
        for k in range(j, 100, j):
            s[k] = 0
print(ans)
Problem p02678 (python)

Fixed submission:
from collections import deque
n,m=map(int,input().split())
l=[[0] for _ in range(n+1)]
vi=[0 for _ in range(n+1)]

for i in range (m):
  a,b=map(int,input().split())
  l[a].append(b)
  l[b].append(a)
st=deque([1])
f=set([1])


while st:
  x=st.popleft()
  for k in l[x]:
    if k not in f:
      st.append(k)
      f.add(k)
      vi[k]=x   
  
print("Yes")
for m in vi[2:]:
  print(m)

Buggy submission (verdict: Runtime Error):
v
from collections import deque
n, m = map(int, input().split())
l = [[0] for _ in range(n+1)]
vi = [0]*(n+1)

for _ in range(m):
    a,b = map(int, input().split())
    l[a].append(b)
    l[b].append(a)
d = deque([1])
s = set([1])

while d:
    x = d.popleft()
    for k in l[x]:
        if k not in s:
            s.add(k)
            d.appendleft(k)
            vi[k] = x
print('Yes')
for i in vi[2:]:
    print(i)
Problem p02687 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
if s = 'ABC':
  print('ARC')
else:
  print('ABC')
Problem p02700 (python)

Fixed submission:
import math
a, b, c, d = list(map(int, input().split()))
if math.ceil(c/b) > math.ceil(a/d):
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
a, b, c, d = list(map(int, input().split()))
if math.ceil(c/b) > math.ceil(a/d):
    print('No')
else:
    print('Yes')
Problem p02717 (python)

Fixed submission:
x, y, z = map(int, input().split())
x, y = y, x
x, z = z, x
print(x, y, z)

Buggy submission (verdict: Runtime Error):
import math
n, k = map(int, input().split())
x = math.ceil( n/k )
if abs(n - k*x) < n:
    n = abs(n - k*x)
print(n)
Problem p02732 (python)

Fixed submission:

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

from collections import Counter
count = Counter(a)

def choose2(x):
    return int(x*(x-1)/2)
    
total = 0
for i in list(count.values()):
    total += choose2(i)

for i in a:
    s = count[i]
    print(total - choose2(s) + choose2(s-1))

Buggy submission (verdict: Runtime Error):

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

def choose2(x):
    return int(x*(x-1)/2)
    
total = 0
for i in b:
    total += choose2(a.count(i))

for i in a:
    print(total - choose2(s[i]) + choose2(s[i]-1))
Problem p02760 (python)

Fixed submission:
#Bingo
card = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = list([int(input()) for _ in range(N)])
a = [[0]*3 for _ in range(3)]
for bi in b:
    for i in range(3):
        for j in range(3):
            if bi == card[i][j]:
                a[i][j] = 1
                
ans = 'No'
#tate
for i in range(3):
    if a[0][i] == 1 and a[1][i] == 1 and a[2][i] == 1:
        ans = 'Yes'
            
#yoko
for i in range(3):
    if a[i][0] == 1 and a[i][1] == 1 and a[i][2] == 1:
        ans = 'Yes'
    
#naname
if a[0][0] == 1 and a[1][1] == 1 and a[2][2] == 1:
    ans = 'Yes'
if a[0][2] == 1 and a[1][1] == 1 and a[2][0] == 1:
    ans ='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
#Bingo
card = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for _ in range(N)]
a = [[0]*3 for _ in range(3)]
for bi in b:
    for i in range(3):
        for j in raneg(3):
            if bi == card[i][j]:
                a[i][j] = 1
                
ans = 'No'
#tate
for i in range(3):
    if a[0][i] == 1 and a[1][i] == 1 and a[2][i] == 1:
        ans = 'Yes'
            
#yoko
for i in range(3):
    if a[i][0] == 1 and a[i][1] == 1 and a[i][2] == 1:
        ans = 'Yes'
    
#naname
if a[0][0] == 1 and a[1][1] == 1 and a[2][2] == 1:
    ans = 'Yes'
if a[1][3] == 1 and a[2][2] == 1 and a[3][1] == 1:
    ans ='Yes'
print(ans)
Problem p02765 (python)

Fixed submission:
n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r + 100*(10-n))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
count = 0
while n >0:
    n //= k
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r - 100:(10-n))
Problem p02811 (python)

Fixed submission:
k, x = map(int, input().split())
if k*500 >= x:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
k. x = map(int, input().split())
if k*500 >= x:
  print('Yes')
else:
  print('No')
Problem p02993 (python)

Fixed submission:

s = input()
for i in range(1, len(s)):
    if s[i] == s[i - 1]:
        print('Bad')
        exit()
print('Good')

Buggy submission (verdict: Runtime Error):
s = intput()
for i in range(1,n):
  if s[i] == s[i-1]:
    print('Bad')
    exit()
print('Good')
Problem p03471 (python)

Fixed submission:
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if i*10000 + j*5000 + (n-i-j)*1000 == y:
            print(i, j, (n-i-j))
            exit()

print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1:
        if i*10000 + j*5000 + (n-i-j)*1000 == y:
            print(i, j, (n-i-j))
            exit()

print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1)
        if i*10000 + j*5000 + (n-i-j)*1000 == y:
            print(i, j, (n-i-j))
            exit()

print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-j+1):
        if i*10000 + j*5000 + (n-i-j)*1000 == y:
            print(i, j, (n-i-j))
            exit()

print(-1, -1, -1)
Problem p03627 (python)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)

b1 = [i[0] for i in c.items() if i[1] >= 4]
b2 = [i[0] for i in c.items() if i[1] >= 2]
b = b1 + b2 + [0,0]

b.sort()
print(b[-1]*b[-2])

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)

b1 = [i[0] for i in c.items() if i[1] >= 4]
b2 = [i[0] for i in c.items() if 4 >= i[1] >= 2]
b = b1 + b2 

b.sort()
print(b[-1]*b[-2])
Problem p02573 (python)

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

def main():
    #xの根を求める
    def find(x):
        if par[x] < 0:
            return x
        else:
            par[x] = find(par[x])
            return par[x]
    #xとyの属する集合の併合
    def unite(x,y):
        x = find(x)
        y = find(y)

        if x == y:
            return False
        else:
            #sizeの大きいほうがx
            if par[x] > par[y]:
                x,y = y,x
            par[x] += par[y]
            par[y] = x
            return True

    #xとyが同じ集合に属するかの判定
    def same(x,y):
        return find(x) == find(y)

    #xが属する集合の個数
    def size(x):
        return -par[find(x)]

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

    #初期化
    #根なら-size,子なら親の頂点
    par = [-1]*n
    #print(par)
    for i in range(m):
        A,B = map(int, input().split())
        unite(A-1,B-1)
    print(max([size(i) for i in range(n)]))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N, M = list(map(int, input().split()))
edges = []
for _i in range(M):
    edges.append(list(map(int, input().split())))

import networkx as nx

G = nx.Graph()
G.add_edges_from(edges)
ans = 1
for comp in nx.connected_components(G):
    ans = max(ans, len(comp))
print(ans)
Problem p02614 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
import itertools
from copy import deepcopy

H, W , K = [int(i) for i in input().split()]

Arr = np.zeros((H, W))
for i in range(H):
    words = input()
    for j, w in enumerate(words):
        if w == "#":
            Arr[i,j] = 1
#print(Arr)
ans = 0
for t in range(0,H+W):
    Ex = list(itertools.combinations([int(i) for i in range(H+W)],t))
    for j in Ex:
        TMP = deepcopy(Arr)
        for num in j:
            if num < H:
                TMP[num] = np.zeros(W)
            else:
                w = num - H
                #print(TMP)
                TMP[:,w] = np.zeros(H)
                #print(w,TMP[:,w])
        if K == int(np.sum(TMP)):
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from itertools import product

H, W , K = [int(i) for i in input().split()]
c = [list(input()) for _ in range(h)]
ans = 0

for row_bit in product(range(2),repeat=H):
    for col_bit in product(range(2),repeat=W):
        cnt = 0
        for row in range(H):
            for col in range(W):
                if c[row][col] = "#" and  (row_bit[row] and col_bit[col]):
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)
Problem p02761 (python)

Fixed submission:
# -*- coding: utf-8 -*-
def main():
    N, M =  [int(i) for i in input().split()]

    S = []
    for i in range(M):
        S.append([int(i) for i in input().split()])

    S.sort(reverse=True)
    #print(S)
    answer = "0" * N
    if N != 1 and [1, 0] in S:
        print(-1)
        return

    for s in S:
        if answer[int(s[0])-1] == "0":
            answer = answer[:int(s[0])-1] + str(s[1]) + answer[int(s[0]):]
            #print(answer)
        elif answer[int(s[0])-1] != str(s[1]):
            #print(answer)
            print(-1)
            return
        else:
            continue

    if answer[0] == "0" and len(answer) != 1:
        print("1" + answer[1:])
    else:
        print(answer)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
def main():
    N, M =  [int(i) for i in input().split()]

    S = []
    for i in range(M):
        S.append([int(i) for i in input().split()])

    answer = "0" * N

    for s in S:
        if answer[int(s[0])-1] == "0":
            answer = answer[:int(s[0])-1] + str(s[1]) + answer[int(s[0]):]
            #print(answer)
        elif answer[int(s[0])-1] != str(s[1]):
            #print(answer)
            print(-1)
            return
        else:
            continue

    if answer[0] == "0" && len(answer) != 1:
        print(-1)
    else:
        print(answer)

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

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

N = int(input())
A = list(map(int, input().split()))

dp = [1000000000000] * N
dp[0] = 0
for i, h in enumerate(A):
    for j in (range(1,3)):
        if i+j < len(A):
            dp[i + j] = min(dp[i + j], dp[i] + abs(A[i] - A[i+j]))
        #print(dp)

print(dp[-1])

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

N = int(input())
Z = []
for i in range(N):
    Z.append(list(map(int, input().split())))

dp = [[0] * N for _ in range(N)]
#print(dp)
dp[0] = Z[0]

for i in range(1,N):
    dp[i][0] = max(dp[i-1][1] + Z[i][0] , dp[i-1][2] + Z[i][0])
    dp[i][1] = max(dp[i-1][0] + Z[i][1] , dp[i-1][2] + Z[i][1])
    dp[i][2] = max(dp[i-1][0] + Z[i][2] , dp[i-1][1] + Z[i][2])
    #print(dp)

print(max(dp[-1]))
Problem p03164 (python)

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

N, W = list(map(int, input().split()))
W_l = []
V_l = []
for i in range(N):
    w, v = list(map(int, input().split()))
    W_l.append(w)
    V_l.append(v)

V_max = sum(V_l)+1
W_max = sum(W_l) +1

#print(V_max, W_max)
dp = [[W+1] * V_max for _ in range(N+1)]
dp[0][0] = 0
for i in range(N):
    #print(i)
    for v in range(V_max):
        if v -V_l[i] >= 0:
            dp[i+1][v] = min(dp[i][v-V_l[i]]+W_l[i], dp[i][v])
        else:
            dp[i+1][v] = dp[i][v]
    #print(dp)
ans = 0
#print(dp[-1])
for v, w in enumerate(dp[-1]):
    if w <= W and ans <= v:
        ans = v
print(ans)

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

N, W = list(map(int, input().split()))
Z = []
for i in range(N):
    Z.append(list(map(int, input().split())))

dp = [[0] * (W+1) for _ in range(N+1)]

for i, z in enumerate(Z):
    #print(i)
    for w in range(W+1):
        if w -z[0] >= 0:
            dp[i+1][w] = max(dp[i][w-z[0]]+z[1], dp[i][w])
        else:
            dp[i+1][w] = dp[i][w]
    #print(dp)

print(max(dp[-1]))
Problem p03262 (python)

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

#109_c
import numpy as np
import math
from functools import reduce
from fractions import gcd

#最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]

x.append(X)
sort_x = np.array(sorted(x))

kaisa = np.diff(sort_x, n=1).tolist()

print(gcd_list(kaisa))

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

#109_c
import numpy as np
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]

x.append(X)
sort_x = np.array(sorted(x))
kaisa = np.diff(sort_x, n=1).tolist()

print(gcd_list(kaisa))

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

#109_c
import numpy as np
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]

x.append(X)
sort_x = np.array(sorted(x))
kaisa = np.diff(sort_x, n=1).tolist()

print(gcd_list(kaisa))
Problem p02727 (python)

Fixed submission:
import sys
def input(): return sys.stdin.readline().strip()
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

x, y, a, b, c = MAP()
p = LIST()
q = LIST()
r = LIST()
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
pq = p[:x] + q[:y]
pq.sort()
pqsum = 0
rsum = 0
d = 0
for i in range(min(c, x + y)):
    pqsum += pq[i]
    rsum += r[i]
    if rsum - pqsum > d:
        d = rsum - pqsum
print(sum(pq) + d)

Buggy submission (verdict: Runtime Error):
import sys
def input(): return sys.stdin.readline().strip()
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

x, y, a, b, c = MAP()
p = LIST()
q = LIST()
r = LIST()
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
pq = p[:x] + q[:y]
pq.sort()
pqsum = 0
rsum = 0
d = 0
for i in range(c):
    pqsum += pq[i]
    rsum += r[i]
    if rsum - pqsum > d:
        d = rsum - pqsum
print(sum(pq) + d)

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]

x, y, a, b, c = MAP()
p = LIST()
q = LIST()
r = LIST()
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
pq = deepcopy(p[:x]) + deepcopy(q[:y])
pq.sort()
pqsum = 0
rsum = 0
d = 0
for i in range(c):
    pqsum += pq[i]
    rsum += r[i]
    if rsum - pqsum > d:
        d = rsum - pqsum
print(sum(pq) + d)
Problem p02733 (python)

Fixed submission:
import sys
inf = sys.maxsize

if __name__ == '__main__':
    h, w, k = map(int, sys.stdin.readline().strip().split())
    s = [[int(i) for i in sys.stdin.readline().strip()] for _ in range(h)]
    
    ans = inf
    for i in range(2 ** (h - 1)): #縦方向の割り方を全探索 O(512)
        hdiv = [1 if i & 2 ** j else 0 for j in range(h - 1)]
        hdiv.append(1)
        sh = sum(hdiv)
        tmpans = sh - 1
        partsum = [0 for _ in range(sh)]
        partsum_p = [0 for _ in range(sh)]
        j = 0
        for j in range(w): #O(10 ** 3)
            tmp = 0
            idx = 0
            flag = False
            for kk in range(h): #O(10)
                tmp += s[kk][j]
                if hdiv[kk]:
                    partsum_p[idx] = partsum[idx]
                    partsum[idx] += tmp
                    if partsum[idx] > k and not flag:
                        tmpans += 1
                        flag = True
                    tmp = 0
                    idx += 1
            if flag:
                partsum = [partsum[l] - partsum_p[l] for l in range(sh)]
                partsum_p = [0 for _ in range(sh)]
                for kk in range(sh):
                    if partsum[kk] > k:
                        tmpans = inf
                        break
        ans = min(ans, tmpans)
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
def input(): return sys.stdin.readline().strip()
inf = sys.maxsize

if __name__ == '__main__':
    h, w, k = map(int,input().split())
    s = np.array([[int(i) for i in input()] for _ in range(h)])
    ans = inf
    for i in range(2 ** (h - 1)): #縦方向の割り方を全探索 O(512)
        hdiv = [1 if i & 2 ** j else 0 for j in range(h - 1)]
        hdiv.append(1)
        sh = sum(hdiv)
        tmpans = sh - 1
        partsum = [0 for _ in range(sh)]
        j = 0
        while j < w: #O(2 * 10 ** 3)
            tmp = 0
            idx = 0
            flag = True
            for kk in range(h): #O(10)
                tmp += s[kk][j]
                if hdiv[kk]:
                    partsum[idx] += tmp
                    if partsum[idx] > k:
                        tmpans += 1
                        partsum = [0 for _ in range(sh)]
                        flag = False
                        break
                    tmp = 0
                    idx += 1
            if flag:
                j += 1
        ans = min(ans, tmpans)
    print(ans)
Problem p02743 (python)

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

from decimal import *

a, b, c = MAP()

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

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

a, b, c = MAP()
'''
n = 5 * pow(10, 8)
m = 3 * n * n + 2 * n * (a + b + c)
a -= n
b -= n
c -= n
'''
ans = 'No'
'''
aa = reversed(str((a - b - c) * a))
bb = reversed(str((b - c - a) * b))
cc = reversed(str((c - a - b) * c))
'''
#print(-m, aa + bb + cc)
if floor(2 * sqrt(a * b)) < c - a - b:
    ans = 'Yes'
print(ans)