problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03013
u178192749
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int, input().split())\nbl = set([int(input())-1 for _ in range(m)])\nl = [i for i in range(n)]\n\nmod = 1000000007\nal = [0]*n\nif 0 in l and 1 in l:\n al[0] = 1\n al[1] = 2\nelif 0 in l:\n al[0] =1\nelif 1 in l:\n al[1] = 1\nelse:\n print(0)\n exit()\n\n \nli = [i for i in l if i>=2]\n...
['Runtime Error', 'Accepted']
['s604207805', 's108499151']
[3064.0, 11768.0]
[17.0, 1652.0]
[450, 467]
p03013
u181195295
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M = map(int,input().split())\na = set([int(input()) for _ in range(M)])\nmod = 10**9+7\ndp=[0]*(N+1)\ndp[1]=1\n\n\nfor i in range(N):\n if i+1 not in a:\n dp[i+1]+=dp[i]\n dp[i+1] %= mod\n if i+2 <= N and i+2 not in a:\n dp[i+2]+=dp[i]\n dp[i+2]%=mod\n \nprint(dp[-1])\n', 'N,M = map(int,input().split...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s155145006', 's173351495', 's279084657', 's588748583', 's687757568', 's844194785', 's976464497']
[13216.0, 134828.0, 460148.0, 3064.0, 7848.0, 7800.0, 13192.0]
[205.0, 2104.0, 2120.0, 17.0, 2108.0, 2104.0, 200.0]
[271, 213, 196, 204, 265, 217, 271]
p03013
u181668771
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\n\ninput = sys.stdin\nN, W = input().split()\naArr = list()\nans = 0\ntmp = int(N)\nMOD = 10 ** 9 + 7\naArr = set(map(int, input()))\n\ntmp = 0\ntmpB = 0\nans = 1\nfor i in range(int(N)):\n if (i in aArr):\n tmp = 0\n elif i < 2:\n tmp = 1\n else:\n tmp = ans\n ans = (tmp +...
['Runtime Error', 'Accepted']
['s169815515', 's287589433']
[3064.0, 11884.0]
[17.0, 71.0]
[337, 332]
p03013
u184817817
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\nsys.setrecursionlimit(100000) \n\nn,m = list(map(int,input().split()))\na = [0]*m\nfor i in range(m):\n a[i] = int(input())\nmemo = [-1]*(n+1)\n\nfor i in a:\n memo[i] = 0\n\ndef stair(k):\n if memo[k] != -1:\n return memo[k]\n else:\n if k == 1:\n if 1 not in a:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s382256791', 's660944397', 's583149728']
[90564.0, 2940.0, 7668.0]
[2105.0, 18.0, 186.0]
[640, 983, 326]
p03013
u185393907
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def func(n):\n if n==0: return 1\n if n==1: return 1\n if dp[n]!=-1: return dp[n]\n f1 = func(n-1) if n-1 not in a else 0\n f2 = func(n-2) if n-2 not in a else 0\n dp[n] = (f1 + f2) % 1000000007\n return dp[n]\nimport sys\nsys.setrecursionlimit(1000000)\nn,m = map(int, intput().split())\na={int(i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s612537695', 's918247733', 's545118422']
[3064.0, 3064.0, 89668.0]
[17.0, 17.0, 212.0]
[362, 320, 361]
p03013
u185802209
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\nprint(n,m)\ndp = [-1]*(n+1)\nfor i in range(m):\n dp[int(input())] = 0\ndp[0] = 1\nif dp[1] != 0:\n dp[1] = 1\nfor i in range(2,n+1):\n if dp[i] != 0:\n dp[i] = (dp[i-1]+dp[i-2])%1000000007\nprint(dp[n])', 'n, m = map(int, input().split())\ndp = [-1]*(n+1)\nfor i in r...
['Wrong Answer', 'Accepted']
['s984595494', 's959217571']
[6900.0, 6900.0]
[191.0, 188.0]
[242, 231]
p03013
u185896732
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m=map(int,input().split())\nstair_m=[True]*(110000)\nfor i in range(m):\n a=int(input())\n stair_m[a]=False\ndp=[0]*(110000)\ndp[0]=1\nfor i in range(2,n+2):\n #print(i,i-2,dp[i-2])\n if stair_m[i]:\n dp[i]=dp[i-1]+dp[i-2]\n else:\n dp[i]=0\nprint(dp[n]%1000000007)', 'n,m=map(int,input(...
['Wrong Answer', 'Accepted']
['s693410108', 's064787429']
[460916.0, 7668.0]
[451.0, 192.0]
[283, 249]
p03013
u185948224
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import numpy as np\nimport sys\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\na = [int(input()) for _ in range(M)]\n \nmat = np.array([[1, 1],[1, 0]])\nn = np.array([[1, 1],[1, 0]])\n\ncnt = 2\nif 1 in a:n[0, 1] = 0\n\nwhile cnt!=N:\n if cnt in a:n[0, 0]=0\n n = np.dot(n, mat) \n cn...
['Wrong Answer', 'Accepted']
['s222855966', 's411204189']
[16276.0, 7668.0]
[2109.0, 69.0]
[358, 327]
p03013
u185966380
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def main(A, dp, n, mod):\n if n == -1:\n return dp[0]\n\n if (n in A) == False: \n dp[n] = (dp[n + 1] + dp[n + 2]) % mod\n return main(A, dp, n-1)\n \nN, M = map(int, input().split())\nmod = 1000000007\ndp = [0] * (10**5)\nA = [int(input()) for _ in range(M)] \nif (N-1 in A) == False:\n dp[N...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s102705950', 's458042451', 's534207234', 's581449905', 's676618301', 's968827000', 's218776151']
[7848.0, 5132.0, 7848.0, 2940.0, 5132.0, 7824.0, 13984.0]
[168.0, 2104.0, 2104.0, 17.0, 2104.0, 169.0, 178.0]
[381, 740, 234, 381, 755, 288, 237]
p03013
u187205913
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\na = [int(input()) for _ in range(m)]\nif 1 in a and 2 in a:\n print(0)\n exit()\nans = 1\nk = 0\nif a[-1]!=n:\n a.append(n)\n\nmod = 10**9+7\nmax = 10**5+1\ng1 = [1, 1] \ng2 = [1, 1] \ninverse = [0, 1] 計算用テーブル\nfor i in range( 2, max + 1 ):\n g1.append( ( g1[-1] * i ) % mod...
['Runtime Error', 'Accepted']
['s823762102', 's629981117']
[18312.0, 460020.0]
[2108.0, 490.0]
[944, 238]
p03013
u187857228
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['INF = float("inf") #const\n\ndef main():\n n,m = map(int,input().split())\n issafe = [0]*m\n for i in range(m):\n a = int(input())\n issafe[a] = False\n dp = [0]*(n+1)\n dp[0],dp[1] = 1,1\n\n for i in range(2,n+1):\n if issafe[i-1]:\n dp[i] += dp[i-1]\n if issa...
['Runtime Error', 'Accepted']
['s824446477', 's121327301']
[3828.0, 463476.0]
[166.0, 492.0]
[410, 413]
p03013
u188244611
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
["# ABC 129, c\nn, m = map(int, input().split())\ndp = [int(el) for el in input().split(' ')]\ndp[0] = 1\ndp[1] = 1\nfor j in [int(input()) for j in range(m)]:\n dp[j] = -1\nfor i in range(n + 1):\n if i < 2:\n if dp[i] == -1:\n dp[i] = 0\n else:\n if dp[i] == -1:\n dp[i] = ...
['Runtime Error', 'Accepted']
['s753371311', 's779628808']
[3064.0, 7860.0]
[17.0, 193.0]
[387, 372]
p03013
u192908410
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['st=[1,1]\nfor i in range(10**5+1):\n st.append((st[-1]+st[-2])%1000000007)\nst.append(0)\nn,m=list(map(int,input().split()))\nret=1\nx=0\nfor i in range(m):\n y=int(input())\n x=-1 if y==1 else x\n ret=(ret*st[y-x-2])%1000000007\n x=y\nret=(ret*st[n-x-1])%1000000007\nprint(ret)', 'st=[1,1]\nfor i in range(10**5+...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s521549960', 's852897951', 's335067436']
[7184.0, 8724.0, 7060.0]
[227.0, 921.0, 233.0]
[270, 305, 249]
p03013
u193598069
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int, input().split())\na = [ int(input()) for _ in range(N)]\n\nans = 0\n\nstep = [0 for _ in range(N + 2)]\nstep[1] = 1\n\nfor _ in range(M):\n i = int(input()) + 1\n step[i] = -1\n\nfor i in range(2, N + 2):\n if step[i] == -1:\n step[i] = 0\n else:\n step[i] = (step[i - 2] + step[i - 1]) % N\n...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s026415871', 's083213908', 's104304026', 's239959460', 's255425603', 's385767941', 's408764164', 's422407901', 's446271416', 's697982459', 's913935649', 's988071568', 's407723695']
[7080.0, 460056.0, 7056.0, 7064.0, 7064.0, 13328.0, 7064.0, 460056.0, 13328.0, 460056.0, 460056.0, 6984.0, 460056.0]
[164.0, 451.0, 174.0, 210.0, 211.0, 155.0, 204.0, 2132.0, 169.0, 454.0, 472.0, 209.0, 469.0]
[327, 278, 331, 280, 280, 239, 286, 302, 242, 288, 285, 286, 279]
p03013
u196697332
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\nN, M = map(int, input().split())\n\na_list = [0] * M\n\nfor m in range(M):\n a_list[m] = int(input())\n\nfor m in range(M - 1):\n if a_list[m] + 1 == a_list[m + 1]:\n print(0)\n sys.exit()\n else:\n continue\n\nrange_list = [i for i in range(1, N + 1)]\nnew_list = [0] * (M + ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s094073907', 's499119327', 's715999170', 's536531161']
[15296.0, 14000.0, 14000.0, 460020.0]
[174.0, 169.0, 173.0, 405.0]
[943, 850, 850, 980]
p03013
u200527996
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import math\ndef fib(number):\n a, b = 0, 1\n if number == 1:\n return a\n elif number == 0:\n return b\n else:\n for _ in range(number-2):\n a, b = b, a + b\n return b\nN, M = map(int, input().split())\na = []\nans = 1\ntmp = 0\nfor _ in range(M):\n a.append(int(...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s025583900', 's030674594', 's569824310']
[7080.0, 7080.0, 7080.0]
[179.0, 201.0, 182.0]
[460, 468, 466]
p03013
u211259428
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M = map(int,input().split())\na = []\nfor i in range(M):\n a.append(int(input()))\n\ndef fibo(x2):\n if (x2 == 1) or (x2 == 2):\n return (1)\n else:\n return((fibo(x2-1) + fibo(x2-2)) % (10**9 + 7))\n\naa = [] \nfor k in range(M-1):\n aa.append(a[k+1] - a[k] - 1)\nprint(aa)\n#aa.append(N -...
['Runtime Error', 'Runtime Error', 'Accepted']
['s686590026', 's995426931', 's763069137']
[8752.0, 3064.0, 7856.0]
[2104.0, 17.0, 209.0]
[691, 570, 989]
p03013
u214304095
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\na = [int(input()) for _ in range(m)]\n\ndp = [0] * (n + 10)\ndp[0] = 1\nmod = 1e9 + 7\n\nok = [1] * (n + 10)\nfor i in a:\n ok[i] = 0\n\nfor i in range(n):\n if ok[i + 1]:\n dp[i + 1] += dp[i]\n dp[i + 1] %= mod\n if ok[i + 2]:\n dp[i + 2] += dp[i]\n ...
['Wrong Answer', 'Accepted']
['s709926172', 's805235860']
[8616.0, 8592.0]
[194.0, 191.0]
[335, 318]
p03013
u222207357
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int,input().split())\na = [int(input) for _ in range(M)]\n\ndev = 100000007\ndp = [0 for _ in range(N+1)]\ndp[0] = 1\ndp[1] = 1\n\nfall = [1 for _ in range(N+1)]\n\nfor i in range(M):\n fall[a[i]] = 0\n\nfor i in range(1,N):\n dp[i+1] = dp[i]*fall[i] + dp[i-1]*fall[i-1]\n dp[i+1] %= dev\n\nprint(d...
['Runtime Error', 'Runtime Error', 'Accepted']
['s056491678', 's823529387', 's277292623']
[7832.0, 7080.0, 9592.0]
[96.0, 2104.0, 257.0]
[306, 550, 309]
p03013
u223646582
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M=map(int,input().split())\na={int(input()) for _ in range(M)}\nprint(a)\n\nl=[0]*(N+1)\nl[0]=1\n\nfor i in range(N):\n c=l[i]%1000000007\n if i>N-2:\n if i not in a:\n l[i+1]+=c\n elif i not in a:\n l[i+1]+=c\n l[i+2]+=c\n\nprint(l[N]%1000000007)', '\nN,M=map(int,input().sp...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s084819045', 's422538999', 's644265348', 's940529150']
[12520.0, 7848.0, 7848.0, 11920.0]
[199.0, 2104.0, 2104.0, 190.0]
[274, 268, 268, 266]
p03013
u224346910
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['from math import factorial', 'def main():\n MOD = 1000000007\n N, M = map(int, input().split())\n a = [int(input()) for _ in range(M)]\n table = [1]*(N+1)\n for broken in a:\n table[broken] = 0\n table[1] = table[0] * table[1]\n if N > 1:\n for n in range(2, N+1):\n table...
['Wrong Answer', 'Accepted']
['s523859958', 's686917865']
[2940.0, 7848.0]
[17.0, 192.0]
[26, 356]
p03013
u225056035
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['try:\n a = list(map(int, input().split()))\n #print(a)\n b=[0]*a[1]\n c=[0]*(a[1]+1)\n b[0]=int(input())\n c[0]=b[0]-0\n for x in range(a[1]-1):\n b[x+1]=int(input())\n c[x+1]=b[x+1]-b[x]-1\n c[-1]=a[0]-b[-1]\n max = 0\n min = a[0]+100\n for x in c:\n if x>max:\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s095295441', 's297122311', 's299145979', 's547782330', 's800680336', 's147066117']
[3064.0, 7856.0, 25444.0, 7780.0, 3064.0, 7864.0]
[17.0, 260.0, 353.0, 231.0, 17.0, 258.0]
[947, 478, 755, 765, 718, 472]
p03013
u225627575
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['BIG = 10**9+7\n\nN,M = map(int,input().split())\na = []\nfor i in range(M):\n a.append(int(input()))\n\npre = a[0]\ndame = False\nfor i in range(1,len(a)):\n if a[i]==pre:\n dame = True\n pre=a[i]\n\ndp = [0 for i in range(N+1)]\nfor item in a:\n dp[item]=-1\ndp[0]=1\nif 1 in a:\n dp[1] = 0\nels...
['Runtime Error', 'Runtime Error', 'Accepted']
['s468271182', 's874995119', 's315698532']
[10180.0, 7848.0, 7856.0]
[225.0, 227.0, 207.0]
[499, 574, 355]
p03013
u227082700
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m=map(int,input().split())\ndp=[0]*(n+7)\ndp[0]=1\na=[int(input())for _ in range(m)]\na=set(a)\nfor i in range(n):\n if i+1 not in a:\n dp[i+2]+=dp[i]\n dp[i+1]+=dp[i]\nprint(dp[n])\n', 'n,m=map(int,input().split())\ndp=[0]*(n+7)\ndp[0]=1\na=list(map(int,input().split()))\na=set(a)\nfor i in range(n):\n if ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s234477625', 's314457103', 's465241306', 's111861923']
[465396.0, 465396.0, 3064.0, 13968.0]
[595.0, 615.0, 17.0, 222.0]
[182, 180, 214, 248]
p03013
u227085629
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\na = [int(input()) for nesya in range(m)]\nhoge = [1]*(n+1)\nfor i in range(m):\n hoge[a[i]] = 0\nfor j in range(1,n+1):\n if hoge[j] == 0:\n continue\n else:\n hoge[j] = hoge[j-1] + hoge[j-2]\n hoge[j] = hoge[j] % (10**9+7)\nprint(hoge[j]%(10**9+7))', 'n,m = map(int,input().s...
['Wrong Answer', 'Accepted']
['s328686755', 's843805404']
[7844.0, 7848.0]
[187.0, 185.0]
[280, 333]
p03013
u228232845
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\na = [int(input()) for _ in range(m)]\nmod = 10**9 + 7\n\ndef check(arr):\n for i in range(m-1):\n if a[i] + 1 == a[i+1]: return 0\n dp = [0 for _ in range(n+1)]\n dp[0] = 0\n dp[1] = 1\n for i in range(2, n+1):\n if i in a: continue\n dp[i] += dp[i-1...
['Wrong Answer', 'Accepted']
['s860736840', 's204086219']
[7080.0, 8624.0]
[2108.0, 190.0]
[387, 346]
p03013
u229429359
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M = map(int,input().split())\na = [int(input()) for _ in range(M)]\n\nT = 1\nfor i in range(M-1):\n if a[i]+1==a[i+1]:\n T = 0\n break\nif T == 0:\n print(0)\nelse:\n if N==1:\n print(1)\n elif N == 2:\n print(2)\n else:\n L = [0 for _ in range(N)]\n if 0 in ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s625894176', 's911779232', 's601776986']
[7080.0, 10260.0, 7080.0]
[2104.0, 170.0, 177.0]
[856, 743, 806]
p03013
u237513745
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\nb = [False]*(m+1)\ndp = [None]*(n+1)\nM = 10**9+7\ndp[0] = 1\ndp[1] = 1\n\ndef up(x):\n if b[x] == True:\n return 0\n res = 0\n if dp[x-1] == None:\n dp[x-1] = up(x-1)\n res += dp[x-1]\n if dp[x-2] == None:\n dp[x-2] = up(x-2)\n res += dp[x-2]\n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s227959861', 's585417775', 's583963932']
[3064.0, 4724.0, 7668.0]
[18.0, 183.0, 191.0]
[506, 507, 241]
p03013
u243312682
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
["def main():\n \n # n, m = map(int, input().split())\n \n\tn, m = map(int, input().split())\n a = set(int(input()) for i in range(m))\n mod = 1000000007\n\n \n d = [0] * (n+1)\n \n cnt = 0 \n \n d[0] = 1\n if 1 not in a:\n d[1] = 1\n # else:\n # d[1] = 1\n \n fo...
['Runtime Error', 'Runtime Error', 'Accepted']
['s233980086', 's844193420', 's452891956']
[2940.0, 2940.0, 11884.0]
[17.0, 17.0, 180.0]
[928, 845, 1010]
p03013
u243699903
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['c_mod=1000000007\nn,m = map(int,input().split())\n\nstep=[0]*n\nfor _ in range(m):\n a=int(input())\n step[a-1]=-1\n\nif step[0]!=-1:\n step[0]=1\nif step[1]!=-1:\n step[1]=1\nfor i in range(2,n):\n if step[i]==-1:\n continue\n if step[i-1]!=-1:\n step[i]+=step[i-1]\n if step[i-2]!=...
['Runtime Error', 'Accepted']
['s403001427', 's307771643']
[462708.0, 464048.0]
[607.0, 575.0]
[355, 530]
p03013
u243755204
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M = map(int,input().split())\nA = set()\nfor i in range(M):\n A.append(int(input()))\ncount = [0] * (N+1)\ncount[0] = 1\nmod = 10 ** 9 + 7\nif 1 in A:\n if 2 in A:\n print(0)\n exit()\n count[2] = 1\n start = 3\nelse:\n count[1] = 1\n start = 2\nfor i in range(start, N+1):\n if i ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s490951317', 's686102159', 's690924246']
[6900.0, 9120.0, 11884.0]
[66.0, 2104.0, 178.0]
[398, 405, 395]
p03013
u244416763
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\na = [0]\nlim = int((1e+9)+7)\ndef combination(n,k):\n ans = 1\n for i in range(k):\n ans = (ans*(n-i))\n ans = (ans/(i+1))\n return int(ans)\n\ndef stair(num):\n ans = 0\n for i in range(num):\n ans = (ans+combination(num-i,i))%lim\n return int(an...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s163332504', 's495279895', 's908201232']
[7852.0, 7080.0, 11048.0]
[965.0, 165.0, 189.0]
[665, 414, 482]
p03013
u250061066
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\nsys.setrecursionlimit(10 ** 6)\n\nfrom itertools import product\n\ndef mat2_mul(X, Y):\n Z = [ [0, 0], \n [0, 0] ]\n for (i,j,k) in product(range(2),range(2),range(2)):\n Z[i][j] += X[i][k] * Y[k][j]\n return Z\n\ndef mat2_pow(X, n):\n if n == 0:\n return [ [1, 0],\n ...
['Runtime Error', 'Accepted']
['s863462704', 's788820623']
[7876.0, 8640.0]
[203.0, 230.0]
[889, 889]
p03013
u252828980
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\n\nmod = 10**9+7\ndp = [-1]*(n+1)\ndp[0]= 1\nfor i in range(m):\n a = int(input())\n dp[a-1] = 0\n#print(dp)\n#dp[1] = 1\n#dp[2] = 2\nfor i in range(1,n+1):\n if i <= 1:\n dp[i] = dp[i-1]+1\n elif i>=2 :\n dp[i] = (dp[i-1]+ dp[i-2])%mod\n #print(dp)\npri...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s005935951', 's038131189', 's230855365', 's687343441']
[12856.0, 12636.0, 465940.0, 12608.0]
[180.0, 147.0, 2211.0, 152.0]
[310, 250, 391, 304]
p03013
u253681061
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = [int(x) for x in input().split()]\na = []\nfor _ in range(m):\n a.append(int(input()))\n\nmod = 1000000007\n\ndp = [0]*(n+1)\ndp[0] = 1\n\nfor i in range(1, n+1):\n dp[i] = (dp[i-1] + dp[i-2]) % mod\n if i in a:\n dp[i] = 0\n print(dp)\n\nprint(dp[n])', 'n, m = [int(x) for x in input().split...
['Wrong Answer', 'Accepted']
['s041895518', 's803634746']
[104192.0, 13192.0]
[2104.0, 212.0]
[261, 224]
p03013
u254871849
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['\n\nimport sys\n\nmod = 10 ** 9 + 7\nn, m, *a = [int(x) for x in sys.stdin.read().split()]\n\ndp = [0] * (n + 2)\ndp[0] = 0\ndp[1] = 1\nfor i in range(2, n+2):\n \n \n # print(0)\n # sys.exit()\n # else:\n # dp[i] = 0\n # else:\n dp[i] = (dp[i-1] + dp[i-2]) % mod\n\...
['Wrong Answer', 'Accepted']
['s385698727', 's568960651']
[13940.0, 14180.0]
[76.0, 72.0]
[394, 347]
p03013
u255943004
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M = [int(i) for i in input().split()]\nA = []\nfor _ in range(M):\n A.append(int(input()))\ndef fibo(n):\n if n <= 2:\n return n\n return fibo(n-1) + fibo(n-2)\ncnt = 1\nfor a in range(len(A)+1):\n if a == 0:\n if A[a] == 1:\n width = 1\n else:\n width = A[a]-2...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s159028374', 's263372786', 's428115573', 's535276313', 's604285625', 's701673997', 's759512135']
[7080.0, 7840.0, 7088.0, 7088.0, 7840.0, 7084.0, 8748.0]
[2104.0, 2103.0, 2104.0, 2104.0, 2104.0, 2104.0, 217.0]
[559, 731, 563, 549, 726, 552, 556]
p03013
u256351611
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m=map(int,input().split())\nls=[int(input()) for i in range(m)]\n\nif 1 in ls:\n steps=[1,0]\nelse:\n steps=[1,1]\n\nfor this_step in range(2,n+1):\n if this_step in ls:\n ap=0\n else:\n ap=steps[-1]+steps[-2]\n steps.append(ap)\n print(steps)\n\nprint(steps[-1]%1000000007)', 'n,m=ma...
['Runtime Error', 'Accepted']
['s336110392', 's934892573']
[135924.0, 460020.0]
[2104.0, 451.0]
[292, 342]
p03013
u256464928
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\na = set([int(input()) for _ in range(m)])\nprint(a)\ndp = [0] * (n+1)\ndp[0] = 1\nfor i in range(1,n+1):\n dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)\n if i in a:dp[i]=0\nprint(dp[n])', 'n,m = map(int,input().split())\na = set([int(input()) for _ in range(m)])\ndp = [0] * (n+1)\ndp[0] = 1\nfo...
['Wrong Answer', 'Accepted']
['s305184152', 's730935269']
[13216.0, 13212.0]
[228.0, 217.0]
[200, 192]
p03013
u261082314
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['li = list(map(int,input().split()))\nn,m=li[0],li[1]\n_list=[int(input()) for i in range(m)]\nis_safe = [True] * (N)\nfor a in _list:\n is_safe[a] = False\nDP=[1, 1] if is_safe[1] == True else [1, 0]\nfor i in range(n-1):\n if is_safe[i+2] == False:\n DP+= [0]\n else:\n DP += [DP[i] + DP[i+1]]\nprint(DP[n])'...
['Runtime Error', 'Runtime Error', 'Accepted']
['s489224340', 's978522739', 's742077715']
[7076.0, 3064.0, 460788.0]
[161.0, 17.0, 501.0]
[305, 340, 341]
p03013
u261700262
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def main():\n N, M = map(int, input().split())\n broken = [int(input()) for _ in range(M)]\n div = 1000000007\n\n comb_list = [0] * (N + 1)\n comb_list[0] = 1\n if 1 not in broken:\n comb_list[1] = 1\n\n for i in range(2, N + 1):\n if i in broken:\n continue\n comb...
['Wrong Answer', 'Accepted']
['s231625959', 's681722701']
[3064.0, 14180.0]
[18.0, 49.0]
[427, 411]
p03013
u265506056
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M=map(int,input().split())\nA=[]\na=[]\na.append(0)\nx=0\nd=1\nA.append(1)\nA.append(2)\nfor j in range(2,N):\n A.append(A[j-1]+A[j-2])\nfor i in range(1,M+1):\n a.append(int(input()))\n x=A[a[i]-a[i-1]-2]\n d=d*x\n if i>1:\n if a[i]-a[i-1]==1:\n d=0\nx=A[N-a[M]-2]\nd=d*x\nprint(A[2...
['Runtime Error', 'Accepted']
['s332121086', 's465953581']
[464160.0, 460020.0]
[668.0, 466.0]
[327, 184]
p03013
u268318377
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int, input().split())\ne = 10*9 + 7\nc = 0\nans = 1\nfor _ in range(m):\n a = int(input())\n b = a-1-c\n if b < 0:\n ans *= 0\n break\n c = a+1\n print(sum([i for i in range(-(-b//2), b)]))\n ans *= (1 + sum([i for i in range(-(-b//2), b)])) % e\n \nb = n - c\nans *= (1 + ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s217779146', 's373534774', 's747948879', 's534717494']
[5016.0, 3064.0, 6900.0, 6900.0]
[479.0, 17.0, 252.0, 200.0]
[355, 288, 293, 238]
p03013
u268792407
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['from math import factorial\nfrom operator import mul\nfrom functools import reduce\n\ndef c(n,r):\n r = min(n-r,r)\n if r == 0 or r == n:\n return 1\n else:\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1,r + 1))\n return over // under\ndef num(k): \n return int((((1+sqrt(5))/2...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s269682079', 's550731005', 's588095314', 's612329609', 's661091346', 's844913352', 's502510836']
[9104.0, 2940.0, 3700.0, 9104.0, 9104.0, 3572.0, 7056.0]
[188.0, 17.0, 24.0, 311.0, 302.0, 23.0, 189.0]
[788, 685, 811, 810, 810, 811, 369]
p03013
u270144704
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\na = [int(input()) for _ in range(m)]\nans = 1\nMOD = 10**9+7\nMAX = 10**5+1\nfact = [1] * MAX\n\nfor i, j in zip(a[:m-1], a[1:]):\n if j - i == 1:\n print(0)\n exit()\n\ndef comb_init():\n fact[0], fact[1] = 1, 1\n for i in range(2, MAX):\n fact[i] = fac...
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s132012032', 's934579456', 's105921158']
[3070732.0, 467608.0, 467520.0]
[2287.0, 492.0, 492.0]
[726, 517, 505]
p03013
u273928723
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def Fib(n):\n a, b = 0, 1\n if n == 1:\n return a\n elif n == 2:\n return b\n else:\n for i in range(n-2):\n a, b = b, a + b\n return b\na,b=input().split()\na=int(a)\nb=int(b)\nll=[]\ny=-1\ns=0\nfor i in range(b):\n x=input()\n x=int(x)\n ll.append(x)\n ...
['Wrong Answer', 'Accepted']
['s352668103', 's018321277']
[5416.0, 5424.0]
[158.0, 149.0]
[571, 525]
p03013
u274635633
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m=map(int,input().split())\np=10**9+7\na=[int(input()) for i in range(m)]\nb=[a[0]-1]\nfor i in range(m):\n b.append(a[i+1]-a[i]-2)\nx=[1]*(max(b)+1)\nfor i in range(2,max(b)+1):\n x[i]=(x[i-1]+x[i-2])%p\n\nans=1\nif min(b)==-1:\n ans=0\nelse:\n for i in range(m):\n ans=(ans*x[b[i]])%p\nprint(ans)', 'n,m=map...
['Runtime Error', 'Accepted']
['s780062577', 's226320319']
[7848.0, 7876.0]
[193.0, 195.0]
[291, 307]
p03013
u276204978
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def main():\n n, m = map(int, input().split())\n a = [int(input()) for _ in range(m)]\n a = set(a)\n\n s[0] = 1\n s[1] = 1 if 1 not in a else 0\n\n for i in range(2, n+1):\n if i in a:\n continue\n s[i] = (s[i-1] + s[i-2]) % 1000000007\n\n print(s[n])\n\nmain()', 'n, m = ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s091642023', 's100998492', 's242866867', 's480959194', 's613842238', 's416176226']
[13216.0, 13216.0, 13216.0, 7064.0, 7080.0, 13212.0]
[168.0, 171.0, 169.0, 2108.0, 2104.0, 185.0]
[292, 235, 232, 258, 257, 367]
p03013
u278356323
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**6)\n\nn, m = map(int, input().split())\na = []\nfor _ in range(m):\n a.append(int(input()))\na=set(a)\n\nmemo = {}\n\n\ndef step(now):\n if now in a:\n return 0\n # print(now)\n if now == n:\n return 1\n if now > n:\n ...
['Wrong Answer', 'Accepted']
['s395687049', 's162368466']
[552808.0, 460020.0]
[2138.0, 465.0]
[483, 408]
p03013
u286623856
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
["import sys\nimport math\ninput = sys.stdin.readline\n\n\ndef main():\n MOD = 10 ** 9 + 7\n sc = Scan()\n n, m = sc.intarr()[0]\n w = sc.intarr()\n is_safe = [True] * (n+2)\n for a in w:\n is_safe[a + 1] = False\n dp = [0] * (n+2)\n dp[1] = 1\n for i in range(2, n+2):\n if is_s...
['Runtime Error', 'Accepted']
['s954213945', 's886954211']
[3064.0, 8616.0]
[18.0, 64.0]
[742, 819]
p03013
u287341833
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['# -*- coding: utf-8 -*-\n"""\nCreated on Wed Jun 19 17:29:01 2019\n\n@author: makigon\n"""\nmod = 10 ** 9 + 7\nN, M = map(int, input().split())\na = [int(input()) for i in range(M)]\n\naset = set(a)\nf = [0 for i in range(N)]\nf[0] = 1\nif 1 in a and len(a)>=2 :\n f[1] = 0\nelif 1 not in a and len(a)>=2:\n f[1]...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s090062667', 's118143777', 's714380906']
[13216.0, 460056.0, 13216.0]
[2104.0, 2119.0, 178.0]
[502, 284, 495]
p03013
u288087195
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = list(map(int, input().split()))\nA =[0]*M\nfor i in range(M):\n A[i] = int(input())\n\namari = 1000000007\ncnt = [0]*(N+1)\ncnt[0] = 0\ncnt[1] = 1\ncnt[2] = 2 \nfor i in range(3,N+1):\n t = (cnt[i-1]+cnt[i-2])\n cnt[i] = t % amari\n\nans = 1\nfor i in range(M): \n if i == 0:\n if A[i] != 1:\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s818408159', 's834878604', 's509564632']
[10868.0, 10868.0, 10868.0]
[207.0, 208.0, 217.0]
[535, 521, 595]
p03013
u288430479
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\nl = [int(input()) for _ in range(m)]\nq = 10**9+7\nmemo = [0]*(n+1)\nmemo[0]=1\ndef a(x):\n if x in l :\n return 0\n elif x==1:\n memo[1]=1\n return 1\n else:\n if memo[x]!=0:\n return memo[x]\n else:\n memo[x] = a(x-1)+a(x-2)\n return (a(x-1)+a(x-2))%\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s511649057', 's823579286', 's944205622']
[3064.0, 3064.0, 7824.0]
[17.0, 18.0, 194.0]
[315, 340, 305]
p03013
u289288647
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int, input().split())\nroute = [int(x) for x in range(N)]\na = [int(input()) for _ in range(M)]\nroute = [item for index, item in enumerate(route) if index not in a]\n\nnums = [0]*(N+1)\nnums[0] = 1\nif 1 not in a:\n nums[1] = 1\nfor i in range(2, N+1):\n print(nums)\n if not i in a:\n nums[i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s142786016', 's266508697', 's015519699']
[134944.0, 134904.0, 460020.0]
[2104.0, 2104.0, 454.0]
[361, 257, 246]
p03013
u296150111
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m=map(int,input().split())\na=[]\nfor i in range(m):\n\ta.append(int(input()))\nif a[0]!=1:\n\ta.insert(0,-1)\nif a[-1]!=n-1:\n\ta.append(n+1)\nb=[]\nfor i in range(len(a)-1):\n\tb.append(a[i+1]-a[i]-1)\n\tif a[i+1]-a[i]==1:\n\t\tprint(0)\n\t\texit()\ndef Fib(n, memo={}):\n if n == 1:\n return 1\n elif...
['Runtime Error', 'Runtime Error', 'Accepted']
['s551699968', 's703716692', 's200979855']
[7080.0, 7852.0, 16804.0]
[171.0, 246.0, 166.0]
[520, 265, 263]
p03013
u299840026
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import numpy as np\nn, m = [int(i) for i in input().split()]\na =[]\nd = 1000000007\n\nfor i in range(m):\n a1=int(input())\n a.append(a1)\n\na.append(n+1)\na = np.array(a)\n#print(a)\n\nif 1 in a[1:]-a[:-1]:\n print(0)\n\nelse:\n dp = [0]*1000001\n dp[1]=1\n dp[2]=1\n for i in range(3,len(dp)):\...
['Time Limit Exceeded', 'Accepted']
['s765962232', 's376936935']
[17128.0, 18820.0]
[2298.0, 391.0]
[604, 667]
p03013
u309141201
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
["n, m = map(int, input().split())\na = []\nans = 1\nfor _ in range(m):\n a.append(int(input()))\nmod = 10**9 + 7\np = 0\nfor i in range(m):\n print(p)\n if i == m-1:\n ans *= n - a[i] - 1\n # print('Y')\n break\n if a[i] == 1:\n if a[i+1] == 2:\n ans *= 0\n els...
['Wrong Answer', 'Accepted']
['s546825062', 's506909923']
[8076.0, 7668.0]
[275.0, 176.0]
[468, 333]
p03013
u317779196
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\na = {int(input()) for _ in range(m)}\nmod = 10**9 + 7\n\ndp = [0]*(n+1)\ndp[0] = 1\n \nfor i in range(1,n+1):\n if i in a:\n continue\n x = dp[i-1] \n if i > 1:\n x += dp[i-2]\n dp[i] = x\nans = dp[n] % x\nprint(ans)', 'n,m = map(int,input().split())\na = {...
['Runtime Error', 'Accepted']
['s865110990', 's185988869']
[465880.0, 465720.0]
[387.0, 392.0]
[262, 264]
p03013
u321035578
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
["def main():\n n, m = map(int,input().split())\n a = [0] * m\n for i in range(m):\n a[i] = int(input())\n ans = [0] * (n+1)\n head = 0\n MOD = 10**9 + 7\n ans[0] = 1\n for i in range(1,n+1):\n print(head,i)\n if head < m and a[head] == i:\n ans[i] = 0\n ...
['Wrong Answer', 'Accepted']
['s450491911', 's634414775']
[10024.0, 7668.0]
[333.0, 180.0]
[551, 514]
p03013
u322185540
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import math\ndef f(k):\n aaa = 1/math.sqrt(5)*(((1+math.sqrt(5))/2)**k-((1-math.sqrt(5))/2)**k)%1000000007\n return aaa\n \nn,m = map(int,input().split())\nstart = []\nfor i in range(m):\n start.append(int(input()))\n\nif start == []:\n print(f(n-1))\nelse:\n pstart = [-1]+start+[n+1] \n newlist ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s599788152', 's866725634', 's964149015']
[8616.0, 2940.0, 9248.0]
[205.0, 18.0, 220.0]
[704, 702, 847]
p03013
u323859575
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\n\nMOD = 10**9 + 7\n\nsafe = [True] * (N+1)\nfor i in range(len(A)):\n safe[A[i]] = False\n\nprint(safe)\n\ndp = [0] * (N+1)\ndp[0] = 1\nif safe[1]:\n dp[1] = 1\n\nfor i in range(2, N+1):\n if(safe[i]):\n dp[i] = dp[i-1] + dp[(i-2)...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s064504821', 's924260303', 's242190480']
[16484.0, 15572.0, 14388.0]
[165.0, 164.0, 156.0]
[368, 355, 340]
p03013
u324761590
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\nfrom collections import defaultdict\n\nstairs = []\nsteps = []\nMOD = 1000000007\n\nn, m = int(input()), int((input()))\nstairs = {int(input()):True for i in range(m)}\n\nstep = defaultdict(int)\nstep[0] = 1\n\nfor i in range(n):\n if i in stairs.keys():\n step[i] = 0\n else:\n step[i+...
['Runtime Error', 'Accepted']
['s742862906', 's961125136']
[9476.0, 30652.0]
[27.0, 175.0]
[398, 384]
p03013
u325704929
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = [int(i) for i in input().split()]\n\ndp = [0] * (N + 1)\ndp[0] = 1\nb = 1\nf = FalseN, M = [int(i) for i in input().split()]\n\ndp = [0] * (N + 1)\ndp[0] = 1\nb = 1\nf = False\nfor _ in range(M):\n a = int(input())\n if a - b == 1:\n f = True\n break\n dp[a] = -1\n b = a\n\nif f:\n ...
['Runtime Error', 'Accepted']
['s303547691', 's040834035']
[3828.0, 6992.0]
[19.0, 139.0]
[690, 604]
p03013
u327162583
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M = (int(i) for i in input().split())\na = [int(input()) for i in range(M)]\nhoge = [0] * N\nhoge[0] = 1\nfor i in range(N):\n if i == 0 and (i+1) not in a:\n hoge[i] = 1\n elif i == 1 and (i+2) not in a:\n hoge[i] = hoge[i-1] + 1\n elif i + 1 in a:\n hoge[i] = 0\n elif i in a and (...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s010494244', 's442737709', 's446859168', 's512311927', 's567421900', 's894384957', 's990287625', 's994673674', 's046116854']
[7848.0, 7848.0, 2940.0, 7824.0, 7848.0, 7848.0, 460020.0, 7848.0, 462708.0]
[2107.0, 2104.0, 18.0, 2104.0, 2104.0, 2104.0, 2105.0, 2104.0, 593.0]
[558, 393, 370, 391, 487, 374, 516, 390, 320]
p03013
u328136010
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
["#!/usr/bin/env pypy\nimport sys\n\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nMOD = 10 ** 9 + 7\n\n\ndef main():\n n, m = map(int, readline().split())\n # a = readlines()\n As = list(map(int, readlines()))\n \n \n # print(0)\n # return\n broken = [Fal...
['Wrong Answer', 'Accepted']
['s671172581', 's169100437']
[11812.0, 16796.0]
[47.0, 50.0]
[664, 588]
p03013
u330661451
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\ninput = sys.input.readline\n\nMOD = 1000000007\n\nn , m = map(int,input().split())\n\ncount = [-1] * (n+1)\nfor i in range(m):\n count[int(input())] = 0\n\nfor i in range(1,n+1):\n if count[i] == 0:\n continue\n \n if i == 1:\n count[i] = 1 \n elif i == 2:\n count[i] = ...
['Runtime Error', 'Accepted']
['s309570239', 's708447794']
[3064.0, 7832.0]
[18.0, 182.0]
[393, 416]
p03013
u334703235
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
[', M = map(int,input().split())\nalist = list()\nfor _ in range(M):\n alist.append(int(input()))\n\n\nli = {}\nli[0] = 1\n\nfor i in range(1,N+1):\n if i in alist:\n li[i] = 0\n else:\n if i == 1:\n li[i] = 1\n else:\n li[i] = (li[i-1] + li[i-2])%(10**9+7)\nprint(li[...
['Runtime Error', 'Accepted']
['s208097086', 's050272672']
[2940.0, 17900.0]
[17.0, 1701.0]
[314, 360]
p03013
u338824669
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M=map(int,input().split())\nA=[-1]+[int(input()) for i in range(M)]+[N+1]\nres=1\nfor i in range(1,len(a)):\n steps=a[i]-a[i-1]-2\n if steps<0:\n patern_nmu=0\n else:\n p,q=1,0\n for j in range(steps):\n p,q=p+q,p\n patern_nmu=p\n res*=patern_nmu\n res%=1000000007\nprint(res)', 'N,M=map(in...
['Runtime Error', 'Accepted']
['s983143344', 's516144925']
[7824.0, 7848.0]
[174.0, 201.0]
[290, 286]
p03013
u339199690
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int, input().split())\nA = [True] * (N + 1)\nfor _ in range(M):\n a = int(input()) - 1\n A[a] = False\n\ndp = [0] * (N + 1)\n\ndp[0] = 1\nfor i in range(N):\n for j in range(i + 1, min(N, i + 2) + 1):\n if A[j] is True:\n dp[j] += dp[i]\n dp[j] %= 10 ** 9 + 7\n\nprint(...
['Wrong Answer', 'Accepted']
['s954941121', 's385788036']
[13416.0, 13424.0]
[204.0, 201.0]
[310, 306]
p03013
u340952887
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int, input().split())\n\nbroken = []\nfor _ in range(M):\n broken.append(int(input()))\n\nmod = 10 ** 9 + 7\nf = [0] * N\nf[1] = 1\nfor i in range(1, N + 1):\n if i in broken:\n if i - 1 in broken:\n print(0)\n exit()\n continue\n f[i] = f[i-2] + f[i-1]\nprint(f[N] % mod)', 'N, M = map(i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s033286018', 's674756822', 's940181366']
[7824.0, 3060.0, 13216.0]
[2104.0, 17.0, 193.0]
[286, 614, 331]
p03013
u342563578
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\na = []\nmod = 10**9+7\nd = [0 for i in range(n+1)]\n d[0] = 1\n d[1] = 1\n d[2] = 2\n for i in range(3,n+1):\n d[i] = d[i-1] + d[i-2]\n d.append(0)\nif m != 0:\n for i in range(m):\n b = int(input())\n a.append(b)\n ans = 1\n if a[0] == 1:\n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s361036987', 's779712359', 's774803536']
[2940.0, 464048.0, 464144.0]
[17.0, 541.0, 546.0]
[489, 361, 485]
p03013
u343977188
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M=map(int,input().split())\na=[0]*N\nfor i in range(M):\n a[int(input())]=1\nMOD = 1000000007\n\ndp=[0]*(N+1)\ndp[0]=1\nif 1 in a:\n dp[1]=0\nelse:dp[1]=1\n\nfor i in range(2,N+1):\n \n if a[i-1]==0:\n dp[i]+=dp[i-1]\n \n if a[i-2]==0:\n dp[i]+=dp[i-2]\n dp[i] = dp[i]%MOD\nprint(d...
['Wrong Answer', 'Accepted']
['s739323428', 's847372015']
[7772.0, 7772.0]
[203.0, 199.0]
[353, 358]
p03013
u344988675
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int,input().split())\nss = [1]*n\nfor i in range(0,m):\n ss[int(input())-1] = 0\nif n == 0:\n print(0)\nelif n == 1:\n print(1)\nelif n == 2:\n if 0 in ss:\n print(0)\n else:\n print(1)\nelse:\n if ss[n-3] != 0:\n ss[n-3] = ss[n-2]+ ss[n-1]\n for i in range(n-4,-1,-...
['Wrong Answer', 'Accepted']
['s515823439', 's181825024']
[465396.0, 460020.0]
[2133.0, 366.0]
[432, 421]
p03013
u346308892
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def acinput():\n return list(map(int,input().split(" ")))\n\n\nN,M=acinput()\na=[0]*(N+1)\nfor i in range(N):\n a[int(input())]=1\n\n\nM=1000000007\n\ndef solve(x):\n global dp,M\n if dp[x]>=0:\n return dp[x]\n\n res=0\n zeroflg=True\n if a[x-1]!=1:\n res+=solve(x-1)%M\n zer...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s095237506', 's261711044', 's356768928', 's154501288']
[3828.0, 5548.0, 2940.0, 52056.0]
[168.0, 245.0, 17.0, 204.0]
[491, 490, 633, 629]
p03013
u350997995
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import bisect\ndef f(x,a):\n global N,M\n if M==0:\n return False\n b = bisect.bisect_left(a,x)\n return True if x==a[mi\n n(b,N)] else False\nMOD = 10**9+7\nN,M = map(int,input().split())\na = [int(input()) for _ in range(M)]\na.sort()\nx = 0\ny = 1\nfor i in range(N):\n if f(i,a) and f(i+1,a):\n print(0...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s221998733', 's690942526', 's752216206', 's836333729', 's987834077', 's209079073']
[2940.0, 2940.0, 7080.0, 7080.0, 7080.0, 7848.0]
[18.0, 17.0, 302.0, 305.0, 262.0, 190.0]
[392, 391, 360, 389, 342, 289]
p03013
u353797797
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def cmb(n, r):\n return fct[n] * inv[r] * inv[n - r] % md\n\nmd = 10 ** 9 + 7\nn, m = map(int, input().split())\nans = 1\npa = -1\nds = []\nfor _ in range(m):\n a = int(input())\n if a == 1:\n pa = 1\n continue\n d = a - pa-2\n if d == -1:\n print(0)\n exit()\n ds.append(...
['Wrong Answer', 'Accepted']
['s846854438', 's759011881']
[11052.0, 11052.0]
[160.0, 157.0]
[708, 709]
p03013
u361381049
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\na = set()\nfor i in range(m):\n a.add(int(input()))\ndp = [0] * (n+1)\ndp[0] = 1\nif not(1 in a):\n dp[1] = 1\nif not(2 in a):\n dp[2] = 1\nfor i in range(2,n+1):\n if i-1 in a:\n dp[i] = dp[i-2]\n dp[i-1] = 0\n else:\n dp[i] = dp[i-1] + dp[i-2]\np...
['Runtime Error', 'Accepted']
['s747253440', 's055703061']
[499188.0, 460020.0]
[2134.0, 451.0]
[336, 308]
p03013
u363992934
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\nnow_step = 0\n\n\n\n\n\nchecked_steps = {-1:0, 0:1, 1:1}\ndivide_num = 1000000007 \n\nif(n >= 3):\n for i in range(3, n):\n checked_steps[i] = (checked_steps[i-1] + checked_steps[i-2]) % divide_num\n\nall_count = 1\nfor i in range(m):\n a = int(input())\n if(a < now_s...
['Runtime Error', 'Runtime Error', 'Accepted']
['s674928883', 's743942013', 's919050168']
[3064.0, 3064.0, 17900.0]
[18.0, 19.0, 273.0]
[985, 965, 967]
p03013
u366482170
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m=map(int,input().split())\na=[]\nfor i in range(m):\n a.append(int(input()))\nb=[0 for x in range(n+1)]\nb[0]=1\nfor i in range(1,n+1):\n if i in a:\n b[i]=0\n else:\n b[i]+=b[i-1]\n if i>1:b[i]+=b[i-2]\nprint(b[n]%=(10**9+7))', 'n,m=map(int,input().split())\na = set(int(input()) for i in range(m))\n\n...
['Runtime Error', 'Accepted']
['s764374787', 's343242555']
[3064.0, 11884.0]
[18.0, 185.0]
[229, 257]
p03013
u367965715
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = [int(i) for i in input().split()]\na = []\nfor _ in range(m):\n a.append(int(input()))\n\nways = [0] * 3\nways[1] = 0 if 1 in a else 1\nways[2] = 0 if 2 in a else ways[1] + 1\nfor i in range(3, n+1):\n if i in a:\n ways.append(0)\n else:\n ways.append((ways[-2]+ways[-1])%(10**9+7))\n ...
['Runtime Error', 'Accepted']
['s890470484', 's673445400']
[134772.0, 8616.0]
[2104.0, 194.0]
[333, 388]
p03013
u370331385
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N,M = map(int,input().split())\nA = []\n\n\nfrom functools import lru_cache\n@lru_cache(maxsize=None)\ndef Fib(n):\n if n == 1:\n return 1\n elif n == 2:\n return 1\n else:\n return Fib(n-1) + Fib(n-2)\n\n \nfor i in range(M):\n a = int(input())\n A.append(a)\n\n\n\n\nans = 0\nfor...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s507087164', 's532483720', 's428923158']
[3064.0, 7084.0, 7076.0]
[17.0, 175.0, 184.0]
[1674, 1362, 1395]
p03013
u370429695
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def count(b,a):\n c = 2\n d = 1\n for i in range(b - a):\n c,d = c+d,c\n return c\n \nn,m = map(int,input().split())\nli = []\nfor i in range(m):\n li.append(int(input()))\ncnt = 1\nfor i in range(len(li) - 1):\n if li[i+1] - li[i] == 1:\n cnt = 0\n break\n else:\n if ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s200888862', 's635961738', 's947169976']
[7056.0, 7056.0, 7668.0]
[289.0, 284.0, 194.0]
[428, 427, 305]
p03013
u372259664
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m = map(int, input().split())\nbk = []\nfor i in range(m):\n bk.append(int(input()))\n\np = [0]*(n+1)\nfor i in bk:\n p[i] = -100\nif n == 1 and m == 0:\n print(1)\nelif n == 1 and m == 1:\n print(0)\nelse:\n p[0] = 1\n if 1 in bk:\n p[1] = 0\n else:\n p[1] = 1\n for i in range...
['Wrong Answer', 'Accepted']
['s215568465', 's784604801']
[7848.0, 7856.0]
[202.0, 194.0]
[491, 490]
p03013
u372320597
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\nw = [1 for _ in range(n)]\nfor _ in range(m):\n w[int(input())] = 0\nfor i in range(2, n):\n if w[i] != 0:\n w[i] = w[i-2] + w[i-1]\nprint(w[-1] % 1000000007)', 'n, m = map(int, input().split())\nw = [1 for _ in range(n+1)]\nfor _ in range(m):\n w[int(input())] = 0\nf...
['Wrong Answer', 'Accepted']
['s481580462', 's344321013']
[460056.0, 460056.0]
[455.0, 458.0]
[198, 212]
p03013
u374829922
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\ninput = sys.stdin.readline\nn,m = map(int, input().split())\n\nprint(a)\ndp = [0] * (n+1)\n\n\ndp[0] = 1\ndp[1] = 1\nfor i in range(2,n+1):\n if i in a:\n dp[i] = 0\n else: \n dp[i] += (dp[i-1] + dp[i-2]) % (10 ** 9 + 7)\n\nprint(dp[-1])\n', 'import sys\ninput = sys.stdin.readline\nn,m...
['Runtime Error', 'Accepted']
['s901013126', 's993312719']
[3060.0, 18332.0]
[17.0, 71.0]
[290, 370]
p03013
u375253797
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int, input().split())\ndp = [0] * N\nfor _ in range(M):\n a = int(input())\n dp[a-1] = -1\n\nk = 1000000007\n\n\nfor i in range(N):\n if dp[i] == -1:\n dp[i] = 0\n continue\n if i == 0:\n dp[i] = 1\n continue\n if i == 1:\n dp[i] = dp[i-1] + 1\n cont...
['Runtime Error', 'Runtime Error', 'Accepted']
['s648551877', 's988914852', 's165510469']
[6132.0, 6900.0, 6900.0]
[194.0, 195.0, 200.0]
[363, 363, 368]
p03013
u375477204
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int, input().split())\na = [int(input()) for _ in range(M)]\na = set(a)\nmod = 1000000007\ndp = [0]*(N+1)\ndp[0] = 1\nif a[0] != 1:\n dp[1] = 1\nfor i in range(2, N+1):\n if i not in a:\n dp[i] = (dp[i-1]+dp[i-2])%mod\nprint (dp[N])', 'N, M = map(int, input().split())\na = [int(input()) for _ ...
['Runtime Error', 'Accepted']
['s228894381', 's622347486']
[13216.0, 13192.0]
[169.0, 183.0]
[245, 282]
p03013
u375695365
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n,m=map(int,input().split())\nmod=10**9+7\nt=[int(input()) for i in range(m)] \ndp=[-1]*(n+1)\n\ndp[0]=0\ndp[1]=1\ndp[2]=1\n\nfor i in range(m):\n dp[t[i]]=0\n\nfor i in range(3,n+1):\n if dp[i]==-1:\n dp[i]=dp[i-1]+dp[i-2]\nprint(dp[-1]%mod)\n', 'n,m=map(int,input().split())\nmod=10**9+7\nt=[int(input()...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s134355188', 's583961813', 's812619306', 's783825161']
[460020.0, 460020.0, 460020.0, 460020.0]
[466.0, 450.0, 453.0, 459.0]
[241, 241, 228, 559]
p03013
u376328830
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['from math import *\n\ndef fib(n):\n return ((1+sqrt(5))**(n+1) - (1-sqrt(5))**(n+1)) // (2**(n+1)*sqrt(5))\n\n\ndef how_many_ways(lst_of_broken_steps,goal):\n\n for i in range(len(lst_of_broken_steps)-1):\n if lst_of_broken_steps[i]+1==lst_of_broken_steps[i+1]:\n return 0\n \n \n an...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s268043521', 's768541763', 's061229270']
[7080.0, 13216.0, 13216.0]
[268.0, 183.0, 192.0]
[1006, 288, 291]
p03013
u377989038
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['def fib(n):\n a, b = 1, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n\n\nn, m = map(int, input().split())\na = [-1] + [int(input()) for i in range(m)] + [n + 1]\nans = 1\n\nfor i in range(len(a) - 1):\n if a[i] != 0 and a[i + 1] != n and a[i + 1] - a[i] == 1:\n print(0)\n exit...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s060228294', 's450329362', 's455057721']
[7848.0, 9116.0, 7836.0]
[289.0, 181.0, 68.0]
[412, 520, 388]
p03013
u379959788
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['sys.setrecursionlimit(10 ** 5 + 10)\nmod = 10 ** 9 + 7\n\n\nfib_memo = {}\ndef fib(N):\n if N < 2: return 1\n if N not in fib_memo:\n fib_memo[N] = fib(N-1) + fib(N-2)\n return fib_memo[N]\n\nN, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\n\ntmp_list = [0] * (M+1)\nnow_kaidan =...
['Runtime Error', 'Accepted']
['s203110644', 's188994324']
[3064.0, 460788.0]
[17.0, 369.0]
[642, 504]
p03013
u380524497
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\n\n\ninput = sys.stdin.readline\n\nn, m = map(int, input().split())\nbroken = set()\nfor i in range(m):\n a = int(input())\n broken.add(a)\n\npattern = [0]*(n+1)\npattern[0] = 1\n\nfor i in range(2, n+1):\n if i in broken:\n pattern[i] = 0\n else:\n pattern[i] = pattern[i-1] + pat...
['Wrong Answer', 'Accepted']
['s564817445', 's240061172']
[460020.0, 11884.0]
[484.0, 66.0]
[341, 375]
p03013
u382431597
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\n\ndef dfs(n:int, heights: int, a_index:int):\n if n < heights:\n return\n \n if m != 0 and a_index <= len(a) -1 and a[a_index] == heights:\n memo[heights] = 0\n a_index += 1\n #print("10",heights)\n else:\n memo[heights] = memo[heights-1] + memo[heights -2]\n...
['Runtime Error', 'Accepted']
['s874920624', 's732485011']
[6804.0, 545140.0]
[172.0, 472.0]
[783, 860]
p03013
u387774811
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import sys\ninput = sys.stdin.readline\nN,M = map(int,input().split())\nlst=[int(input()) for i in range(M)]\nt=0\nans=[0]*(N+1)\nans[0]=1\nfor j in range(N):\n if M!=0:\n if lst[t]==j+1:\n ans[j+1]=0\n t+=1\n t=min(M-1,t)\n else:\n ans[j+1]+=ans[j]\n if j!=0:\n ans[j+1]+=ans[j-1]\n ans[j+1]%=(10**9+7)\np...
['Wrong Answer', 'Accepted']
['s685920245', 's726040139']
[7848.0, 7856.0]
[106.0, 109.0]
[312, 398]
p03013
u389679466
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import scipy.misc as scm\n\nN, M = map(int, input().split())\n\na_s = []\nflag = False\n\nfor i in range(M):\n a_m = int(input())\n a_s.append(a_m)\n if(i > 0 and a_m == a_s[i-1]+1):\n flag = True\n print(0)\n break\n\n\nif not flag:\n way = 1\n now = 0\n for a in a_s:\n ...
['Runtime Error', 'Accepted']
['s791614325', 's230862579']
[15932.0, 7832.0]
[2109.0, 202.0]
[1000, 353]
p03013
u389910364
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import bisect\nimport operator\nimport os\nfrom collections import Counter, deque\nfrom fractions import gcd\nfrom functools import lru_cache\nfrom functools import reduce\nimport functools\nimport heapq\nimport itertools\nimport math\nimport numpy as np\nimport re\nimport sys\n\nif os.getenv("LOCAL"):\n sys.stdin...
['Time Limit Exceeded', 'Accepted']
['s461791438', 's112374237']
[22092.0, 9604.0]
[2108.0, 138.0]
[2534, 594]
p03013
u392319141
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import math\n\nN , M = map(int,input().split())\n\nif M == 0:\n a = [-1 , N+1]\nelse :\n a = [-1] * (M+2)\n\n for i in range(1,M+1) :\n a[i] = int(input())\n\nflag = True \nfor i in range(0,M+1) :\n if a[i] + 1 == a[i+1] :\n flag = False\n break\n\nfact = [0] * (M)\n\nif flag :\n a...
['Runtime Error', 'Accepted']
['s148079283', 's061980684']
[7796.0, 463988.0]
[173.0, 611.0]
[1188, 585]
p03013
u393693918
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['n, m = map(int, input().split())\nli = []\nfor i in range(m):\n li.append(int(input()))\n\n\ndef fib(dan):\n if dan == 1:\n return 1\n elif dan == 2:\n return 1\n elif dan == 0:\n return 0\n else:\n a1 = 1\n a2 = 1\n a3 = 0\n for _ in range(dan-2):\n ...
['Runtime Error', 'Accepted']
['s393545571', 's804551175']
[2940.0, 7080.0]
[17.0, 211.0]
[639, 641]
p03013
u394721319
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['import math\n\nN,M = [int(i) for i in input().split()]\nA = [int(input()) for _ in range(M)]\n\nm = 10**9+7\n\nmemo = [1]*(N+1)\nfor i in range(3,N+1):\n memo[i] = memo[i-1] + memo[i-2]\n\nA.append(N+1)\np = A[0]\nans = memo[p]\nfor i in range(1,M+1):\n print(ans)\n if p+1 == A[i]:\n print(0)\n ...
['Runtime Error', 'Accepted']
['s912054262', 's753498817']
[464040.0, 464040.0]
[520.0, 534.0]
[390, 294]
p03013
u396391104
2,000
1,048,576
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step. He can climb up one or two steps at a time. However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps. How many are there to climb ...
['N, M = map(int,input().split())\na = list(int(input()) for i in range(M))\na.append(N+1)\n\n\ndef Fib(n):\n a, b = 1, 1\n if n == 1:\n return a\n elif n == 2:\n return b\n else:\n for i in range(n-2):\n a, b = b, a + b\n return b\n\nans = 1\nprint(M,a,N)\nif M > 1:\n...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s142852113', 's532979659', 's896004494', 's062827732']
[9112.0, 7088.0, 2940.0, 7088.0]
[186.0, 181.0, 18.0, 172.0]
[774, 794, 794, 795]