Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=len(str(n))
from math import floor,sqrt
s=floor(sqrt(n))
f=[]
for i in range(2,s+1):
    if n%i==0:
        while True:
            f.append(i)
            n//=i
            if n%i!=0:
                break
if n!=1:
    f.append(n)
l=len(f)
iter=2**l-1
for i in range(2**l):
    iter+=1
    liter=str(bin(iter))[3:]
    a,b=1,1
    for j in range(l):
        if liter[j]=="0":
            a*=f[j]
        else:
            b*=f[j]
    t=max(len(str(a)),len(str(b)))
    if t<ans:
        ans=t
print(ans)


Fixed submission:
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
import math
#li=input().split()
#S=input()
#lis=list(map(int,input().split()))

n=int(input())

A=[0]
i=1
while i<=math.sqrt(n):
    if n%i==0:
        A.append(i)
    i+=1
B=[0]
s=[]
for i in range(len(A)-1):
    j=int(n/A[i+1])
    B.append(j)
    a=len(str(A[i+1]))
    b=len(str(B[i+1]))
    s.append(max(a,b))
ans=min(s)
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=len(str(n))
from math import floor,sqrt
s=floor(sqrt(n))
f=[]
for i in range(2,1+s):
  if n%i==0:
    while True:
      f.append(i)
      n=n//i
      if n%i!=0:
        break
itr=2**(len(f))-1
l=len(f)
for i in range(2**(len(f)-1)):
  itr+=1
  litr=str(bin(itr))[3:]
  a,b=1,1
  for j in range(l):
    if litr[j]=="0":
      a*=f[j]
    else:
      b*=f[j]
    t=max(len(str(a)),len(str(b)))
    if t<ans:
      ans=t
print(ans)
  

Fixed submission:
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
import math
#li=input().split()
#S=input()
#lis=list(map(int,input().split()))

n=int(input())

A=[0]
i=1
while i<=math.sqrt(n):
    if n%i==0:
        A.append(i)
    i+=1
B=[0]
s=[]
for i in range(len(A)-1):
    j=int(n/A[i+1])
    B.append(j)
    a=len(str(A[i+1]))
    b=len(str(B[i+1]))
    s.append(max(a,b))
ans=min(s)
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=len(str(n))
from math import floor,sqrt
s=floor(sqrt(n))
f=[]
for i in range(2,1+s):
  if n%i==0:
    while True:
      f.append(i)
      n=n//i
      if n%i!=0:
        break
itr=2**(len(f))-1
l=len(f)
for i in range(2**(len(f-1))):
  itr+=1
  litr=str(bin(itr))[3:]
  a,b=1,1
  for j in range(l):
    if litr[j]=="0":
      a*=f[j]
    else:
      b*=f[j]
    t=max(len(str(a)),len(str(b)))
    if t<ans:
      ans=t
print(ans)
  

Fixed submission:
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
import math
#li=input().split()
#S=input()
#lis=list(map(int,input().split()))

n=int(input())

A=[0]
i=1
while i<=math.sqrt(n):
    if n%i==0:
        A.append(i)
    i+=1
B=[0]
s=[]
for i in range(len(A)-1):
    j=int(n/A[i+1])
    B.append(j)
    a=len(str(A[i+1]))
    b=len(str(B[i+1]))
    s.append(max(a,b))
ans=min(s)
print(ans)
Buggy python submission (verdict: Runtime Error):
a=list(map(input().split()))
print(len(set(a)))

Fixed submission:
a=input().split()
print(len(set(a)))
Buggy python submission (verdict: Runtime Error):
nk=list(map(int,input().split()))
d=list(map(int,input().split()))
i=nk[0]
ans=0
while ans=0:
  flag=0
  for j in range(len(str(i))):
    if str(i)[j] in d:
      flag=1
      break
  if flag==0:
    ans=i
  i+=1
print(ans)

Fixed submission:
nk=list(map(int,input().split()))
d=list(map(int,input().split()))
i=nk[0]
ans=0
while ans==0:
  flag=0
  for j in range(len(str(i))):
    if int(str(i)[j]) in d:
      flag=1
      break
  if flag==0:
    ans=i
  i+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
nk=list(map(int,input().split()))
d=set(map(int,input().split()))
i=nk[0]
ans=0
while ans=0:
  flag=0
  for j in range(len(str(i))):
    if str(i)[j] in d:
      flag=1
      break
  if flag==0:
    ans=i
  i+=1
print(ans)

Fixed submission:
nk=list(map(int,input().split()))
d=list(map(int,input().split()))
i=nk[0]
ans=0
while ans==0:
  flag=0
  for j in range(len(str(i))):
    if int(str(i)[j]) in d:
      flag=1
      break
  if flag==0:
    ans=i
  i+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, int(n**0.5 + 1)):
    if n % i == 0:
        t = n // i - 1
        if (n // t) == (n % t):
            ans += t
print(ans)

Fixed submission:
n = int(input())
ans = 0
if n == 1:
    pass
else:
    for i in range(1, int(n**0.5 + 1)):
        if n % i == 0:
            t = n // i - 1
            if (n // t) == (n % t):
                ans += t
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

print((10 ** N - 2 * 9 ** N + 8 ** N % (10 ** 9 + 7))

Fixed submission:
print(abs(int(input())-1))

Buggy python submission (verdict: Runtime Error):
print((10 ** int(input()) - 2 * 9 ** int(input()) + 8 ** int(input())) % (10 ** 9 + 7))

Fixed submission:
print(abs(int(input())-1))
Buggy python submission (verdict: Runtime Error):
N = int(input())

mod = 10 ** 9 + 7

print((pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)) % mod)

Fixed submission:
N = int(input())

print(((10 ** N - 2 * 9 ** N + 8 ** N) % (10 ** 9 + 7)))

Buggy python submission (verdict: Runtime Error):
print(10 ** int(input()) - 2 * 9 ** int(input()) + 8 ** int(input()))

Fixed submission:
N = int(input())

print(((10 ** N - 2 * 9 ** N + 8 ** N) % (10 ** 9 + 7)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

x = sum(A)
y = sum([A[i] ** 2 for i in range(N)])

print(((x ** 2 - y) // 2) % (10 ** 9 + 7))

Fixed submission:
D, T, S = map(int, input().split())

if T * S >= D:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
S, T = [input() for _ in range(2)]
answer = 1001

for i in range(len(S) - len(T) + 1):
	k = 0
	U = S[i:i + len(T)]
	for j in range(len(T)):
		if T(j) != U(j):
			k += 1
	answer = min(answer, k)
print(answer)

Fixed submission:
S, T = [input() for _ in range(2)]
answer = 1001

for i in range(len(S) - len(T) + 1):
	k = 0
	U = S[i:i + len(T)]
	for j in range(len(T)):
		if T[j] != U[j]:
			k += 1
	answer = min(answer, k)
print(answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

x = sum(A)
y = sum([A[i] ** 2 for i in range(n)])

print(((x ** 2 - y) / 2) % (10 ** 9 + 7))

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

x = sum(A)
y = sum([A[i] ** 2 for i in range(N)])

print(((x ** 2 - y) // 2) % (10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
s = 0

for i in range(N - 1):
	for j in range(i + 1, N):
		s += (A[i] * A[j]) % (10 ** 9 + 7)
		s = s % (10 ** 9 + 7)
print(s)

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

x = sum(A)
y = sum([A[i] ** 2 for i in range(N)])

print(((x ** 2 - y) // 2) % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
list=input().rstrip
if list[2]==list[3] and list[4]==list[5]:
	print("Yes")
else:
	print("No")
 

Fixed submission:
list=input().rstrip()
if list[2]==list[3] and list[4]==list[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split()
A = [int(a) for a in A]

MAX = 10**18
total = 1
for i in range(N):
    total *= A[i]

if total > MAX:
    print(-1)
else:
    print(total)

Fixed submission:
N = int(input())
A = input().split()
A = [int(a) for a in A]
A.sort()
MAX = 10**18
res = 1
for i in range(N):
    res *= A[i]
    if res > MAX:
        res = -1
        break
print(res)
Buggy python submission (verdict: Runtime Error):
N = str(input())
if '7' in N:
  print('Yes'):
else:
  print('No')

Fixed submission:
N = input()
if '7' in N:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = input()
if (N[2] == N[3]) and (N[4] == N[5]):
  return True
else:
  return False

Fixed submission:
N = input()
N = str(N)
if (N[2] == N[3]) and (N[4] == N[5]):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
input()
a = list(map(int, input().split()))
ans = 0
ai = 0
while all(ai%2==0 for ai in a):
    a = [ai/2 for i in a]
    ans += 1
print(ans)

Fixed submission:
input()
a = list(map(int, input().split()))
ans = 0
while all(ai%2==0 for ai in a):
    a = [ai/2 for ai in a]
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())
if N >= K:
    res = K * X + (N-K) * Y
else: 
    res = N * X
print(res)


Fixed submission:
n, k, x, y = (int(input()) for _ in range(4)) 
if n >= k:
    res = k * x + (n-k) * y
else: 
    res = n * x
print(res)

Buggy python submission (verdict: Runtime Error):
N, K, X, Y = list(map(int, input().split()))
if N >= K:
    res = K * X + (N-K) * Y
else: 
    res = N * X
print(res)

Fixed submission:
n, k, x, y = (int(input()) for _ in range(4)) 
if n >= k:
    res = k * x + (n-k) * y
else: 
    res = n * x
print(res)
Buggy python submission (verdict: Runtime Error):
res = ''
for x in input():
    if x = 'B':
        res = res[:-1]
    else:
        res += x 
print(res)




Fixed submission:
res = ''
for x in input():
    if x == 'B':
        res = res[:-1]
    else:
        res += x 
print(res)
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
five_cnt = 0
seven_cnt = 0

for a in A:
    if a == 5:
        five_cnt++
    if a == 7:
        seven_cnt++

if five_cnt == 2 and seven_cnt == 1:
    print("Yes")
else:
    print("No")


Fixed submission:
A = list(map(int, input().split()))
five_cnt = 0
seven_cnt = 0

for a in A:
    if a == 5:
        five_cnt += 1
    if a == 7:
        seven_cnt += 1

if five_cnt == 2 and seven_cnt == 1:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
N = input()
L = input()
A = list(map(str, input().split()))
A.sort()

res = ''
for a in A:
    res += a

print(res)


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

input_str_list = []
for input_str_index in range(N):
    input_str_list.append(input())

input_str_list.sort()

print(''.join(input_str_list))
Buggy python submission (verdict: Runtime Error):
a=input()
ans=0
for i in a:
  ans = (ans+int(i))%9
print(["Yes","No"][ans])

Fixed submission:
a=input()
ans=0
for i in a:
  ans = (ans+int(i))%9
print(["Yes","No"][ans>0])
Buggy python submission (verdict: Runtime Error):
a,b=map(input().split(" "))
c,d=map(input().split(" "))
print((a-c)*(b-d))

Fixed submission:
a,b=map(int,input().split(" "))
c,d=map(int,input().split(" "))
print((a-c)*(b-d))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split(" "))
print([a+b,b-a][b%a])

Fixed submission:
a,b=map(int,input().split(" "))
print([a+b,b-a][b%a>0])
Buggy python submission (verdict: Runtime Error):
a,b,c=input()
if a<b:
  a,b=b,a
if b<c:
  b,c=c,b
if a<b:
  a,b=b,a
print(10*a+b+c)

Fixed submission:

a,b,c=map(int,input().split())
if a<b:
  a,b=b,a
if b<c:
  b,c=c,b
if a<b:
  a,b=b,a
print(10*a+b+c)
Buggy python submission (verdict: Runtime Error):
a=int(input())
rint(["ABC","ARC","AGC"][(a>=1200)+(a>=2800)])

Fixed submission:
a=int(input())
print(["ABC","ARC","AGC"][(a>=1200)+(a>=2800)])

Buggy python submission (verdict: Runtime Error):
a=int(input())
print(["ABC","ARC","AGC"][a//1200+a//2800])

Fixed submission:
a=int(input())
print(["ABC","ARC","AGC"][(a>=1200)+(a>=2800)])
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().replace(" "))
print(["Even","Odd"][(a*b)%2])

Fixed submission:
a,b=map(int,input().split(" "))
print(["Even","Odd"][(a*b)%2])
Buggy python submission (verdict: Runtime Error):
a=input()
a[3]="8"
print(a)

Fixed submission:
a=input().replace("2017","2018")
print(a)
Buggy python submission (verdict: Runtime Error):
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=map(int,input().split(" "))
print("Yes") if (c[0] in a and c[1] in a) or (c[0] in b and c[1] in b) else print("No")

Fixed submission:
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=list(map(int,input().split(" ")))
print("Yes") if (c[0] in a and c[1] in a) or (c[0] in b and c[1] in b) else print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split(" "))
print("YES") if b-a==c-b else print("NO)

Fixed submission:
a,b,c=map(int,input().split(" "))
print("YES") if b-a==c-b else print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
L = []
x=0
for a in A:
    x ^= a
    L.append(x)
R = []
x=0
for a in reversed(A):
    x ^= a
    R.insert(0, x)
for i in range(n):
    x = 0
    if i>0:
        x^=L[i-1]
    if i<n-1:
        x^=R[i+1]
    print(x, end="")
    if i==n-1:
        print("")
    else:
        print(" ",end="")

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
L = []
x=0
for a in A:
    x ^= a
    L.append(x)
R = []
x=0
for a in reversed(A):
    x ^= a
    R.append(x)
for i in range(n):
    x = 0
    if i>0:
        x^=L[i-1]
    if i<n-1:
        x^=R[n-1-(i+1)]
    print(x, end="")
    if i==n-1:
        print("")
    else:
        print(" ",end="")
Buggy python submission (verdict: Time Limit Exceeded):
import collections
s=input()
n=len(s)
a=[]
x=0
for i in range(n):
	j = n-1-i
	c = int(s[j])
	x += (10**i)*c
	x %= 2019
	a.append(x)
c=collections.Counter(a)
ans = 0
for k,v in c.items():
	if k==0:
		ans += v
	else:
		ans += v*(v-1)//2
print(ans)

Fixed submission:
import collections
s=input()
n=len(s)
a=[]
x=0
p=1
for i in range(n):
	j = n-1-i
	c = int(s[j])
	p %= 2019
	x += (p*c)%2019
	p *= 10
	x %= 2019
	a.append(x)
c=collections.Counter(a)
ans = 0
for k,v in c.items():
	if k==0:
		ans += v
	ans += v*(v-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
input()
v = [0,0,0]
ans = 1
MOD = 1000000007
for a in map(int,input().split()):
    c = v.count(a)
    ans *= c
    ans %= MOD
    v[v.index(a)] += 1
print(ans)

Fixed submission:
input()
v = [0,0,0]
ans = 1
MOD = 1000000007
for a in map(int,input().split()):
    c = v.count(a)
    ans *= c
    ans %= MOD
    if ans == 0:
        break
    v[v.index(a)] += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
input()
v = [0,0,0]
ans = 1
MOD = 1000000007
for a in map(int,input().split()):
    c = v.count(a)
    ans *= c
    ans %= MOD
    v[v.index(a)] += 1
print(ans)

Fixed submission:
input()
v = [0,0,0]
ans = 1
MOD = 1000000007
for a in map(int,input().split()):
    c = v.count(a)
    ans *= c
    ans %= MOD
    if ans == 0:
        break
    v[v.index(a)] += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from functools import reduce
n = int(input())
print(reduce(lambda x,y:x+y, { n//i - 1 for i in range(1, int(n**0.5)+1) if n%i==0 and n//i-i>=2 }))


Fixed submission:
from functools import reduce
n = int(input())
print(reduce(lambda x,y:x+y, { n//i - 1 for i in range(1, int(n**0.5)+1) if n%i==0 and n//i-i>=2 }, 0))
Buggy python submission (verdict: Runtime Error):
'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    l = 0
    r = 10**9+1
    while l != r:
        mid = l+(r-l)//2
        nm = 0
        for i in a:
            nm += (i-1)//mid
        if nm > k:
            l = mid+1
        else:
            r = mid

    print(r)

    return None

if __name__ == '__main__':
    main()


Fixed submission:
'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    l = 1
    r = 10**9+1
    while l != r:
        mid = l+(r-l)//2
        nm = 0
        for i in a:
            nm += (i-1)//mid
        if nm > k:
            l = mid+1
        else:
            r = mid

    print(r)

    return None

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    hq = []
    for i in a:
        hpq.heappush(hq,(-i,i,1))

    for i in range(k):
        ln,ai,nm = hpq.heappop(hq)
        hpq.heappush(hq,(-ai/(nm+1),ai,nm+1))

    ln,ai,nm = hpq.heappop(hq)
    print((ai-1)//nm+1)

    return None

if __name__ == '__main__':
    main()


Fixed submission:
'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    l = 1
    r = 10**9+1
    while l != r:
        mid = l+(r-l)//2
        nm = 0
        for i in a:
            nm += (i-1)//mid
        if nm > k:
            l = mid+1
        else:
            r = mid

    print(r)

    return None

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    a = input()
    if a.isupper():
        print(A)
    else:
        print(a)

    return

if __name__ == '__main__':
    main()


Fixed submission:
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    a = input()
    if a.isupper():
        print("A")
    else:
        print("a")

    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    h,w,k = map(int,ipt().split())
    x1,y1,x2,y2 = map(int,ipt().split())
    x1 -= 1; y1 -= 1; x2 -= 1; y2 -= 1
    ms = [input()+"@" for _ in range(h)]
    ms.append("@"*(w+1))
    hq = []
    al = [[10**18]*w for _ in range(h)]
    al[x1][y1] = 0
    dr = [(0,1),(1,0),(0,-1),(-1,0)]
    hpq.heappush(hq,(0,x1,y1))
    while hq:
        c,x,y = hpq.heappop(hq)
        cn = c+1
        if x == x2 and y == y2:
            print(c)
            exit()
        for dx,dy in dr:
            xx = x
            yy = y
            for i in range(k):
                xx += dx
                yy += dy
                if ms[xx][yy] == "." and al[xx][yy] >= cn:
                    al[xx][yy] = cn
                    hpq.heappush(hq,(cn,xx,yy))
                else:
                    break
    print(-1)

    return

if __name__ == '__main__':
    main()


Fixed submission:
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    h,w,k = map(int,ipt().split())
    x1,y1,x2,y2 = map(int,ipt().split())
    x1 -= 1; y1 -= 1; x2 -= 1; y2 -= 1
    ms = [input()+"@" for _ in range(h)]
    ms.append("@"*(w+1))
    hq = []
    al = [[10**18]*w for _ in range(h)]
    al[x1][y1] = 0
    dr = [(0,1),(1,0),(0,-1),(-1,0)]
    hpq.heappush(hq,(0,x1,y1))
    while hq:
        c,x,y = hpq.heappop(hq)
        cn = c+1
        if x == x2 and y == y2:
            print(c)
            exit()
        for dx,dy in dr:
            xx = x
            yy = y
            for i in range(k):
                xx += dx
                yy += dy
                if ms[xx][yy] == "." and al[xx][yy] > cn:
                    al[xx][yy] = cn
                    hpq.heappush(hq,(cn,xx,yy))
                elif ms[xx][yy] == "." and al[xx][yy] == cn:
                    continue
                else:
                    break
    print(-1)

    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    sa = sum(a)
    for i in range(k):
        mov = [0]*n
        for i,ai in enumerate(a):
            if i-ai >= 0:
                mov[i-ai] += 1
            else:
                mov[0] += 1
            if i+ai+1 < n:
                mov[i+ai+1] -= 1
        na = a*1
        sna = sa
        a[0] = mov[0]
        sa = mov[0]
        for i in range(1,n):
            a[i] = a[i-1]+mov[i]
            sa += a[i]
        if sna == sa:
            break
    print(" ".join(map(str,a)))

    return

if __name__ == '__main__':
    main()


Fixed submission:
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    sa = sum(a)
    for i in range(k):
        mov = [0]*n
        for i,ai in enumerate(a):
            if i-ai >= 0:
                mov[i-ai] += 1
            else:
                mov[0] += 1
            if i+ai+1 < n:
                mov[i+ai+1] -= 1
        na = a*1
        sna = sa
        a[0] = mov[0]
        sa = mov[0]
        for i in range(1,n):
            a[i] = a[i-1]+mov[i]
            sa += a[i]
        if sna == sa:
            break
    print(" ".join(map(str,a)))

    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

a,b = input().split()
b = int(b.replace(".",""))
a = int(a)
print((a*b)//100)


Fixed submission:
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

n = int(ipt())
a = [int(i) for i in ipt().split()]
if 0 in a:
    print(0)
    exit()
ans = 1
for i in a:
    if 10**18/ans < i:
        print(-1)
        exit()
    ans *= i
if ans > 10**18:
    print(-1)
else:
    print(ans)