ZhenlongDai/ACPR huggingface dataset:
Problem: p02792
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
ans=0
for i in range(1,n):
    a=str(i)[0]
    b=str(i)[-1]
    for digit in range(1,7):
        if digit == 1:
            if a==b:
                ans+=1
        elif b!='0':
            mn = int(b+'0'*(digit-2)+a)
            mx = int(b+'9'*(digit-2)+a)
            if mn>n:
                break
            if mx<=n:
                ans+=10**(digit-2)
            else:
                ns=str(n)
                for j in range(1,len(ns)-1):
                    ans+=int(ns[j])*10**(max(digit-2-j,0))
                if ns[-1]>=a:
                    ans+=1
                break
if n==1:
    ans+=1

print(ans)





Failing test case input:
3437

Expected output:
118300


Actual output:
118289


Fixed submission (verdict: Accepted):
n = int(input())
ans=0
for i in range(1,n+1):
    a=str(i)[0]
    b=str(i)[-1]
    for digit in range(1,7):
        if digit == 1:
            if a==b:
                ans+=1
        elif b!='0':
            mn = int(b+'0'*(digit-2)+a)
            mx = int(b+'9'*(digit-2)+a)
            if mn>n:
                break
            if mx<=n:
                ans+=10**(digit-2)
            else:
                ns=str(n)
                for j in range(1,len(ns)-1):
                    ans+=int(ns[j])*10**(max(digit-2-j,0))
                if ns[-1]>=a:
                    ans+=1
                break


print(ans)

Problem: p02792
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
max_l = len(str(N))
cnt = 0
for n in range(1, N+1):
    str_n = str(n)
    f_n, l_n = str_n[0], str_n[-1]
    if(f_n == '0' or l_n == '0'):
        continue
    if(f_n == l_n):
        cnt += 1
    i = 0
    while(int(l_n +'0'*i + f_n)<=N):
        cnt += min(math.ceil((N-int(l_n +'0'*i + f_n))/10), 10**i)
        i += 1

print(cnt)



Failing test case input:
453

Expected output:
2099


Actual output:
2088


Fixed submission (verdict: Accepted):
import math
N = int(input())
max_l = len(str(N))
cnt = 0
for n in range(1, N+1):
    str_n = str(n)
    f_n, l_n = str_n[0], str_n[-1]
    if(f_n == '0' or l_n == '0'):
        continue
    if(f_n == l_n):
        cnt += 1
    i = 0
    while(int(l_n +'0'*i + f_n)<=N):
        cnt += min((N-int(l_n +'0'*i + f_n))
        i += 1

print(cnt)
Problem: p02792
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

BegEndTbl = []
for _ in range(10):
    BegEndTbl.append([0] * 10)
print(BegEndTbl)

ans = 0
for i in range(1, N + 1):
    left = int(str(i)[0])
    right = i % 10
    if left == right:
        ans += 1
    ans += BegEndTbl[right][left] * 2
    BegEndTbl[left][right] += 1
print(ans)

Failing test case input:
141750

Expected output:
200930633


Actual output:
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
200930633


Fixed submission (verdict: Accepted):
N = int(input())

BegEndTbl = []
for _ in range(10):
    BegEndTbl.append([0] * 10)

ans = 0
for i in range(1, N + 1):
    left = int(str(i)[0])
    right = i % 10
    if left == right:
        ans += 1
    ans += BegEndTbl[right][left] * 2
    BegEndTbl[left][right] += 1
print(ans)

Problem: p02792
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
N = int(input())
ans = 0
c = defaultdict(int)

for i in range(1, N+1):
  s = int(str(i)[0])
  t = int(str(i)[-1])
  if s != 0 and t != 0:
    c[(s, t)] += 1

for i in range(1, 10):
  for j in range(1, 10):
    ans += c[(i, j)] * c[(j, i)]
    print(i, j, c[(i, j)] * c[(j, i)])
print(ans)

Failing test case input:
1257

Expected output:
15840


Actual output:
1 1 1444
1 2 407
1 3 407
1 4 407
1 5 407
1 6 407
1 7 407
1 8 396
1 9 396
2 1 407
2 2 144
2 3 121
2 4 121
2 5 121
2 6 121
2 7 121
2 8 121
2 9 121
3 1 407
3 2 121
3 3 144
3 4 121
3 5 121
3 6 121
3 7 121
3 8 121
3 9 121
4 1 407
4 2 121
4 3 121
4 4 144
4 5 121
4 6 121
4 7 121
4 8 121
4 9 121
5 1 407
5 2 121
5 3 121
5 4 121
5 5 144
5 6 121
5 7 121
5 8 121
5 9 121
6 1 407
6 2 121
6 3 121
6 4 121
6 5 121
6 6 144
6 7 121
6 8 121
6 9 121
7 1 407
7 2 121
7 3 121
7 4 121
7 5 121
7 6 121
7 7 144
7 8 121
7 9 121
8 1 396
8 2 121
8 3 121
8 4 121
8 5 121
8 6 121
8 7 121
8 8 144
8 9 121
9 1 396
9 2 121
9 3 121
9 4 121
9 5 121
9 6 121
9 7 121
9 8 121
9 9 144
15840


Fixed submission (verdict: Accepted):
from collections import defaultdict
N = int(input())
ans = 0
c = defaultdict(int)

for i in range(1, N+1):
  s = int(str(i)[0])
  t = int(str(i)[-1])
  if s != 0 and t != 0:
    c[(s, t)] += 1

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


print("{}".format(dp[-1]))

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

Expected output:
426572798


Actual output:
12041560821995351736726


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



print("{}".format(dp[-1]))

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

Failing test case input:
100 3
1
23
71
47
154

Expected output:
829506026


Actual output:
16724228725899106282


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

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

mod = 10 ** 9 + 7

dp = [0] * (n+1)
dp[-1] = 1
if broken[n-1]:
    dp[n-1] = 1

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

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

Expected output:
782204094


Actual output:
29782204297


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

mod = 10 ** 9 + 7

dp = [0] * (n+1)
dp[-1] = 1
if broken[n-1]:
    dp[n-1] = 1

for i in reversed(range(n-1)):
    if broken[i]:
        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 = 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):
    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:
100 5
1
23
21
27
89

Expected output:
40991458


Actual output:
868028435


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 (PyPy3 (2.4.0), verdict: Wrong Answer):
N,M = map(int,input().split())
A = [int(input()) for _ in range(M)]

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

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

print(dp[N])

Failing test case input:
10 2
4
1

Expected output:
8


Actual output:
24


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 (Python (3.4.3), verdict: Wrong Answer):


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

def f(i):
    if dp[i] != None:
        return dp[i]
    else:
        if i in A:
            dp[i] = 0
        elif i < 2:
            dp[i] = 1
        else:
            dp[i] = (f(i - 1) + f(i - 2)) % MOD
        return dp[i]

print(f(N))


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

Expected output:
96839479


Actual output:
0


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())
li = [int(input()) for i in range(m)]

st = [1]*(n+1)
for i in range(m):
    st[li[i]-1] = 0

if st[0] == 0 and st[1] == 0:
    print(0)
elif st[0] == 0:
    st[1] = 1
elif st[0] == 1:
    st[1] = 2

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

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

Expected output:
709798407


Actual output:
355313056


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

st = [1]*(n+1)
for i in range(m):
    st[li[i]-1] = 0

if st[0] == 0 and st[1] == 0:
    print(0)
    exit()
elif st[0] == 0 and st[1] != 0:
    st[1] = 1
elif st[0] == 1 and st[1] != 0:
    st[1] = 2

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

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
a = list(map(int, [input() for _ in range(m)]))
dp = [0] * (n+1)


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

print(dp[-1])


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

Expected output:
42837731


Actual output:
455898627


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
a = set(map(int, [input() for _ in range(m)]))
dp = [0] * (n+1)


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

print(dp[-1])

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

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

Expected output:
157493236


Actual output:
1277605021100728320


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
MOD = 1000000007 
D=[0] * (n+2)
D[0] = 1
for _ in range(m):
    D[int(input())] = -1
for i in range(n):
    if D[i] == -1:
        continue
    if D[i+1] != -1:
        D[i+1] += D[i]
    if D[i+2] != -1:
        D[i+2] += D[i]
    D[i]%=MOD
print(D[n] % MOD)
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M=map(int,input().split())

chk=[True]*(10**5+1)
for i in range(M):
    a=int(input())
    chk[a]=False

mod=10**9+7

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

f=[0]*(N+1)

if chk[1]:
    f[1]=1
else:
    f[1]=0


for i in range(2,N+1):
    if chk[i-2]:
        f[i]+=f[i-2]
    if chk[i-1]:
        f[i]+=f[i-1]
    f[i]=f[i]%mod

print(f[N])

Failing test case input:
010 1
1
88
140
8
24

Expected output:
34


Actual output:
0


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

chk=[True]*(10**5+1)
for i in range(M):
    a=int(input())
    chk[a]=False

mod=10**9+7

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

f=[0]*(N+1)
f[0]=1
if chk[1]:
    f[1]=1
else:
    f[1]=0


for i in range(2,N+1):
    if chk[i-2]:
        f[i]+=f[i-2]
    if chk[i-1]:
        f[i]+=f[i-1]
    f[i]=f[i]%mod

print(f[N])

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[n] = 1
dp[n-1] = 1
for i in range(2,n+1):
    if dp[n-i] == -1:
        dp[n-i] = dp[n-i+1] + dp[n-i+2]
print(dp[0]%1000000007)

Failing test case input:
4 1
3

Expected output:
2


Actual output:
5


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())
mod = 10e9+7
dp = [0]*(n+1)
dp[0] = 1
isPass = [1]*(n+1)
for _ in range(m):
    a = int(input())
    isPass[a] = 0
for i in range(n):
    for j in range(i+1, min(n, i+2)+1):
        if isPass[j]:
            dp[j] += dp[i]
            dp[j] %= mod
print(dp[n])

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

Expected output:
887463728


Actual output:
8093074675.0


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
mod = 1e+9+7
dp = [0]*(n+1)
dp[0] = 1
isPass = [1]*(n+1)
for _ in range(m):
    a = int(input())
    isPass[a] = 0
for i in range(n):
    for j in range(i+1, min(n, i+2)+1):
        if isPass[j]:
            dp[j] += dp[i]
            dp[j] %= mod
print(int(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:
101 5
1
23
45
67
89

Expected output:
366077159


Actual output:
84913773


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):

def main():
    N,M = map(int,input().split())
    A = [int(input()) for i in range(M)]
    MOD = 1000000007
    ans = []
    ans.append(0) if 1 in A else ans.append(1)
    ans.append(0) if 2 in A else ans.append(1)
    for i in range(2,N):
        ans.append(0)
        if i+1 in A:
            continue
        ans[i] += (ans[i-1] + ans[i-2])
    print(ans[N-1] % MOD)
if __name__ == '__main__':
    main()

Failing test case input:
13 0
7
0

Expected output:
377


Actual output:
233


Fixed submission (verdict: Accepted):

def main():
    N,M = map(int,input().split())
    A = set([int(input()) for _ in range(M)])
    MOD = 1000000007
    ans = [1]
    ans.append(0) if 1 in A else ans.append(1)
    for i in range(2,N+1):
        ans.append(0)
        if i in A:
            continue
        ans[i] += (ans[i-1] + ans[i-2])
    print(ans[N] % MOD)
if __name__ == '__main__':
    main()

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[0]=1
MOD=(10**9)+7

a.append(int(input()) for i in range(m))
  
if 1 not in a:
  b[1]=1
else:
  b[1]=0
  
for j in range(2,n+1):
  if j in a:
    continue
  else:
    b[j]=(b[j-1]+b[j-2])%MOD
    
print(b[n]%MOD)    
    
  
  
  



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

Expected output:
186727242


Actual output:
470199269


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

n, m = map(int, input().split())
a = [1] * (n + 1)
mod=1e9+7
print(a)
for i in range(m):
    a[int(input())] = 0
print(a)
b = [1] * (n + 1)
if a[1] == 0:
    b[1] = 0
for i in range(2, n + 1):
    b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)
print(b, b[n])

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

Expected output:
34319280


Actual output:
[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, 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, 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, 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, 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, 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, 0, 21892, 21892, 43784, 65676, 109460, 175136, 284596, 459732, 744328, 1204060, 1948388, 3152448, 5100836, 8253284, 13354120, 21607404, 34961524, 56568928, 91530452, 148099380, 239629832, 387729212, 627359044, 15088249, 642447293, 657535542, 299982828, 957518370, 257501191, 215019554, 472520745, 687540299, 160061037, 847601336, 7662366, 855263702, 862926068, 0, 862926068, 862926068, 725852129, 588778190, 314630312, 903408502, 218038807, 121447302, 339486109, 460933411, 800419520, 261352924, 61772437, 323125361, 384897798, 708023159, 92920950, 800944109, 893865059, 694809161, 588674213, 283483367, 872157580, 155640940, 27798513, 183439453, 211237966, 394677419, 605915385, 592797, 606508182, 607100979, 213609154, 820710133, 34319280] 34319280


Fixed submission (verdict: Accepted):

n, m = map(int, input().split())
a = [1] * (n + 1)
mod=1e9+7
for i in range(m):
    a[int(input())] = 0
b = [1] * (n + 1)
if a[1] == 0:
    b[1] = 0
for i in range(2, n + 1):
    b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)
print(b[n])
Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, m = map(int, input().split())
a = list(int(input()) for _ in range(m))

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

if 1 in a:
    dp[1] = 0
else:
    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] %= 1000000007

print(dp)


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

Expected output:
796411630


Actual output:
[1, 1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 0, 233, 233, 466, 699, 1165, 1864, 3029, 4893, 7922, 12815, 0, 12815, 12815, 25630, 38445, 64075, 102520, 166595, 269115, 435710, 704825, 1140535, 1845360, 2985895, 4831255, 7817150, 12648405, 20465555, 33113960, 53579515, 86693475, 140272990, 226966465, 0, 226966465, 226966465, 453932930, 680899395, 134832318, 815731713, 950564031, 766295737, 716859761, 483155491, 200015245, 683170736, 883185981, 566356710, 449542684, 15899387, 465442071, 481341458, 946783529, 428124980, 374908502, 803033482, 177941977, 980975459, 158917429, 139892881, 298810310, 438703191, 737513501, 176216685, 913730186, 89946864, 3677043, 93623907, 97300950, 190924857, 288225807, 479150664, 767376471, 246527128, 13903592, 260430720, 274334312, 534765032, 809099344, 343864369, 152963706, 496828075, 649791781, 146619849, 796411630]


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

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

if 1 in a:
    dp[1] = 0
else:
    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] %= 1000000007

print(dp[n])

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

Failing test case input:
20 0
7
0

Expected output:
10946


Actual output:
4181


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
A={int(input()) for _ in range(m)}
dp=[1]+[0]*(n+1)
for i in range(n):
    if i in A:
        continue
    dp[i+1] += dp[i]
    dp[i+2] += dp[i]
print(dp[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 _ in range(m)]

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

ok = [1] * (n + 10)
for i in a:
    ok[i] = 0

for i in range(n):
    if ok[i + 1]:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
    if ok[i + 2]:
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
print(dp[n])


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

Expected output:
782204094


Actual output:
782204094.0


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

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

ok = [1] * (n + 10)
for i in a:
    ok[i] = 0

for i in range(n):
    if ok[i + 1]:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
    if ok[i + 2]:
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
print(int(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
    if s[i-1] + s[i-2] <= 0:
        s[n] = 0
        break
    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())
a = [0] * (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])

Failing test case input:
21 1
1

Expected output:
6765


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):
import math
import fractions
(n,m)=map(int,input().split())
a=[0]*(n+2)
b=[0]*(n+2)
for i in range(m):
    t=int(input())
    a[t]=1
b[0]=1
for i in range(n+1):
    if(a[i]==1):
        continue
    if(i==0):
        continue
    if(i==1):
        b[i]=b[i-1]
        continue
    b[i]=b[i-1]+b[i-2]

print(b[n])



Failing test case input:
101 4
2
19
65
27
31

Expected output:
84865811


Actual output:
4627945531480484304


Fixed submission (verdict: Accepted):
import math
import fractions
mod=1000000007
(n,m)=map(int,input().split())
a=[0]*(n+2)
b=[0]*(n+2)
for i in range(m):
    t=int(input())
    a[t]=1
b[0]=1
for i in range(n+1):
    if(a[i]==1):
        b[i]=0
        continue
    if(i==0):
        continue
    if(i==1):
        b[i]=b[i-1]
        continue
    b[i]=(b[i-1]+b[i-2])%mod

print(b[n]%mod)

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = (int(x) for x in input().split())
A = [-1]*(N+1)
for i in range(M):
  a = int(input())
  A[a] = 0
A[N] = 1
A[N-1] = 1
for i in reversed(range(N-1)):

  if A[i] == -1:
  	A[i] = A[i+1] + A[i+2]

print(A[0]%(1000000007))

Failing test case input:
4 1
3

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
N, M = (int(x) for x in input().split())
A = [-1]*(N+1)
for i in range(M):
  a = int(input())
  A[a] = 0
A[N] = 1
if A[N-1] == -1:
	A[N-1] = 1
for i in reversed(range(N-1)):

  if A[i] == -1:
  	A[i] = A[i+1] + A[i+2]

print(A[0]%(1000000007))
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)]
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
j=0
for i in range(1,n+1):
  if j in a:
    
    continue
  if i==1:
    dp[1] = dp[0]
    continue
  dp[i] = dp[i-1]+dp[i-2]
  dp[i]%=mod
print(dp[n])

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

Expected output:
561782750


Actual output:
470199269


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

a=set()
for i in range(m):
    tmp=int(input())
    a.add(tmp)
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
j=0
for i in range(1,n+1):
  if i in a:
    
    continue
  if i==1:
    dp[1] = dp[0]
    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):
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
a = set(map(int, [input() for _ in range(m)]))
dp = [0] * (n+1)


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

print(dp[-1])


Failing test case input:
110 3
1
23
71
47
154

Expected output:
670637289


Actual output:
302891712


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
a = set(map(int, [input() for _ in range(m)]))
dp = [0] * (n+1)


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

print(dp[-1])

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



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

Expected output:
358254682


Actual output:
1765668405717933433


Fixed submission (verdict: Accepted):
n,m=list(map(int,input().split(" ")))
a=[]
dp=[float("inf") for i in range(n+1)]
for i in range(m):
  a=int(input())
  dp[a]=0
dp[0]=1
if dp[1] != 0:
  dp[1]=1
for i in range(2,n+1):
  if dp[i]!=0:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%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)]
mod = 10**9+7
dp=[0]*(N+1)
dp[1]=1

for i in range(N):
  if i+1 not in a:
    dp[i+1]+=dp[i]
    dp[i+1] %= mod
  if i+2 <= N and i+2 not in a:
    dp[i+2]+=dp[i]
    dp[i+2]%=mod
  
print(dp[-1])


Failing test case input:
13 0
7
0

Expected output:
377


Actual output:
233


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
a = set([int(input()) for _ in range(M)])
mod = 10**9+7
dp=[0]*(N+1)
dp[0]=1


for i in range(N):
  if i+1 not in a:
    dp[i+1]+=dp[i]
    dp[i+1] %= mod
  if i+2 <= N and i+2 not in a:
    dp[i+2]+=dp[i]
    dp[i+2]%=mod
  
print(dp[-1])
Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, m = map(int, input().split())
a = [i for i in range(m)]

mod= 1000000007
oks = [True] * (n+1)
for i in a:
    oks[i] = False

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

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

print(dp[n])

Failing test case input:
101 2
1
25
141
101
89

Expected output:
300126398


Actual output:
0


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

mod = 1000000007
brok = [False] * (n+1)

for i in a:
    brok[i] = True

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

for i in range(n-1, -1, -1):
    if brok[i]:
        dp[i] = 0
        continue
    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())
print(n,m)
dp = [-1]*(n+1)
for i in range(m):
    dp[int(input())] = 0
dp[0] = 1
if dp[1] != 0:
    dp[1] = 1
for i in range(2,n+1):
    if dp[i] != 0:
        dp[i] = (dp[i-1]+dp[i-2])%1000000007
print(dp[n])

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

Expected output:
229617645


Actual output:
100 5
229617645


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

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):
    tmp_a = int(input())
    a[tmp_a] = 1

l = [0] * (n + 1)

l[n] = 1
l[n-1] = 1

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

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 (PyPy3 (2.4.0), verdict: Wrong Answer):
n, m = map(int, input().split())
a = [i for i in range(m)]

mod = 1000000007
brok= [False] * (n+1)

for i in a:
    brok[i] = True

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

print(dp[0])

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 = [int(input()) for _ in range(m)]

mod = 1000000007
brok = [False] * (n+1)

for i in a:
    brok[i] = True

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

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

print(dp[0])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
def conbination(x,y):
  return math.factorial(x) 
 
n, m = map(int, input().split())
a = []
for i in range(m):
  a.append(int(input()))

flag = 0
ans = 0
 
for i in range(m-1):
  if a[i+1] - a[i] == 1:
    ans = 0
    flag = 1
    break
    
if flag == 0:
  for i in range(n-2*m-1): 
    ans += conbination(n-2*m-2, i)
      
print(ans%(10**9+7)) 

Failing test case input:
27 -4
3
-1

Expected output:
317811


Actual output:
943272305


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


dp = [0] * (n+1)
dp[0] = 1
if 1 in a:
  dp[1] = 0
else:
  dp[1] = 1
  
for i in range(2, n+1):
  if dp[i-2] == 0 and dp[i-1] == 0:
    ans = 0
    flag = 1
    break
  elif i in a:
    continue
  else:
    dp[i] = dp[i-1] + dp[i-2]
if flag == 0:
  ans = dp[n]
print(ans%(10**9+7))

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split(" "))
a=[]
mod = 10 ** 9 + 7
ans = 1
for i in range(m):
    a.append(int(input()))
    if a[i]-1 == a[i-1]:
        ans = 0

dp = [1] * (n+1)
for j in range(n+1):
    if j in a:
        dp[j] = dp[j-1]
    elif j-1 in a or j-2 in a:
        dp[j] = dp[j-1]
    elif j > 1:
        dp[j] = dp[j-1] + dp[j-2]

print(dp[n])


Failing test case input:
100 5
1
23
28
62
93

Expected output:
93718175


Actual output:
1251905023857053280


Fixed submission (verdict: Accepted):
n,m = map(int,input().split(" "))
a=[0] * (n+1)
mod = 10 ** 9 + 7
for i in range(m):
    a[int(input())] = 1

dp = [0] * (n+1)
for j in range(n+1):
    if a[j] == 1:
        dp[j] = 0
    elif j == 1 or j == 0:
        dp[j] = 1
    else:
        dp[j] = (dp[j-1] + dp[j-2]) % mod

print(dp[n])

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


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

Expected output:
358254682


Actual output:
501902831


Fixed submission (verdict: Accepted):
n, m = [int(x) for x in input().split()]
a = 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):
    if i in a:
        continue
    if i >= 2:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod
    else:
        dp[i] = dp[i - 1]
print(dp[-1])
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
MOD = 10**9+7
a = set()
for i in range(M):
    a.add(int(input()))
step = [0]*(N+1)
step[0] = 1
for i in range(N+1):
    if i == 0:
        pass
    elif i in a:
        step[i] = 0
    elif i == 1:
        step[i] = step[0]
    else:
        step[i] = step[i-1]+step[i-2]
print(step[N])


Failing test case input:
101 4
2
19
65
27
31

Expected output:
84865811


Actual output:
4627945531480484304


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

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[0]=0
b[1]=1

for i in range(0,m):
  a.append(int(input()))
  
for j in range(1,n+1):
  if j in a:
    b[j]=0
  else:
    if j==2:
      if b[1]==0:
        b[j]=0
      else:
        b[j]=2
    else:
      b[j]=b[j-1]+b[j-2]
    
print(b[n]%(10**9+7))    
    
  
  
  

Failing test case input:
12 1
8
0

Expected output:
63


Actual output:
0


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

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

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

for i in range(N):
    c=l[i]%1000000007
    if i>N-2:
        if i not in a:
            l[i+1]+=c
    elif i not in a:
        l[i+1]+=c
        l[i+2]+=c

print(l[N]%1000000007)

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

Expected output:
229617645


Actual output:
{1, 67, 6, 45, 89}
229617645


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

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

for i in range(N):
    c=l[i]%1000000007
    if i>N-2:
        if i not in a:
            l[i+1]+=c
    elif i not in a:
        l[i+1]+=c
        l[i+2]+=c

print(l[N]%1000000007)
Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
mod = 10e9+7
dp = [0]*(n+1)
dp[0] = 1
isPass = [1]*(n+1)
for _ in range(m):
    a = int(input())
    isPass[a] = 0
for i in range(n):
    for j in range(i+1, min(n, i+2)+1):
        if isPass[j]:
            dp[j] += dp[i]
            dp[j] %= mod
print(int(dp[n]))

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

Expected output:
878718644


Actual output:
84319833


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

Problem: p03013
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
broken_step = []
     
line = [int(s) for s in input().split()]
     
N, M = line[0], line[1]
     
for i in range(M):
    step_num = int(input().split()[0])
    broken_step.append(step_num)
        
        
dp = [0]*(N+1)
dp[0] = 1
if 1 in broken_step:
    dp[1] = 0
else:
    dp[0] = 1
     
for i in range(2, N+1):
    dp[i] = (dp[i-1]+dp[i-2])%1000000007 if i not in broken_step else 0
print(dp[N])

Failing test case input:
12 0
6
0

Expected output:
233


Actual output:
89


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

     
line = [int(s) for s in input().split()]
     
N, M = line[0], line[1]
     
b = [0]*(N+1)
for i in range(M):
    step_num = int(input().split()[0])
    b[step_num] = 1
        
        
dp = [0]*(N+1)
dp[0] = 1
if b[1] == 1:
    dp[1] = 0
else:
    dp[1] = 1
     
for i in range(2, N+1):
    if b[i] == 1:
        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):
MOD = 10 ** 9 + 7


def resolve():
    N, M = map(int, input().split())

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

    ans = 1
    for j in range(N - 2):
        if not A[j] and not A[j + 1]:
            print(0)
            return

        if A[j] and A[j + 1]:
            ans = ans * 2

    print(ans % MOD)


resolve()

Failing test case input:
110 0
-2
116
44
26
153

Expected output:
455898627


Actual output:
951047217


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


def resolve():
    N, M = map(int, input().split())

    broken = [False] * (N + 1)
    dp = [0 for _ in range(N + 1)]
    dp[0] = 1

    for _ in range(M):
        broken[int(input())] = True

    for i in range(1, N + 1):
        if broken[i]:
            continue

        if i == 1:
            dp[i] = dp[i - 1]
        else:
            dp[i] = dp[i - 1] + dp[i - 2]
            dp[i] %= MOD

    print(dp[N])


resolve()
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.append(int(input()))

dp = [1] + [0] * n
for i in range(1, n+1):
    if n in bads:
        continue
    if 1 < i:
        dp[i] = dp[i-1] + dp[i-2]
    else:
        dp[i] = dp[n-1]
    dp[i] %= 1000000007

print(dp[-1])


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

Expected output:
855029413


Actual output:
687995182


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 (PyPy3 (2.4.0), verdict: Wrong Answer):


import sys

def input():
    return sys.stdin.readline().strip()

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
li = [1] + [0 for _ in range(N)]

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

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

Expected output:
96839479


Actual output:
24096839647


Fixed submission (verdict: Accepted):


import sys

def input():
    return sys.stdin.readline().strip()

N, M = map(int, input().split())
a = set(int(input()) for _ in range(M))
li = [1] + [0 for _ in range(N)]

for i in range(1, N + 1):
    if i in a:
        continue
    else:
        li[i] = li[i - 1] + li[i - 2]
print(li[-1] % 1000000007)

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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(max(dp[n], 0))

Failing test case input:
110 0
-2
116
44
26
153

Expected output:
455898627


Actual output:
629776842


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 (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[-2]%num)
if __name__ == "__main__":
    main()

Failing test case input:
10 2
4
1

Expected output:
8


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 = set([int(input()) for _ in range(M)])
mod = 10**9+7
dp=[0]*(N+1)
dp[1]=1


for i in range(N):
  if i+1 not in a:
    dp[i+1]+=dp[i]
    dp[i+1] %= mod
  if i+2 <= N and i+2 not in a:
    dp[i+2]+=dp[i]
    dp[i+2]%=mod
  
print(dp[-1])


Failing test case input:
17 0
7
0

Expected output:
2584


Actual output:
1597


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
a = set([int(input()) for _ in range(M)])
mod = 10**9+7
dp=[0]*(N+1)
dp[0]=1


for i in range(N):
  if i+1 not in a:
    dp[i+1]+=dp[i]
    dp[i+1] %= mod
  if i+2 <= N and i+2 not in a:
    dp[i+2]+=dp[i]
    dp[i+2]%=mod
  
print(dp[-1])

Problem: p03013
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, m = map(int, input().split())
dp = [0] * (n + 1)
for i in range(m):
    a = int(input())
    dp[a] = -1
    if i == 0 and a != 1:
        dp[1] = 1
    if i == 0 and a == 1:
        dp[1] = 0
mod = 10 ** 9 + 7

dp[0] = 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])

Failing test case input:
12 0
6
0

Expected output:
233


Actual output:
89


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 (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int,input().split())
data = []
for i in range(M):
    data.append(int(input()))
dp = [-1] * (N + 1)
dp[0] = 1
dp[1] = 1
for i in data:
    dp[i] = 0
if 1 in data:
    dp[1] = 0
mod = 10**9 + 7
for i in range(2,N + 1):
    if dp[i] != 0:
        dp[i] = dp[i - 1] + dp[i - 2]
print(dp)
print(dp[N] % mod)

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

Expected output:
561782750


Actual output:
[1, 1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 0, 6765, 6765, 13530, 0, 13530, 13530, 27060, 40590, 67650, 108240, 175890, 284130, 460020, 744150, 1204170, 1948320, 3152490, 5100810, 8253300, 13354110, 21607410, 34961520, 56568930, 91530450, 148099380, 239629830, 387729210, 627359040, 1015088250, 1642447290, 2657535540, 4299982830, 6957518370, 11257501200, 18215019570, 29472520770, 47687540340, 77160061110, 124847601450, 202007662560, 326855264010, 0, 326855264010, 326855264010, 653710528020, 980565792030, 1634276320050, 2614842112080, 4249118432130, 6863960544210, 11113078976340, 17977039520550, 29090118496890, 47067158017440, 76157276514330, 123224434531770, 199381711046100, 322606145577870, 521987856623970, 844594002201840, 1366581858825810, 2211175861027650, 3577757719853460, 5788933580881110, 9366691300734570, 15155624881615680, 24522316182350250, 39677941063965930, 64200257246316180, 103878198310282110, 168078455556598290, 271956653866880400, 440035109423478690, 711991763290359090, 1152026872713837780, 1864018636004196870, 3016045508718034650, 4880064144722231520]
561782750


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 (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(max(dp[n], 0))

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

Expected output:
144


Actual output:
999999973


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])