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

from operator import mul
from functools import reduce


def main():
  input = sys.stdin.readline
  N = int(input())
  a= tuple(map(int , input().split()))
  ans=reduce(mul, a)
  if ans > 10**18:
    print(-1)
  else:
    print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
n=int(input())
a = list(map(int,input().split()))
ans=a[0]
if 0 in a:
  print(0)
  exit()
for s in range(1,n):
  ans *=a[s]
  if ans > 10**18:
    print(-1)
    exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n=int(input())
  a = tuple(map(int,input().split()))
  ans=a[0]
  for s in range(1,n):
    ans *=a[s]
  if ans > 10**18:
    print(-1)
  else:
    print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
n=int(input())
a = list(map(int,input().split()))
ans=a[0]
if 0 in a:
  print(0)
  exit()
for s in range(1,n):
  ans *=a[s]
  if ans > 10**18:
    print(-1)
    exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n=int(input())
  a = tuple(map(int,input().split()))
  ans=a[0]
  for s in range(1,n):
    ans *=a[s]
  if ans > 10**18:
    print(-1)
  else:
    print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
n=int(input())
a = list(map(int,input().split()))
ans=a[0]
if 0 in a:
  print(0)
  exit()
for s in range(1,n):
  ans *=a[s]
  if ans > 10**18:
    print(-1)
    exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int,input().split()))
ans=a[0]
for s in range(1,n):
  ans *=a[s]
if ans > 10**18:
  print(-1)
else:
  print(ans)


Fixed submission:
n=int(input())
a = list(map(int,input().split()))
ans=a[0]
if 0 in a:
  print(0)
  exit()
for s in range(1,n):
  ans *=a[s]
  if ans > 10**18:
    print(-1)
    exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int,input().split()))
ans=a[0]
for s in range(1,n):
  ans *=a[s]
if ans > 10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
n=int(input())
a = list(map(int,input().split()))
ans=a[0]
if 0 in a:
  print(0)
  exit()
for s in range(1,n):
  ans *=a[s]
  if ans > 10**18:
    print(-1)
    exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
list = list(map(int,input().split()))
min_ = min(list)
max_ = max(list)
num=[]
for a in range(min_,max_):
  _ = []
  for b in range(len(list)):
    _.append((a - list[b])**2)
  num.append(sum(_))
if n == 1:
  print(0)
  exit()
print(min(num))

Fixed submission:
n = int(input())
list_ = list(map(int,input().split()))
min_ = min(list_)
max_ = max(list_)
num=[]
for a in range(min_,max_):
  _ = []
  for b in range(len(list_)):
    _.append((a - list_[b])**2)
  num.append(sum(_))
if len(list(set(list_))) == 1:
  print(0)
  exit()
print(min(num))

Buggy python submission (verdict: Runtime Error):
n = int(input())
list = list(map(int,input().split()))
min_ = min(list)
max_ = max(list)
num=[]
for a in range(min_,max_):
  _ = []
  for b in range(len(list)):
    _.append((a - list[b])**2)
  num.append(sum(_))
print(min(num))

Fixed submission:
n = int(input())
list_ = list(map(int,input().split()))
min_ = min(list_)
max_ = max(list_)
num=[]
for a in range(min_,max_):
  _ = []
  for b in range(len(list_)):
    _.append((a - list_[b])**2)
  num.append(sum(_))
if len(list(set(list_))) == 1:
  print(0)
  exit()
print(min(num))
Buggy python submission (verdict: Runtime Error):
N = input()
answer = N % 1000
print(answer)

Fixed submission:
N = int(input())
answer = 0
for i in range(1, 1000):
  pay = 1000 * i
  if pay >= N:
    answer = pay - N
    break
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import math

x = int(input())
a = math.ceil(x ** 0.2)
while True:
    aa = a ** 5
    bb = aa - x
    bbb = bb ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    b *= int(bbb.real + bbb.imag)
    if aa - b ** 5 == x:
        print(a,b)
        break
    a -= 1

Fixed submission:
import math
import sys

x = int(input())
r = math.ceil(x ** 0.2)
# print(r)
def reverse_num(x):
    return r - x
def calc_b(aa):
    bb = aa - x
    bbb = abs(bb) ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    # print(bb,b * int(bbb.real + bbb.imag))
    return b * int(bbb.real + bbb.imag)
def check(a):
    aa = a ** 5
    b = calc_b(aa)
    # print(a,b)
    if aa - b ** 5 == x:
        print(a,b)
        return True
    else:
        return False
for a in range(r // 2 + 1):
    if check(a) or check(reverse_num(a)):
        sys.exit()
a = r + 1
while True:
    if check(a):
        sys.exit()
    a += 1

Buggy python submission (verdict: Time Limit Exceeded):
import math

x = int(input())
a = math.ceil(math.log(x,5))
while True:
    aa = a ** 5
    bb = aa - x
    bbb = bb ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    b *= int(bbb.real + bbb.imag)
    # print(a,b)
    if aa - b ** 5 == x:
        print(a,b)
        break
    a -= 1

Fixed submission:
import math
import sys

x = int(input())
r = math.ceil(x ** 0.2)
# print(r)
def reverse_num(x):
    return r - x
def calc_b(aa):
    bb = aa - x
    bbb = abs(bb) ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    # print(bb,b * int(bbb.real + bbb.imag))
    return b * int(bbb.real + bbb.imag)
def check(a):
    aa = a ** 5
    b = calc_b(aa)
    # print(a,b)
    if aa - b ** 5 == x:
        print(a,b)
        return True
    else:
        return False
for a in range(r // 2 + 1):
    if check(a) or check(reverse_num(a)):
        sys.exit()
a = r + 1
while True:
    if check(a):
        sys.exit()
    a += 1

Buggy python submission (verdict: Time Limit Exceeded):
import math

x = int(input())
a = 0
while True:
    aa = a ** 5
    bb = aa - x
    bbb = bb ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    b *= int(bbb.real + bbb.imag)
    # print(a,b)
    if aa - b ** 5 == x:
        print(a,b)
        break
    a += 1

Fixed submission:
import math
import sys

x = int(input())
r = math.ceil(x ** 0.2)
# print(r)
def reverse_num(x):
    return r - x
def calc_b(aa):
    bb = aa - x
    bbb = abs(bb) ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    # print(bb,b * int(bbb.real + bbb.imag))
    return b * int(bbb.real + bbb.imag)
def check(a):
    aa = a ** 5
    b = calc_b(aa)
    # print(a,b)
    if aa - b ** 5 == x:
        print(a,b)
        return True
    else:
        return False
for a in range(r // 2 + 1):
    if check(a) or check(reverse_num(a)):
        sys.exit()
a = r + 1
while True:
    if check(a):
        sys.exit()
    a += 1
Buggy python submission (verdict: Runtime Error):
import numpy as np
a,b,m = [int(i) for i in input().split()]
aa = [int(i) for i in input().split()]
bb = [int(i) for i in input().split()]
x = np.zeros(m,dtype=int)
y = np.zeros(m,dtype=int)
c = np.zeros(m,dtype=int)
for i in range(m):
    x[i],y[i],c[i] = [int(j) for j in input().split()]
r = np.zeros((a,b),dtype=int)
for i in range(a):
    for j in range(b):
        r[i][j] = aa[i] + bb[j]
v = np.min(r)
for i,j,l in zip(x,y,c):
    if v > r[i-1][j-1] - l:
        v = r[i-1][j-1] - l
print(v)

Fixed submission:
s = input()
if s.replace('hi','') == '':
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
if s.replace('hi','') == '':
    print('Yes')
else
    print('No')

Fixed submission:
s = input()
if s.replace('hi','') == '':
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
x = np.array(list(map(int,input().split())))
# x = np.array(x)
r = np.full(100, 100 * n)

for p in range(100):
    r[p] = np.sum((x - p + 1)**2)
print(np.min(r))

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

if n >= 10:
    print(r)
else:
    print(r + (100 * (10 - n)))
Buggy python submission (verdict: Runtime Error):
m = input()
print(48 - m)

Fixed submission:
m = int(input())
print(48 - m)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b)

Fixed submission:
a, b = map(int,input().split())
mul = a*b
print(mul)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
mul = a*b
print(mul)

Fixed submission:
a, b = map(int,input().split())
mul = a*b
print(mul)
Buggy python submission (verdict: Runtime Error):
Num = int(input())
if "7" in Num:
  print("Yes")
else:
  print("No")
 

Fixed submission:
Num = input()
if "7" in Num:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(a,b,c)

temp = a
a = c
c = b
b = temp 

print(a,b,c)

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
  
print(a,b,c)

a = a + b + c    
b = a - (b+c)    
c = a - (b+c) 
a = a - (b+c) 
print(a,b,c)

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

Buggy python submission (verdict: Runtime Error):
def swapThree(a, b, c):  
    a = a + b + c  
   
    b = a - (b+c) 
   
    c = a - (b+c) 
   
    a = a - (b+c) 
      
    print("After swapping a =",a,", b =",b,", c =",c) 
  
if __name__ == '__main__': 
    a = int(input())
    b = int(input())
    c = int(input())
  
    print("Before swapping a =",a,", b =",b,", c =",c) 
  
    swapThree(a, b, c)

Fixed submission:
a,b,c = map(int, input().split())
print(c,a,b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

M_NUM = 10**18

ans = 1
for item in a:
    ans *= item

if ans > M_NUM:
    print('-1')
else:
    print(ans)


Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

M_NUM = 10**18

ans = 1
for item in a:
    if ans > M_NUM:
        break
    ans *= item

if 0 in a:
    print('0')
elif ans > M_NUM:
    print('-1')
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

ans = 0
rgb_idx = {
    'R': [],
    'G': [],
    'B': [],
}
for i in range(n):
    if s[i] == 'R':
        rgb_idx['R'].append(i)
    elif s[i] == 'G':
        rgb_idx['G'].append(i)
    else:
        rgb_idx['B'].append(i)

for i in range(len(rgb_idx['R'])):
    for j in range(len(rgb_idx['G'])):
        ans += len(rgb_idx['B'])
        rnum = rgb_idx['R'][i]
        gnum = rgb_idx['G'][j]
        if gnum-rnum>0:
            g = gnum
            l = rnum
        else:
            g = rnum
            l = gnum
        if g+abs(gnum-rnum) in rgb_idx['B']:
            ans -= 1
        if l-abs(gnum-rnum) in rgb_idx['B']:
            ans -= 1
        if (g+l)/2 in rgb_idx['B']:
            ans -= 1

print(ans)


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

ans = 0
rgb_idx = {
    'R': [],
    'G': [],
    'B': [],
}
for i in range(n):
    if s[i] == 'R':
        rgb_idx['R'].append(i)
    elif s[i] == 'G':
        rgb_idx['G'].append(i)
    else:
        rgb_idx['B'].append(i)

for i in range(len(rgb_idx['R'])):
    for j in range(len(rgb_idx['G'])):
        ans += len(rgb_idx['B'])
        
        rnum = rgb_idx['R'][i]
        gnum = rgb_idx['G'][j]
        if gnum-rnum>0:
            g = gnum
            l = rnum
        else:
            g = rnum
            l = gnum
        dist = abs(gnum-rnum)
        if n > g+dist and s[g+dist]=='B':
            ans -= 1
        if 0 <= l-dist and s[l-dist]=='B':
            ans -= 1
        if (g+l)%2==0 and s[int((g+l)/2)]=='B':
            ans -= 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = list(map(int, input().split()))
p = list(map(int, input().split()))

max_num = [0]*k
for i in range(n-k+1): 
    if sum(max_num) < sum(p[i:k+i]):
        max_num = p[i:k+i]

ans = [(1+n)/2 for n in max_num]
print(sum(ans))

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

max_num = []
tmp = 0
current_sum = sum(p[:k-1])
for i in range(n-k+1):
    current_sum += p[k+i-1]
    if tmp < current_sum:
        max_num = p[i:k+i]
        tmp = current_sum
    current_sum -= p[i]

print(sum([(1+n)/2 for n in max_num]))
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

div = 10**9 + 7
lcm_num = lcm(a)
ans = [(lcm_num // ai) % div for ai in a]

print(sum(ans)%div)

Fixed submission:
from fractions import gcd

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

div = 10**9 + 7
lcm_num = lcm(a)
ans = [lcm_num//ai for ai in a]

print(sum(ans)%div)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

div = 10**9 + 7
lcm_num = lcm(a)
ans = 0

for i in range(n):
    ans += (lcm_num // a[i]) % div

print(ans%div)

Fixed submission:
from fractions import gcd

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

div = 10**9 + 7
lcm_num = lcm(a)
ans = [lcm_num//ai for ai in a]

print(sum(ans)%div)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

div = 10**9 + 7
lcm_num = lcm(a)
ans = 0

for i in range(n):
    ans += (lcm_num // a[i]) % div

print(ans%div)

Fixed submission:
from fractions import gcd

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

div = 10**9 + 7
lcm_num = lcm(a)
ans = [lcm_num//ai for ai in a]

print(sum(ans)%div)
Buggy python submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline
A, B = map(int, input().split())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


af = factorization(A)
bf = factorization(B)
ans = 1
for afi in af:
    if afi in bf:
        ans += 1
print(ans)


Fixed submission:
N = int(input())

if N % 2 == 0:
    print('0.5000000000')
else:
    print(round((int(N / 2) + 1) / N, 10))
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = sys.stdin.readline
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
m_idx = A.index(max(A))

for _ in range(M):
    A[A.index(max(A))] //= 2

print(sum(A))

Fixed submission:
import sys
import heapq

input = sys.stdin.readline
N, M = map(int, input().split())

A = []
for x in input().split():
    heapq.heappush(A, int(x) * (-1))

for _ in range(M):
    max_n = heapq.heappop(A) * (-1)
    heapq.heappush(A, (max_n // 2) * (-1))
    
print(sum(A) * (-1))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import heapq

def heapsort(iterable):
    h = []
    for value in iterable:
        heapq.heappush(h, value)
    return [heapq.heappop(h) for i in range(len(h))]

input = sys.stdin.readline
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
A = heapsort(A)

for _ in range(M):
    A[N-1] //= 2
    A = heapsort(A)

print(sum(A))

Fixed submission:
import sys
import heapq

input = sys.stdin.readline
N, M = map(int, input().split())

A = []
for x in input().split():
    heapq.heappush(A, int(x) * (-1))

for _ in range(M):
    max_n = heapq.heappop(A) * (-1)
    heapq.heappush(A, (max_n // 2) * (-1))
    
print(sum(A) * (-1))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
list.sort(A, reverse=True)

for _ in range(M):
    A[0] //= 2
    list.sort(A, reverse=True)

print(sum(A))

Fixed submission:
import sys
import heapq

input = sys.stdin.readline
N, M = map(int, input().split())

A = []
for x in input().split():
    heapq.heappush(A, int(x) * (-1))

for _ in range(M):
    max_n = heapq.heappop(A) * (-1)
    heapq.heappush(A, (max_n // 2) * (-1))
    
print(sum(A) * (-1))

Buggy python submission (verdict: Runtime Error):
S = input()
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
list.sort(A, reverse=True)

for _ in range(M):
    A[0] //= 2
    list.sort(A, reverse=True)

print(sum(A))

Fixed submission:
import sys
import heapq

input = sys.stdin.readline
N, M = map(int, input().split())

A = []
for x in input().split():
    heapq.heappush(A, int(x) * (-1))

for _ in range(M):
    max_n = heapq.heappop(A) * (-1)
    heapq.heappush(A, (max_n // 2) * (-1))
    
print(sum(A) * (-1))
Buggy python submission (verdict: Runtime Error):
SSR
SSR

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

ans = 0
for i in range(3):
    ans += 1 if S[i] == T[i] else 0

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

n, k = map(int, input().split())
a = list(map(int, input().split()))
score = [0] * (n+1)

for i in range(k, n+1):
    score[i] = reduce(lambda x, y: x*y, a[i-k:i], 1)
    if i == k:
        continue
    print('Yes' if score[i-1] < score[i] else 'No')


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

for i in range(k, n+1):
    if i == k:
        continue
    print('Yes' if a[i-k-1] < a[i-1] else 'No')

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

n, k = map(int, input().split())
a = list(map(int, input().split()))
score = [0] * (n+1)

for i in range(k, n+1):
    score[i] = np.prod(a[i-k:i])

for i in range(k+1, n+1):
    print('Yes' if score[i-1] < score[i] else 'No')


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

for i in range(k, n+1):
    if i == k:
        continue
    print('Yes' if a[i-k-1] < a[i-1] else 'No')
Buggy python submission (verdict: Runtime Error):
money = 1000
stock = 0
leave_max = max(a[1:])

for i in range(n):
    if i == n-1:
        if stock != 0:
            money += a[i] * stock
        break

    leave_max = max(a[i+1:])

    if a[i] >= a[i+1]:
        if stock != 0:
            money += a[i] * stock
            stock = 0

        if a[i] > leave_max:
            break
        else:
            continue

    elif a[i] < a[i+1]:
        num = money // a[i]
        if num != 0:
            stock += num
            money -= stock * a[i]

print(money)


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

money = 1000

for i in range(n-1):
    stock = 0
    if a[i] < a[i+1]:
        stock = money // a[i]
    money += (a[i+1] - a[i]) * stock

print(money)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
board = [1] * (n+1)

def divisor_num(n, board):
    for i in range(2, n+1):
        j = 1
        while i*j <= n:
            board[i*j] += 1
            j += 1

divisor_num(n, board)
res = sum([i * board[i] for i in range(1, n+1)])
print(res)


Fixed submission:
n = int(input())
board = [1] * (n+1)

def divisor_num(n, board):
    for i in range(2, n+1):
        j = 1
        while i*j <= n:
            board[i*j] += 1
            j += 1

divisor_num(n, board)
res = sum([i * board[i] for i in range(1, n+1)])
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
def divisor_num(m):
    i = 1
    cnt = 0
    while i * i <= m:
        if m % i == 0:
            cnt += 2
            if i * i == m:
                cnt -= 1
        i += 1
    return cnt


n = int(input())
res = sum([i * divisor_num(i) for i in range(1, n+1)])
print(res)


Fixed submission:
n = int(input())
board = [1] * (n+1)

def divisor_num(n, board):
    for i in range(2, n+1):
        j = 1
        while i*j <= n:
            board[i*j] += 1
            j += 1

divisor_num(n, board)
res = sum([i * board[i] for i in range(1, n+1)])
print(res)

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

n = int(input())
res = sum([i * len(sympy.divisors(i)) for i in range(1, n+1)])
print(res)

Fixed submission:
n = int(input())
board = [1] * (n+1)

def divisor_num(n, board):
    for i in range(2, n+1):
        j = 1
        while i*j <= n:
            board[i*j] += 1
            j += 1

divisor_num(n, board)
res = sum([i * board[i] for i in range(1, n+1)])
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

n = int(input())
a = [int(arg) for arg in input().split()]
res = reduce(lambda x, y: x*y, a)
print(res if res <= 10**18 else -1)


Fixed submission:
n = int(input())
a = [int(arg) for arg in input().split()]
res = 1
if 0 in a:
    print(0)
    exit()

for i in a:
    res *= i
    if res > 10**18:
        res = -1
        break
print(res)
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print(s[:k] _ '...')

Fixed submission:
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print(s[:k] + '...')
Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split()))
a = [int(input()) for _ in range(m)]

MOD = 10**9 + 7
res = [0] * (n+1)
res[0] = 1
res[1] = 1 if 1 not in a else 0

for i in range(2, n+1):
    if i in a:
        continue

    # 到達不可能
    if res[i-1] == 0 and res[i-2] == 0:
        break

    res[i] = (res[i-1] % MOD + res[i-2] % MOD) % MOD

print(res[-1])


Fixed submission:
n, m = list(map(int, input().split()))
a = [0] * (n+1)
for _ in range(m):
    a[int(input())] = -1

MOD = 10**9 + 7
res = [0] * (n+1)
res[0] = 1
res[1] = 0 if a[1] == -1 else 1

for i in range(2, n+1):
    if a[i] == -1:
        continue

    # 到達不可能
    if res[i-1] == 0 and res[i-2] == 0:
        break

    res[i] = (res[i-1] + res[i-2]) % MOD

print(res[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split()))
a = [int(input()) for _ in range(m)]

MOD = 10**9 + 7
res = [0] * (n+1)
res[0] = 1
res[1] = 1 if 1 not in a else 0

for i in range(2, n+1):
    if i in a:
        continue

    # 到達不可能
    if res[i-1] == 0 and res[i-2] == 0:
        break

    res[i] = res[i-1] + res[i-2]

print(res[-1]%MOD)


Fixed submission:
n, m = list(map(int, input().split()))
a = [0] * (n+1)
for _ in range(m):
    a[int(input())] = -1

MOD = 10**9 + 7
res = [0] * (n+1)
res[0] = 1
res[1] = 0 if a[1] == -1 else 1

for i in range(2, n+1):
    if a[i] == -1:
        continue

    # 到達不可能
    if res[i-1] == 0 and res[i-2] == 0:
        break

    res[i] = (res[i-1] + res[i-2]) % MOD

print(res[-1])