Problem p03013 (python)

Fixed submission:
N, M = list(map(int, input().split()))
A = {i: 0 for i in range(N+1)}
mod = 10 ** 9 + 7
for _ in range(M):
    A[int(input())] = 1
 
dp = [0 for _ in range(N+1)]
dp[0] = 1
 
for i in range(N+1):
    if A.get(i+1) == 0:
        dp[i + 1] += dp[i]
    if A.get(i+2) == 0:
        dp[i + 2] += dp[i]
 
print(dp[N]%mod)

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

n,m=map(int,input().split())
step=list(range(2,n+1))
broken=[]
for i in range(m):
    broken+=[int(input())]
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if m==0:
    dp[1]=1
elif not broken[0]==1:
    dp[1]=1
b=deque(broken)
if len(broken) != 0:
    bad_one = b.popleft()
    if bad_one==1:
        bad_one=b.popleft()
else:
    bad_one = -1
for i in step:
    if i != bad_one:
        dp[i]=(dp[i-1]+dp[i-2])%mod
    elif i == bad_one and len(b) != 0:
        bad_one = b.popleft()
print(dp[n])

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

n,m=map(int,input().split())
step=list(range(2,n+1))
broken=[]
for i in range(m):
    broken+=[int(input())]
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if m==0:
    dp[1]=1
elif not broken[0]==1:
    dp[1]=1
b=deque(broken)
if len(broken) != 0:
    bad_one = b.popleft()
for i in step:
    if i != bad_one:
        dp[i]=(dp[i-1]+dp[i-2])%mod
    elif i == bad_one and len(b) != 0:
        bad_one = b.popleft()
print(dp[n])

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

n,m=map(int,input().split())
step=list(range(2,n+1))
broken=[]
for i in range(m):
    broken+=[int(input())]
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if m==0:
    dp[1]=1
elif not broken[0]==1:
    dp[1]=1
b=deque(broken)
bad_one = b.popleft()
for i in step:
    if i != bad_one:
        dp[i]=(dp[i-1]+dp[i-2])%mod
    elif i == bad_one and len(b) != 0:
        bad_one = b.popleft()
print(dp[n])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
step=list(range(2,n+1))
broken=[]
for i in range(m):
    broken+=[int(input())]
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if not broken[0]==1:
    dp[1]=1
for i in step:
    if not i in broken:
        dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[n])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
step=list(range(1,n+1))
broken=[]
for i in range(m):
    broken+=[int(input())]
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if not broken[0]==1:
    dp[1]=1
for i in enable:
  	if not i in broken:
      	dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[n])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
step=list(range(n+1))
mod=10**9+7
for i in range(m):
    step.remove(int(input()))
dp=[0]*n+1
dp[0]=1
dp[1]=1
step.remove(0)
for i in range(2,n):
    dp[i]=(dp[i-1]+dp[i-2])
print(dp[n]%mod)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
step=list(range(n+1))
mod=10**9+7
for i in range(m):
    step.remove(int(input()))
dp=[0]*n+1
dp[0]=1
if step[1]==1:
    dp[1]=1
    step.remove(1)
step.remove(0)
for i in step:
    dp[i]=(dp[i-1]+dp[i-2])
print(dp[n]%mod)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
step=list(range(n))
mod=10**9+7
for i in range(m):
    step.remove(int(input())-1)
dp=[0]*n
dp[0]=1
if step[1]==1:
    dp[1]=1
    step.remove(1)
step.remove(0)
for i in step:
    dp[i]=(dp[i-1]+dp[i-2])
print(dp[n-1]%mod)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input())
step=list(range(1,n))
for i in range(m):
    step.remove(int(input()))
dp=[0]*n
dp[0]=1
if step[1]=2:
    dp[1]=1
    step.remove(2)
else:
    step.remove(3)
step.remove(1)
for i in step:
    dp[i]=(dp[i-1]+dp[i-2])%1000000007
print(dp[n])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input())
step=list(range(1,n))
for i in range(m):
    step.remove(int(input()))
dp=[0]*n
dp[0]=1
if step[1]=2:
    dp[1]=1
for i in step:
    dp[i]=(dp[i-1]+dp[i-2])%1000000007
print(dp[n])