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
u399155892
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 ...
["a = [0]\n\nN, M = map(int, input().split(' '))\n\nfor _ in range(M):\n a.append(int(input()))\na.append(N+1)\n\n#print(a)\n\nb = []\nfor i in range(M+1):\n b.append(a[i+1] - a[i] - 2)\n\n#print(b)\n\ndef func(n):\n if n == -2:\n retval = 0\n elif n == -1:\n retval = 1\n elif n == 0:\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s227689990', 's717077425', 's741408799', 's022861392']
[7904.0, 7852.0, 9996.0, 460148.0]
[2104.0, 2103.0, 2104.0, 496.0]
[544, 508, 505, 523]
p03013
u408262366
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\nhoge = input().split()\nN = int(hoge[0])\nM = int(hoge[1])\nbroken = []\nfor i in range(M):\n broken.append(int(input()))\n\nanss = []\nsafes = []\nfibo = [1,2]\nsafes.append(broken[0]-1)\nfor i in range(M-1):\n safes.append(broken[i+1] - broken[i] - 1)\n\nsafes.append(N-broken[M-1] - 1)\n\nfor i in ran...
['Runtime Error', 'Runtime Error', 'Accepted']
['s018608974', 's280525069', 's970945437']
[9952.0, 9948.0, 462708.0]
[261.0, 262.0, 603.0]
[866, 855, 264]
p03013
u408375121
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\nfor _ in range(m):\n a = int(input())\n A[a] = False\n\nmod = 10**9 + 7\ndp = [0] * (n + 1)\ndp[0] = 1\nif A[1]:\n dp[1] = 1\n\nfor i in range(2, n+1):\n if A[i]:\n dp[i] = dp[i-1] + dp[i-2]\n dp[i] %= mod\n\nprint(dp[n])\n\n \n', 'n, m = map(int, input().s...
['Runtime Error', 'Runtime Error', 'Accepted']
['s978066298', 's985022608', 's044601355']
[13424.0, 13276.0, 13504.0]
[152.0, 154.0, 156.0]
[269, 275, 266]
p03013
u408620326
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 = [int(x) for x in input().strip().split()]\nA = [int(input()) for _ in range(M)]\nans = [0 for _ in range(N+1)]\nans[0] = 0\nif 1 not in A:\n ans[1] = 1\nif 2 not in A:\n ans[2] = ans[1] + 1\n\nfor i in range(3, N+1):\n if i in A:\n ans[i] = 0\n continue\n for j...
['Runtime Error', 'Accepted']
['s461502158', 's260750482']
[501912.0, 13192.0]
[2133.0, 169.0]
[376, 254]
p03013
u409064224
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 = [1]*n\n#kubaru_dp = [1]*n\n\nfor i in range(m):\n a = int(input())\n l[a] = 0\n\n# l = [1,1,1,0,1,1,1]\nfor i in range(2,n+1):\n if l[i]==0:\n continue\n l[i] = l[i-1]+l[i-2]\nelse:\n print(l[-1]%(10**9+7))\n', 'n,m = map(int,input().split())\nl = [1]*(n+1)\n#...
['Runtime Error', 'Accepted']
['s142818344', 's697310925']
[460020.0, 6900.0]
[461.0, 180.0]
[251, 267]
p03013
u416773418
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 culc(m):\n s=0\n if m%2==1:\n m1=1 \n m2=m//2 \n else:\n m1=0\n m2=m//2\n \n while m2>=0:\n l1=1\n l2=1\n for i in range(m2):\n l1=l1*(m1+i+1)\n l2=l2*(i+1)\n s+=int(l1/l2)\n m1+=2\n m2+=-1\n return s\n\n...
['Wrong Answer', 'Accepted']
['s690455746', 's586907829']
[4008.0, 5836.0]
[2104.0, 150.0]
[739, 393]
p03013
u419877586
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\nstep=[0]*(N+1)\nstep[1]=0 if 1 in A else 0\nstep[2]=0 if 2 in A else 1 if 1 in A else 0\nfor i in range(3, N+1):\n if i in A:\n continue\n step[i]=(step[i-1]+step[i-2])%mod\nprint(step[-1])', 'N, M=map(int, input().split())\nA=[int(...
['Runtime Error', 'Accepted']
['s367104958', 's155459631']
[7848.0, 7824.0]
[2104.0, 211.0]
[265, 200]
p03013
u430414424
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+1)\ndp[0] = 1\nans = 0\n\nfor i in range(1, N+1):\n if i in a:\n dp[i] = 0\n if dp[i-1] == 0:\n ans = 0\n break\n else:\n if i > 2:\n dp[i] = dp[i-1] + dp[i-2]\n els...
['Wrong Answer', 'Accepted']
['s828365509', 's640633872']
[460020.0, 460020.0]
[2119.0, 451.0]
[390, 333]
p03013
u434872492
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+1)\nfor i in range(M):\n a[i] = int(input())\nmod = 1000000007\nans = [0] * (N+1)\nans[0] = 1\nfor i in range(1,N+1):\n ans[i] = (ans[i-2]*a[i-2] + ans[i-1]*a[i-1]) % mod\nprint(ans[N])', 'N, M = map(int,input().split())\na = [0] * (N+1)\nfor i in range(M):\n a[...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s244319533', 's922621228', 's948366696', 's984694177']
[10852.0, 4596.0, 4596.0, 7764.0]
[227.0, 227.0, 220.0, 222.0]
[229, 229, 229, 229]
p03013
u436982376
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=[]\nb_clone=[]\n\nfor i in range(m):\n t=int(input())\n b.append(t)\n b_clone.append(t)\n\n\nans_list=[1]\n\nif len(b)!=0 and b[0]==1:\n b.pop(0)\n ans_list.append(0)\nelse:\n ans_list.append(1)\n\nfor i in range(2,n+1):\n if len(b)!=0 and i==b[0]:\n b.pop(0...
['Wrong Answer', 'Accepted']
['s633470550', 's913341817']
[10292.0, 8284.0]
[1701.0, 1716.0]
[457, 440]
p03013
u437351386
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=[]\nfor i in range(m):\n a.append(int(input()))\ndp=[float("inf") for i in range(n)]\ndp[0]=0\nif 1 in a:\n dp[1]=0\nelse:\n dp[1]=1\nfor i in range(2,n):\n if (i-1 not in a)and(i-2 not in a):\n dp[i]=dp[i-1]+dp[i-2]\n elif (i-1 not in a)and(i-2 in a):\n dp[i]=dp[i-...
['Runtime Error', 'Accepted']
['s479049447', 's824554581']
[460184.0, 460312.0]
[2107.0, 478.0]
[389, 250]
p03013
u439063038
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\ndp[1] = 1 if 1 not in a else 0\n\na = list(set(range(2, N+2)) - set(a))\nfor i in a:\n dp[i] = (dp[i-1] + dp[i-2]) % MOD\nprint(dp[N] % MOD)', 'N, M = map(int, input().split())\na = [int(input())...
['Runtime Error', 'Runtime Error', 'Accepted']
['s421872675', 's860097447', 's597842034']
[27488.0, 27488.0, 27552.0]
[152.0, 151.0, 151.0]
[252, 246, 253]
p03013
u440161695
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 collections import deque\nimport sys\nimport functools\nsys.setrecursionlimit(10000000000)\n@functools.lru_cache(maxsize=None)\ndef stairs(n):\n if n==1:\n return 1\n if n==2:\n return 2\n return stairs(n-1)+stairs(n-2)\nN,M=map(int,input().split())\nA=deque()\nfor _ in range(M):\n A.append(int(input()...
['Runtime Error', 'Runtime Error', 'Accepted']
['s277564825', 's698069453', 's438958720']
[3572.0, 3828.0, 6900.0]
[23.0, 18.0, 191.0]
[492, 227, 200]
p03013
u440985596
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 cmb(n, r, mod, g1, g2):\n if ( r<0 or r>n ):\n return 0\n r = min(r, n-r)\n return g1[n] * g2[r] * g2[n-r] % mod\n\ndef main():\n N, M = map(int, input().split())\n A = [-1] + [int(input()) for i in range(M)] + [N + 1]\n\n mod = 10**7+7 \n N = 10**5\n g1 = [1, 1] \n ...
['Wrong Answer', 'Accepted']
['s297982413', 's449961507']
[14864.0, 7848.0]
[243.0, 161.0]
[1041, 695]
p03013
u441064181
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 ...
['\nimport sys\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI(): return list(map(int,sys.stdin.readline().rstrip().split()))\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split())\nN, M = LI()\nA = [I() for _ in range(M)][::-1]\nmd = 10**9+7\n\ndp = [0]...
['Wrong Answer', 'Accepted']
['s497901412', 's265545297']
[7848.0, 8616.0]
[228.0, 154.0]
[654, 678]
p03013
u441575327
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()))\n\ncombination = [1,1,2]\nfor i in range(3,N):\n combination.append(combination[i-1]+combination[i-2])\n\na = 0\nans = 1\nlst = []\nfor i in range(M):\n next_a = int(input())\n if next_a == 1:\n lst.append(1)\n a = next_a\n continue\n elif next_a-...
['Wrong Answer', 'Accepted']
['s345901691', 's442429206']
[460532.0, 462640.0]
[460.0, 520.0]
[496, 639]
p03013
u442877951
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 b = int(input())\n a[b] = False\n\nmod = 10**9+7\ndp = [0]*(N+1)\ndp[0] = 1\nfor i in range(N):\n for j in range(i+1,min(i+2,N)+1):\n if a[j]:\n dp[j] += dp[i]\n dp[j] %= mod\n\n\nprint(dp)', 'N,M = map(int,input().split())\na = [T...
['Wrong Answer', 'Accepted']
['s578745077', 's421931586']
[10896.0, 7700.0]
[256.0, 248.0]
[260, 264]
p03013
u444732068
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 = [int(input()) for i in range(M)]\ndekai = 1000000007\n \ndef Fib(n):\n\ta,b = 0,1\n\tif n == 1:\n\t\treturn a\n\telif n == 2:\n\t\treturn b\n\telse:\n\t\tfor i in range(n-2):\n\t\t\ta,b = b,a+b\n\t\treturn b\n\n\nans = 1\nfor i in range(M+1):\n\tif i == 0:\n\t\tans = ans*(Fib...
['Runtime Error', 'Accepted']
['s779310610', 's811893056']
[3064.0, 7076.0]
[22.0, 221.0]
[403, 721]
p03013
u445624660
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\n\n\nn, m = map(int, input().split())\nstep_count = [0 for _ in range(n+1)]\nng_step = [False for _ in range(n+1)]\nfor _ in range(m):\n ng = int(input())\n ng_step[ng] = True\n\nfor i in range(n+1):\n if ng_step[i]:\n step_count[i] = 0\n else:\n if i==1:\n step_count[i] = 1\n elif i==2:\n s...
['Wrong Answer', 'Accepted']
['s872546063', 's261472588']
[11028.0, 7832.0]
[208.0, 205.0]
[524, 505]
p03013
u454093752
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 as fac\nN,M = map( int, input().split() )\nbreak_list = []\nfor i in range(M):\n break_list.append( int( input() ) )\nbreak_list.append( N + 1 )\nstart = 0\nans = 1\nk = 1\nfor i in break_list:\n sum_c = 0\n end = i - 1\n if start > end:\n k = -1\n step_1 = end - start...
['Runtime Error', 'Runtime Error', 'Accepted']
['s409494366', 's593220597', 's709131642']
[7080.0, 2940.0, 460020.0]
[2104.0, 17.0, 514.0]
[554, 394, 468]
p03013
u454557108
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\nn,m = map(int, input().split())\na = [0]\nfor i in range(m):\n a.append(int(input()))\na.append(n)\n \nmod = 1000000007\nans = 1\n\nfor i in range(1,len(a)-2):\n if a[i+1]-a[i]==1:\n print(0)\n sys,exit()\n\nb = []\nfor i in range(1,len(a)):\n if i == 1:\n b.appned(a[1]-...
['Runtime Error', 'Accepted']
['s217850114', 's530586529']
[7084.0, 46136.0]
[184.0, 591.0]
[716, 762]
p03013
u456173040
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())\nc=10**9+7\na = [-1 for _ in range(m + 1)]\nfor i in range(1, m+1):\n a = a + [int(input())]\na =a+[n+1] \nfor i in range(m+1):\n a[i]=a[i+1] - a[i]-1\nb=[0 for _ in range(max(a) + 1)]\nb=b+[1]\nfor i in range(2, max(a)+1):\n b=b+[(b[i-1] + b[i-2])%c]\ns=1\nfor i in range(m+1):...
['Wrong Answer', 'Accepted']
['s235881490', 's777664841']
[5588.0, 7848.0]
[2104.0, 272.0]
[334, 331]
p03013
u456353530
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 = [int(input()) for _ in range(M)]\n\nclass comb():\n F = [1, 1]\n Fi = [1, 1]\n I = [0, 1]\n def __init__(self, num, mod):\n self.MOD = mod\n for i in range(2, num + 1):\n self.F.append((self.F[-1] * i) % mod)\n self.I.append(mod - self.I[mod % i] * (mod ...
['Runtime Error', 'Accepted']
['s621738789', 's975896215']
[17340.0, 29192.0]
[216.0, 412.0]
[835, 839]
p03013
u464205401
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 i in range(m))\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,m=map(int,input().split())\nA=set(int(input()) for i in range(m))\ndp=[0]*(n+1)\ndp[0]=1\nfor i in range(1,n+1):\n dp[i]=(...
['Wrong Answer', 'Accepted']
['s454423342', 's994984783']
[11884.0, 11884.0]
[220.0, 224.0]
[180, 183]
p03013
u465699806
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 fractions as fr\nimport itertools as it\nimport collections as col\nimport heapq as hq\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n"""\npython3 main.py < input.txt\n"""\n\n"""\nN=int(input())\nW=list(map(int, input().split()))\nans=10**100\nfor T in range(1,N):\n S1=sum(W[:T])...
['Runtime Error', 'Accepted']
['s742868276', 's167829337']
[2007672.0, 27348.0]
[2120.0, 214.0]
[2385, 962]
p03013
u472696272
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())\nflag = [0]*(n+1)\nfor i in range(m):\n a = int(input())\n flag[a] = 1\nnum = 10**9+7\ncount = [0]*(n+1)\ncount[0] = 1\ncount[1] = 1 if 1 not in a else 0\nfor i in range(2,n+1):\n if flag[i]==0: count[i] = count[i-1] + count[i-2]\n count[i] = count[i]%num\nprint(count[n])\n', 'n,m =...
['Runtime Error', 'Accepted']
['s416469475', 's016232049']
[4596.0, 7668.0]
[172.0, 193.0]
[296, 296]
p03013
u474423089
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\nmod = 10**9+7\n\ndef stairs(n):\n a = 1/math.sqrt(5)\n b = (1+math.sqrt(5))/2\n c = (1-math.sqrt(5))/2\n return int(a*(b**(n+1)-c**(n+1)))%mod\n\ndef main():\n n,m = map(int,input().split(' '))\n a=[-1]\n a_list=[]\n ans = 1\n for i in range(m):\n a.append(int(input()))\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s776312938', 's901135120', 's441958376']
[9000.0, 11824.0, 11884.0]
[185.0, 248.0, 49.0]
[543, 671, 360]
p03013
u476604182
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 = input().split()\nN = int(inf[0])\nM = int(inf[1])\nls = []\nfor i in range(M):\n a = int(input())\n ls += [a]\nstep = [0 for i in range(N)]\nif 1 not in ls:\n step[0] = 1\nif 2 not in ls:\n step[1] = 1 + step[0]\nfor j in range(2, N):\n if j not in ls:\n step[j] = step[j-1]+step[j-2]\n else:\n step[...
['Runtime Error', 'Accepted']
['s936493787', 's637079391']
[460056.0, 460020.0]
[2119.0, 509.0]
[344, 508]
p03013
u479638406
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\n\ndef solve():\n n, m = map(int, input().split())\n a = [int(input()) for _ in range(m)]\n\n if len(a) > 1:\n for ...
['Wrong Answer', 'Accepted']
['s514737769', 's267672029']
[12868.0, 12748.0]
[136.0, 140.0]
[638, 640]
p03013
u480200603
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\ncnt = [1, 2]\n\nfor i in range(1, n - 1):\n cnt.append(cnt[i] + cnt[i - 1])\n\nif m == 0:\n print(cnt[n - 1] % 1000000007)\n exit()\n\nl = [int(input()) for _ in range(m)]\n\nl_diff = [l[0] - 1]\nfor i in range(1, m):\n l_diff.append(l[i] - l[i - 1] - 2)\nl_diff.append(...
['Wrong Answer', 'Accepted']
['s007903370', 's366802024']
[466144.0, 464920.0]
[538.0, 534.0]
[541, 527]
p03013
u480887263
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\nN,M=map(int,input().split())\na=[int(input()) for i in range(M)]\nc=[0]*(N+1)\nc[0]=1\nMOD=7+10**9\nif M==0:\n c[1]=1\n for i in range(1,N):\n c[i+1]=c[i]+c[i-1]\n print(c[N])\nelse:\n j=0\n for i in range(1,N+1):\n if i==a[j]:\n if j+1<=M:\n if i+1...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s375099995', 's474862075', 's482807351']
[460148.0, 460148.0, 17740.0]
[470.0, 479.0, 703.0]
[541, 568, 320]
p03013
u481101428
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\na = [0] * M\nfor i in range(M):\n a[i] = int(input())\n \n\n\n\nmemo = [-1] * (N+1)\nmemo[0] = 1\n\nfor i in range(M):\n memo[a[i]] = 0\n\n\nfor i in range(1,N+1):\n if i == 1:\n memo[i] = memo[i-1]\n if memo[i] >= 0:\n memo[i] = 0\n \n else:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s053715879', 's410429613', 's652530360']
[460020.0, 460020.0, 460020.0]
[449.0, 452.0, 453.0]
[423, 442, 444]
p03013
u483645888
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())\no = [int(input()) for _ in range(m)]\nprint(o)\nmod = (10**9)+7\ndp = [1]+[0]*(n)\n\nfor i in range(1,n+1):\n dp[i] = dp[i-1]+dp[i-2]\n if i in o:\n dp[i] = 0\n #print(i,dp)\n#print(dp)\nprint(dp[-1]%mod)\n', 'n,m = map(int,input().split())\no = [int(input()) for _ in range(m)]\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s635986688', 's754563552', 's576974004']
[460004.0, 460004.0, 13192.0]
[2119.0, 2116.0, 206.0]
[231, 260, 218]
p03013
u489559146
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 ...
['maxNum, brokenCount = map(int,input().split(" "))\n\nbrokenIndexSet = set([int(input()) for i in range(brokenCount)])\n\nans = [0] * (maxNum + 1)\nans[0] = 1\n\nfor i in range(1,maxNum+1):\n if i in brokenIndexSet:\n ans[i] = 0\n else:\n ans[i] = (ans[i-1] + ans[i-2]) % 1000000007\n print(ans)\n\nprint(ans[m...
['Wrong Answer', 'Accepted']
['s693221795', 's249730734']
[109752.0, 13192.0]
[2104.0, 181.0]
[311, 298]
p03013
u489762173
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\n\n\ndef main():\n N, M = map(int, input().split())\n a = [input() for _ in range(M)]\n\n dp = [0]*(N+1)\n dp[0] = 1\n dp[1] = 1\n\n for i in range(2, N+1):\n if i in a:\n dp[i] = 0\n continue\n\n\n dp[i] = dp[i-1] + dp[i-2]\...
['Wrong Answer', 'Accepted']
['s737080990', 's237632514']
[499444.0, 460404.0]
[2134.0, 452.0]
[323, 624]
p03013
u490045217
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 collections import deque\n\ndef num_way(stair):\n memo = ["EMPTY"]*(stair+1)\n def _fib(stair):\n if stair == 1 or stair == 0:\n return 1\n elif stair == 2:\n return 2\n elif memo[stair] != "EMPTY":\n return memo[stair]\n else:\n memo[stair] = _fib(stair-1)+_fib(stair-2)\n ...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s175296335', 's407445361', 's415620713', 's521232642', 's544115487', 's659131867', 's659907277', 's839270507', 's894591259', 's980657106']
[5248.0, 4340.0, 4340.0, 5240.0, 4340.0, 4340.0, 4460.0, 4076.0, 5252.0, 513644.0]
[214.0, 214.0, 214.0, 211.0, 210.0, 206.0, 219.0, 198.0, 211.0, 495.0]
[840, 733, 777, 793, 789, 784, 623, 808, 734, 859]
p03013
u490489966
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\nn, m = map(int, input().split())\na = [1] * (n + 1)\nmod=1e9+7\nprint(a)\nfor i in range(m):\n a[int(input())] = 0\nprint(a)\nb = [1] * (n + 1)\nif a[1] == 0:\n b[1] = 0\nfor i in range(2, n + 1):\n b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)\nprint(b[n])', '#C\nn, m = map(int, input().split())\na = [...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s008660144', 's515682676', 's992148548', 's936859021']
[8764.0, 7204.0, 11924.0, 6900.0]
[239.0, 221.0, 244.0, 220.0]
[258, 380, 261, 366]
p03013
u494058663
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 ...
['Num = 1000000007 \nN,M = map(int,input().split())\na = []\nfor i in range(M):\n a.append(int(input()))\nnow = 0\nif 1 in a:\n prev1 = 0\nelse:\n prev1 = 1\nprev2 = 1\n\nfor i in range(2,N+1):\n if i in a:\n now = 0\n prev2 = prev1\n prev1 = now \n continue\n else:\n n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s550388189', 's640414983', 's755189329']
[56180.0, 10004.0, 460788.0]
[2104.0, 2108.0, 370.0]
[397, 289, 309]
p03013
u497046426
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\nA = [int(input()) for _ in range(M)]\nif M == 0:\n print(pat[N] % MOD)\nelse:\n pat = [0] * (N+1)\n pat[1] = 1\n pat[2] = 2\n for i in range(3, N+1):\n pat[i] = (pat[i-1] + pat[i-2]) % MOD\n steps = []\n if len(A) > 1\n for i in ran...
['Runtime Error', 'Accepted']
['s180679103', 's875407697']
[3064.0, 11824.0]
[17.0, 241.0]
[645, 626]
p03013
u501163846
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\ninf=1000000007\n\ndef fib(k):\n a, b = 1, 1\n for i in range(k):\n yield a\n a, b = b, a + b\n \nl=[i for i in fib(n)]\np=[]\nfor i in range(n):\n if i+1 in a:\n p.append(1)\n else:\n p.append...
['Runtime Error', 'Accepted']
['s171487279', 's887962679']
[464168.0, 11816.0]
[2132.0, 270.0]
[664, 507]
p03013
u503228842
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\nBIG_NUM = 10**9+7\ndef stairs_n(n):\n if n <= 3:\n return n\n else:\n return stairs_n(n-1)+stairs_n(n-2)\n\n\n\nn,m = map(int,input().split())\n\nif m == 0:\n print(stairs_n(n)%BIG_NUM)\nelse:\n\n\n a_list = [int(input()) for _ in range(m)]\n a_list.append(n)\n a_np...
['Runtime Error', 'Runtime Error', 'Accepted']
['s510255497', 's853757742', 's428286421']
[18484.0, 18676.0, 460788.0]
[2108.0, 2108.0, 388.0]
[527, 525, 486]
p03013
u504562455
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 = [-1]\n\nMAX = 100000\nMOD = 1000000007\nfac = [1 for i in range(MAX)]\nfinv = [1 for i in range(MAX)]\ninv = [1 for i in range(MAX)]\nfor i in range(2, MAX):\n fac[i] = fac[i-1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD\n finv[i] = finv[i - 1] * i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s270087588', 's367241827', 's529765752']
[17328.0, 17336.0, 7832.0]
[328.0, 326.0, 205.0]
[846, 850, 337]
p03013
u506858457
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()))\nans=0\nMOD=1000000007\ndp=[]\nfor i in range(N-1,0,-1):\n if i in A:\n dp[i]=0\n continue\n dp[i]=dp[i+1]+dp[i+2]\n \nans=dp[0]\nans/=MOD\nprint(ans)\n \n', 'MOD = 10**9 + 7\nn, m = map(int, input().split())\n\nban = ...
['Runtime Error', 'Accepted']
['s470797199', 's666360677']
[7080.0, 7668.0]
[174.0, 257.0]
[238, 623]
p03013
u511379665
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 i in range(m)]\ncheck=[0 for i in range(n+1)]\nfor i in range(m):\n check[a[i]]=1\nMOD= 1000000007\n\nc=[0]*(n+1)\nc[0]=1\nif 1 in a:\n c[1]=0\nelse:\n c[1]=1\n\nfor i in range(2,n+1):\n if check[i]!=0:\n print(i)\n continue\n else:\n ...
['Wrong Answer', 'Accepted']
['s934893332', 's607939462']
[9484.0, 8600.0]
[261.0, 193.0]
[349, 341]
p03013
u512138205
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 calc_step_combination(num):\n if num == 0:\n return 0\n if num == 1:\n return 1\n if num == 2:\n return 2\n return calc_step_combination(num - 1) + calc_step_combination(num - 2)\n\n\ndef sol(n, a_list):\n step_batch = []\n batch_start = 0\n for a in a_list:\n step...
['Runtime Error', 'Accepted']
['s552972693', 's128744731']
[3060.0, 549860.0]
[17.0, 477.0]
[752, 800]
p03013
u514894322
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[0]*m]\nl=set(l)\ndp=[0]*(n+1)\n\ndp[0]=1\ndp[1]=0 if 1 in l else 1\nMOD =10**9+7\n\nfor i in range(2,n+1):\n if i not in l:\n dp[i] = (dp[i-1] + dp[i-2])%MOD\nprint(dp[n])', 'n,m = map(int,input().split())\nl = [int(input()) for _ in[0]*m]\nl=set(l)\ndp=[...
['Runtime Error', 'Accepted']
['s292765238', 's147203566']
[3064.0, 13696.0]
[17.0, 175.0]
[328, 328]
p03013
u515172797
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 functools import lru_cache\n2.@lru_cache(maxsize=1000)\n3.def fib(n):\n4. if n < 2:\n5. return n\n6. else:\n7. return fib(n - 1) + fib(n - 2)\n8. \n9.n,m = map(int,input().split())\n10.a = []\n11.a.append(0)\n12.for i in range(m):\n13. b = int(input())\n14. b -= 1\n15. a.append(b)\n1...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s288094229', 's363860560', 's828136306', 's194018321']
[2940.0, 464828.0, 7080.0, 460020.0]
[17.0, 1152.0, 191.0, 485.0]
[865, 672, 586, 226]
p03013
u515723930
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())\narr = [int(input()) for _ in range(0,M)]\n\narr = [-1]+arr+[N+1]\nfrom math import factorial\ncount = 0\nfor i in range(0,len(arr)-1):\n start,end = arr[i],arr[i+1]\n span = end - start - 2 # the first step is taken by a certain step (with no choice)\n nptn = int(span/2)\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s514483261', 's550954258', 's599733780']
[8616.0, 8616.0, 9612.0]
[2104.0, 167.0, 173.0]
[681, 757, 450]
p03013
u517142514
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\nN,M = map(int, input().split())\nans = 1\nbro = list([])\n\ndef Comp (A , B):\n ans = math.factorial(A) // (math.factorial(A-B) * math.factorial(B))\n return ans\n\ndef Keisan (X):\n sum=0\n a = int(X//2+1)\n x = int(X)\n if X== -1:\n return 0\n\n for i in range(a):\n s...
['Wrong Answer', 'Accepted']
['s446480278', 's771389952']
[9512.0, 7080.0]
[2104.0, 1716.0]
[676, 359]
p03013
u517152997
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 ...
['#\nimport sys\nimport math\nimport numpy as np\nimport itertools\n\n\nn,m = (int(i) for i in input().split()) \n\n\na = [int(input()) for i in range(m)] \na.append(9999999) # sentinel\ndame=0\n\nb=[1]\nif a[dame]==1:\n dame += 1\n b.append(0)\nMOD = 1000000007\n\nfor i in range(2,n+1):\n if i==a[dame]:\n ...
['Runtime Error', 'Accepted']
['s632020459', 's933337649']
[20812.0, 17012.0]
[325.0, 318.0]
[463, 517]
p03013
u517516365
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 = map(int, input().split())\nif M == 1:\n A = int(input())\nelse:\n A = np.array([int(input()) for _ in range(M)], dtype = int)\n\nMOD= 1000000007\ndp = np.zeros(N, dtype = int)\ndp[A - 1] = -1\nif dp[0] == -1 and dp[1] == -1:\n pass\nelif dp[0] == -1:\n dp[1] = 1\nelif dp[1] == -...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s183452152', 's327456262', 's502376311', 's523695326', 's589407293', 's668422173', 's754172529', 's946756546', 's986861961', 's554155390']
[17088.0, 17084.0, 22788.0, 16996.0, 17104.0, 16960.0, 16992.0, 17100.0, 17000.0, 7080.0]
[311.0, 303.0, 431.0, 600.0, 302.0, 308.0, 308.0, 612.0, 303.0, 232.0]
[502, 503, 510, 508, 511, 478, 521, 485, 519, 667]
p03013
u521323621
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 = 1000000007\n\nfact=[0,1]\nfact_inv=[0]*(n+1)\nfor i in range(2,n+1):\n fact.append(fact[-1]*i % MOD)\n\nfact_inv[n] = pow(fact[n],MOD-2,MOD)\nfor i in range(n-1,-1,-1):\n fact_inv[i] = fact_inv[i+1]*(i+1)%MOD\n\ndef comb(n,r):\n return fact[n]*fact_inv[r]*fact_inv[n-r]%MOD\n...
['Wrong Answer', 'Accepted']
['s053458287', 's314422121']
[12956.0, 12972.0]
[254.0, 200.0]
[775, 852]
p03013
u522293645
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,ng = map(int,input().split())\nnglist = list(int(input()) for i in range(ng))\n\nMOD = 10**9+7 \ndp = [0]*(n+1)\ndp[0] = 1\n\nfor i in range(1,n+1):\n\n if i in nglist:\n dp[i] == 0\n continue\n\n if i==1:\n dp[1] == dp[0]\n continue\n \n dp[i] = (dp[i-2] + dp[i-1]) % MOD\n\nprint(dp[n])', 'n,n...
['Wrong Answer', 'Accepted']
['s862323788', 's662668734']
[7836.0, 7668.0]
[2107.0, 183.0]
[292, 323]
p03013
u522937309
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\nfrom fractions import Fraction\nimport sys\n\nfrom fractions import Fraction\nimport sys\nsys.setrecursionlimit(15000)\n\ndef fibMul(fn1, fn2):\n a = fn1[0]\n b = fn1[1]\n c = fn2[0]\n d = fn2[1]\n return (a*c + 5*b*d, a*d + b*c)\n\ndef fibExp(fn, n):\n if (n == 0):\n return (Fra...
['Wrong Answer', 'Accepted']
['s019770315', 's255493622']
[9116.0, 9108.0]
[2104.0, 226.0]
[1252, 1082]
p03013
u527977536
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 sm\n\ndef fib(N):\n N = N-1\n a = N // 2\n ans = 0\n for i in range(a+1):\n sum = sm.factorial(N-i)/(sm.factorial(N-2*i)*sm.factorial(i))\n ans += int(sum)\n return ans\n\nN, M = map(int, input().split())\nA = []\nfor i in range(M):\n A.append(int(input()))\n\nflag = False\nfor i ...
['Runtime Error', 'Accepted']
['s318306787', 's267304676']
[23484.0, 12476.0]
[2109.0, 205.0]
[772, 1028]
p03013
u529012223
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\n\nN, M = map(int, input().split())\na = [int(input()) for i in range(M)]\n\nans = np.zeros(N + 1)\nans[N] = 1\n\nif N - 1 not in a:\n ans[N - 1] = 1\n\nprint(ans[N])\n\nfor i in range(2, N + 1):\n if N - i not in a:\n ans[N - i] = (ans[N - i + 1] + ans[N - i + 2])\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s588004920', 's700896636', 's810806920', 's910768879', 's215514959']
[16224.0, 16356.0, 16356.0, 427892.0, 14036.0]
[2109.0, 2109.0, 2109.0, 440.0, 747.0]
[354, 356, 359, 584, 384]
p03013
u529180657
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())\noks = [True] * (N+1)\na = [int(input()) for _ in range(M)]\nfor i in a:\n oks[i] = False\ndp = [0] * (N+1)\nif oks[1]:\n dp[1] = 1\nif oks[2]:\n dp[2] = 1\nfor i in range(3, N+1):\n if oks[i]:\n dp[i] = int((dp[i-1] + dp[i-2]) % (1e9+7))\n\n\nprint(dp[N])', 'N, M =...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s371129538', 's487309706', 's661018481', 's291002123']
[8592.0, 8592.0, 8616.0, 8616.0]
[177.0, 178.0, 181.0, 250.0]
[293, 293, 352, 304]
p03013
u531599639
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+1)\ndp[1],dp[2] = 1,1\n\nfor _ in range(m):\n a = int(input())\n dp[a] = -1\n\nfor i in range(1,n-1):\n if dp[i+2]==-1:\n continue\n if dp[i]==-1 and dp[i+1]==-1:\n dp[i+2] = -1\n elif dp[i]==-1:\n dp[i+2] = dp[i+1]\n elif dp[i+1]==-1:\n dp[i+2] = dp[i]\n ...
['Runtime Error', 'Accepted']
['s765679726', 's526946365']
[465780.0, 466108.0]
[514.0, 497.0]
[385, 381]
p03013
u532514769
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())\nif m==0:\n x=1\n y=2\n for i in range(n-2):\n if x<y:\n x+=y%1000000007\n else:\n y+=x%1000000007\n print(max(x,y)%1000000007)\n sys.exit()\na=list(int(input()) for i in range (m))\n\nx=['']*n\nif a[0]==1:\n x[0]=0\nelse:\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s045397981', 's424759680', 's491028459']
[3064.0, 3064.0, 11884.0]
[17.0, 18.0, 63.0]
[753, 369, 540]
p03013
u533885955
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 ...
['\nN,M = map(int,input().split())\na = []\nfor i in range(M):\n a.append(int(input()))\n \nway = []\nfor i in range(N+1):\n if i == 0:\n way.append(0)\n elif i == 1:\n way.append(1)\n else:\n way.append(way[i-1]+way[i-2])\n \nans = 1\nnow = 0\nfor i in range(N):\n if (i+1) in ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s364402001', 's610837575', 's811392070', 's469549383']
[464040.0, 464100.0, 464100.0, 464128.0]
[2135.0, 645.0, 536.0, 533.0]
[539, 561, 582, 578]
p03013
u534953209
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())\nif N == 1:\n print(1)\nelse:\n A = [int(input()) for _ in range(M)]\n\n S =[0]*(N + 1)\n S[0] = 1\n if A[0] == 1:\n S[1] = 0\n else:\n S[1] = 1\n\n for i in range(2, N+1):\n if i in A:\n S[i] = 0\n else:\n S[i] = ...
['Runtime Error', 'Accepted']
['s820405168', 's561148563']
[7824.0, 11884.0]
[2104.0, 203.0]
[356, 302]
p03013
u536034761
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 sys import exit\nclass Fib:\n def __init__(self):\n self.memo = {}\n def calc(self, n):\n if n == 1 or n == 2:\n self.memo[n] = 1\n return 1\n if n <= 0:\n self.memo[n] = 0\n return 0\n if n in self.memo.keys():\n return self.memo[n]\n self.memo[n] = self.calc(n - 1) + s...
['Runtime Error', 'Accepted']
['s935756966', 's421964104']
[3940.0, 549856.0]
[182.0, 531.0]
[643, 667]
p03013
u537782349
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 ...
['a', 'a, b = map(int, input().split())\nc = [int(input()) for _ in range(b)]\nd = [0] * (a + 1)\nd[0] = 1\nd[1] = 1\nfor i in c:\n d[i] = -1\nfor i in range(2, len(d)):\n if d[i] != -1:\n d[i] = ((0 if d[i-1] == -1 else d[i-1]) + (0 if d[i-2] == -1 else d[i-2])) % 1000000007\nprint(d[len(d)-1])\n']
['Runtime Error', 'Accepted']
['s128141689', 's455211782']
[2940.0, 7824.0]
[17.0, 177.0]
[1, 293]
p03013
u537892680
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\nMOD = (10 ** 9) + 7\nN, M = map(int, input().split())\nA = [False] * (N + 1)\nfor _ in range(M):\n A[int(input())] = True\ndp = [0] * (N + 1)\ndp[0] = 1\nif 1 not in A:\n dp[1] = 1\n\nfor i in range(2, N + 1):\n if A[i]:\n dp[i] = 0\n else:\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\n\nprin...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s539567686', 's732434449', 's833540403', 's048229506']
[7668.0, 3828.0, 7824.0, 7668.0]
[188.0, 179.0, 175.0, 191.0]
[329, 329, 372, 340]
p03013
u543954314
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)])\ndp = [0]*(n+1)\ndp[1] = int(1 not in a)\nfor i in range(2,n+1):\n if i in a:\n continue\n dp[i] = dp[i-1] + dp[i-2]\nprint(dp[n])', 'n,m = map(int,input().split())\na = set([int(input()) for _ in range(m)])\ndp = [0]*(n+1)\nmod = 10**9+7\...
['Wrong Answer', 'Accepted']
['s074727944', 's989511668']
[460148.0, 13216.0]
[454.0, 180.0]
[201, 232]
p03013
u546104065
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\nfrom math import factorial as fac\n\nN,M= map(int, input().split())\nbroken_steps=[]\n\nfor m in range(M):\n broken_steps.append(int(input()))\n\nfor i in range(len(broken_steps)-1):\n if broken_steps[i+1]-broken_steps[i]==1:\n print("{}".format(0))\n FLG=True\n\nif FLG!=True:...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s251131790', 's983103245', 's113779422']
[20524.0, 16868.0, 7064.0]
[406.0, 2108.0, 187.0]
[501, 544, 332]
p03013
u547001323
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 collections import deque\n\nN, M = map(int, input().split())\na = deque([int(input()) for _ in range(M)])\n\nbefore1 = 1\nbefore2 = 0\nai = a.popleft if len(a) else 0\n\nfor i in range(1, N+1):\n if i == ai:\n before2 = before1\n before1 = 0\n ai = a.popleft if len(a) else ai\n else:\n...
['Wrong Answer', 'Accepted']
['s847572504', 's770452600']
[8056.0, 8056.0]
[215.0, 197.0]
[427, 431]
p03013
u547167033
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())-1 for i in range(m)]\na=set(a)\nmod=10**9+7\ndp=[0]*n\ndp[0]=1\nif a[0]==1:\n dp[1]=0\nelse:\n dp[1]=1\nfor i in range(2,n):\n if i in a:\n dp[i]=0\n else:\n dp[i]=(dp[i-1]+dp[i-2])%mod\nprint(dp[n-1])', 'n,m=map(int,input().split())\na=set()\nfor i in range(m):...
['Runtime Error', 'Accepted']
['s819200501', 's960860396']
[13192.0, 11884.0]
[174.0, 190.0]
[242, 325]
p03013
u547633429
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\nimport sys\n\nsys.setrecursionlimit(10**20)\n\nif m == 0:\n print(countWays_memo(n))\nelse:\n list_a = []\n for i in range(m):\n list_a.append(int(input()))\n\n def countWays_memo(n):\n memo = [-1]*(n+1)\n def _countWays(n):\n if n < 0:\n ...
['Runtime Error', 'Accepted']
['s152283436', 's729251123']
[3064.0, 513140.0]
[18.0, 559.0]
[1022, 981]
p03013
u549383771
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\n\nfor i in range(m):\n dp[int(input())-1] = 10**12\n \nif dp[0] == 10**12:\n dp[0] = 0\nelse:\n dp[0] = 1\n\nif dp[1] == 10**12:\n dp[1] = 0\nelse:\n dp[1] = 1+ dp[0]\n\nmod = 1000000007\n\nif 2 in a_list:\n dp[1] = 0\nfor i in range(2,n):\n if dp[i]...
['Runtime Error', 'Runtime Error', 'Accepted']
['s802741471', 's840592887', 's371237139']
[3828.0, 7848.0, 6900.0]
[178.0, 2104.0, 190.0]
[405, 348, 457]
p03013
u551692187
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 fibonacci(n):\n if n == 0:\n return 0\n elif n == 1:\n return 1\n n+=2\n return fibonacci_sub2(n-2, 1, 0)\n\ndef fibonacci_sub2(n, fibo_minus1, fibo_minus2):\n return fibo_minus1 if n==0 else fibonacci_sub2(n-1, fibo_minus1+fibo_minus2, fibo_minus1)\n\n\nN,M = map(int, input().split()...
['Runtime Error', 'Accepted']
['s201576349', 's569494840']
[11688.0, 92020.0]
[181.0, 179.0]
[785, 1067]
p03013
u552357043
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\nN,M = map(int, input().split())\ndef C(a,b):\n return math.factorial(a+b)/(math.factorial(a)*math.factorial(b))\ndef pattern(n):\n ans = 0\n i = 0\n while n - 2*i >= 0:\n ans += C(n-i*2,i)\n i += 1\n return ans\nab = 0\nans = 1\nmod = 10**9 + 7\nfor i in range(M):\n aa = i...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s072992397', 's373273918', 's564896138']
[4384.0, 7112.0, 462616.0]
[2104.0, 2108.0, 608.0]
[495, 578, 319]
p03013
u556672233
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())\naa = {int(input()) for _ in range(m)}\ndp = [0 for _ in range(n + 1)]\ndp[0] = 1\n\nif 1 not in aa:\n dp[1] = 1\n\nfor i in range(2, n + 1):\n if dp[i - 1] > 0 and (i - 1) not in aa:\n dp[i] += dp[i - 1]\n if dp[i - 2] > 0 and (i - 2) not in aa:\n dp[i] += dp[i...
['Wrong Answer', 'Accepted']
['s512174109', 's601654115']
[462744.0, 462744.0]
[646.0, 624.0]
[354, 340]
p03013
u557282438
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())\ndef stair(N):\n if(N <0):\n return 0\n if(N == 0):\n return 1\n elif(N == 1):\n return 1\n elif(N == 2):\n return 2\n else:\n return stair(N-1)+stair(N-2)\nans = 1\na = 0\nmod = 10**9+7\nfor i in range(M):\n b = int(input())\n b -...
['Runtime Error', 'Accepted']
['s139389200', 's164875599']
[4340.0, 460020.0]
[2104.0, 469.0]
[399, 323]
p03013
u558182684
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\nb = [0]*(n+2)\nb[0] = 1\n\nfor i in range(m):\n b[int(input())] = -1\n\nfor i in range(m):\n if b[i] != -1:\n if b[i+1] != -1:\n b[i+1] += b[i]\n if b[i+2] != -1:\n b[i+2] += b[i]\n b[i] %= 1000000007\n\nprint(b[n] % 1000000007)\n', '...
['Wrong Answer', 'Accepted']
['s405608124', 's171781142']
[4548.0, 6900.0]
[178.0, 1909.0]
[297, 295]
p03013
u561231954
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())\nbroken=[int(i) for i in range(n)]\nmod=10**9+7\n\nfactorial=[1]\nfor i in range(1, n+1):\n factorial.append(factorial[-1] * i % mod)\n\ninv_factorial = [-1] * (n+1)\ninv_factorial[-1] = pow(factorial[-1], mod-2, mod)\n\nfor i in reversed(range(n)):\n inv_factorial[i] = inv_factoria...
['Wrong Answer', 'Accepted']
['s868195643', 's369550495']
[15024.0, 8592.0]
[118.0, 189.0]
[793, 350]
p03013
u561862393
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\nA = [int(a) for a in input().strip()]\n\na0 = 1 \na1 = 1 if A[0] !=1 else 0 \n\nANS=[0]*(n+1)\nANS[0]=a0\nANS[1]=a1\nNext = A[1:] if a1 !=0 else A\nnext = 0\nfor i in range(2,n+1) :\n if i == Next[next]:\n A[i] = 0\n next += 1 \n else:\n A[i] = A[i-2] + A[i-1] \n \npr...
['Runtime Error', 'Accepted']
['s134657419', 's193735457']
[3828.0, 460020.0]
[18.0, 474.0]
[308, 437]
p03013
u562033060
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()))\nif m > 0:\n a = [int(input()) for i in range(m)]\nelse:\n a = []\n\nif n = 1:\n pat = 1\nelse:\n pt = [1]\n if (1 in a):\n pt.append(0)\n else:\n pt.append(1)\n\n for i in range(2, n + 1):\n if (i in a):\n pt.append(0)\n else:\n if (i-1 in a):\n ...
['Runtime Error', 'Accepted']
['s951343811', 's017849436']
[2940.0, 460020.0]
[17.0, 466.0]
[410, 423]
p03013
u567124995
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 functools import lru_cache\n\nn, m = map(int, input().split())\na = []\nfor i in range(m):\n a.append(int(input()))\n \n@lru_cache(maxsize=100000)\ndef comb(n):\n if n in a:\n return 0\n if 1 not in a and n == 1:\n return 0\n elif n in (0, 1):\n return 1\n else:\n return (comb(n-1) + comb(n-2))...
['Runtime Error', 'Accepted']
['s247833576', 's662246867']
[7576.0, 8948.0]
[606.0, 1937.0]
[330, 352]
p03013
u572343785
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 \nn,m=map(int,input().split())\na=[]\nfor i in range(m):\n b=int(input())\n if b-1 in a:\n print(0)\n sys.exit()\n else:\n a.append(b)\n \nstate=0\nstep=0\nans=0\n\nbunnbo=lambda n,r: math.factorial(r)*math.factorial(n-r)\nbunshi=lambda n: math.factorial(n)...
['Wrong Answer', 'Accepted']
['s177580374', 's333359610']
[4092.0, 460020.0]
[2104.0, 486.0]
[779, 255]
p03013
u573754721
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()))\na = {int(input()) for i in range(m)}\nmod = 10 ** 9 + 7\n \nx = 1 if 1 not in a else 0\ndp = [1, x] + [0] * (n - 1)\n \nfor i in range(2, n + 1):\n if i in a:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2])\n \nprint(dp[-1] % mod)', 'n,m=map(int,input().split())\nA={int(inpu...
['Runtime Error', 'Accepted']
['s332577614', 's311153176']
[3064.0, 460020.0]
[17.0, 465.0]
[261, 211]
p03013
u573900545
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 if n <= 1:\n return n\n result = [1, 0, 0, 1]\n matrix = [1, 1, 1, 0]\n while n > 0:\n if n % 2:\n result = mul(matrix, result)\n matrix = mul(matrix, matrix)\n n //= 2\n return result[2]\n\ndef mul(a, b):\n return [a[0]*b[0] + a[1]*b[2],\n ...
['Wrong Answer', 'Accepted']
['s238149313', 's412722420']
[13796.0, 12696.0]
[177.0, 144.0]
[707, 360]
p03013
u576432509
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 kjou(kkk):\n ka=1\n for km in range(kkk):\n ka=ka*(km+1) \n return ka\n\ndef fcof(ad):\n k=ad//2\n if k==0 :\n return 1\n kcnt=0\n for kk in range(k+1):\n ar=ad-(kk)*2\n dk=kjou(kk+ar)/kjou(kk)/kjou(ar)\n kcnt=kcnt+ dk\n print(ad,k,kk,ar)\n retu...
['Runtime Error', 'Accepted']
['s651935770', 's419029548']
[3064.0, 7700.0]
[18.0, 252.0]
[544, 287]
p03013
u576917603
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()))\ndp=[0]*(n+1)\nif 1 in a:\n dp[1]=0\ndp[0]=1\nmod=10**9+7\nfor i in range(2,n+1):\n if i in a:\n continue\n dp[i]=dp[i-1]+dp[i-2]\nprint(dp[-1]%mod)', 'n,m=map(int,input().split())\na=[int(input()) for i in range(m)]\nm...
['Wrong Answer', 'Accepted']
['s377830536', 's934893452']
[460020.0, 13984.0]
[2119.0, 187.0]
[234, 252]
p03013
u577138895
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 = list(map(int, input().split()))\na = []\n\nfor i in range(M):\n a.append(int(input()))\n \nanswer = 0\n# a = [3]\nfor i in range(len(a) + 1):\n\tif i == 0:\n\t\tdif = a[i] - 1\n\telif i == len(a):\n\t\tdif = N - a[-1] - 1\n\telse:\n\t\tdif = a[i] - a[i - 1] - 2\n\tif dif >= 2:\n\t\tb = dif //...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s051577325', 's350117126', 's355789734', 's416998060', 's502301459', 's607967123', 's364926938']
[7080.0, 7056.0, 7076.0, 3060.0, 3064.0, 7080.0, 462708.0]
[265.0, 265.0, 268.0, 17.0, 17.0, 394.0, 541.0]
[536, 549, 536, 454, 430, 534, 522]
p03013
u580093517
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 = 1000000007\ndp = [0]*(n+1)\ndp[0],dp[1] = 1,1\nfor i in range(2,n+1):\n dp[i] = (dp[i-1] + dp[i-2])\n if i in a:dp[i] = 0\nprint(dp[n])', 'n,m = map(int,input().split())\nA = [int(input()) for _ in range(m)]\nmod = 1000000007\ndp =...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s041439376', 's046924272', 's212919330', 's892485510']
[13216.0, 7824.0, 13192.0, 13192.0]
[174.0, 168.0, 170.0, 203.0]
[214, 209, 218, 206]
p03013
u580258754
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 i in range(M)]\ndp = [0 for i in range(N+1)]\ndp[0] = 1\ndp[1] = 1\nfor i in range(2,N+1)\n if (i-2 in a) and (i-1 in a):\n dp[-1] = 0\n break\n elif i-2 in a:\n dp[i] = dp[i-1]\n elif i-1 in a:\n dp[i] = dp[i-2]\n else:\n dp[i] = dp[i-1] + dp[...
['Runtime Error', 'Accepted']
['s745077363', 's500533831']
[2940.0, 13216.0]
[18.0, 187.0]
[333, 389]
p03013
u593567568
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 ** 7)\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN,M = map(int,readline().split())\nA = [True] * (N+10)\nMOD = 10 ** 9 + 7\nfor _ in range(M):\n x = int(readline())\n A[x] = False\n\n\nDP = [0] * (N+10)\nDP[0]...
['Runtime Error', 'Runtime Error', 'Accepted']
['s237624156', 's933036063', 's777938095']
[3064.0, 3064.0, 7668.0]
[17.0, 17.0, 125.0]
[502, 501, 501]
p03013
u594512144
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 = [int(input()) for i in range(N+1)]\nfor i in range(M):\n A = int(input())\n dp[A] = -1\ndp[0] = 1\nfor j in range(2, N + 1):\n if dp[j] == -1:\n dp[j] = 0\n continue\n dp[j] = dp[j-2] + dp[j-1]\n\nprint(dp[N] % 1000000007)', 'N, M = map(int, input().spl...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s137668174', 's780268284', 's819202188', 's659146048']
[7080.0, 7080.0, 460056.0, 460056.0]
[162.0, 160.0, 454.0, 461.0]
[275, 275, 264, 314]
p03013
u594956556
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\nif n==1:\n print(1)\n exit()\nif n==2:\n print(2-m)\n exit()\nkumiawase = [0 for i in range(n+1)]\nkumiawase[0] = 1\nkumiawase[1] = 1\nkumiawase[2] = 2\nfor i in range(3,n+1):\n kumiawase[i] = kumiawase[i-2] + kumiawase[i-1]...
['Wrong Answer', 'Accepted']
['s466639935', 's980492466']
[464056.0, 7088.0]
[607.0, 153.0]
[788, 420]
p03013
u598229387
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**9)\nn,m=map(int,input().split())\n\na=[int(input()) for i in range(m)]\n\ndef fib(n):\n if n==0:\n return 1\n if n==1:\n return 1\n if n==2:\n return 2\n return fib(n-1)+fib(n-2)\n\nans=1\ncheck=0\nfor i in a:\n if i...
['Runtime Error', 'Accepted']
['s083160612', 's195742373']
[7076.0, 11884.0]
[2104.0, 182.0]
[489, 226]
p03013
u598720217
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 i in range(M)]\n\npre = 0\nlast = -1\nans_l = []\nflag = False\nl.append(N+1)\n\nnCr = {}\ndef cmb(n, r):\n if r == 0 or r == n: return 1\n if r == 1: return n\n if (n,r) in nCr: return nCr[(n,r)]\n nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)\n retu...
['Runtime Error', 'Runtime Error', 'Accepted']
['s301069648', 's808744687', 's872516761']
[7080.0, 29872.0, 25228.0]
[169.0, 260.0, 211.0]
[789, 834, 330]
p03013
u600402037
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 ** 7)\n\nn,m = map(int,input().split())\nA = [int(input()) for _ in range(m)] \n\npos = 0\ncount = 1\ndp = [0] * (n+1)\ndp[0] = 1\n\nfor i in range(N+1):\n if (i+1) in A and (i+2) in A:\n print(0)\n exit()\n if (i+1) not in A:\n ...
['Runtime Error', 'Accepted']
['s390391171', 's817808913']
[7848.0, 465268.0]
[49.0, 635.0]
[398, 369]
p03013
u606090886
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())\nmat = [0 for i in range(n+1)]\n\nfor i in range(m):\n mat[int(input())] = -1\n\nfor i in range(n):\n if i == 0:\n mat[i] = 1\n if mat[i] == -1:\n continue\n if i + 1 < n+1:\n if mat[i+1] != -1:\n mat[i+1] += mat[i]\n if i + 2 < n+1:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s022259668', 's245730474', 's876313921']
[3064.0, 3064.0, 462716.0]
[17.0, 18.0, 655.0]
[423, 438, 421]
p03013
u606878291
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\n\n\ndef main(n, m, a):\n dp = np.zeros(n + 1)\n dp[0] = 1\n dp[1] = 1 if 1 not in a else 0\n\n for i in range(2, len(dp)):\n dp[i] = dp[i - 1] + dp[i - 2] if i not in a else 0\n dp[i] %= 1000000007\n\n return dp[-1]\n\n\nif __name__ == '__main__':\n N, M = map(int, ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s101946019', 's573789561', 's107901717']
[21060.0, 21064.0, 11968.0]
[484.0, 483.0, 177.0]
[410, 418, 331]
p03013
u607075479
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())\nif N == 1:\n print(1)\n exit()\n\na = [int(input()) for i in range(M+100)]\nans = [0] * (N+1)\nans[0] = 1\nif a[0] != 1: ans[1] = 1\nelse: pass\nfor i in range(2, N+1):\n if i in a:\n ans[i] = 0\n else:\n ans[i] = (ans[i-1] + ans[i-2]) % (10**9+7)\nprint...
['Runtime Error', 'Accepted']
['s513072510', 's065352368']
[7080.0, 8616.0]
[169.0, 195.0]
[311, 412]
p03013
u616117610
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(range(m+2))\na[0] = -1\na[m+1] = n+1\nans = 1\nfor i in range(m):\n a[i+1] = int(input())\nfor i in range(m+1):\n if a[i]+1 == a[i+1]:\n ans = 0\n else:\n x = a[i+1]-a[i]-1\n ans = ans * 1/(5**0.5) * (((1+(5**0.5))/2)**x - ((1-(5**0.5))/2)**x)%1000000007\n\nif m ==...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s034745355', 's183492603', 's358280335', 's432829507', 's806970629']
[6900.0, 6900.0, 6900.0, 3064.0, 463988.0]
[211.0, 187.0, 187.0, 17.0, 580.0]
[420, 397, 455, 411, 464]
p03013
u617515020
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 ...
['MOD=10**9+7\nn,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()\nelif 1 in a:\n ans=[0,1]\nelif 2 in a:\n ans=[1,0]\n\nfor i in range(2,n):\n if i+1 in a:\n ans.append(0)\n else:\n s=(ans[-1]+ans[-2])%MOD\n ans.append(s)\nprint(ans[-1]%MOD)', 'MO...
['Runtime Error', 'Accepted']
['s371901338', 's701410413']
[12656.0, 18748.0]
[2206.0, 163.0]
[295, 249]
p03013
u618107373
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\ndef intinput(): return map(int,sys.stdin.readline().split())\n\n\nn, m = intinput()\na = {int(sys.stdin.readline()) for _ in range(m)}\nprint(a)\nmemo = [0 for x in range(n + 4)]\nmemo[0] = 1\nmod = 10 ** 9 + 7\nfor i in range(n):\n if i + 1 not in a:\n memo[i + ...
['Wrong Answer', 'Accepted']
['s698847893', 's887904874']
[12520.0, 11884.0]
[103.0, 113.0]
[413, 419]
p03013
u618750827
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 noboru(m):\n if (m == 1):\n return 1\n elif (m == 2):\n return 2\n else:\n return noboru(m-1)+noboru(m-2)\n\ndef func(N, M, a):\n ans = 1\n if (a[0] == 1):\n ans *=1\n else:\n ans *= noboru(a[0]-1)\n for i in range(1, M):\n if (a[i] == a[i-1]+1):\n ...
['Runtime Error', 'Accepted']
['s922723184', 's220277542']
[7080.0, 7080.0]
[2104.0, 162.0]
[548, 625]