Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
a_n = list(map(int,input().split()))

#辞書dの0でない要素の数を返す関数
def count_dict(d):
    list = d.values()
    cnt_dict = 0
    for i in list:
        if i == 0:
            cnt_dict += 1
    return len(d) - cnt_dict

dict = {}
for i in a_n:
    if i in dict:
        dict[i] += 1
    else:
        dict[i] = 1

cnt = 0
while count_dict(dict) > K:
    minimum = 100000000
    flag = False
    for i in dict.values():
        if i <= minimum and i != 0:
            minimum = i
    for j in dict:
        if dict[j] == minimum:
            dict[j] = 0
            cnt += minimum
            flag = True
        if flag == True:
            break
print(cnt)

Fixed submission:
import collections

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

dict = collections.Counter(a_n)

v_list = list(dict.values())
v_list_s = sorted(v_list)

cnt = 0
if len(v_list_s) <= K:
    print(0)
else:
    x = len(v_list_s) - K
    for i in range(x):
        cnt += v_list_s[i]
    print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())

cnt = 0
for i in range(len(s)-2):
    if s[i] == '#' and s[i+1] == '.':
        if s[i+2] == '.':
            s[i] = '.'
        else:
            s[i+1] = "#"

        cnt += 1

if s[-2] == "#" and  s[-1] == ".":
    s[-1] = "#"
    cnt += 1

print(cnt)


Fixed submission:
n = int(input())
s = list(input())

w_sum = [0]
b_sum = [0]
for i in range(len(s)):
    if s[i] == '.':
        w_sum.append(w_sum[-1] + 1) 
        b_sum.append(b_sum[-1])
    else:
        b_sum.append(b_sum[-1] + 1)
        w_sum.append(w_sum[-1])

assert len(w_sum) == len(b_sum)
assert len(w_sum) == len(s) + 1

minSum = 10 ** 5
for i in range(len(s)):
    minSum = min(minSum, b_sum[i] + (w_sum[-1] - w_sum[i+1]))
    
print(minSum)

# .##...####... ->
# ......#######
Buggy python submission (verdict: Runtime Error):
import functools

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b / gcd(a, b)

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

lcmVal = int(functools.reduce(lcm, a))
print(sum(map(lambda x: (lcmVal-1) % x, a)))


Fixed submission:
import functools

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b / gcd(a, b)

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

lcmVal = int(functools.reduce(lcm, a, 0))
print(sum(map(lambda x: (lcmVal-1) % x, a)))

Buggy python submission (verdict: Runtime Error):
import functools

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b / gcd(a, b)

N = int(input())
a = list(map(int, input().split()))
assert(len(a) == N)

lcmVal = int(functools.reduce(lcm, a))
print(sum(map(lambda x: (lcmVal-1) % x, a)))


Fixed submission:
import functools

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b / gcd(a, b)

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

lcmVal = int(functools.reduce(lcm, a, 0))
print(sum(map(lambda x: (lcmVal-1) % x, a)))

Buggy python submission (verdict: Runtime Error):
import functools

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b / gcd(a, b)

N = int(input())
a = list(map(int, input().split()))
assert(len(a) == N)

lcmVal = int(functools.reduce(lcm, a))
print(lcmVal)
print(sum(map(lambda x: (lcmVal-1) % x, a)))


Fixed submission:
import functools

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b / gcd(a, b)

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

lcmVal = int(functools.reduce(lcm, a, 0))
print(sum(map(lambda x: (lcmVal-1) % x, a)))
Buggy python submission (verdict: Time Limit Exceeded):
def digit_sum(n, s):
    if s > n:
        return -1
    if s == n:
        return n + 1

    b = 2
    while b**2 < n:
        if f(b, n) == s:
            return b

        b += 1

    p = int(n * 0.5)
    while p >= 1:
        b = (n - s) // p + 1
        if b > 1 and f(b, n) == s:
            return b
        
        p -= 1

    return -1


def f(b, n):
    if n < b:
        return n

    return f(b, n // b) + (n % b)

def solve():
    n = int(input())
    s = int(input())
    result = digit_sum(n, s)
    print(result)

solve()


Fixed submission:
def digit_sum(n, s):
    if s > n:
        return -1
    if s == n:
        return n + 1

    b = 2
    while b**2 < n:
        if f(b, n) == s:
            return b

        b += 1

    p = int(n ** 0.5)
    while p >= 1:
        b = (n - s) // p + 1
        if b > 1 and f(b, n) == s:
            return b
        
        p -= 1

    return -1


def f(b, n):
    if n < b:
        return n

    return f(b, n // b) + (n % b)

def solve():
    n = int(input())
    s = int(input())
    result = digit_sum(n, s)
    print(result)

solve()

Buggy python submission (verdict: Runtime Error):
def digit_sum(n, s):
    if s > n:
        return -1
    if s == n:
        return n + 1

    b = 2
    while b**2 < n:
        if f(b, n) == s:
            return b

        b += 1

    p = 1
    while p**2 < n:
        b = (n - s) // p + 1
        if f(b, n) == s:
            return b
        
        p += 1

    return -1


def f(b, n):
    if n < b:
        return n

    return f(b, n // b) + (n % b)

def solve():
    n = int(input())
    s = int(input())
    result = digit_sum(n, s)
    print(result)

solve()


Fixed submission:
def digit_sum(n, s):
    if s > n:
        return -1
    if s == n:
        return n + 1

    b = 2
    while b**2 < n:
        if f(b, n) == s:
            return b

        b += 1

    p = int(n ** 0.5)
    while p >= 1:
        b = (n - s) // p + 1
        if b > 1 and f(b, n) == s:
            return b
        
        p -= 1

    return -1


def f(b, n):
    if n < b:
        return n

    return f(b, n // b) + (n % b)

def solve():
    n = int(input())
    s = int(input())
    result = digit_sum(n, s)
    print(result)

solve()
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=0
for i in range(a):
  c=input().split()
  if c[1]=='BTC':
    b+=(float)c[0]*380000.0
  else:
    b+=(float)c[0]
print(b)
    
    
  
  


Fixed submission:
a=input().split('/')
if int(a[1])<=4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=0
for i in range(a):
  c=input().split()
  if c[1]=='BTC':
    b+=(float)c[0]*380000.0
  else:
    b+=(int)c[0]
print(b)
    
    
  
  


Fixed submission:
a=input().split('/')
if int(a[1])<=4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=0
for i in range(a):
  c=input().split()
  if c[1]='BTC':
    b+=(float)c[0]*380000.0
  else:
    b+=(int)c[0]
print(b)
    
    
  
  


Fixed submission:
a=input().split('/')
if int(a[1])<=4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
a=input().split('/')
if int(a[1]<=4):
  print("Heisei")
else:
  print("TBD")
  
  

Fixed submission:
a=input().split('/')
if int(a[1])<=4:
  print("Heisei")
else:
  print("TBD")
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [0] * m
r = [0] * m
for i in range(0,m):
	l[i], r[i] = map(int, input().split())

count = 0
for i in range(1,n+1):
	
	if max(l) <= i <= min(r):
		count += 1
			
print(count)
		

Fixed submission:
n,m = map(int,input().split())
l = [0] * m
r = [0] * m
for i in range(0,m):
	l[i], r[i] = map(int, input().split())

count = 0

max_l = max(l)
min_r = min(r)

for i in range(1,n+1):
	
	if max_l <= i <= min_r:
		count += 1
			
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [0] * m
r = [0] * m
for i in range(0,m):
	l[i], r[i] = map(int, input().split())
			
count = 0
for i in range(1,n+1):
	ok_count = 0
	for j in range(0,len(l)):
		if l[j] <= i <= r[j]:
			ok_count += 1
			
		if ok_count == len(l):
			count += 1
			
print(count)
		

Fixed submission:
n,m = map(int,input().split())
l = [0] * m
r = [0] * m
for i in range(0,m):
	l[i], r[i] = map(int, input().split())

count = 0

max_l = max(l)
min_r = min(r)

for i in range(1,n+1):
	
	if max_l <= i <= min_r:
		count += 1
			
print(count)
Buggy python submission (verdict: Runtime Error):
n,k= list(map(int, input().split()))
s = input()


s = s[:n+1]
print( s[:k] + s[k].lower() + s[k+1:-1])


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


print(s[:k] + s[k].lower() + s[k+1:])

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

abc = "ABCAB" * 10

abc = abc[:n+1]
print( abc[:k] + abc[k].lower() + abc[k+1:-1])


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


print(s[:k] + s[k].lower() + s[k+1:])
Buggy python submission (verdict: Runtime Error):
import sys

s = input()
s = s[:4]
a = s[:2]
b = s[2:]

if (int(a) > 12 and int(b) > 12) or  int(b) == 0  or int(a) == 0:
	
	print("NA")
	sys.exit()
	
if 0 <  int(a) <= 12 and 0 <  int(b) <= 12:

	
if int(a) > 12 and 0 < int(b) <= 12:

	print("YYMM")
	sys.exit()

if 0 < int(a) <= 12 and int(b) > 12:

	print("MMYY")
	sys.exit()

print("AMBIGUOUS")




Fixed submission:
import sys

s = input()
s = s[:4]
a = s[:2]
b = s[2:]

	
if 0 <  int(a) <= 12 and 0 <  int(b) <= 12:

	print("AMBIGUOUS")
	sys.exit()


if int(a) >= 0 and 0 < int(b) <= 12:

	print("YYMM")
	sys.exit()
#１~12で0より上なら
if 0 < int(a) <= 12 and int(b) >= 0:

	print("MMYY")
	sys.exit()

print("NA")
Buggy python submission (verdict: Runtime Error):
import math
import functools
import fractions

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

if max(v) % 2 ==0:
	b = True
else:
	b = False
		
v.sort()

for index,_ in enumerate(v):
	if _  % 2 ==0:
		if not b:
			v[index] = v[-1]
			break
			
	else:
		if b:
			v[index] = v[-1]
			break
				
#ans = functools.reduce(math.gcd,v)
#ans = v[0]
for i in range(1,len(v)):
	ans = fractions.gcd(ans, v[i])
	
print(ans)



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

while t + 0.5 > tt + a:
	c+= b
	tt += a	

	
print(c)

Buggy python submission (verdict: Runtime Error):
import math
import functools

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

if max(v) % 2 ==0:
	b = True
else:
	b = False
		
v.sort()

for index,_ in enumerate(v):
	if _  % 2 ==0:
		if not b:
			v[index] = v[-1]
			break
			
	else:
		if b:
			v[index] = v[-1]
			break
			
ans = functools.reduce(math.gcd,v)
print(ans)



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

while t + 0.5 > tt + a:
	c+= b
	tt += a	

	
print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
v = [int(input()) for _ in range(n)]
c = [int(input()) for _ in range(n)]

a=0
b=0

for _ in range(n):
	if v[_] > c[_]:
		a += v[_]
		b += c[_]
		
print(a-b)

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


a=0
b=0

for _ in range(n):
	if v[_] > c[_]:
		a += v[_]
		b += c[_]
		
print(a-b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h_list = [int(input()) for h in range(n)]

count = 0
last_h = 0
for index,h in enumerate(h_list):
	if last_h <= h:
		count += 1
	
	if last_h < h:
		last_h = h

print(count)
		
	
	

Fixed submission:
n = int(input())
h_list = list(map(int, input().split()))
h_list = h_list[:n]
count = 0
last_h = 0
for index,h in enumerate(h_list):
	if last_h <= h:
		count += 1
	
	if last_h <= h:
		last_h = h

print(count)
Buggy python submission (verdict: Runtime Error):
import sys

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

if 7 in [a,b,c]:
  if filter(lambda x:x ==5,[a,b,c]) is 2:
  	print("YES")
    sys.exit()

print("NO")

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



count = 0
for i in l:
	if i == 5:
		count += 1
		
		if count == 2:
			break

if any([i == 7 for i in l]) and count == 2:
	print("YES")
else:
	print("NO")
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
ans = [0 for i in range(N)]
anss = 0

for i in range(M):
    L,R = list(map(int,input().split()))
    if L == R:
        ans[L-1]+=1
    else:
        for j in range(L-1,R,1):
            ans[j]+=1

maxn = 0
for i in range(M):
    if ans[i] > maxn:
        maxn = ans[i]
        
for i in range(M):
    if ans[i] == maxn:
        anss += 1
print(anss)

Fixed submission:
N,M = list(map(int,input().split()))
L = 1
R = N+1
ans = N*2

for i in range(M):
    tL,tR = list(map(int,input().split()))
    if tR < L or R < tL:
        ans = 0
        break
    if tL > L:
        L = tL
    if tR < R:
        R = tR

print(min(ans,R-L+1))

Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
ans = [0 for i in range(N)]
anss = 0

for i in range(M):
    L,R = list(map(int,input().split()))
    if L == R:
      ans[L-1]+=1
    else:
      for j in range(L-1,R,1):
        ans[j]+=1

maxn = 0
for i in range(M):
    if ans[i] > maxn:
        maxn = ans[i]
        
for i in range(M):
    if ans[i] == maxn:
        anss += 1
print(anss)

Fixed submission:
N,M = list(map(int,input().split()))
L = 1
R = N+1
ans = N*2

for i in range(M):
    tL,tR = list(map(int,input().split()))
    if tR < L or R < tL:
        ans = 0
        break
    if tL > L:
        L = tL
    if tR < R:
        R = tR

print(min(ans,R-L+1))

Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
ans = [0 for i in range(N)]

for i in range(M):
    L,R = list(map(int,input().split()))
    for j in range(L-1,R,1):
        ans[j]+=1

maxn = 0
for i in range(M):
    if ans[i] > maxn:
        maxn = ans[i]
        
print(maxn)

Fixed submission:
N,M = list(map(int,input().split()))
L = 1
R = N+1
ans = N*2

for i in range(M):
    tL,tR = list(map(int,input().split()))
    if tR < L or R < tL:
        ans = 0
        break
    if tL > L:
        L = tL
    if tR < R:
        R = tR

print(min(ans,R-L+1))
Buggy python submission (verdict: Runtime Error):
s = str(input())
if s[0] == "0" and s[1] == "0" and int(s[2]+s[3]) > 12:
    print("NA")
elif s[2] == "0" and s[3] == "0" and int(s[0]+s[1]) > 12:
    print("NA")
elif s = "0000":
    print("NA")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) > 12:
    print("NA")
elif s[0] == "0" and s[1] == "0":
    print("YYMM")
elif s[2] == "0" and s[3] == "0":
    print("MMYY")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) <= 12:
    print("YYMM")
elif int(s[2]+s[3]) > 12 and int(s[0]+s[1]) <= 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Fixed submission:
s = str(input())
if s[0] == "0" and s[1] == "0" and int(s[2]+s[3]) > 12:
    print("NA")
elif s[2] == "0" and s[3] == "0" and int(s[0]+s[1]) > 12:
    print("NA")
elif s == "0000":
    print("NA")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) > 12:
    print("NA")
elif s[0] == "0" and s[1] == "0":
    print("YYMM")
elif s[2] == "0" and s[3] == "0":
    print("MMYY")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) <= 12:
    print("YYMM")
elif int(s[2]+s[3]) > 12 and int(s[0]+s[1]) <= 12:
    print("MMYY")
else:
    print("AMBIGUOUS")
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [str(input()) for i in range(N)]
ans = 0
a = 0
b = 0
ab = 0
for i in range(N):
    ans += s[i].count('AB')
    if s[i][0] == 'B' and not s[i][-1] == 'A':
        b += 1
    if s[i][-1] == 'A' and not s[i][0] == 'B':
        a += 1
    if s[i][0] == 'B' and s[i][-1] == 'A':
        ab += 1
ans += min(a,b)
ans += ab
print(ans)

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

print(N-K+1)
Buggy python submission (verdict: Runtime Error):
A,B,K = list(map(int,input().split()))

nums = []

for i in range(1,min(A,B),1):
    if B % i == 0 and A % i == 0:
        nums.append(i)

if nums == []:
    print(1)
else:
    print(nums[K-1])

Fixed submission:
A,B,K = list(map(int,input().split()))

nums = []
cnt = 0

for i in range(1,min(A,B)+1,1):    
    if B % i == 0 and A % i == 0:
        nums.append(i)

print(nums[-K])
Buggy python submission (verdict: Runtime Error):
import sys

S = list(map(int,input()))
init = int(len(S))
ans = []

def cube(S):
    if not any(S) or all(S):
        print(int((init-len(S))))
        sys.exit()
    for i in range(len(S)-1):
        if S[i] != S[i+1]:
            cube(S[0:i]+S[i+2:])
cube(S)

Fixed submission:
S = list(map(int,input()))
num1 = 0
num0 = 0

for i in range(len(S)):
    if S[i]:
        num1 += 1
    else:
        num0 += 1

print(min(num1,num0)*2)

Buggy python submission (verdict: Runtime Error):
S = list(map(int,input()))
init = int(len(S))
ans = []

def cube(S,ans):
    if not any(S) or all(S):
        ans.append(int((init-len(S))))
    for i in range(len(S)-1):
        if S[i] != S[i+1]:
            cube(S[0:i]+S[i+2:],ans)
cube(S,ans)
ans.sort()
print(ans[-1])

Fixed submission:
S = list(map(int,input()))
num1 = 0
num0 = 0

for i in range(len(S)):
    if S[i]:
        num1 += 1
    else:
        num0 += 1

print(min(num1,num0)*2)
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))

ref = [i+1 for i in range(M)]
LIKE = [i+1 for i in range(M)]

for i in range(N):
    myLIKE = list(map(int,input().split()[1:]))
    for j in ref:
        if j not in myLIKE:
            LIKE.remove(j)
print(len(LIKE))

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

ref = [i+1 for i in range(M)]
LIKE = [i+1 for i in range(M)]

for i in range(N):
    myLIKE = list(map(int,input().split()[1:]))
    for j in ref:
        try:
            if j not in myLIKE:
                LIKE.remove(j)
        except ValueError:
            pass
            
print(len(LIKE))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
num = []
num = [int(i) for i in input().split()]

gate = []

for temp in range(num[1]):
    temp = []
    temp = [int(i) for i in input().split()]
    gate.append(temp)

check = [0] * num[0]

for temp in gate:
    while temp[0] <= temp[1]:
        check[temp[0]-1] += 1
        temp[0] += 1

print(check.count(num[1]))

Fixed submission:
import sys
input = sys.stdin.readline
num = []
num = [int(i) for i in input().split()]

syou = []
dai = []

for temp in range(num[1]):
    suuzi = []
    suuzi = [int(i) for i in input().split()]
    syou.append(suuzi[0])
    dai.append(suuzi[1])

result= min(dai) - max(syou) + 1
if result > 0:
    print(result)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
num = []
num = [int(i) for i in input().split()]

gate = []

for temp in range(num[1]):
    temp = []
    temp = [int(i) for i in input().split()]
    gate.append(temp)

check = [0] * num[0]

for temp in gate:
    while temp[0] <= temp[1]:
        check[temp[0]-1] += 1
        temp[0] += 1

print(check.count(num[1]))

Fixed submission:
import sys
input = sys.stdin.readline
num = []
num = [int(i) for i in input().split()]

syou = []
dai = []

for temp in range(num[1]):
    suuzi = []
    suuzi = [int(i) for i in input().split()]
    syou.append(suuzi[0])
    dai.append(suuzi[1])

result= min(dai) - max(syou) + 1
if result > 0:
    print(result)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
num = []
num = [int(i) for i in input().split()]

gate = []

for temp in range(num[1]):
    temp = []
    temp = [int(i) for i in input().split()]
    gate.append(temp)

check = [0] * num[0]

for temp in gate:
    for kazu in range(num[0]):
        if kazu + 1 < temp[0]:
            check[kazu] = 1
        elif kazu + 1 > temp[1]:
            check[kazu] = 1

print(check.count(0))

Fixed submission:
import sys
input = sys.stdin.readline
num = []
num = [int(i) for i in input().split()]

syou = []
dai = []

for temp in range(num[1]):
    suuzi = []
    suuzi = [int(i) for i in input().split()]
    syou.append(suuzi[0])
    dai.append(suuzi[1])

result= min(dai) - max(syou) + 1
if result > 0:
    print(result)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
arr = (input()).split()

for i,temp in enumerate(arr):
  arr[i] = int(arr[i])
  
result = 0
for i in range(2):
  result += max(arr)
  index = arr.index(mac(arr))
  arr[index] = arr[index] -1
  
print(result)

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

for i,temp in enumerate(arr):
  arr[i] = int(arr[i])
  
result = 0
for i in range(2):
  result += max(arr)
  index = arr.index(max(arr))
  arr[index] = arr[index] -1
  
print(result)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 >= 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

print(sum(num)-10+min(iti))

Fixed submission:
import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 >= 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

if iti == []:
    last = 10
else:
    last = min(iti)
print(sum(num)-10+last)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 > 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

print(sum(num)-10+min(iti))

Fixed submission:
import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 >= 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

if iti == []:
    last = 10
else:
    last = min(iti)
print(sum(num)-10+last)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans  = 1
for i in range(1,N+1):
    ans = ans * i
print(ans % (10**9 + 7))

Fixed submission:
N = int(input())
ans  = 1
for i in range(1,N+1):
    ans = ans * i % (10**9 + 7)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
k,s = map(int,input().split())
count = 0
for i,j,k in itertools.product(range(k+1),range(k+1),range(k+1)):
	if i+j+k == s:
		count += 1
print(count)

Fixed submission:
import itertools
k,s = map(int,input().split())
count = 0
for i,j in itertools.product(range(k+1),range(k+1)):
	d = s -(i+j)
	if 0 <= d <= k:
		count += 1
		
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = list(map(int,input().split()))
i = a
count = 0
while i <= b:
	if i % x == 0 :
		count += 1
		i += 1
	else :
		i += 1
print(count)

Fixed submission:
a,b,x = map(int,input().split())
print((b // x) - (a-1) // x)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if(a==7):
    if(b==5 & c==5):
        print('YES')
    else:
        print('NO')
elif(b==7):
    if(a==5 & c==5):
        print('YES')
    else:
        print('NO')
elif(c==7):
    if(b==5 & a==5):
        print('YES')
    else:
        print('NO')
else
    print('NO')
    

Fixed submission:
a, b, c = map(int, input().split())
if(a==7):
    if(b==5 and c==5):
        print('YES')
    else:
        print('NO')
elif(b==7):
    if(a==5 and c==5):
        print('YES')
    else:
        print('NO')
elif(c==7):
    if(b==5 and a==5):
        print('YES')
    else:
        print('NO')
else:
    print('NO')