Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = str(input())
i = 0
ch = "keyence"
while len(s) > 7:
    if s[i] != ch[i]:
        s = s[:i] + s[i+1:]
    else:
        i += 1
if s == ch:
    print("YES")
else:
    print("NO")

Fixed submission:
s = str(input())
n = len(s) - 7
for i in range(n,len(s)):
    if s[:i-n] + s[i:] == "keyence":
        print("YES")
        exit()
print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
DP = [0]
for i in range(N-1):
    act = float("inf")
    for k in range(K):
        if i-k < 0 : continue
        act = min(DP[-1-k] + abs(h[i-k]-h[i+1]) , act)
    DP += [act]
 
print(DP[-1])

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(n-1):
    cnt = float("inf")
    for j in range(k):
        if i-j < 0: continue
        cnt = min(dp[-1-j] + abs(h[i-j]-h[i+1]), cnt)
        #print("i =",i,"j =",j,"i-j =",i-j,"i+j =",i+j,"cnt =",cnt)
    dp.append(cnt)
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(n-1):
    cnt = 10**9
    for j in range(k):
        if i-j < 0: continue
        cnt = min(dp[-1-j] + abs(h[i-j]-h[i+1]), cnt)
        #print("i =",i,"j =",j,"i-j =",i-j,"i+j =",i+j,"cnt =",cnt)
    dp += [cnt]
print(dp[-1])

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(n-1):
    cnt = float("inf")
    for j in range(k):
        if i-j < 0: continue
        cnt = min(dp[-1-j] + abs(h[i-j]-h[i+1]), cnt)
        #print("i =",i,"j =",j,"i-j =",i-j,"i+j =",i+j,"cnt =",cnt)
    dp.append(cnt)
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(n-1):
    cnt = float("inf")
    for j in range(k):
        if i-j < 0: continue
        cnt = min(dp[-1-j] + abs(h[i-j]-h[i+1]), cnt)
        #print("i =",i,"j =",j,"i-j =",i-j,"i+j =",i+j,"cnt =",cnt)
    dp.append(cnt)
print(dp[-1])

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(n-1):
    cnt = float("inf")
    for j in range(k):
        if i-j < 0: continue
        cnt = min(dp[-1-j] + abs(h[i-j]-h[i+1]), cnt)
        #print("i =",i,"j =",j,"i-j =",i-j,"i+j =",i+j,"cnt =",cnt)
    dp.append(cnt)
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(n-1):
    cnt = 10**9
    for j in range(k):
        if i-j < 0: continue
        cnt = min(dp[-1-j] + abs(h[i-j]-h[i+1]), cnt)
        #print("i =",i,"j =",j,"i-j =",i-j,"i+j =",i+j,"cnt =",cnt)
    dp.append(cnt)
print(dp[-1])

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
for i in range(n-1):
    cnt = float("inf")
    for j in range(k):
        if i-j < 0: continue
        cnt = min(dp[-1-j] + abs(h[i-j]-h[i+1]), cnt)
        #print("i =",i,"j =",j,"i-j =",i-j,"i+j =",i+j,"cnt =",cnt)
    dp.append(cnt)
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
ans = 1
for i in range(1,1000):
    tmp = 2
    while i**tmp <= x:
        ans = max(ans,i**tmp)
        tmp += 1
print(ans)

Fixed submission:
x = int(input())
ans = 1
for i in range(2,1000):
    tmp = 2
    while i**tmp <= x:
        ans = max(ans,i**tmp)
        tmp += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
sum1=0
sum2=0
if a<=b:
    sum1=a
else:
    sum1=b
if c<=d:
    sum2=c
else:
    sum2=d
print(sum1+sum2)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
sum1=0
sum2=0
if a<=b:
    sum1=a
else:
    sum1=b
if c<=d:
    sum2=c
else:
    sum2=d
print(sum1+sum2)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(input()) for i in range(N)]
list.sort(A,reverse=True)
a=0
b=0
for i in range(N):
    if(i%2==0):
        a+=A[i]
    else:
        b+=A[i]
print(a-b)

Fixed submission:
N=int(input())
A= list(map(int,input().split()))
list.sort(A,reverse=True)
a=0
b=0
for i in range(N):
    if(i%2==0):
        a+=A[i]
    else:
        b+=A[i]
print(a-b)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a+b)%2==1:
    print((a+b)//@2+1)
else:
    print((a+b)//2)

Fixed submission:
a,b = map(int,input().split())
if (a+b)%2==1:
    print((a+b)//2+1)
else:
    print((a+b)//2)
Buggy python submission (verdict: Runtime Error):
s = input()
# AKIHABARA
if (s == "AKIHABARA") or (s == "AKIHABAR") or (s == "AKIHABRA") or (s == "AKIHABR") or (s == "AKIHBARA") or (s == "AKIHBAR") or (s == "AKIHBRA") or (s == "AKIHBR")
or (s == "KIHABARA") or (s == "KIHABAR") or (s == "KIHABRA") or (s == "KIHABR") or (s == "KIHBARA") or (s == "KIHBAR") or (s == "KIHBRA") or (s == "KIHBR"):
     print("YES")
else:
    print("NO")

Fixed submission:
s = input()
# AKIHABARA
if (s == "AKIHABARA") or (s == "AKIHABAR") or (s == "AKIHABRA") or (s == "AKIHABR") or (s == "AKIHBARA") or (s == "AKIHBAR") or (s == "AKIHBRA") or (s == "AKIHBR") or (s == "KIHABARA") or (s == "KIHABAR") or (s == "KIHABRA") or (s == "KIHABR") or (s == "KIHBARA") or (s == "KIHBAR") or (s == "KIHBRA") or (s == "KIHBR"):
     print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s = input()
if s in "AC":
  print("Yes")
 else:
  print("No")

Fixed submission:
s = input()
if "AC" in s:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = [a[0]]
for i in range(n-1):
    ans.append(a[i+1])
    ans = ans[::-1]
print(*ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
print(*(a[::-2]+a[n%2::2]))
Buggy python submission (verdict: Runtime Error):
s=str(input())
for i in s:
    if s[i]==",":
        s=s[:i]+" "+s[i+1:]
print(s)

Fixed submission:
s=str(input())
for i in range(len(s)):
    if s[i]==",":
        s=s[:i]+" "+s[i+1:]
print(s)
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
if b == "+":
    print(a+c)
else:
    print(a-b)

Fixed submission:
a,b,c = input().split()
if b == "+":
    print(int(a)+int(c))
else:
    print(int(a)-int(c))
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
for i in range(h):
  c = list(map(int,input().split()))
  print(c)
  print(c)

Fixed submission:
h,w = map(int,input().split())
for i in range(h):
  c = input()
  print(c)
  print(c)
Buggy python submission (verdict: Runtime Error):
unchi

Fixed submission:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, D = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

    d2=D**2
    cnt=0
    for x,y in S:
        if x**2+y**2<=d2:
            cnt+=1
    print(cnt)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)

def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    N = input()
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    s=N[-1]
    l1=("2","4","5","7","9")
    l2=("0","1","6","8")
    if s in l1:
        print('hon')
    elif s in l2: print('pon')
    else: print("bon")






if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter

from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#l=deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
#dequeを使うときはpython3を使う、pypyはダメ
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds

#mod = 10**9+7
#w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え
#start 4:00
N = int(input())
#N, K = map(int, input().split())
#L = [int(input()) for i in range(N)]
#A = list(map(int, input().split()))
#S = [list(map(int, input().split())) for i in range(N)]



A = list(map(int, input().split()))
edge = [[] for i in range(N)]
for i in range(N-1):
    x,y = map(int,input().split())
    edge[x-1].append(y-1)
    edge[y-1].append(x-1)


#始点sから各頂点への最短距離
inf=10**10
dp = [inf]*N
visited=[False]*N
q=[]
q=deque(q)
ans=[0]*N

def dfs(e):
    visited[e]=True
    a=A[e]
    ci=bisect_left(dp,a)
    q.append((ci,dp[ci]))
    dp[ci]=a
    ans[e]=bisect_left(dp,inf)
    #print(edge[e])
    for ne in edge[e]:
        if not visited[ne]:
            dfs(ne)
            pi,px=q.pop()
            dp[pi]=px


dfs(0)
    #print(d)
    
for x in ans:
    print(x)
#print(d[4])



Fixed submission:
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter

from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
#dequeを使うときはpython3を使う、pypyはダメ
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds

#mod = 10**9+7
#w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

K = int(input())
A,B = map(int, input().split())
#L = [int(input()) for i in range(N)]
#A = list(map(int, input().split()))
#S = [list(map(int, input().split())) for i in range(N)]


if A%K==0 or B%K==0:
    print('OK')
    exit()

elif A//K<B//K:
    print('OK')
    exit()
print('NG')
Buggy python submission (verdict: Runtime Error):
import sys
import math
import queue
import copy
import bisect#2分探索
from collections import deque #popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s): return sorted(range(len(s)), key=lambda k: s[k])

#mod = 10**9+7

S = int(input())
#N, K = map(int, input().split())
#L = [int(input()) for i in range(N)]
#A = list(map(int, input().split()))
#S = [inputl() for i in range(H)]
#q = queue.Queue() #q.put(i) #q.get() 
#q = queue.LifoQueue() #q.put(i) #q.get() 

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b=copy.deepcopy(a)  #2次元配列はこうコピーする
#w.sort(key=lambda x:x[1],reverse=True)  #二個目の要素で降順並び替え

#素数リスト
# n = 100
# primes = set(range(2, n+1))
# for i in range(2, int(n**0.5+1)):
#     primes.difference_update(range(i*2, n+1, i))
# primes=list(primes)

#bisect.bisect_left(a, 4)#aはソート済みである必要あり。aの中から4未満の位置を返す。rightだと以下
#bisect.insort_left(a, 4)#挿入

ss=str(S)
# #print(ss)
ls=len(ss)
# l=[0]*(ls+1)

    #print(l[i])
#print(l)

import heapq #優先度付きqueue

kl=dict()
kl[0]=1
# a = [0]
# heapq.heapify(a)  # aを優先度付きキューに

for i in range(0,ls):
    tmp=(S%10**(i+1))%2019
    kl[tmp]=kl.get(tmp,0)+1
#print(a)


ans=0

for k in kl:
    val=kl[k]
    ans+=val*(val-1)//2

print(ans)
# cur=-1
# ans=0
# for i, li in enumerate(l):
#     if cur==-1:
#         cur=li
#         count=1
#     elif li==cur:
#         count+=1
#     else:
#         ans+=count*(count-1)//2
#         cur=li
#         count=1

# print(ans)

Fixed submission:
import sys
import math
import queue
import copy
import bisect#2分探索
from collections import deque #popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s): return sorted(range(len(s)), key=lambda k: s[k])

#mod = 10**9+7

#N = int(input())
S,W = map(int, input().split())
#L = [int(input()) for i in range(N)]
#A = list(map(int, input().split()))
#S = [inputl() for i in range(H)]
#q = queue.Queue() #q.put(i) #q.get() 
#q = queue.LifoQueue() #q.put(i) #q.get() 

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b=copy.deepcopy(a)  #2次元配列はこうコピーする
#w.sort(key=lambda x:x[1],reverse=True)  #二個目の要素で降順並び替え

#素数リスト
# n = 100
# primes = set(range(2, n+1))
# for i in range(2, int(n**0.5+1)):
#     primes.difference_update(range(i*2, n+1, i))
# primes=list(primes)

#bisect.bisect_left(a, 4)#aはソート済みである必要あり。aの中から4未満の位置を返す。rightだと以下
#bisect.insort_left(a, 4)#挿入

if S<=W:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, M = map(int, input().split())
    A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

	print(max(-1,N-sum(A)))




if __name__ == "__main__":
    main()

Fixed submission:

# -*- coding: utf-8 -*-
N,M=map(int, input().split())
As=list(map(int, input().split()))


tot=sum(As)
if tot>N:
    print(-1)
else:
    print(N-tot)
Buggy python submission (verdict: Time Limit Exceeded):

# -*- coding: utf-8 -*-
import math
K=int(input())

count=0

for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            cal=math.gcd(math.gcd(a,b),c) 
            #print(cal)
            count+=cal
            

print(count)

Fixed submission:

# -*- coding: utf-8 -*-
import math
K=int(input())

count=0

for a in range(1,K+1):
    for b in range(a,K+1):
        for c in range(b,K+1):
            cal=math.gcd(math.gcd(a,b),c) 
            #print(cal)
            if a!=b and b!=c:
                count+=cal*6
            elif a==b==c:
                count+=cal
            else:
                count+=cal*3
            

print(count)
Buggy python submission (verdict: Runtime Error):
from demical import Demical
a,b,c=input().split()
a=Demical(a)
b=Demical(b)
c=Demical(c)
if a**0.5+b**0.5<c**0.5:
  print('Yes')
else:
  print('No')

Fixed submission:
# -*- coding: utf-8 -*-
a, b, c=map(int,input().split())


if c>a+b and int(4*a*b)<int((c-a-b)**2):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import math
H=input()
W=input()
N=input()
m=max(H,W)
print(math.ceil(N/m))

Fixed submission:
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N=len(v)
    size=len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    #N = int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列


    import math
    H=int(input())
    W=int(input())
    N=int(input())
    m=max(H,W)
    print(math.ceil(N/m))



if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
As = list(map(lambda x: int(x), input().split()))


for _ in range(m):
  maxa=-1
  for i,a in enumerate(As):
    if maxa<a:
      maxa=a
      maxi=i
  As.pop(maxi)
  As.append(int(maxa/2))
  #print(As)
print(sum(As))

Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))  # 計算誤差の関係で-1を2回かけてます
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
As = list(map(lambda x: int(x), input().split()))


for _ in range(m):
  maxa=-1
  for i,a in enumerate(As):
    if maxa<a:
      maxa=a
      maxi=i
  As.pop(maxi)
  As.append(int(maxa/2))
  #print(As)
print(sum(As))

Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))  # 計算誤差の関係で-1を2回かけてます
print(-sum(a))
Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)