ZhenlongDai/ACPR huggingface dataset:
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int,input().split())
A = []
for i in range(M):
    A.append(int(input()))
print(A)
count = [0] * (N+1)
count[0] = 1
mod = 10 ** 9 + 7
if 1 in A:
    if 2 in A:
        print(0)
        exit()
    count[2] = 1
    start = 3
else:
    count[1] = 1
    start = 2
for i in range(start, N+1):
    if i in A:
        continue
    count[i] = count[i-1] + count[i-2]
    count[i] %= mod

print(count[N])

Failing test case input:
6 1
3

Expected output:
4

Actual output:
[3]
4


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
MOD = 10 ** 9 + 7
dp = [0] * (N+1)
dp[0] = 1
a = set()
for _ in range(M):
    a.add(int(input()))
if 1 in a:
    if 2 in a:
        print(0)
        exit()
    dp[2] = 1
    start = 3
else:
    dp[1] = 1
    start = 2
for i in range(start, N+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= MOD
print(dp[N])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int,input().split())
a = [0] * (N+1)
for i in range(M):
    a[i] = int(input())
mod = 1000000007
ans = [0] * (N+1)
ans[0] = 1
for i in range(1,N+1):
     ans[i] = (ans[i-2]*a[i-2] + ans[i-1]*a[i-1]) % mod
print(ans[N])

Failing test case input:
011 1
1
133
140
8
24

Expected output:
55


Actual output:
0


Fixed submission (verdict: Accepted):
N, M = map(int,input().split())
a = [1] * (N+1)
for i in range(M):
    a[int(input())] = 0
mod = 1000000007
ans = [0] * (N+1)
ans[0] = 1
for i in range(1,N+1):
     ans[i] = (ans[i-2]*a[i-2] + ans[i-1]*a[i-1]) % mod
print(ans[N])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int, input().split())
a=list()
for i in range(m):
    a.append(int(input()))

mod=10e9+7

inf=float('inf')

dp=[inf]*(n+1)
dp[0]=1
dp[1]=1

for i in a:
    dp[i]=0

for i in range(2,n+1):
    dp[i] = min(dp[i], dp[i-1]+dp[i-2]) % mod

print(int(dp[-1]))

Failing test case input:
100 4
1
23
65
27
31

Expected output:
34319280


Actual output:
778723341


Fixed submission (verdict: Accepted):
n,m=map(int, input().split())
a=list()
for i in range(m):
    a.append(int(input()))

mod=1e9+7

inf=float('inf')

dp=[inf]*(n+1)
dp[0]=1
dp[1]=1

for i in a:
    dp[i]=0

for i in range(2,n+1):
    dp[i] = min(dp[i], dp[i-1]+dp[i-2]) % mod

print(int(dp[-1]))
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int,input().split())
mod=10**9+7
A=[1]*(N+1)
for i in range(M):
  a=int(input())
  A[a]=0
print(A)
for i in range(2,N+1):
  if A[i]!=0:
    A[i]=(A[i-1]+A[i-2])%mod
print(A[-1]%mod)
print(A)

Failing test case input:
100 3
1
23
45
47
89

Expected output:
733629168


Actual output:
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
733629168
[1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 0, 10946, 10946, 21892, 32838, 54730, 87568, 142298, 229866, 372164, 602030, 974194, 1576224, 2550418, 4126642, 6677060, 10803702, 17480762, 28284464, 45765226, 74049690, 119814916, 0, 119814916, 119814916, 239629832, 359444748, 599074580, 958519328, 557593901, 516113222, 73707116, 589820338, 663527454, 253347785, 916875239, 170223017, 87098249, 257321266, 344419515, 601740781, 946160296, 547901070, 494061359, 41962422, 536023781, 577986203, 114009977, 691996180, 806006157, 498002330, 304008480, 802010810, 106019283, 908030093, 14049369, 922079462, 936128831, 858208286, 794337110, 652545389, 446882492, 99427874, 546310366, 645738240, 192048599, 837786839, 29835431, 867622270, 897457701, 765079964, 662537658, 427617615, 90155266, 517772881, 607928147, 125701021, 733629168]


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
mod=10**9+7
A = {int(input()) for i in range(M)}

if 1 in A:
  x=0
else:
  x=1
B=[1,x]
for i in range(2,N+1):
  if i in A:
    B +=[0]
  else:
    B +=[(B[i-1]+B[i-2])%mod]
print(B[-1]%mod)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
alis = list(int(input()) for _ in range(m))
dp = [-1]*(n+1)
for i in alis:
    dp[i] = 0
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = dp[i-1] + dp[i-2]
print(dp[n]%1000000007)

Failing test case input:
111 2
1
23
44
101
89

Expected output:
426572798


Actual output:
876328947


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
alis = list(int(input()) for _ in range(m))
dp = [-1]*(n+1)
mod = 10**9 + 7
for i in alis:
    dp[i] = 0
dp[0] = 1
dp[1] = 1 if 1 not in alis else 0
for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print(dp[n])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
A = []
for i in range(M):
  A.append(int(input()))

dp = [0] * (N+1)
dp[0] = 1
if 1 in A:
  dp[1] = 0
else:
  dp[1] = 1
div = 1000000007

for i in range(2,N+1):
  if (dp[i-1] == 0) & (dp[i-2]==0):
    print(0)
    exit()
  elif i in A:
    continue
  else:
    dp[i] = dp[i-1]+dp[i-2]

print(dp[N])


Failing test case input:
100 5
1
6
45
67
1

Expected output:
731163710


Actual output:
4524068290399641516


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
A = []
for i in range(M):
  A.append(int(input()))

A = set(A)
dp = [0] * (N+1)
dp[0] = 1
if 1 in A:
  dp[1] = 0
else:
  dp[1] = 1
mod = 1000000007

for i in range(2,N+1):
  if (dp[i-1] == 0) & (dp[i-2]==0):
    print(0)
    exit()
  elif i in A:
    continue
  else:
    dp[i] = dp[i-1]+dp[i-2]

print(dp[N]%mod)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
alis = list(int(input()) for _ in range(m))
dp = [-1]*(n+1)
for i in alis:
    dp[i] = 0
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = dp[i-1] + dp[i-2]
print(dp[n])

Failing test case input:
101 4
2
16
50
27
31

Expected output:
796411630


Actual output:
4622174573151633410


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
alis = list(int(input()) for _ in range(m))
dp = [-1]*(n+1)
mod = 10**9 + 7
for i in alis:
    dp[i] = 0
dp[0] = 1
dp[1] = 1 if 1 not in alis else 0
for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print(dp[n])

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

n, m = map(int, input().split())
dp = [-1] * (n + 1)
for i in range(m):
    a = int(input())
    dp[a] = 0
    if i == 0 and a != 1:
        dp[1] = 1
mod = 10 ** 9 + 7

dp[0] = 1
for i in range(1, n):
    if dp[i + 1] == 0:
        continue
    dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])

Failing test case input:
18 -2
4
-1

Expected output:
4181


Actual output:
999999020


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
dp = [0] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    dp[aa] = -1
    a.append(aa)
for i in range(m - 1):
    if a[i] + 1 == a[i + 1]:
        print(0)
        exit()
mod = 10 ** 9 + 7

dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = 0
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])
Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,M =map(int,input().split())
a = [int(input()) for i in range(M)]
DP = [1]*N
mod = 10**9 + 7
for i in a:
    DP[i-1] = 0
if(N != 1):
    for i in range(N):
        if(DP[i] != 0):
            if(i<1):
                DP[i+1] = DP[i]%mod
            else:
                DP[i] = (DP[i-2] + DP[i-1])%mod
else:
    DP = [1]
print(DP[-1])

Failing test case input:
4 1
2

Expected output:
1


Actual output:
5


Fixed submission (verdict: Accepted):
N,M =map(int,input().split())
a = [int(input()) for i in range(M)]
DP = [1]*N
mod = 10**9 + 7
for i in a:
    DP[i-1] = 0
if(N != 1):
    for i in range(N):
        if(DP[i] != 0):
            if(i<1):
                DP[i] = DP[i-1]%mod
            else:
                DP[i] = (DP[i-2] + DP[i-1])%mod
else:
    DP = [1]
print(DP[-1])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
a=[]
for i in range(m):
  a.append(int(input()))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(n-1):
  if i not in a:
    b[i+1]+=b[i]
    b[i+2]+=b[i]
  else:
    b[i]=0

if n not in a:
  b[n]+=b[n-1]

print(b[n]%(10**9+7))


Failing test case input:
4 1
3

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
a=[]
a = set(int(input()) for _ in range(m))


b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    continue
  x=b[i-1]
  if i>1:x+=b[i-2]
  b[i]=x
print(b[n]%(10**9+7))

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
MOD=1000000007

dp=[0]*(n+1)
for i in range(1,n+1):
  if i in a:
    dp[i]=0
  else:
    if i==1:
      dp[i]=1
    elif i==2:
      dp[i]=2
    else:
      dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%MOD)

Failing test case input:
111 2
1
23
44
101
89

Expected output:
426572798


Actual output:
853145596


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
a=set(a)
MOD=1000000007

dp=[0]*(n+1)
for i in range(1,n+1):
  if i in a:
    dp[i]=0
  else:
    if i==1:
      dp[i]=1
    elif i==2:
      dp[i]=dp[1]+1
    else:
      dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%MOD)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int,input().split())
mod=10**9+7
A=[1]*(N+2)
for i in range(M):
  a=int(input())
  A[a+1]=0
for i in range(2,N+2):
  if A[i]!=0:
    A[i]=(A[i-1]+A[i-2])%mod
print(A[-1]%mod)

Failing test case input:
101 5
2
23
48
67
89

Expected output:
157493236


Actual output:
314986472


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
mod=10**9+7
A = {int(input()) for i in range(M)}

if 1 in A:
  x=0
else:
  x=1
B=[1,x]
for i in range(2,N+1):
  if i in A:
    B +=[0]
  else:
    B +=[(B[i-1]+B[i-2])%mod]
print(B[-1]%mod)
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
brokensteps = set([int(input()) for x in range(m)])
dp = [0] * (n+1)
for i in range(n+1):
    if i in brokensteps:
        dp[i] = 0
        continue
    
    elif i <= 1:
        dp[i] = 1

    else:
        dp[i] = (dp[i-1] + dp[i-2])%(10**9+7)

print(dp)

Failing test case input:
18 -2
4
-1

Expected output:
4181


Actual output:
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181]


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
brokensteps = set([int(input()) for x in range(m)])
dp = [0] * (n+1)
for i in range(n+1):
    if i in brokensteps:
        dp[i] = 0
        continue
    
    elif i <= 1:
        dp[i] = 1

    else:
        dp[i] = (dp[i-1] + dp[i-2])%(10**9+7)

print(dp[n])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int, input().split())
DIV = 10*8+7
a = [0]*(n+1)
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 1
for _ in range(m):
    broken = int(input())
    a[broken] = 1
for i in range(2,n+1):
    dp[i]=(dp[i-1]+dp[i-2]) % DIV
    if a[i] == 1:
        dp[i] = 0
print(dp[n])


Failing test case input:
100 5
1
23
21
47
89

Expected output:
358254682


Actual output:
43


Fixed submission (verdict: Accepted):
n,m = map(int, input().split())
DIV = 10**9+7
a = [0]*(n+1)
dp = [0]*(n+1)
dp[0] = 1
for _ in range(m):
    broken = int(input())
    a[broken] = 1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2]) % DIV
    if a[i] == 1:
        dp[i] = 0
print(dp[n])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
o = [int(input()) for _ in range(m)]
print(o)
mod = (10**9)+7
dp = [1]+[0]*(n)
flag1 = False

for i in range(n):
  if i+1 not in o:
    dp[i+1] = dp[i] + dp[i-1]
  else:
    dp[i+1] = 0
  

print(dp[-1]%mod)

Failing test case input:
10 2
4
5

Expected output:
0

Actual output:
[4, 5]
0


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
o = set(int(input()) for _ in range(m))

mod = (10**9)+7
dp = [0]*(n+1)
dp[0] = 1

for i in range(1,n+1):
  dp[i] = (dp[i-1]+dp[i-2])%mod
  if i in o:
    dp[i] = 0
  

print(dp[-1])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
mod = 10**9 + 7

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

for i in range(m):
    a[int(input())] = 1

l = [0] * (n + 1)
l[n] = 1
l[n-1] = 1

num = n - 2
while num >= 0:
    if a[num] == 0:
        l[num] = (l[num+1] % mod) + (l[num+2] % mod)
    else:
        l[num] = 0
    num -= 1

print(l[0])

Failing test case input:
4 1
3

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
mod = 10**9 + 7

n, m = map(int, input().split())
a = [1] * (n + 1)

for i in range(m):
    a[int(input())] = 0

l = [-1] * (n + 1)
l[n] = 1
l[n-1] = a[n-1]

num = n - 2
while num >= 0:
    if a[num] == 1:
        l[num] = (l[num+1] + l[num+2]) % mod
    else:
        l[num] = 0
    num -= 1

print(l[0])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int, input().split())
DIV = 10**9+7
a = [0]*(n+1)
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 1
for _ in range(m):
    broken = int(input())
    a[broken] = 1
for i in range(2,n+1):
    dp[i]=(dp[i-1]+dp[i-2]) % DIV
    if a[i] == 1:
        dp[i] = 0
print(dp[n])


Failing test case input:
100 2
1
24
151
001
89

Expected output:
738895863


Actual output:
39022254


Fixed submission (verdict: Accepted):
n,m = map(int, input().split())
DIV = 10**9+7
a = [0]*(n+1)
dp = [0]*(n+1)
dp[0] = 1
for _ in range(m):
    broken = int(input())
    a[broken] = 1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2]) % DIV
    if a[i] == 1:
        dp[i] = 0
print(dp[n])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

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

print (step[N] % 1000000007)


Failing test case input:
100 5
1
23
21
27
89

Expected output:
40991458


Actual output:
868028435


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

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

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

print (step[-1] % 1000000007)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
mod = 1000000007
dp = [0] * (N+2)
A = [int(input()) for _ in range(M)] 
dp[-1] = 1

for i in range(N-1, -1, -1):
    if (i in A) == False:
        dp[i] = (dp[i + 1] + dp[i + 2]) % mod 

print(dp[0])



Failing test case input:
101 4
2
16
50
27
31

Expected output:
796411630


Actual output:
146619849


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
mod = 1000000007
dp = [0] * (N+2)
A = set([int(input()) for _ in range(M)]) 
dp[-2] = 1

for i in range(N-1, -1, -1):
    if (i in A) == False:
        dp[i] = (dp[i + 1] + dp[i + 2]) % mod 

print(dp[0])

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,M = map(int,input().split())
H = []
for i in range(M):
  H.append(int(input()))

dp = [0]*(N+1) 
dp[0] = 1
dp[1] = 0 if 1 in H else 1
for i in range(2,N+1):
  if i in H:
    dp[i] = 0
  else:
    dp[i] = (dp[i-1]+dp[i-2])%1000000007

Failing test case input:
10 2
4
5

Expected output:
0

Actual output:

Fixed submission (verdict: Accepted):
mod = 10**9+7
n,m = map(int,input().split())
a = set()
for i in range(m):
  a.add(int(input()))
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1) :
    dp[i] = (dp[i-1] + dp[i-2]) % mod
    if i in a :
        dp[i] = 0
print(dp[n])
Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, M = map(int, input().split())

mod = 10**9 + 7

li = [0]*(N+1)
li[0] = 1
li[1] = 1
for i in range(M):
    a = int(input())
    li[a] = -1

for i in range(2, N+1):
    if li[i] == 0:
        li[i] = (li[i-1] + li[i-2]) % mod
    else:
        li[i] = 0

print(li[-1])


Failing test case input:
110 3
1
23
4
47
17

Expected output:
294219152


Actual output:
705780855


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

mod = 10**9 + 7

li = [0]*(N+2)
li[0] = 0
li[1] = 1
for i in range(M):
    a = int(input())+1
    li[a] = -1

for i in range(2, N+2):
    if li[i] == -1:
        li[i] = 0
    else:
        li[i] = (li[i-1] + li[i-2]) % mod

print(li[-1])

Problem: p03013
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = list(map(int, input().split()))
aaa = list(int(input()) for i in range(m))

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

for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1])  % MOD


Failing test case input:
6 1
1

Expected output:
5


Actual output:

Fixed submission (verdict: Accepted):
n, m = list(map(int, input().split()))
broken = [False] * (n + 1)
for _ in range(m):
    broken[int(input())] = True

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if not broken[1] else 0
MOD = 10 ** 9 + 7

for i in range(2, n + 1):
    if not broken[i - 1]:
        dp[i] += (dp[i - 1])
    if not broken[i - 2]:
        dp[i] += (dp[i - 2])
    dp[i] %= MOD

print(dp[n])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n, m = [int(i) for i in input().split()]
p = [int(input()) for i in range(m)]

a = []
a.append(0)
a.append(1)
a.append(2)
for i in range(3, n + 1):
    if i in p:
        a.append(0)
    else:
        a.append(a[i - 2] + a[i - 1])
    
print(a[n] % 1000000007)

Failing test case input:
100 1
2
23
44
58
89

Expected output:
593786270


Actual output:
782204094


Fixed submission (verdict: Accepted):
import math
n, m = [int(i) for i in input().split()]
p = [0 for i in range(n + 1)]
for _ in range(m):
    p[int(input())] = 1
    
a = []
a.append(1)
if p[1] == 1:
    a.append(0)
else:
    a.append(1)
for i in range(2, n + 1):
    if p[i] == 1:
        a.append(0)
    else:
        a.append((a[i - 2] + a[i - 1]) % 1000000007)
    
print(a[n])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


MOD = (10 ** 9) + 7
N, M = map(int, input().split())
A = [False] * (N + 1)
for _ in range(M):
    A[int(input())] = True
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in A:
    dp[1] = 1

for i in range(2, N + 1):
    if A[i]:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[N])


Failing test case input:
12 1
6
0

Expected output:
64


Actual output:
24


Fixed submission (verdict: Accepted):


MOD = (10 ** 9) + 7
N, M = map(int, input().split())
A = [False] * (N + 1)
for _ in range(M):
    A[int(input())] = True
dp = [0] * (N + 1)
dp[0] = 1
if A[1] == False:
    dp[1] = 1

for i in range(2, N + 1):
    if A[i] == True:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[N])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int,input().split())
a = [True]*(N+1)
for _ in range(M):
  b = int(input())
  a[b] = False

mod = 10**9+7
dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
  for j in range(i+1,min(i+2,N)+1):
    if a[j]:
      dp[j] += dp[i]
      dp[j] %= mod


print(dp)

Failing test case input:
10 2
1
3

Expected output:
13


Actual output:
[1, 0, 1, 0, 1, 1, 2, 3, 5, 8, 13]


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
a = [True]*(N+1)
for _ in range(M):
  b = int(input())
  a[b] = False

mod = 10**9+7
dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
  for j in range(i+1,min(i+2,N)+1):
    if a[j]:
      dp[j] += dp[i]
      dp[j] %= mod


print(dp[-1])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = list(map(int, input().split(' ')))
aaa = [0] * (n + 3)
for i in range(m):
    aaa[int(input())] = True

dp = [1] * (n + 3)
for i in range(1, n+1):  
    if not aaa[i]:
        dp[i]  = dp[i-1]
        dp[i] += dp[i-2]
        dp[i] = dp[i] % int(1e9 + 7)
    else:
        dp[i] = 0
print(dp[n])

Failing test case input:
16 -4
4
-1

Expected output:
1597


Actual output:
2584


Fixed submission (verdict: Accepted):
n, m = list(map(int, input().split(' ')))
aaa = [0] * (n + 3)
for i in range(m):
    aaa[int(input())] = True

dp = [1] * (n + 3)
for i in range(1, n+1):  
    if not aaa[i]:
        dp[i]  = dp[i-1]
        if i >= 2:
            dp[i] += dp[i-2]
        dp[i] = dp[i] % int(1e9 + 7)
    else:
        dp[i] = 0
print(dp[n])

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m = map(int, input().split())
a = [int(input()) for _ in range(m)]

dp = [1,1]
temp = 1
for i in range(2,n+1):
  temp = dp[i-1] + dp[i-2]
  if i in a:
    temp = 0
  dp.append(temp)

print(dp[-1]%1000000007)

Failing test case input:
10 2
1
3

Expected output:
13


Actual output:
26


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
 
dp = [0, 1]
for i in range(N):
    if i+1 in A: dp.append(0)
    else: dp.append(dp[i]+dp[i+1])
print(dp[N+1]%1000000007)
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
dp=[0]*(n+3)
for i in range(m):
    dp[int(input())]=-1

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

print(dp[n]%1000000007)

Failing test case input:
100 3
1
10
90
47
89

Expected output:
492215488


Actual output:
0


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
dp=[0]*(n+3)
dp[0]=1
for i in range(m):
    dp[int(input())]=-1

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

print(dp[n]%1000000007)

Problem: p03013
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, m = map(int, input().split())
 
forbidden = []
for i in range(m):
  forbidden.append(int(input()))
 
ans = [1, 1]
if 1 in forbidden:
  ans[-1] = 0
for i in range(2,n+1):
  if i in forbidden:
    ans.append(0)
  else:
    ans.append(ans[-1]+ans[-2])
  if ans[-1] == 0 and ans[-2] == 0:
    print(0)
  if i == n:
    print(ans[-1]%1000000007)

Failing test case input:
10 2
4
5

Expected output:
0

Actual output:
0
0
0
0
0
0
0


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
 
forbidden = []
for i in range(m):
  forbidden.append(int(input()))
forbidden = set(forbidden) 
ans = [0]*(n+1)
ans[0] = 1
if 1 not in forbidden:
  ans[1] = 1
for i in range(2,n+1):
  if i not in forbidden:
    ans[i] += ans[i - 1] + ans[i - 2]
    ans[i] %= 1000000007
print(ans[-1])

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, m = list(map(int, input().split(' ')))

bads = {}
for i in range(m):
    bads[int(input())] = None

dp = [1, 1]
for i in range(2, n):
    dp.append(0)
    if i-1 not in bads:
        dp[i] += dp[i-1]
    if i-2 not in bads:
        dp[i] += dp[i-2]
    dp[i] %= 1000000007

print(dp[-1])


Failing test case input:
011 0
1
19
1
65
104

Expected output:
144


Actual output:
89


Fixed submission (verdict: Accepted):
n, m = list(map(int, input().split(' ')))

bads = {}
for i in range(m):
    bads[int(input())] = None

dp = [1]
if 1 not in bads:
    dp.append(1)
else:
    dp.append(0)
for i in range(2, n+1):
    dp.append(0)
    if i-1 not in bads:
        dp[i] += dp[i-1]
    if i-2 not in bads:
        dp[i] += dp[i-2]
    dp[i] %= 1000000007

print(dp[-1])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
mod = 1000000007

N, M = map(int, input().split())
oks = [True] * (N + 1)
for _ in range(M):
    oks[int(input())] = False

dp = [1] * (N + 1)
for i in range(M):
    dp[i] = 0


for i in range(2, N + 1):
    if oks[i-1]:
        dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7)

print(dp[N])


Failing test case input:
101 3
1
10
90
47
89

Expected output:
778312335


Actual output:
150282414


Fixed submission (verdict: Accepted):

n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]


dp = [1] * (n+1)

for i in a:
    dp[i] = 0

for i in range(2, n+1):
    if dp[i] != 0:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (10 ** 9 + 7)

print(dp[n])

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m = map(int,input().split())
stair = []
for i in range(m):
    stair.append(int(input()))

ans = [0 for i in range(n+1)]
ans[0] = 1
ans[1] = 1
for i in range(n+1):
    if i==0:
        continue
        
    elif i in stair:
        ans[i] = 0
    else:
        ans[i] = ans[i-2] + ans[i-1]
print(ans[n])

Failing test case input:
110 1
1
85
140
8
24

Expected output:
42837731


Actual output:
26925748508234281076009


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
ans = [1]*(n+1)
for i in range(m):
    a = int(input())
    ans[a] = 0
    
for i in range(2,n+1):
    if ans[i]==0:
        continue
    else:
        ans[i] = ans[i-2] + ans[i-1]
print(ans[n]%(10**9+7))

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
p = 10**9 + 7
n,m = list(map(int, input().split()))
a = set()
a = [a.add(int(input())) for _ in range(m)]

dp = [0 for i in range(n+2)]
dp[0] = 1

for i in range(n):
    if i+2 not in a:
        dp[i+2] += dp[i]%p
    if i+1 not in a:
        dp[i+1] += dp[i]%p

print(dp[-2]%p)

Failing test case input:
100 5
1
6
45
67
89

Expected output:
229617645


Actual output:
782204094


Fixed submission (verdict: Accepted):
p = 10**9 + 7
n,m = list(map(int, input().split()))
a = set()
for _ in  range(m):
    a.add(int(input()))

dp = [0 for i in range(n+2)]
dp[0] = 1

for i in range(n):
    if i+2 not in a:
        dp[i+2] += dp[i]%p
    if i+1 not in a:
        dp[i+1] += dp[i]%p

print(dp[-2]%p)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
mod = 10**9 + 7

def check(arr):
    for i in range(m-1):
      if a[i] + 1 == a[i+1]: return 0
    dp = [0 for _ in range(n+1)]
    dp[0] = 0
    dp[1] = 1
    for i in range(2, n+1):
        if i in a: continue
        dp[i] += dp[i-1] + dp[i-2]
        dp[i] %= mod
    
    return dp[n]

print(check(n))

Failing test case input:
18 -2
4
-1

Expected output:
4181


Actual output:
2584


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
mod = int(1e9 + 7)
notbroken = [True for _ in range(n+1)]

for i in a:
  notbroken[i] = False

dp = [0 for _ in range(n+1)]
dp[0] = 1
if notbroken[1]: dp[1] = 1

for i in range(2, n+1):
    if notbroken[i]:
        dp[i] += dp[i-1] + dp[i-2]
        dp[i] %= mod

print(dp[n])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))
ans=[n]*n
ans[0]=1
for i in range(m):
    ans[a[i]-1]=0
if len(ans)>1:
    ans[1]=ans[0]+1
for j in range(n-2):
    if ans[j+2]==0:
        continue
    else:
        ans[j+2]=ans[j+1]+ans[j]
        ans[j+2]=ans[j+2]%(1000000007)
    
print(ans[n-1])


Failing test case input:
101 2
2
23
28
27
93

Expected output:
887463728


Actual output:
655439454


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))
ans=[10*9]*n
ans[0]=1
for i in range(m):
    ans[a[i]-1]=0
if len(ans)>1 and ans[1]!=0:
    ans[1]=ans[0]+1
for j in range(n-2):
    if ans[j+2]==0:
        continue
    else:
        ans[j+2]=ans[j+1]+ans[j]
        ans[j+2]=ans[j+2]%(1000000007)
    
print(ans[n-1])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
count = [[0, 0] for _ in range(n+1)]
for _ in range(m):
    a = int(input())
    count[a][1] = -1
count[0][0] = 1
count[1][0] = 1

for i in range(2, n+1):
    if -1 == count[i][1] and -1 == count[i-1][1]:
        print(0)
        exit(0)
    if -1 == count[i][1]:
        continue
    count[i][0] = count[i-1][0] + count[i-2][0]
print(count[n][0] % 1000000007)


Failing test case input:
101 4
1
23
65
27
31

Expected output:
855029413


Actual output:
271841562


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
count = [[0, False] for _ in range(n+2)]
for _ in range(m):
    a = int(input())
    count[a][1] = True
count[n][0] = 1

for i in range(n)[::-1]:
    if count[i][1] and count[i+1][1]:
        print(0)
        exit(0)
    if count[i][1]:
        continue
    count[i][0] = (count[i+1][0] + count[i+2][0])
print(count[0][0] % 1000000007)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [0]*(N+1)
dp[0] = 1

for i in range(1, N+1):
    if i in a:
        dp[i] = 0
    else:
        try:
            dp[i] = dp[i-1] + dp[i-2]
        except:
            dp[i] = dp[i-1]

print(dp[-1])


Failing test case input:
100 3
1
23
45
47
89

Expected output:
733629168


Actual output:
16724228753803229620


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [-1]*(N+1)
for i in a:
    dp[i] = 0

dp[0] = 1
mod = 1000000007

for i in range(1, N+1):
    if dp[i] == 0:
        continue
    else:
        if i > 1:
            dp[i] = (dp[i-1] + dp[i-2]) % mod
        else:
            dp[i] = dp[i-1] % mod

print(dp[-1])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
w = [1 for _ in range(n)]
for _ in range(m):
    w[int(input())] = 0
for i in range(2, n):
    if w[i] != 0:
        w[i] = w[i-2] + w[i-1]
print(w[-1] % 1000000007)

Failing test case input:
101 5
1
23
45
47
89

Expected output:
668692158


Actual output:
621622238


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
w = [1 for _ in range(n+1)]
for _ in range(m):
    w[int(input())] = 0
for i in range(2, n+1):
    if w[i] != 0:
        w[i] = w[i-2] + w[i-1]

print(w[-1] % 1000000007)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[0]*(n+2)
dp[0]=0
dp[1]=1
if m==0:
  print(0)
  exit()
for j in range(n):
  if j+1 not in a:
    dp[j+2]=(dp[j]+dp[j+1])%(10**9+7)
  else:
    dp[j+2]=0
print(dp[j+2]%(10**9+7))

Failing test case input:
17 0
7
0

Expected output:
2584


Actual output:
0


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
b=set(a)
dp=[0]*(n+2)
dp[0]=0
dp[1]=1
for j in range(n):
  if j+1 not in b:
    dp[j+2]=(dp[j]+dp[j+1])%(10**9+7)
  else:
    dp[j+2]=0
print(dp[j+2]%(10**9+7))
Problem: p03013
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

MOD = 10**9 + 7

safe = [True] * (N+1)
for i in range(len(A)):
    safe[A[i]] = False

print(safe)

dp = [0] * (N+1)
dp[0] = 1
if safe[1]:
    dp[1] = 1

for i in range(2, N+1):
    if(safe[i]):
        dp[i] = dp[i-1] + dp[(i-2)]
        dp[i] = dp[i] % MOD
    else:
        dp[i] = 0

print(dp)

Failing test case input:
110 3
1
23
4
47
17

Expected output:
294219152


Actual output:
[True, False, True, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]
[1, 0, 1, 1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 0, 2584, 2584, 5168, 7752, 12920, 20672, 33592, 54264, 87856, 142120, 229976, 372096, 602072, 974168, 1576240, 2550408, 4126648, 6677056, 10803704, 17480760, 28284464, 45765224, 74049688, 119814912, 193864600, 313679512, 507544112, 821223624, 328767729, 149991346, 478759075, 628750421, 107509489, 736259910, 843769399, 580029302, 423798694, 3827989, 427626683, 431454672, 859081355, 290536020, 149617368, 440153388, 589770756, 29924137, 619694893, 649619030, 269313916, 918932946, 188246855, 107179794, 295426649, 402606443, 698033092, 100639528, 798672620, 899312148, 697984761, 597296902, 295281656, 892578558, 187860207, 80438758, 268298965, 348737723, 617036688, 965774411, 582811092, 548585496, 131396581, 679982077, 811378658, 491360728, 302739379, 794100107, 96839479, 890939586, 987779065, 878718644, 866497702, 745216339, 611714034, 356930366, 968644400, 325574759, 294219152]


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

MOD = 10**9 + 7

safe = [True] * (N+1)
for i in range(len(A)):
    safe[A[i]] = False

dp = [0] * (N+1)
dp[0] = 1
if safe[1]:
    dp[1] = 1

for i in range(2, N+1):
    if(safe[i]):
        dp[i] = dp[i-1] + dp[(i-2)]
        dp[i] = dp[i] % MOD
    else:
        dp[i] = 0

print(dp[N])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))
    
s = [0 if n-i in a else -1 for i in range(n+1)] 
s[0] = s[1] = 1

for i in range(2, n+1):
    if s[i] == 0:
        continue
    s[i] = (s[i-1] + s[i-2]) % 1000000007

print(s[n])

Failing test case input:
4 1
3

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
def main():
    n, m = map(int, input().split())
    if m != 0:
        a = [int(input()) for _ in range(m)]
        a = set(a)
    else:
        a = set()
    
    s = [0] * (n+1)
    s[0] = 1
    s[1] = 1 if 1 not in a else 0

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

    print(s[n])

main()

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
oks = [True]*(n+1)
for i in range(m):
    a = int(input())
    oks[a] = False
print(oks)
dp = [0]*(n+1)
dp[0] = 1
for i in range(n+1):
    for j in range(i+1,min(n+1,i+3)):
        if oks[j]:
            dp[j] += dp[i]
            dp[j] %= 1000000007
print(dp[n])


Failing test case input:
100 2
1
37
141
101
89

Expected output:
319068443


Actual output:
[True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]
319068443


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
oks = [True]*(n+1)
for i in range(m):
    a = int(input())
    oks[a] = False
dp = [0]*(n+1)
dp[0] = 1
for i in range(n+1):
    for j in range(i+1,min(n+1,i+3)):
        if oks[j]:
            dp[j] += dp[i]
            dp[j] %= 1000000007
print(dp[n])
Problem: p03013
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

N,M = map(int,input().split())
A = [int(input()) for _ in range(M)]


dp = [0]*(N+1)

dp[0] = 1


for v in range(1,N+1):
    if v in A:
        continue
    dp[v] = (dp[v] + dp[v-1])%(1000000007)
    if v > 1:
        dp[v] = (dp[v] + dp[v-2])%(1000000007)
print(dp)
print(dp[N])

Failing test case input:
100 3
1
10
90
47
89

Expected output:
492215488


Actual output:
[1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 0, 21, 21, 42, 63, 105, 168, 273, 441, 714, 1155, 1869, 3024, 4893, 7917, 12810, 20727, 33537, 54264, 87801, 142065, 229866, 371931, 601797, 973728, 1575525, 2549253, 4124778, 6674031, 10798809, 17472840, 28271649, 45744489, 74016138, 119760627, 193776765, 313537392, 507314157, 820851549, 328165699, 149017241, 477182940, 626200181, 103383114, 729583295, 832966409, 562549697, 395516099, 958065796, 353581888, 311647677, 665229565, 976877242, 642106800, 618984035, 261090828, 880074863, 141165684, 21240540, 162406224, 183646764, 346052988, 529699752, 875752740, 405452485, 281205218, 686657703, 967862921, 654520617, 622383531, 276904141, 899287672, 176191806, 75479471, 251671277, 327150748, 578822025, 905972773, 484794791, 390767557, 0, 390767557, 390767557, 781535114, 172302664, 953837778, 126140435, 79978206, 206118641, 286096847, 492215488]
492215488


Fixed submission (verdict: Accepted):

N,M = map(int,input().split())
A = [int(input()) for _ in range(M)]
A = set(A)


dp = [0]*(N+1)


dp[0] = 1

for v in range(1,N+1):
    if v in A:
        continue
    dp[v] = (dp[v] + dp[v-1])%(1000000007)
    if v > 1:
        dp[v] = (dp[v] + dp[v-2])%(1000000007)
print(dp[N])

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m=map(int,input().split())
flag=list(1 for _ in range(n+1))
count=list(0 for _ in range(n+1))
ans=0
for i in range(m):
    x=int(input())
    flag[x]=0
print(flag)

if n==1:
    ans=1
else:
    if flag[1]==1:
        count[1]=1
    if flag[2]==1:
        count[2]=count[1]+1
    for i in range(3,n+1):
        if flag[i]==1:
            count[i]=count[i-1]+count[i-2]
            
    ans=count[n]
print(ans%(10**9+7))

Failing test case input:
101 4
2
16
50
27
31

Expected output:
796411630


Actual output:
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
796411630


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
flag=list(1 for _ in range(n+1))
count=list(0 for _ in range(n+1))
ans=0
for i in range(m):
    x=int(input())
    flag[x]=0

if n==1:
    ans=1
else:
    if flag[1]==1:
        count[1]=1
    if flag[2]==1:
        count[2]=count[1]+1
    for i in range(3,n+1):
        if flag[i]==1:
            count[i]=count[i-1]+count[i-2]
            
    ans=count[n]
print(ans%(10**9+7))
Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m = map(int,input().split())


dp = [0]*(n+1)
dp[0] = 1

for i in range(m):
	dp[int(input())] = -1


for i in range(n-1):
	if dp[i+2] != -1:
		if dp[i+1] != -1:
			dp[i+2] += dp[i+1]
		if dp[i] != -1:
			dp[i+2] += dp[i]

print(dp[n]%1000000007)

Failing test case input:
100 4
3
23
95
27
31

Expected output:
890327982


Actual output:
445163991


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())


dp = [0]*(n+1)
dp[0] = 1

for i in range(m):
	dp[int(input())] = -1

if dp[1] != -1:
	dp[1] = 1

for i in range(n-1):
	if dp[i+2] != -1:
		if dp[i+1] != -1:
			dp[i+2] += dp[i+1]
		if dp[i] != -1:
			dp[i+2] += dp[i]

print(dp[n]%1000000007)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,*a=map(int,open(0).read().split())
dp=[1]*(N+1)
for i in range(2,N+1):
    if i in a:
        dp[i]=0
        continue
    dp[i]=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])

Failing test case input:
17 0
7
0

Expected output:
2584


Actual output:
715


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())
dp=[1]*(N+1)
for i in range(M):
    dp[int(input())]=0
for i in range(2,N+1):
    if dp[i]!=0:
        dp[i]=(dp[i-1]+dp[i-2])
print(dp[-1]%1000000007)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys,math
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
dp = [0] * 10*(N+1)
mod = 10**9+7
for i in range(N,-1,-1):
    if i == N or i == N-1:
        dp[i] = 1
    elif i in a:
        continue
    else:
        dp[i] = dp[i+1] + dp[i+2]
print(dp[0]%mod)


Failing test case input:
4 1
3

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
import sys,math
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
b = set(a)
dp = [0] * (N+1)
mod = 10**9+7
for i in range(N,-1,-1):
    if i in b:
        continue
    elif i == N or i == N-1:
        dp[i] = 1
    else:
        dp[i] = (dp[i+1] + dp[i+2])%mod
print(dp[0])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int,input().split())
data = []
for i in range(M):
    data.append(int(input()))
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1
if 1 in data:
    dp[1] = 0
mod = 10**9 + 7
for i in range(2,N + 1):
    if not i in data:
        dp[i] = dp[i - 1] + dp[i - 2]
print(dp)
print(dp[N] % mod)

Failing test case input:
100 5
1
23
21
27
91

Expected output:
643250530


Actual output:
[1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 0, 4181, 0, 4181, 4181, 8362, 0, 8362, 8362, 16724, 25086, 41810, 66896, 108706, 175602, 284308, 459910, 744218, 1204128, 1948346, 3152474, 5100820, 8253294, 13354114, 21607408, 34961522, 56568930, 91530452, 148099382, 239629834, 387729216, 627359050, 1015088266, 1642447316, 2657535582, 4299982898, 6957518480, 11257501378, 18215019858, 29472521236, 47687541094, 77160062330, 124847603424, 202007665754, 326855269178, 528862934932, 855718204110, 1384581139042, 2240299343152, 3624880482194, 5865179825346, 9490060307540, 15355240132886, 24845300440426, 40200540573312, 65045841013738, 105246381587050, 170292222600788, 275538604187838, 445830826788626, 721369430976464, 1167200257765090, 1888569688741554, 3055769946506644, 4944339635248198, 8000109581754842, 12944449217003040, 20944558798757882, 33889008015760922, 54833566814518804, 0, 54833566814518804, 54833566814518804, 109667133629037608, 164500700443556412, 274167834072594020, 438668534516150432, 712836368588744452, 1151504903104894884, 1864341271693639336]
643250530


Fixed submission (verdict: Accepted):
N, M = map(int,input().split())
data = []
dp = ['.' for i in range(N + 1)]
dp[0] = 1
dp[1] = 1
for i in range(M):
    k = int(input())
    data.append(k)
    dp[k] = 0
mod = 10**9 + 7
for i in range(2,N + 1):
    if dp[i] != 0:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod
print(dp[N] % mod)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

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

print (step[N] % 1000000007)




Failing test case input:
100 2
1
20
151
101
89

Expected output:
878718644


Actual output:
64


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

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

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

print (step[-1] % 1000000007)
Problem: p03013
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

N,M = map(int,input().split())
Danger_List = []
Route_List = [[] for i in range(N+1)]
for i in range(M):
    Route_List[int(input())] = 0
        
Route_List[0] = 1

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

    
    
        
print(Route_List[-1])

Failing test case input:
100 2
1
37
141
101
89

Expected output:
319068443


Actual output:
60508827864880860530


Fixed submission (verdict: Accepted):

N,M = map(int,input().split())
Danger_List = []
Route_List = [[] for i in range(N+1)]
for i in range(M):
    Route_List[int(input())] = 0
        
Route_List[0] = 1

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

    
    
        
print(Route_List[-1] % 1000000007)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M=map(int,input().split())
broken=[0]*N
for _ in range(M):
  a=int(input())
  broken[a]=1
dp=[0]*(N+2)
dp[N]=1
for i in range(N-1,-1,-1):
  if broken[i]==1:
    dp[i]=0
  else:
    dp[i]=dp[i+1]+dp[i+2]
print(dp[0])

Failing test case input:
100 3
1
33
5
47
17

Expected output:
542655836


Actual output:
17656238020136321108


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())
broken=[0]*N
for _ in range(M):
  a=int(input())
  broken[a]=1
dp=[0]*(N+2)
dp[N]=1
for i in range(N-1,-1,-1):
  if broken[i]==1:
    dp[i]=0
  else:
    dp[i]=(dp[i+1]+dp[i+2])%1000000007
print(dp[0])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int,input().split())
A = [int(input()) for i in range(M)]
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1
for i in range(2,N+1):
    if A.count(i) != 0 and A.count(i-1) != 0:
        print(0)
        exit(0)
    if A.count(i) != 0:
        dp[i] = 0
    else:
        dp[i] = dp[i - 1] + dp[i - 2]

print(dp[N] % 1000000007)





Failing test case input:
100 5
1
23
21
27
91

Expected output:
643250530


Actual output:
60995038


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
A = [int(input()) for i in range(M)]
broken = [False] * (N + 1)
dp = [0] * (N + 1)
for a in A:
    broken[a] = True

dp[0] = 1
if broken[1]:
    dp[1] = 0
else:
    dp[1] = 1


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

print(dp[N] % 1000000007)
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
  N, M= map(int, input().split())
  a =[str(input()) for _ in range(M)]
  DP = [0]*(N+1)
  num = 1000000007
  DP[0] = 1
  for i in range(N):
    if str(i) in a:
      DP[i] = (DP[i-1] + DP[i-2]) % num
  print(DP[-1]%num)
if __name__ == "__main__":
    main()

Failing test case input:
100 3
1
33
5
47
17

Expected output:
542655836


Actual output:
0


Fixed submission (verdict: Accepted):
N, M, = map(int, input().split())
a = set([int(input()) for _ in range(M)])
DP = [0]*(N+2)
num = 1000000007
DP[0] = 1
for i in range(N):
  if i in a:
    DP[i] = 0
  else:
    DP[i] = DP[i] % num 
    if i < N:
      DP[i+1] += DP[i]
      DP[i+2] += DP[i]
print(DP[-2]%num)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())


a = [True] * (N)
for _ in range(M):
    a[int(input())-1] = False


mod = 10**9 + 7
dp = [0] * (N)
dp[0] = (1 if a[0] else 0)

if N == 1:
    print(dp[0])
    exit(0)

dp[1] = (1 if a[1] else 0) + dp[0]
for i in range(2, N):
    if a[i]:
        dp[i] = (dp[i-1] + dp[i-2]) % mod

print(dp[N-1])


Failing test case input:
4 1
2

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
mod = 10**9 + 7
N, M = map(int, input().split())


a = [True] * (N+1)
for _ in range(M):
    a[int(input())] = False


dp = [0] * (N+1)
dp[0] = 1
for i in range(N+1):
    for j in range(1, 3):
        if (i+j) > N or a[i+j] == False:
            continue
        dp[i+j] += dp[i]
        dp[i+j] %= mod

print(dp[N])

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
a = set([int(input()) for _ in range(m)])
dp = [0]*(n+1)
dp[1] = int(1 not in a)
for i in range(2,n+1):
  if i in a:
    continue
  dp[i] = dp[i-1] + dp[i-2]
print(dp[n])

Failing test case input:
10 2
6
4

Expected output:
9


Actual output:
6


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
a = set([int(input()) for _ in range(m)])
dp = [0]*(n+1)
mod = 10**9+7
dp[0] = 1
dp[1] = int(1 not in a)
for i in range(2,n+1):
  if i in a:
    continue
  dp[i] = (dp[i-1] + dp[i-2])%mod
print(dp[n])