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

E = []

for i in range(N):
    E.append((P[i]+1)/2)

l = N - K + 1
tnt = 0
ans = 0
j = 0
k = K

while k <= N:
    tnt = sum(E[j:k])
    ans = max(ans, tnt)
    j += 1
    k += 1

print(ans)


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

E = []

for i in range(N):
    E.append((P[i]+1)/2)

tnt = sum(E[:K])
ans = tnt

for i in range(N-K):
    tnt = tnt + E[K+i] - E[i]
    ans = max(ans, tnt)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))

l = N - K + 1
ans = 0
tnt = 0

for i in range(l):
    for j in range(K):
        tnt += (P[i+j]+1)/2
        ans = max(ans, tnt)
    tnt = 0

print(ans)


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

E = []

for i in range(N):
    E.append((P[i]+1)/2)

tnt = sum(E[:K])
ans = tnt

for i in range(N-K):
    tnt = tnt + E[K+i] - E[i]
    ans = max(ans, tnt)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

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

MV = 0
add = 0
m = 0 #何番目のサイコロを最後に含むか
ev = 0
lst = deque()

for i in range(K, N+1):
    for j in range(i-K, i):
        add += p[j]
        m = j
    if MV < add:
        MV = add
        for k in range(m-K+1, m+1):
            ev += ((p[k]*(p[k]+1))/2)/p[k]
        lst.append(ev)

    add = 0
    ev = 0

print(lst.pop())

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

E = []

for i in range(N):
    E.append((P[i]+1)/2)

tnt = sum(E[:K])
ans = tnt

for i in range(N-K):
    tnt = tnt + E[K+i] - E[i]
    ans = max(ans, tnt)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = list(map(float, input().split()))
MV = 0
add = 0
m = 0 #何番目のサイコロを最後に含むか
ev = 0
lst = []
for i in range(K, N+1):
    for j in range(i-K, i):
        add += p[j]
        m = j
    if MV < add:
        MV = add
        for k in range(m-K+1, m+1):
            ev += ((p[k]*(p[k]+1))/2)/p[k]

    lst.append(ev)
    add = 0
    ev = 0

print(float(max(lst)))

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

E = []

for i in range(N):
    E.append((P[i]+1)/2)

tnt = sum(E[:K])
ans = tnt

for i in range(N-K):
    tnt = tnt + E[K+i] - E[i]
    ans = max(ans, tnt)

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

count = 1

for i in range(1, N):
    if p[i] < min(p[:i]):
        count +=1

print(count)

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

count = 1
min = p[0]

for i in range(1, N):
    if p[i] < min:
        count +=1
        min = p[i]
    

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

WA_count = 0
AC_count = 0
Penal = 0
d = {}
d_W = {}

for i in range(1, M+1):
    p, S = list(map(str, input().split()))
    if S == "WA":
        if p not in d_W.keys():
            d_W[p] = 1
        else:
            d_W[p] += 1
    else:
        if p not in d.keys():
            d[p] = d_W[p]

    # if S == "WA":
    #     WA_count += 1
    # else:
    #     if p not in d.keys():
    #         d[p] = WA_count
    #         WA_count = 0
    #     else:
    #         WA_count = 0
        # cor.append(p)
        # if AC_count != set(cor):
        #     AC_count = set(cor)
        #     Penal += WA_count
        #     WA_count = 0
        # else:
        #     WA_count = 0

print(len(d), sum(d.values()))

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

WA_count = 0
AC_count = 0
Penal = 0
d = {}
d_W = {}

for i in range(1, M+1):
    p, S = list(map(str, input().split()))
    if S == "WA":
        if p not in d_W.keys():
            d_W[p] = 1
        else:
            d_W[p] += 1
    else:
        if p not in d_W.keys():
            d[p] = 0
        elif p not in d.keys():
            d[p] = d_W[p]

    # if S == "WA":
    #     WA_count += 1
    # else:
    #     if p not in d.keys():
    #         d[p] = WA_count
    #         WA_count = 0
    #     else:
    #         WA_count = 0
        # cor.append(p)
        # if AC_count != set(cor):
        #     AC_count = set(cor)
        #     Penal += WA_count
        #     WA_count = 0
        # else:
        #     WA_count = 0

print(len(d), sum(d.values()))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())

count = 0

for i in range(1, N):
    if S[i-1] == 'A' and S[i] =='B' and S[i+1] == 'C':
        count += 1

print(count)

Fixed submission:
N = int(input())
S = str(input())

count = 0

for i in range(1, N-1):
    if S[i-1] == 'A' and S[i] =='B' and S[i+1] == 'C':
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
from collections import deque

S = str(input())
T = str(input())

print(T, S, sep='')


Fixed submission:

S, T = map(str,input().split())
print(T, S, sep='')
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

print(int((a * b) / np.gcd(a, b)))


Fixed submission:
import fractions

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

print(int((a * b) / fractions.gcd(a, b)))

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

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

print(int((a * b) / math.gcd(a, b)))

Fixed submission:
import fractions

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

print(int((a * b) / fractions.gcd(a, b)))
Buggy python submission (verdict: Runtime Error):
S = int(input())

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else:
    print(1)

Fixed submission:
S = str(input())

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else:
    print(1)

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

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else*
    print(1)


Fixed submission:
S = str(input())

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()
if N%2 == 1:
    print('No')
    exit()

n = (N/2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')

Fixed submission:
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()
if N%2 == 1:
    print('No')
    exit()

n = (N//2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')

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

if N%2 == 1:
    print('No')
    exit()

n = (N/2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')


Fixed submission:
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()
if N%2 == 1:
    print('No')
    exit()

n = (N//2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()

n = math.ceil(N/2)
j = True

if N%2 == 0:
    for i in range(n):
    if S[i] != S[i + n]:
        j = False
else:
    for i in range(n-1):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')


Fixed submission:
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()
if N%2 == 1:
    print('No')
    exit()

n = (N//2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()

n = math.ceil(N/2)
j = True

try:
    for i in range(n):
    if S[i] != S[i + n]:
        j = False
except:
    break

if j:
    print('Yes')
else:
    print('No')


Fixed submission:
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()
if N%2 == 1:
    print('No')
    exit()

n = (N//2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()

n = math.ceil(N/2)
j = True

for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')

Fixed submission:
import math
N = int(input())
S = str(input())

if N == 1:
    print('No')
    exit()
if N%2 == 1:
    print('No')
    exit()

n = (N//2)
j = True


for i in range(n):
    if S[i] != S[i + n]:
        j = False

if j:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from collections import deque

N = int(input())
H = deque(map(float, input().split()))

prev = H.popleft()

for i in range(N-2):
    cor = H.popleft()
    if prev - cor < -1:
        print('No')
        exit()
    prev = cor

cor = H.popleft()

if cor - prev < 0:
    print('No')
    exit()
    
print('Yes')

Fixed submission:
from collections import deque

N = int(input())
H = deque(map(float, input().split()))

ato = H.pop()

if N == 1:
    print('Yes')
    exit()

for i in range(N-1, 0, -1):
    mae = H.pop()
    if ato - mae < -1:
        print('No')
        exit()
    elif ato - mae == -1:
        ato = mae - 1
    else:
        ato = mae

print('Yes')
Buggy python submission (verdict: Runtime Error):
N = int(input())
M = list(map(int, input().split()))

count = 0
for i, m enumerate(M, 1):
    if i != m:
        count += 1

if count > 2:
    print('NO')
else:
    print('YES')

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

count = 0
for i, m in enumerate(M, 1):
    if i != m:
        count += 1

if count > 2:
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
x = int(input())

if x >= 30:
  print('Yes')
else
  print('No')

Fixed submission:
# -*- coding: utf-8 -*-
x = int(input())

if x >= 30:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
h, n = map(int, input().split())
a = list(map(int, input().split()))

sum = 0
for i int range(n):
  sum += a[i]

if h <= sum:
  print('YES')
else:
  print('NO')


Fixed submission:
h, n = map(int, input().split())
a = list(map(int, input().split()))
 
sum = 0
for i in range(n):
  sum += a[i]
 
if h <= sum:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(num) for num in input().split()]

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9)+7)
print(ans)

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

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9+7)
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(num) for num in input().split()]

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9)+7))
print(ans)

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

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = [int(num) for num in input().split()]
ans = [1] * N

for i in range(M):
    A, B = map(int, input().split())
    if(H[A-1] > H[B-1]):
        ans[B-1] = 0
    elif(H[B-1] > H[A-1]):
        ans[A-1] = 0
    else:
        ans[A-1] = 0
        ans[B-1] = 0

print(sum(ans))

Fixed submission:
N, D = map(int, input().split())
ans = 0

DD = D*D
for i in range(N):
    x, y = map(int, input().split())

    if(x*x + y*y <= DD):
        ans += 1 

print(ans)

Buggy python submission (verdict: Runtime Error):
20 100000
14309 -32939
-56855 100340
151364 25430
103789 -113141
147404 -136977
-37006 -30929
188810 -49557
13419 70401
-88280 165170
-196399 137941
-176527 -61904
46659 115261
-153551 114185
98784 -6820
94111 -86268
-30401 61477
-55056 7872
5901 -163796
138819 -185986
-69848 -96669

Fixed submission:
N, D = map(int, input().split())
ans = 0

DD = D*D
for i in range(N):
    x, y = map(int, input().split())

    if(x*x + y*y <= DD):
        ans += 1 

print(ans)
Buggy python submission (verdict: Runtime Error):
K = int(input())

a = [0] * 1000000
a[0] = 7 % K
for i in range(1000000):
    a[i+1] = (a[i] * 10 + 7) % K 
    
    if (a[i] == 0):
        break

if(i == 999999):
    print('-1')
else:
    print(i+1)


Fixed submission:
K = int(input())

a = [0] * 1000001
a[0] = 7 % K
for i in range(1000000):
    a[i+1] = (a[i] * 10 + 7) % K 
    
    if (a[i] == 0):
        break

if(i == 999999):
    print('-1')
else:
    print(i+1)
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

A = 0
while(True):
    if(pow(A, 5) >= X):
        break
    else:
        A += 1

Aminus1 = A-1
Apow5 = pow(A,5)
Aminus1pow5 = pow(A-1, 5)

B = 0
while(True):
    Bpow5 = pow(B, 5)
    if(Apow5-Bpow5 == X):
        print(A, B)
        break
    elif(Aminus1pow5 + Bpow5 == X):
        print(A-1, -B)
        break
    else:
        B +=1


Fixed submission:
X = int(input())

for A in range(-118, 120):
    for B in range(-119, 119):
        A5 = pow(A,5)
        B5 = pow(B,5)
        if( (A5-B5) == X):
            ans = str(A) + ' ' + str(B)
            break

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

for i in range(1, N+1):
        ans = Mgr.count(i)
        print(ans)


Fixed submission:
N = int(input())
Mgr = [int(num) for num in input().split()]
sub = [0]*N

for i in range(len(Mgr)):
    sub[Mgr[i]-1] += 1

for i in range(N):
    print(sub[i])
Buggy python submission (verdict: Runtime Error):
N = int(input())
As = [int(i) for i in input().split()]

iter = 0
ans = 0
while(True):
  while(As[iter] != (iter+1)):
    del As[iter]
    ans += 1
  iter += 1

  if(iter >= len(As)):
    break
print(ans)

Fixed submission:
N = int(input())
As = [int(i) for i in input().split()]

ColNum = 1
ans = 0
for i in range(N):
  if(As[i] != ColNum):
    ans += 1
  else:
    ColNum += 1

if(ColNum == 1):
  ans = -1

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

ans = 0
for i in range(N):
    current = 0
    if(N-i < ans):
        break
    
    while(True):
        if(i==N-1):
            break
        elif(H[i] >= H[i+1]):
                current += 1
                i += 1
        else:
            break

    if(current > ans):
        ans = current

print(ans)



Fixed submission:
N = int(input())
H = [int(x) for x in input().split()]
 
ans = 0
current = 0
for i in range(N):
    if(i == N-1):
        if(current > ans):
            ans = current
        break
    if(H[i] >= H[i+1]):
        current += 1
    else:
        if(ans < current):
            ans = current
        current = 0
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = [int(x) for x in input().split()]
print(H)
ans = 0
for i in range(N):
    current = 0
    if(N-i < ans):
        break
    
    while(True):
        if(i==N-1):
            break
            \
        elif(H[i] >= H[i+1]):
                current += 1
                i += 1
        else:
            break

    if(current > ans):
        ans = current

print(ans)



Fixed submission:
N = int(input())
H = [int(x) for x in input().split()]
 
ans = 0
current = 0
for i in range(N):
    if(i == N-1):
        if(current > ans):
            ans = current
        break
    if(H[i] >= H[i+1]):
        current += 1
    else:
        if(ans < current):
            ans = current
        current = 0
 
print(ans)

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

ans = 0
for i in range(N):
    current = 0
    while(True):
        if(i==N-1):
            break
        elif(H[i] >= H[i+1]):
                current += 1
                i += 1
        else:
            break

    if(current > ans):
        ans = current

print(ans)



Fixed submission:
N = int(input())
H = [int(x) for x in input().split()]
 
ans = 0
current = 0
for i in range(N):
    if(i == N-1):
        if(current > ans):
            ans = current
        break
    if(H[i] >= H[i+1]):
        current += 1
    else:
        if(ans < current):
            ans = current
        current = 0
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = ['']*N
 
for i in range(N):
  str = input()
  s[i] = ''.join(sorted(str))
 
s.sort()
ans = 0
for i in range(N):
  ans += s[i+1:].count(s[i])
  
print(ans)


Fixed submission:
N = int(input())
s = ['']*N
 
for i in range(N):
	str = input()
	s[i] = ''.join(sorted(str))
 
s.sort()
ans = 0

#for i in range(N):
i = 0
while (i < N):
	current = s[i]
	same = 1
	while(i < N-1):
		if(s[i+1] == current):
			i += 1
			same += 1
		else:
			break

	ans += same * (same - 1)//2
	#print(i, same, ans)
	i += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = ['']*N

for i in range(N):
  str = input()
  s[i] = ''.join(sorted(str))

s.sort()
ans = 0
for i in range(N):
  ans += s[i+1:].count(s[i])
  
print(ans)
  
  

Fixed submission:
N = int(input())
s = ['']*N
 
for i in range(N):
	str = input()
	s[i] = ''.join(sorted(str))
 
s.sort()
ans = 0

#for i in range(N):
i = 0
while (i < N):
	current = s[i]
	same = 1
	while(i < N-1):
		if(s[i+1] == current):
			i += 1
			same += 1
		else:
			break

	ans += same * (same - 1)//2
	#print(i, same, ans)
	i += 1

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

FLAG = True
for i in range(N):
  current = H[i]
  for j in range(i, N):
    if ( (current-H[j])>1):
      FLAG = False

      break;
      
if(FLAG == True):
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
list = input().split()
H = [int(x) for x in list]
 
FLAG = True
current = H[N-1]
for i in reversed(range(N-1)):
  if(H[i]-1 > current):
    FLAG = False
    break
  elif(H[i]-1 == current):
    H[i] = H[i] -1
  else:
    H[i] = H[i]
  current = H[i]
  
if(FLAG == True):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N, X = map(int,input().split())

L = input().split()
pos = 0
ans = 1
for i in range(N+1):
  pos += int(L[i])
  if(pos <= X):
    ans +=1
  else:
    break
  
print(ans)


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

L = input().split()
pos = 0
ans = 1
for i in range(N):
  pos += int(L[i])
  if(pos <= X):
    ans +=1
  else:
    break
  
print(ans)

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

L = input().split()
pos = 0
for i in range(N+1):
  pos += int(L[i])
  if(pos > X):
    break
  
print(i+1)


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

L = input().split()
pos = 0
ans = 1
for i in range(N):
  pos += int(L[i])
  if(pos <= X):
    ans +=1
  else:
    break
  
print(ans)

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

L = input().split()
cnt = 0
pos = 0
for i in range(N+1):
        if(pos <= X):
                pos += int(L[i])
                cnt += 1
        else:
                break
print(cnt)


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

L = input().split()
pos = 0
ans = 1
for i in range(N):
  pos += int(L[i])
  if(pos <= X):
    ans +=1
  else:
    break
  
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())

broken = [0]*M
ans = [0]*(N+1)

for i in range(M):
    a = int(input())
    broken[i] = a

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
else:
    ans[1] = 1

for i in range(2,N+1):
    if (i in broken):
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)

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

broken = [N+1]*(M+1)
ans = [0]*(N+1)
broken_pointer = 0
for i in range(M):
    a = int(input())
    broken[i] = a

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
    broken_pointer += 1
else:
    ans[1] = 1

for i in range(2,N+1):
    if (broken[broken_pointer] == i):
        ans[i] = 0
        broken_pointer += 1
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)

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

broken = []
ans = [0]*(N+1)

for i in range(M):
    a = int(input())
    broken.append(a)

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
else:
    ans[1] = 1

for i in range(2,N+1):
    if (i in broken):
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)

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

broken = [N+1]*(M+1)
ans = [0]*(N+1)
broken_pointer = 0
for i in range(M):
    a = int(input())
    broken[i] = a

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
    broken_pointer += 1
else:
    ans[1] = 1

for i in range(2,N+1):
    if (broken[broken_pointer] == i):
        ans[i] = 0
        broken_pointer += 1
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)

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

broken = []
ans = [0]*(N+1)

for i in range(M):
    a = int(input())
    broken.append(a)

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
else:
    ans[1] = 1

for i in range(2,N+1):
    if (i in broken):
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)

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

broken = [N+1]*(M+1)
ans = [0]*(N+1)
broken_pointer = 0
for i in range(M):
    a = int(input())
    broken[i] = a

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
    broken_pointer += 1
else:
    ans[1] = 1

for i in range(2,N+1):
    if (broken[broken_pointer] == i):
        ans[i] = 0
        broken_pointer += 1
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)
Buggy python submission (verdict: Runtime Error):
A, P =map(int,input().split())

print(int((A*3+p)/2))

Fixed submission:
A, P =map(int,input().split())
 
print(int((A*3+P)/2))