Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
a = list(map(int, input().split()))
len_a = len(a)
range_a = range(len_a)
times1 = []
times2 = []

for i in range_a:
    times1 += [a[i]] * (len_a - (i + 1))
    times2 += a[i + 1 : ]

result = np.array(times1, dtype = "uint64") * np.array(times2, dtype = "uint64")

print(int(sum(result) % (10 ** 9 + 7)))


Fixed submission:
n = input()
a = list(map(int, input().split()))
sum_a = sum(a)
count = 0
for i, v in enumerate(a):
    sum_a -= v
    count += v * sum_a

print(count % (10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
len_a = len(a)
range_a = range(len_a)
times1 = []
times2 = []

for i in range_a:
    times1 += [a[i]] * (len_a - (i + 1))
    times2 += a[i + 1 : ]

count = 0
for v1, v2 in zip(times1, times2):
    count += v1 * v2

print(count % (10 ** 9 + 7))


Fixed submission:
n = input()
a = list(map(int, input().split()))
sum_a = sum(a)
count = 0
for i, v in enumerate(a):
    sum_a -= v
    count += v * sum_a

print(count % (10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
len_a = len(a)
range_a = range(len_a)
result = []

for i in range_a:
    for j in range_a:
        if i < j:
            result.append(a[i] * a[j])

print(sum(result) % (10 ** 9 + 7))


Fixed submission:
n = input()
a = list(map(int, input().split()))
sum_a = sum(a)
count = 0
for i, v in enumerate(a):
    sum_a -= v
    count += v * sum_a

print(count % (10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

result = []
for i in range(len(a)):
    for j in range(len(a)):
        if i < j:
            result.append(a[i] * a[j])

print(sum(result) % (10 ** 9 + 7))


Fixed submission:
n = input()
a = list(map(int, input().split()))
sum_a = sum(a)
count = 0
for i, v in enumerate(a):
    sum_a -= v
    count += v * sum_a

print(count % (10 ** 9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

aMax = max(a)

answer = 0
countOld = 0

for i,v in enumerate(a):
    if i != 0:
        count = 0
        while v + count < a[i-1] + countOld:
            count += 1
        answer += count
        countOld = count

print(answer)


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

aMax = max(a)

answer = 0
countOld = 0

for i,v in enumerate(a):
    if i != 0:
        count = 0
        count = a[i-1] + countOld - v
        if count < 0:
            count = 0
        answer += count
        countOld = count

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
count = 1
for i in A:
    count *= i

if 10 ** 18 < count:
    count = -1

print(count)


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

if 0 in A:
    print(0)
    exit()

count = 1
for i in A:
    count *= i
    if 10 ** 18 < count:
        break

if 10 ** 18 < count:
    count = -1

print(count)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import functools
import operator

def calc(n):
    return n / 1000000

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

#z = functools.partial(functools.reduce, operator.mul)
#count = z(A)

count = np.prod(A)

#print(count)

count = count * 1000000 ** len(A)

if 10 ** 18 < count:
    count = -1
print(count)


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

if 0 in A:
    print(0)
    exit()

count = 1
for i in A:
    count *= i
    if 10 ** 18 < count:
        break

if 10 ** 18 < count:
    count = -1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
count = A[0]
for i,v in enumerate(A):
    if i != 0:
        count = count * v
if 10 ** 18 < count:
    count = -1
print(count)


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

if 0 in A:
    print(0)
    exit()

count = 1
for i in A:
    count *= i
    if 10 ** 18 < count:
        break

if 10 ** 18 < count:
    count = -1

print(count)
Buggy python submission (verdict: Runtime Error):
KN = list(map(int, input().split()))
A = list(map(int, input().split()))

answer = []

for i,home in enumerate(A):
    kouho = home - A[i - 1]
    if kouho < 0:
        answer.append(20 + kouho)
    else:
        aanswer.append(kouho)

print(20 - max(answer))


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

answer = []

for i,home in enumerate(A):
    if home < A[i - 1]:
        answer.append(home - A[i - 1] + KN[0])
    else:
        answer.append(home - A[i - 1])

print(KN[0] - max(answer))
Buggy python submission (verdict: Time Limit Exceeded):
ABM = list(map(int, input().split()))
price_A = list(map(int, input().split()))
price_B = list(map(int, input().split()))

waribiki = []
for i in range(ABM[2]):
    waribiki.append(list(map(int, input().split())))

result = []
for i in waribiki:
    for i_A in price_A:
        for i_B in price_B:
            result.append(i_A + i_B)
    result.append(price_A[i[0] - 1] + price_B[i[1] - 1] - i[2])

print(min(result))


Fixed submission:
ABM = list(map(int, input().split()))
price_A = list(map(int, input().split()))
price_B = list(map(int, input().split()))

waribiki = []
for i in range(ABM[2]):
    waribiki.append(list(map(int, input().split())))

result = []
for i in waribiki:
    result.append(price_A[i[0] - 1] + price_B[i[1] - 1] - i[2])

result.append(min(price_A) + min(price_B))

print(min(result))
Buggy python submission (verdict: Time Limit Exceeded):
N_A_B = list(map(int, input().split()))
N = N_A_B[0]
A = N_A_B[1]
B = N_A_B[2]

count = 0
retu = []
while count < 10 ** 100 and count < N:
    count += 1
    for index in range(A):
        retu.append(1)
    for index in range(B):
        retu.append(0)
retu = retu[0:N]
print(sum(retu))


Fixed submission:
N_A_B = list(map(int, input().split()))
N = N_A_B[0]
A = N_A_B[1]
B = N_A_B[2]

"""
count = 0
retu = []
while count < 10 ** 100 and count < N:
    count += 1
    for index in range(A):
        retu.append(1)
    for index in range(B):
        retu.append(0)
retu = retu[0:N]
print(sum(retu))
"""

if N % (A + B) == 0:
    print(N // (A + B) * A)
elif N % (A + B) > A:
    print(N // (A + B) * A + A)
else:
    print(N // (A + B) * A + N % (A + B))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

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

for i in itertools.combinations(a, 2):
    ans += i[0]*i[1]

print(ans % 1000000007)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
num=0

for i in range(n-1):
  num+=a[i]
  ans+=a[i+1]*num
  
print(ans%1000000007)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
num=[]
count=0

a=sorted(a)

for i in a:
  for j in num:
    if i%j==0:
      count+=1
      break
      
  num.append(i)
  
  
if a[0]==a[1]:
  count+=1
  
print(n-count)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
num=[0]*(max(a)+1)
maxa=max(a)
cnt=1

for i in a:
  while 1:
    try:
      num[i*cnt]+=1
      cnt+=1
      
      
    except IndexError:
      break
  cnt=1      

count=0

for i in range(n):
  if num[a[i]]==1:
    count+=1
    
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=1

for i in range(n):
  ans*=a[i]
    
if ans>1000000000000000000:
  print("-1")
  
else:
  print(ans)

Fixed submission:
import math
import sys

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


ans = 1
num = 1000000000000000000

if 0 in a:
    print(0)
    sys.exit()

for i in a:
    ans *= i
    if ans > num:
        print(-1)
        sys.exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
import dcimal
a,b=map(decimal.Decimal,input().split())
print(int(a*b))

Fixed submission:
import decimal
a,b=map(decimal.Decimal,input().split())
print(int(a*b))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a.sort()
count=0

for i in range(1,n+1):
  if len(a)>=1 and i==a[0]:
    for j in a:
      if i==j:
        count+=1
      else:
        break
    del a[:count]
        
  print(count)
  count=0

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ls=[0]*n

for i in a:
  ls[i-1]+=1
for i in ls:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a.sort()
count=0

for i in range(1,n+1):
  for j in a:
    if i==j:
      count+=1
    else:
      break
  del a[:count]
        
  print(count)
  count=0

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ls=[0]*n

for i in a:
  ls[i-1]+=1
for i in ls:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a.sort()
num=a[0]
count=0

for i in range(1,n+1):
  if num==i:
    for j in a:
      if num==j:
        count+=1
      else:
        num=i+1
        break
    del a[:count]
        
  print(count)
  count=0

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ls=[0]*n

for i in a:
  ls[i-1]+=1
for i in ls:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

for i in range(1,n+1):
  print(a.count(i))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ls=[0]*n

for i in a:
  ls[i-1]+=1
for i in ls:
  print(i)
Buggy python submission (verdict: Runtime Error):
n=int(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: Time Limit Exceeded):
import sys

n,k=map(int,input().split())
be=n

if n%k==0:
  print(0)
  
else:
  while True:
    if abs(n-k)<=be:
      be=abs(n-k)
    else:
      print(be)
      sys.exit()
    n=abs(n-k)

Fixed submission:
import math

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

be=n%k
af=abs(k-be)

print(be if be<=af else af)
Buggy python submission (verdict: Runtime Error):
import math

n,a,b=map(int,input().split())
st="b"*a+"r"*b

num=math.floor(n/(a+b))
s=st*num

for i in range(n-len(s)):
  if i+1<=a:
    s+="b"
  else:
    s+="r"
    
print(s.count("b"))

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

ab=a+b
num=n//ab
n-=ab*num

if n>=a:
  ans=a
  
else:
  ans=n
  
print(ans+num*a)

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

n,a,b=map(int,input().split())
st="b"*a+"r"*b

num=math.floor(n/(a+b))
s=st*num

for i in range(n-len(s)):
  if i<=a:
    s+="b"
  else:
    s+="r"
    
print(s.count("b"))

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

ab=a+b
num=n//ab
n-=ab*num

if n>=a:
  ans=a
  
else:
  ans=n
  
print(ans+num*a)

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

count="b"*a
count+="r"*b

if len(count)==n:
  print(count.count("b"))
elif a==0:
  print(0)
else:
  n-=len(count)
  if n<=a:
    count+="b"*n
    print(count.count("b"))
  else:
    while n>0:
      if n==a+b:
        count+="b"*a
        count+="r"*b
        print(count.count("b"))
      elif n<=a+b:
        count+="b"*n
        print(count.count("b"))
      else:
        count+="b"*a
        count+="r"*b
        n-=a+b

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

ab=a+b
num=n//ab
n-=ab*num

if n>=a:
  ans=a
  
else:
  ans=n
  
print(ans+num*a)

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

count="b"*a
count+="r"*b

if len(count)==n:
  print(count.count("b"))
else:
  n-=len(count)
  if n<=a:
    count+="b"*n
    print(count.count("b"))
  else:
    for i in range(n):
      if i+1<=a:
        count+="b"
      if i+1==a+b:
        n-=a+b
    print(count.count("b"))

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

ab=a+b
num=n//ab
n-=ab*num

if n>=a:
  ans=a
  
else:
  ans=n
  
print(ans+num*a)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
count=0

while n>0:
  for i in range(a):
    count+=1
    n-=1
    if n==0:
      break
  for i in range(b):
    n-=1
    if n==0:
      break

if a==0:
  print(0)
else:
  print(count)

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

ab=a+b
num=n//ab
n-=ab*num

if n>=a:
  ans=a
  
else:
  ans=n
  
print(ans+num*a)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
s=list(map(int,input().split()))

while k>0:
  s[s.index(max(s))]=0
  k-=1
    
print(sum(s))

Fixed submission:
import sys

n,k=map(int,input().split())
s=list(map(int,input().split()))
s.sort(reverse=True)

if k<len(s):
  for i in range(k):
    s[i]=0
else:
  for i in range(n):
    print(0)
    sys.exit()

print(sum(s))

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

while k>0:
  s[s.index(max(s))]=0
  k-=1
    
if len(s)!=n-1:
  for i in s:
    count+=i
      
print(count)

Fixed submission:
import sys

n,k=map(int,input().split())
s=list(map(int,input().split()))
s.sort(reverse=True)

if k<len(s):
  for i in range(k):
    s[i]=0
else:
  for i in range(n):
    print(0)
    sys.exit()

print(sum(s))
Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

if a+b==k:
  print(0,0)
  sys.exit()

while k>0 and a>0 and b>0:
  if a>0:
    while a>0 or k>0:
      if a==0 or k==0:
        break
      a-=1
      k-=1
  if b>0:
    while b>0 or k>0:
      if b==0 or k==0:
        break
      b-=1
      k-=1
print(a,b)

Fixed submission:
import sys

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

if a<=k:
  k=k-a
  a=0
elif a>k:
  a=a-k
  print(a,b)
  sys.exit()
  
if b<=k:
  b=0
else:
  b=b-k
print(a,b)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=[]

for i in range(1,n+1):
  ans.append(str(a.index(i)+1))
  
print(" ".join(ans))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
num=["0"]*n
count="1"

for i in a:
  num[i-1]=count
  count=int(count)
  count+=1
  count=str(count)
  
print(" ".join(num))
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int,input().split())
ls=[k]*n
for _ in range(q):
  a=int(input())
  
  for i in range(n):
    if i+1==a:
      ls[i]+=1
      break
    
for i in ls:
  if i<=q:
    print("No")
  else:
    print("Yes")

Fixed submission:
n,k,q=map(int,input().split())
ls=[0]*n

for _ in range(q):
  a=int(input())
  ls[a-1]+=1
  
for i in ls:
  print("Yes"if k+i>q else "No")

Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int,input().split())
point=[k]*n
for _ in range(q):
  a=int(input())
  for i in range(n):
    if i==a-1:
      pass
    else:
      point[i]-=1
      
for i in point:
  if i<=0:
    print("No")
  else:
    print("Yes")

Fixed submission:
n,k,q=map(int,input().split())
ls=[0]*n

for _ in range(q):
  a=int(input())
  ls[a-1]+=1
  
for i in ls:
  print("Yes"if k+i>q else "No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input())for _ in range(n)]
maxmax=max(a)
for i in range(n):
  if a[i]==maxmax:
    print(sorted(a)[-2])
  else:
    print(maxmax)


Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a)

for i in a:
  if i==b[-1]:
    print(b[-2])
  else:
    print(b[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input())for _ in range(n)]

for i in range(n):
  if a[i]==max(a):
    print(sorted(a)[-2])
  else:
    print(max(a))

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a)

for i in a:
  if i==b[-1]:
    print(b[-2])
  else:
    print(b[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input())for _ in range(n)]

for i in range(n):
  b=a[i]
  a[i]=0
  print(max(a))
  a[i]=b

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a)

for i in a:
  if i==b[-1]:
    print(b[-2])
  else:
    print(b[-1])
Buggy python submission (verdict: Runtime Error):
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!=="00":
  print("AMBIGUOUS")

elif int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
  
else:
  print("NA")

Fixed submission:
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12 and af!="00":
    print("YYMM")
    
elif int(be)<=12 and be!="00":
    print("MMYY")
  
else:
  print("NA")

Buggy python submission (verdict: Runtime Error):
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")
  
if be=="00" or af=="00":
  if int(af)<=12:
    if af=="00":
      print("NA")
    else:
      print("YYMM")
      
  elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")

elif int(be)<=12 and int(af)<=12:   
    print("AMBIGUOUS")
  
else:
  print("NA")

Fixed submission:
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12 and af!="00":
    print("YYMM")
    
elif int(be)<=12 and be!="00":
    print("MMYY")
  
else:
  print("NA")
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()

for i in range(q):
  l,r=map(int,input().split())
  
  string=s[l-1:r]
  print(string.count("AC"))

Fixed submission:
n,q=map(int,input().split())
s=input()
num=[0]
be=""

for i in range(n):
  if be=="A" and s[i]=="C":
    num.append(num[-1]+1)
    
  else:
    num.append(num[-1])
    
  be=s[i]
    
for i in range(q):
  l,r=map(int,input().split())
  
  print(abs(num[l]-num[r]))

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
for _ in range(q):
  l,r=map(int,input().split())
  print(s[l-1:r].count("AC"))

Fixed submission:
n,q=map(int,input().split())
s=input()
num=[0]
be=""

for i in range(n):
  if be=="A" and s[i]=="C":
    num.append(num[-1]+1)
    
  else:
    num.append(num[-1])
    
  be=s[i]
    
for i in range(q):
  l,r=map(int,input().split())
  
  print(abs(num[l]-num[r]))

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
for _ in range(q):
  l,r=map(int,input().split())
  word=s[l-1:r]
  print(word.count("AC"))

Fixed submission:
n,q=map(int,input().split())
s=input()
num=[0]
be=""

for i in range(n):
  if be=="A" and s[i]=="C":
    num.append(num[-1]+1)
    
  else:
    num.append(num[-1])
    
  be=s[i]
    
for i in range(q):
  l,r=map(int,input().split())
  
  print(abs(num[l]-num[r]))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
sump=1

for i in range(n):
  sump*=i+1
  
print(sump%(1000000007))

Fixed submission:
n=int(input())
sump=1

for i in range(n):
  sump*=i+1
  sump%=1000000007
  
print(sump)

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

for i in range(n):
  sump*=i+1
  
print(sump%(10**9+7))

Fixed submission:
n=int(input())
sump=1

for i in range(n):
  sump*=i+1
  sump%=1000000007
  
print(sump)

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

for i in range(n):
  sump=sump*(i+1)
  
print(sump%(10**9+7))

Fixed submission:
n=int(input())
sump=1

for i in range(n):
  sump*=i+1
  sump%=1000000007
  
print(sump)
Buggy python submission (verdict: Time Limit Exceeded):
s,c=map(int,input().split())
count=0

while s>=1 and c>=2:
  count+=1
  s-=1
  c-=2

while c>=4:
  count+=1
  c-=4
  
print(count)

Fixed submission:
import math

s,c=map(int,input().split())

if s*2>c:
  print(int(c/2))

else:
  count=s
  c-=s*2
  count+=math.floor(c/4)
  print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
num=0

for i in range(a,b+1):
  num+=1
  
if a>0 and b>0 or a<0 and b<0 and num%2==0:
  print("Positive")
  
elif a<0 and b<0 and num%1==0 or a<0 and b<0:
  print("Negative")
  
else:
  print("Zero")

Fixed submission:
a,b=map(int,input().split())
num=0

if a%2==0 and b%2==1 or a%2==1 and b%2==0:
  num=1
  
if a>0 and b>0 or a<0 and b<0 and num==1:
  print("Positive")
  
elif a<0 and b<0 and num==0 or a<0 and b<0:
  print("Negative")
  
else:
  print("Zero")

Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
ans=1

for i in range(a,b+1):
  ans*=i

print("Positive" if ans>0 else "Negative"if ans<0 else "Zero")

Fixed submission:
a,b=map(int,input().split())
num=0

if a%2==0 and b%2==1 or a%2==1 and b%2==0:
  num=1
  
if a>0 and b>0 or a<0 and b<0 and num==1:
  print("Positive")
  
elif a<0 and b<0 and num==0 or a<0 and b<0:
  print("Negative")
  
else:
  print("Zero")
Buggy python submission (verdict: Runtime Error):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
import numpy as np
import random
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



N=int(input())
mod=10**9+7
dp=[[8,1,1,0] for i in range(N)]#1,2~8,9,both
for i in range(1,N):
    dp[i][0]=dp[i-1][0]*8
    dp[i][1]=dp[i-1][0]+dp[i-1][1]*9
    dp[i][2]=dp[i-1][0]+dp[i-1][2]*9
    dp[i][3]=dp[i-1][1]+dp[i-1][2]+dp[i-1][3]*10
    for n in range(4):
        dp[i][n]%=mod
print(dp[-1][3]%mod)


Fixed submission:
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
import random
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



N=int(input())
mod=10**9+7
dp=[[8,1,1,0] for i in range(N)]#1,2~8,9,both
for i in range(1,N):
    dp[i][0]=dp[i-1][0]*8
    dp[i][1]=dp[i-1][0]+dp[i-1][1]*9
    dp[i][2]=dp[i-1][0]+dp[i-1][2]*9
    dp[i][3]=dp[i-1][1]+dp[i-1][2]+dp[i-1][3]*10
    for n in range(4):
        dp[i][n]%=mod
print(dp[-1][3]%mod)

Buggy python submission (verdict: Runtime Error):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
import numpy as np
import random
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



N=int(input())
mod=10**9+7
dp=[[8,1,1,0] for i in range(N)]#1,2~8,9,both
for i in range(1,N):
    dp[i][0]=dp[i-1][0]*8
    dp[i][1]=dp[i-1][0]+dp[i-1][1]*9
    dp[i][2]=dp[i-1][0]+dp[i-1][2]*9
    dp[i][3]=dp[i-1][1]+dp[i-1][2]+dp[i-1][3]*10
    for n in range(4):
        dp[i][n]%=mod
print(dp[-1][3]%mod)


Fixed submission:
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
import random
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



N=int(input())
mod=10**9+7
dp=[[8,1,1,0] for i in range(N)]#1,2~8,9,both
for i in range(1,N):
    dp[i][0]=dp[i-1][0]*8
    dp[i][1]=dp[i-1][0]+dp[i-1][1]*9
    dp[i][2]=dp[i-1][0]+dp[i-1][2]*9
    dp[i][3]=dp[i-1][1]+dp[i-1][2]+dp[i-1][3]*10
    for n in range(4):
        dp[i][n]%=mod
print(dp[-1][3]%mod)