Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
 
p = list(map(int, input().split()))
 
p = [(e+1) / 2 for e in p]
 
s_max = sum(p[0:k])
 
for i in range(n-k):
  s = s - p[i] + p[i+k]
  if s_max < s:
    s_max = s
    
print(s_max)

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

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)

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

p = [(e+1) / 2 for e in p]

s_max = sum(p[0:k])

for i in range(n-k+1):
  s = s - p[i] + p[i+k]
  if s_max < s:
    s_max = s
    
print(s_max)

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

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
 
p = list(map(int, input().split()))
s_max = 0
 
p = [(e+1) / 2 for e in p]
 
for i in range(n-k+1):
  s = sum(p[i:i+k])
  if s_max < s:
    s_max = s
    
print(s_max)

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

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
 
p = list(map(int, input().split()))
s_max = 0

p = [(e+1) / 2 for e in p]

for i in range(n-k+1):
  s = sum(p[i:i+k])
  if s_max < s:
    s_max = s
    
print(e)

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

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
 
p = list(map(int, input().split()))
s_max = 0
 
for i in range(n-k+1):
  s = sum(p[i:i+k])
  if s_max < s:
    s_max = s
    e = (k+sum(p[i:i+k]))/2
    
print(e)

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

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)
Buggy python submission (verdict: Runtime Error):
h, a = map(int, input(),split())
count = 0

while h > 0:
  count += 1
  h = h - a
 
print(count)

Fixed submission:
h, a = map(int, input().split())
count = 0

while h > 0:
  count += 1
  h = h - a
 
print(count)
Buggy python submission (verdict: Runtime Error):
h, n = map(int, input().split())
a = list(map(int, input().split()))

a = sorted(a)

for i in a:
  h = h - a
 
if h <= 0:
  print('Yes')
else:
  print('No')

Fixed submission:
h, n = map(int, input().split())
a = list(map(int, input().split()))
 
a = sorted(a)
 
for i in a:
  h = h - i
 
if h <= 0:
  print('Yes')
else:
  print('No')

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

a = sorted(a)

for i in a:
  h = h - a
 
if h <= 0:
  print('Yes')
else:
  print('No)

Fixed submission:
h, n = map(int, input().split())
a = list(map(int, input().split()))
 
a = sorted(a)
 
for i in a:
  h = h - i
 
if h <= 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
h = int(input())

count = 0

def cal(h):
  if h = 1:
    count = count + 1
    return 0
  
  return count + cal(int(h/2))) + 1

print(cal(h))

Fixed submission:
h = int(input())
 

def cal(h):
  if h == 1:
    return 1
  
  return 2*cal(int(h/2)) + 1
 
print(cal(h))
Buggy python submission (verdict: Runtime Error):
L = int(input())
# ノード数を決める
for i in range(1,21):
    if (1 << i) > L:
        node = i
        break

# 必ず 0と2^Nの辺を貼る
edge = []
for i in range(node-1):
    edge.append((i+1,i+2,0))
    edge.append((i+1,i+2,1<<i))

# 2の累乗の区間に分割
for i in range(node-1):
    if (L >> i) & 1:
        edge.append((i+1,node,L-(1<<i)))
        L = L-(1<<i)

#出力
print(str(dig) + " " + str(len(edge)))
s = "{0} {1} {2}"
for v,v2,w in edge:
    print(s.format(v,v2,w))

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# 終了後に解説を見て解けた
# パス数が２のべき乗であれば簡単にグラフを構築できることに気付きたかった。
#
# 本番中は、10進法で考えて 頂点1と頂点2の間を辺{0, 100, 200, ..., 900}で繋ぎ、頂点2と頂点3の間を辺{0, 10, ..., 90}で繋ぎ、
# などという事を考えていたが、それ以上進展させることが難しかった。


import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

L = int(input())

v = 1
edges = []  # (from, to, cost)

# L = 37の場合を例にとりコメントを付与
# まず長さ0 ~ 31までのパスを作成する。
#   頂点1 -> 頂点2を0の辺と1の辺で結ぶ
#   頂点2 -> 頂点3を0の辺と2の辺で結ぶ
#   頂点3 -> 頂点4を0の辺と4の辺で結ぶ
#   頂点4 -> 頂点5を0の辺と8の辺で結ぶ
#   頂点5 -> 頂点6を0の辺と16の辺で結ぶ
n = 2
cost = 1
while n <= L:
    edges.append((v, v+1, 0))
    edges.append((v, v+1, cost))
    cost *= 2
    v += 1
    n *= 2

# 頂点6をv_sink(最終到達点)とする
v_sink = v

# ここから先、長さ32, 33, 34, 35, 36のパスを生成することになる。
# 頂点3と頂点6を、32の辺で直でつなぐと、長さ32, 33, 34, 35のパスが作れる。
# 頂点1と頂点6を、36の辺で直でつなぐと、長さ36のパスが作れる。
n //= 2
N = n
L -= N

while L > 0:
    if L >= n:
        edges.append((v, v_sink, N))
        L -= n
        N += n
    n //= 2
    v -= 1

print(v_sink, len(edges))
for e in edges:
    print(*e)
Buggy python submission (verdict: Runtime Error):
s = input()
k = input()

flag = True

for i in range(len(k)):
  if s[i] != 1:
    prtin(s[i])
    flag = false
    break
    
if flag:
  print("1")


Fixed submission:
s = list(input())
k = int(input())
 
flag = True

for i in range(k):
  if s[i] != "1":
    print(s[i])
    flag = False
    break

if flag:
  print("1")
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))

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

S = {0 : 1}
t = 0
for i in range(N):
  t = (t + D[i]) % M
  if t in S:
    S[t] += 1
  else:
    S[t] = 1

r = 0

for i in S.values():
  r += i * (i - 1) // 2
  
print(r)

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

if n % k == 0:
    print("0")
else:
    print("1")

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

if n % k == 0:
    print("0"):
else:
    print("1")


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

if n % k == 0:
    print("0")
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
n = int(input())

c = 0

ans = 'No'
for i in range(15):
    for i in range(26):
        c = 4 * j + 7 * i
    if n == c:
        ans = 'Yes'

print(ans)

Fixed submission:
n = int(input())

c = 0

ans = 'No'

for i in range(15):
    for j in range(26):
        c = 4 * j + 7 * i
        if n == c:
            ans = 'Yes'
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = []
m = 1

def f(m, a):
    s_tmp = 0
    for i in range(n):
        s_tmp = s_tmp + m % a[i]
    return s_tmp

for i in range(n):
    m = m * a[i]

print(f(m-1, a))

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

a.sort()

print(a[2]- a[0])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
s = []
m = 1

def f(m, a):
    s_tmp = 0
    for i in range(n):
        s_tmp = s_tmp + m % a[i]
    return s_tmp

for i in range(n):
    m = m * a[i]

for i in range(1,m):
    s.append(f(i, a))

print(max(s))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = []
m = 1

def f(m, a):
    s_tmp = 0
    for i in range(n):
        s_tmp = s_tmp + m % a[i]
    return s_tmp

for i in range(n):
    m = m * a[i]

print(f(m-1, a))
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n % 2 == 0:
  print(n)
else:
  print(2*n

Fixed submission:
n = int(input())

if n % 2 == 0:
  print(n)
else:
  print(2*n)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

for i in range(1, 1000000000):
  if i%2==0 and i%n==0:
    print(i)
    break
    

Fixed submission:
n = int(input())

if n % 2 == 0:
  print(n)
else:
  print(2*n)
Buggy python submission (verdict: Runtime Error):
s = 10000000

for i in range(2+max(a)):
  s_tmp = 0
  
  for j in range(n):
    s_tmp = s_tmp + abs(a[l] - i - (j+1))
    
    if s_tmp < s:
      s = s_tmp


Fixed submission:
n = int(input())

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

sorted_num = sorted([a[i] - i for i in range(len(a))])

b = sorted_num[len(sorted_num)//2]
print(sum([abs(b-i) for i in sorted_num]))

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

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

for i in range(2+max(a)):
  s_tmp = 0
  
  for j in range(n):
    s_tmp = s_tmp + abs(a[l] - i - (j+1))
    
    if s_tmp < s:
      s = s_tmp

print(s)

Fixed submission:
n = int(input())

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

sorted_num = sorted([a[i] - i for i in range(len(a))])

b = sorted_num[len(sorted_num)//2]
print(sum([abs(b-i) for i in sorted_num]))
Buggy python submission (verdict: Runtime Error):
d, n = map(int, input().split())

c = 100　** d

a = c * n

print(a)


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

c = pow(100, d)

if n  != 100:
    a = c * n
else:
    a = c * (n+1)

print(a)
Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().split())

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

cost = 0

for i in range(N):
    if array[i][1] <= T and (cost == 0 or cost < array[i][0]:
    　   cost = arrayp[i][0]
if cost == 0:
    print('TLE')
print(cost)


Fixed submission:
N, T = map(int, input().split())
array = [list(map(int, input().split())) for i in range(N)]

cost = 0
time = 0

for i in range(N):
    if array[i][1] <= T and (cost > array[i][0] or cost == 0):
        cost = array[i][0]

if cost == 0:
    print('TLE')
    exit()

print(cost)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
T = input()


for i in range(len(S)):
    S_ch = [j for j, x in enumerate(S) if x == S[i]]
    T_ch = [j for j, x in enumerate(T) if x == T[i]]
    if S_ch != T_ch:
        print('No')
        exit()

print('Yes')


Fixed submission:
S = input()
T = input()

string = ''

for i in range(len(S)):
    if S[i] not in string:
        S_ch = [j for j, x in enumerate(S) if x == S[i]]
        T_ch = [j for j, x in enumerate(T) if x == T[i]]
        string += S[i]
        if S_ch != T_ch:
            print('No')
            exit()

print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()

S = [s[i] for i in range(len(s))]
T = [t[i] for i in range(len(t))]

for i in range(len(S)):
    S_ch = [j for j, x in enumerate(S) if x == S[i]]
    T_ch = [j for j, x in enumerate(T) if x == T[i]]
    if S_ch != T_ch:
        print('No')
        exit()

print('Yes')


Fixed submission:
S = input()
T = input()

string = ''

for i in range(len(S)):
    if S[i] not in string:
        S_ch = [j for j, x in enumerate(S) if x == S[i]]
        T_ch = [j for j, x in enumerate(T) if x == T[i]]
        string += S[i]
        if S_ch != T_ch:
            print('No')
            exit()

print('Yes')
Buggy python submission (verdict: Runtime Error):
N = int(input())

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

for i in range(N - 1):
    if word.count(word[i]) != 1:
        print('No')
        exit()

for i in range(1, N):
    if word[i][0] != word[i - 1][-1]:
        print('No')
        exit()

print('Yes')


Fixed submission:

A, B = map(int, input().split())

AB = A * B

for C in range(1, 4):
    if (AB * C) % 2 == 1:
        print('Yes')
        exit()

print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())

word = []

for i in range(N):
    word.append(input())

for i in range(N - 1):
    if word.count(word[i]) != 1:
        print('No')
        exit()


for i in range(1, N ):
    if word[i][0] != word[i - 1][-1]:
        print('No')
        exit()

print('Yes')


Fixed submission:

A, B = map(int, input().split())

AB = A * B

for C in range(1, 4):
    if (AB * C) % 2 == 1:
        print('Yes')
        exit()

print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())

word = [word.append(input()) for i in range(N)]


for i in range(1, N):
    if word[i][0] != word[i - 1][-1] or word.count(word[i]) != 1:
        print('No')
        exit()

print('Yes')



Fixed submission:
N = int(input())

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

for i in range(N - 1):
    if word.count(word[i]) != 1:
        print('No')
        exit()

for i in range(1, N):
    if word[i][0] != word[i - 1][-1]:
        print('No')
        exit()

print('Yes')
Buggy python submission (verdict: Runtime Error):
H,A=map(int,input().split())
pattern = [i for i in list(map(int,input().split()))  ]
a = max(pattern)
pattern.remove(a)
b= max(pattern)
if a+b < H:
    print("No")
else:
    print("Yes")

Fixed submission:
H,A=map(int,input().split())
pattern = list(map(int,input().split()))  
a = sum(pattern)
if a < H:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
N=int(input())
permu = list(map(int,input().split()))
cnt=0
for index,num in enumerate(permu):
    if num <= min(permu[:index+1]):
        cnt+=1
    
    else:
        continue
print(cnt)        
    

Fixed submission:
N,M =map(int,input().split())
if N > M:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
a=math.gcd(A,B)
b=A*B//a
print(b)

Fixed submission:
import fractions
A,B=map(int,input().split())
a=fractions.gcd(A,B)
b=A*B//a
print(b)
Buggy python submission (verdict: Runtime Error):
mport itertools
import math
N=int(input())
a=[]
kyori_list=[]
for i in range(N):
    x,y=map(int,input().split())
    a.append((x,y))
for j in itertools.permutations(a):
    k=list(j)
    
    cnt=0
    sum=0
    while cnt<N-1:
        kryoi=0
        kyori=((k[cnt+1][0]-k[cnt][0])**2+(k[cnt+1][1]-k[cnt][1])**2)**(1/2)
        cnt+=1
        
        sum+=kyori
    kyori_list.append(sum)
c=0

for i in kyori_list:
    c+=i
    
    
print(c/math.factorial(N))

Fixed submission:
import itertools
import math
N=int(input())
a=[]
kyori_list=[]
for i in range(N):
    x,y=map(int,input().split())
    a.append((x,y))
for j in itertools.permutations(a):
    k=list(j)
    
    cnt=0
    sum=0
    while cnt<N-1:
        kryoi=0
        kyori=((k[cnt+1][0]-k[cnt][0])**2+(k[cnt+1][1]-k[cnt][1])**2)**(1/2)
        cnt+=1
        
        sum+=kyori
    kyori_list.append(sum)
c=0

for i in kyori_list:
    c+=i
    
    
print(c/math.factorial(N))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for i in range(1,N+1):
    if N%i==0:
        x=i+N//i
        a.append(x)
b=min(a)
print(b-2)

Fixed submission:
N=int(input())
a=[]
for i in range(1,int(N**(1/2)+1)):
    if N%i==0:
        x=i+N//i
        a.append(x)
b=min(a)
print(b-2)
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
hito=[]
points=[]
for _ in range(Q):
    hito.append(int(input()))
for _ in range(N):
    points.append(K)
for i in hito:
    for j in list(range(0,i-1))+list(range(i,N)):
        points[j]-=1
for point in points:
    if point>0:
        print("Yes")
    else:
        print("No")
    

Fixed submission:
N,K,Q=map(int,input().split())
hito=[]
points=[]
for _ in range(Q):
    hito.append(int(input()))
for _ in range(N):
    points.append(K-Q)
for i in hito:
    points[i-1]+=1
for j in points:
    if j>0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
idou=[]
i=0
cnt=0
if N==1:
    print(0)
elif N==2:
    if h[1]-h[0]>=0:
        print(1)
    else:
        print(0)
else:
    while i<=N-2:
        if h[i]>=h[i+1]:
            cnt+=1
            if i==N-2:
                idou.append(cnt)
        else:
            idou.append(cnt)
            cnt=0
        i+=1

print(max(idou))        

Fixed submission:
N=int(input())
h=list(map(int,input().split()))
idou=[]
i=0
cnt=0
if N==1:
    print(0)
elif N==2:
    if h[1]-h[0]<=0:
        print(1)
    else:
        print(0)
else:
    while i<=N-2:
        if h[i]>=h[i+1]:
            cnt+=1
            if i==N-2:
                idou.append(cnt)
        else:
            idou.append(cnt)
            cnt=0
        i+=1

    print(max(idou))

Buggy python submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
idou=[]
i=0
cnt=0
while i<=N-2:
    if h[i]>=h[i+1]:
        cnt+=1
        if i==N-2:
            idou.append(cnt)
    else:
        idou.append(cnt)
        cnt=0
    i+=1

print(max(idou))        

Fixed submission:
N=int(input())
h=list(map(int,input().split()))
idou=[]
i=0
cnt=0
if N==1:
    print(0)
elif N==2:
    if h[1]-h[0]<=0:
        print(1)
    else:
        print(0)
else:
    while i<=N-2:
        if h[i]>=h[i+1]:
            cnt+=1
            if i==N-2:
                idou.append(cnt)
        else:
            idou.append(cnt)
            cnt=0
        i+=1

    print(max(idou))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N=int(input())
gu=list(map(int,input().split()))
ans=[]
for v in itertools.permutations(gu):
    cnt=2
    k=(v[0]+v[1])/2
    while cnt<=N-1:
        k=(k+v[cnt])/2
        cnt+=1
    ans.append(k)
print(max(ans))        
        

Fixed submission:
N=int(input())
gu=list(map(int,input().split()))
gu.sort()
ans=[]
cnt=2
k=(gu[0]+gu[1])/2
while cnt<=N-1:
        k=(k+gu[cnt])/2
        cnt+=1
    
print(k)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for _ in range(N):
    a.append(int(input()))
for i in range(N):
    new=a[:i]+a[i+1:]
    print(max(new))

Fixed submission:
N=int(input())
a=[]
for _ in range(N):
    a.append(int(input()))
x=sorted(a,reverse=True)
m1=x[0]
m2=x[1]
for i in a:
    if i==m1:
        print(m2)
    else:
        print(m1)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,D=map(int,input().split())
a=[i for i in range(A,B+1) if i%C==0 or i%D==0]
print(B-A+1-len(a))

Fixed submission:
import fractions
A,B,C,D=map(int,input().split())
c=B//C-(A-1)//C
d=B//D-(A-1)//D
lm=C*D//fractions.gcd(C,D)
cd=B//lm-(A-1)//lm

print(B-A+1-c-d+cd)
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
l=list(map(int,input().split()))
d=0
cnt=1
while True:
    
    d+=l[cnt-1]
    if d>X:
        print(cnt)
        break
    cnt+=1
    
else:
    
    print(cnt)

Fixed submission:
N,X=map(int,input().split())
l=list(map(int,input().split()))
d=0
cnt=1
while True:
    
    d+=l[cnt-1]
    if d>X:
        print(cnt)
        break
    cnt+=1
    if cnt==N+1:
        print(N+1)
        break
else:
    
    print(cnt)
Buggy python submission (verdict: Runtime Error):
N=int(input())
rest=[]
for i in range(1,N+1):
    s,p=input().split()
    p=int(p)
    rest.append((s,-p,i))



for i in range(N):
    print(x[i][2])
    

    


Fixed submission:
N=int(input())
rest=[]
for i in range(1,N+1):
    s,p=input().split()
    p=int(p)
    rest.append((s,-p,i))

x=sorted(rest)


for i in range(N):
    print(x[i][2])

Buggy python submission (verdict: Runtime Error):
N=int(input())
rest=[]
for i in range(1,N+1):
    s,p=input().split()
    p=int(p)
    rest.append((s,-p,i))


print(x)
for i in range(N):
    print(x[i][2])
    

    


Fixed submission:
N=int(input())
rest=[]
for i in range(1,N+1):
    s,p=input().split()
    p=int(p)
    rest.append((s,-p,i))

x=sorted(rest)


for i in range(N):
    print(x[i][2])
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split()))
if a[0]==a[1]:
  　print(2*a[0])
else:
　　print(2max(a)-1)

Fixed submission:
a=list(map(int,input().split()))
if a[0]==a[1]:
    print(2*a[0])
else:
    print(2*max(a)-1)
Buggy python submission (verdict: Runtime Error):
a=[]
b=[]
for _ in range(5):
    a.append(int(input()))
for i in  a:
    if i%10!=0:
        b.append(10-i%10)
if b:
             
    b.remove(max(b))
c=sum(b)
print(sum(a)+c)
print(sum(l))

Fixed submission:
a=[]
b=[]
for _ in range(5):
    a.append(int(input()))
for i in  a:
    if i%10!=0:
        b.append(10-i%10)
if b:
             
    b.remove(max(b))
c=sum(b)
print(sum(a)+c)

Buggy python submission (verdict: Runtime Error):
a=[]
b=[]
for _ in range(5):
    a.append(int(input()))
for i in  a:
    if i%10!=0:
        b.append(10-i%10)
b.remove(max(b))
c=sum(b)
print(sum(a)+c)
    

Fixed submission:
a=[]
b=[]
for _ in range(5):
    a.append(int(input()))
for i in  a:
    if i%10!=0:
        b.append(10-i%10)
if b:
             
    b.remove(max(b))
c=sum(b)
print(sum(a)+c)
Buggy python submission (verdict: Runtime Error):
S=input()
b=["A","T","G","C"]
cntl=[]
cnt=0
for i in S:
    if i in b:
        cnt+=1
    else:
        cntl.append(cnt)
        cnt=0
print(max(cntl))

Fixed submission:
S=input()
b=["A","T","G","C"]
cntl=[]
cnt=0
for i in S:
    if i in b:
        cnt+=1
    else:
        cntl.append(cnt)
        cnt=0
else:
    cntl.append(cnt)
print(max(cntl))
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
shop=[]
for _ in range(N):
    a=list(map(int,input().split()))
    shop.append(a)
shop.sort(key=lambda x: x[0])
cnt=0
p=0
i=0

while cnt<=M:
    a=shop[i][0]
    b=shop[i][1]
    cnt+=b
    p+=a*b
    i+=1
su=cnt-M

a = shop[i-1][0]
p-=a*su
print(p)


Fixed submission:
N,M=map(int,input().split())
shop=[]
for _ in range(N):
    a=list(map(int,input().split()))
    shop.append(a)
shop.sort(key=lambda x: x[0])
cnt=0
p=0
i=0

while cnt<M:
    a=shop[i][0]
    b=shop[i][1]
    cnt+=b
    p+=a*b
    i+=1
su=cnt-M

a = shop[i-1][0]
p-=a*su
print(p)
Buggy python submission (verdict: Runtime Error):
import bisect
 
 
n, k = map(lambda x: int(x), input().split())
a = list(map(lambda x: int(x), input().split()))
 
a.sort()
pos = bisect.bisect(a, 0)
 
def judge(cur):
    global n, k, a
    cnt, j = 0, 1
    for i in range(pos):
        while(j < len(a) and (i == j or a[i] * a[j] > cur)): j += 1
        if(j >= len(a)): break
        cnt += (len(a) - j)
 
    j = len(a) - 1
    for i in range(pos, len(a)):
        while(j > i and (i == j or a[i] * a[j] > cur)): j -= 1
        if(i >= j): break
        cnt += (j-i)
 
    if(cnt >= k): return True
    else: return False
 
 
l, r = int(-1e18), int(1e18)
while(l < r):
    m = (l+r)>>1
    if(judge(m)): r = m
    else: l = m + 1

if(judge(r) == False): r -= 1
print(r)

Fixed submission:
a = set(map(lambda x: int(x), input().split()))

if(len(a) == 2):
    print('Yes')
else: print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]

def d_or_n(N, A):

    while True:
        for i in range(N-1):
            for j in range(i+1, N):
                if A[i] == A[j]:
                    print('NO')     
                    return False      
        print('YES')
        break

d_or_n(N, A)


Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

if len(A) != len(set(A)):
    print('NO')
else:
    print('YES')

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]

flag = True

while flag:
    for i in range(N-1):
        for j in range(i+1, N):
            if A[i] == A[j]:
                print('NO')     
                flag = False      
while flag:
    print('YES')

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

if len(A) != len(set(A)):
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
a = np.array(a)
a = a[a%2==0]

for i in range(n):
    if a[i]%3 != 0 and a[i]%5 != 0:
        return print("APPROVED")

return print("DENIED")

Fixed submission:
import numpy as np
import sys

n = int(input())
a = list(map(int, input().split()))
a = np.array(a)
a = a[a%2==0]

for i, j  in enumerate(a):
    if j%3 != 0 and j%5 != 0:
        print("DENIED")
        sys.exit()

print("APPROVED")