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 | u619197965 | 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 _ in range(m)]\nbroken=[False]*(n+1)\ndp=[1]+[0]*100010\nfor i in range(m):\n broken[i]=True\nfor i in range(1,n+1):\n if broken[i]:\n dp[i]=0\n else:\n try:\n dp[i]=dp[i-1]+dp[i-2]\n except:\n dp[i]=dp[i-1]... | ['Wrong Answer', 'Accepted'] | ['s279746074', 's066087116'] | [9360.0, 460004.0] | [188.0, 382.0] | [344, 205] |
p03013 | u623687794 | 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=[1,2]\narr=arr+[0]*(n-2)\ndanger=[int(input()) for _ in range(m)]\nif 1 in danger:\n arr[0]=0\n arr[1]=1\nfor i in range(n):\n if i+1 in danger:\n arr[i]=0\n elif i==0 :\n continue \n else:\n arr[i]=(arr[i-1]+arr[i-2])%(10**9+7)\nprint(arr[-1]%(10**9+7))\n', 'n,m=map(in... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s199339847', 's424033570', 's679875099', 's893283267', 's698668622'] | [7780.0, 3064.0, 7780.0, 2940.0, 7780.0] | [2104.0, 17.0, 2104.0, 17.0, 85.0] | [289, 332, 289, 300, 396] |
p03013 | u625963200 | 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 m > 0:\n aaa = set(map(int, sys.stdin))\nelse:\n aaa = set()\n\ndp = [0] * (n+1)\ndp[0] = 1\ndp[1] = 1 if 1 not in aaa else 0\n\nmod=10**9+7\nfor i in range(2, n+1):\n if i in aaa:\n continue\n dp[i] = (dp[i-1]+dp[i-2])%mod\n\nprint(dp[n])", 'N,M = [int(i) fo... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s281683597', 's361274414', 's644500609', 's827604080', 's171873619'] | [6900.0, 3060.0, 3060.0, 7080.0, 11884.0] | [59.0, 2104.0, 2104.0, 2104.0, 57.0] | [282, 261, 265, 233, 269] |
p03013 | u626000772 | 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 = [int(x) for x in input().split()]\n pattern = [1]\n broken = -1\n brokencnt = 0\n if brokencnt < m:\n broken = int(input())\n brokencnt += 1\n for i in range(1, n + 1):\n if i == broken:\n pattern.append(0)\n if brokencnt < m:\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s899707859', 's943971019', 's190207363'] | [3064.0, 20532.0, 7060.0] | [29.0, 2108.0, 186.0] | [565, 764, 581] |
p03013 | u626337957 | 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_memo(n):\n \n memo = [0]*(n+1)\n\n def _fib(n):\n if n <= 1:\n return n\n if memo[n] != 0:\n return memo[n]\n memo[n] = _fib(n-1) + _fib(n-2)\n return memo[n]\n\n return _fib(n)\n \nN, M = map(int, input().split())\nA = list(map(int, input().split... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s002762960', 's022994794', 's144582177', 's179268570', 's183866765', 's235895003', 's241274392', 's241543391', 's375194053', 's476300327', 's803039798', 's830482726', 's846494048', 's899756274', 's969774841', 's117775679'] | [3064.0, 7056.0, 2940.0, 3064.0, 460020.0, 3064.0, 3064.0, 3064.0, 7056.0, 3064.0, 3064.0, 3064.0, 2940.0, 7080.0, 3064.0, 460788.0] | [18.0, 164.0, 17.0, 17.0, 2119.0, 17.0, 17.0, 17.0, 191.0, 17.0, 18.0, 17.0, 17.0, 165.0, 18.0, 453.0] | [663, 371, 125, 660, 293, 600, 604, 614, 164, 654, 656, 615, 419, 640, 654, 267] |
p03013 | u627234757 | 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 = []\nfor i in range(M):\n a.append(int(input()))\nbroken = [False for _ in range(N+1)]\n\ndp = [0 for _ in range(N + 1)]\ndp[0] = 1\nfor _ in range(M):\n\tbroken[int(input())] = True\nfor i in range(1, N+1):\n\tif broken[i]:\n\t\tcontinue\n\tif i == 1:\n\t\tdp[... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s437431938', 's712345911', 's827155358'] | [8624.0, 2940.0, 13360.0] | [184.0, 18.0, 150.0] | [372, 329, 365] |
p03013 | u630281418 | 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)]\ninterval_max = 0\nfor i in range(len(a)-1):\n if a[i+1] - a[i] == 1:\n print(0)\n exit()\n interval_max = max(interval_max, a[i+1] - a[i])\na.insert(0, 0)\na.append(n)\nfor i in range(len(a)-1):\n interval_max = max(interva... | ['Runtime Error', 'Accepted'] | ['s038619221', 's993337856'] | [460020.0, 7824.0] | [472.0, 168.0] | [596, 934] |
p03013 | u633320358 | 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=[]\nfor i in range(m):\n\ta.append(int(input()))\n\nprint(a)\n#while True:\n# try:\n\n# a += i\n # except EOFError:\n # break\n\nnum=[0,0,1,2]\n\nfor i in range(4,n+1):\n\tnum.append(1)\n\tnum[i]=num[i-1]+num[i-2]\n\n#print(num)\n\nlist=[]\ncount=0\ny=1\... | ['Wrong Answer', 'Accepted'] | ['s149940510', 's843859768'] | [464728.0, 7868.0] | [2135.0, 171.0] | [684, 430] |
p03013 | u636251914 | 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 = [int(_) for _ in input().split()]\nA = [int(input()) for i in range(M)]\nisBroken = [False] * (N + 1)\nfor i in A:\n isBroken[i] = True\n\n\ndef solve():\n\n # It\'s impossible\n temp = A[0]\n for a in A[1:]:\n if a - 1 == temp:\n return 0\n temp = a\n\n # ... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s014794054', 's088233289', 's394384220', 's446607172', 's574842341', 's720999038', 's956048800'] | [14280.0, 13568.0, 9056.0, 14384.0, 14396.0, 14416.0, 117376.0] | [148.0, 144.0, 32.0, 144.0, 145.0, 139.0, 145.0] | [797, 802, 46, 769, 803, 808, 739] |
p03013 | u638320267 | 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\nphi = (1 + math.sqrt(5)) / 2\n\ndef counter(n):\n if n == 1:\n return 0\n else:\n f = round(phi**(n) / math.sqrt(5)) % (10**9+7)\n return f\n\nN, M = map(int, input().split())\na = [int(input()) for _ in range(M)]\nans = round(phi**(a[0]) / math.sqrt(5)) % (10**9+7)\nprint(ans)... | ['Runtime Error', 'Accepted'] | ['s900381526', 's262824485'] | [7080.0, 7080.0] | [245.0, 202.0] | [453, 560] |
p03013 | u638456847 | 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)]\n\nflag = 0\nif m > 2:\n for i in range(M-1):\n if a[i+1] - a[i] == 1:\n flag += 1\n\nif flag >= 1:\n print(0)\n\n\nelse:\n def fib(n):\n a, b = 0, 1\n for i in range(n):\n a, b = b, a + b\n ... | ['Runtime Error', 'Accepted'] | ['s711108152', 's800372102'] | [7080.0, 7080.0] | [160.0, 224.0] | [469, 433] |
p03013 | u638795007 | 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 M>0:\n a = [0]*M\n for i in range(M):\n a[i] = int(input())\n\nans = int(1)\n\nA = [0]*(M+1)\nA[0]=N\nif M!=0:\n A[0] = a[0] - 1\n A[M] = N - a[M-1]-1\n for i in range(M-1):\n A[i+1] = a[i+1] - a[i]- 2\n if A[i+1]==-1:\n ans = 0\n\n\nSA ... | ['Runtime Error', 'Accepted'] | ['s698267287', 's618751752'] | [11720.0, 464456.0] | [264.0, 437.0] | [556, 827] |
p03013 | u640603056 | 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#Dynamic Programming\ndp=[0]*(N+1)\ndp[0]=1\nif 1 not in a:\n\tdp[1]=1\nelse:\n\tdp[1]=0\nfor i in range(2,N+1):\n\tif i in a:\n\t\tcontinue\n\tdp[i]=(dp[i-1]+dp[i-2])%mod\nprint(ans)', 'N,M=map(int,input().split())\na=[int(input()) for _ ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s107122714', 's666039062', 's279761373'] | [7848.0, 7824.0, 7832.0] | [2104.0, 2104.0, 183.0] | [242, 248, 240] |
p03013 | u641460756 | 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())\nans = [1] * (n + 1)\nfor i in a:\n ans[i] = 0\nfor i in range(2, n + 1):\n if ans[i]:\n ans[i] = ans[i - 1] + ans[i - 2]\n if ans[i] >= 1000000007:\n ans[i] = ans[i] % 1000000007\nprint(ans[-1])', 'n, m = map(int, input().split())\na = [int(input()) for i in ra... | ['Runtime Error', 'Accepted'] | ['s678269109', 's628387692'] | [3828.0, 7824.0] | [18.0, 186.0] | [242, 279] |
p03013 | u642012866 | 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)]\n\nb = [0]*N\n\nif 1 not in a:\n b[0] = 1\n\nif 2 not in a:\n if b[0] == 1:\n b[1] = 2\n else:\n b[1] = 1\n\nfor i in range(2,N):\n if i+1 not in a:\n if b[i-2] != 0:\n b[i]+= b[i-2]\n if b[i... | ['Runtime Error', 'Accepted'] | ['s026587573', 's662731203'] | [500084.0, 7028.0] | [2132.0, 1911.0] | [369, 304] |
p03013 | u644533034 | 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 itertools import accumulate\n\nn, m = map(int, input().split())\na = [0]*m\nfor i in range(m):\n a[i] = int(input())\n \n if i>=2 and a[-2]+1 == a[-1]:\n print(0)\n exit()\n\nl = [1] * (n+1)\n\nfor i in range(n+1):\n if i in a:\n l[i] = 0\n elif i > 2:\n l[i] = l[i-2] ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s095618370', 's977073336', 's408995027'] | [460020.0, 460020.0, 459980.0] | [2116.0, 2119.0, 550.0] | [399, 265, 274] |
p03013 | u647087591 | 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 = [0] * (n + 1)\n\nfor i in range(m):\n a = int(input())\n broken[a] = 1\n\ndp = [0] * (n + 1)\nmod = 1000000007\n\nfor i in range(1, n+1):\n if broken[i]:\n continue\n dp[i] = (dp[i-1] + dp[i-2]) % mod\n\nprint(dp[n])', 'n, m = map(int, input().split())\nbr... | ['Wrong Answer', 'Accepted'] | ['s414538506', 's342747599'] | [10424.0, 13496.0] | [151.0, 153.0] | [263, 273] |
p03013 | u648901783 | 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(input()) for i in range(M)]\n\nwa = (10**9) + 7\n\n\n\ndp = [0]*(N+1)\ndp[0]=1\nnow_a = 0\nif len(a)!=0:\n a.reverse()\n now_a = a.pop()\nif len(a)==0:\n now_a = -1\nfor i in range(1,N+1):\n if i==1:\n dp[i]=dp[i-1]\n else:\n dp[i]=dp[i-1] + dp[i... | ['Wrong Answer', 'Accepted'] | ['s432930721', 's495067685'] | [460020.0, 460020.0] | [449.0, 487.0] | [456, 489] |
p03013 | u651803486 | 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\n\ndef Fibonacci(n): \n if n<0: \n print("Incorrect input") \n # First Fibonacci number is 0 \n elif n==1: \n return 1\n # Second Fibonacci number is 1 \n elif n==2: \n return 2\n else: \n return Fibonacci(n-1)+Fibonacci(n-2) \n \n\n... | ['Runtime Error', 'Accepted'] | ['s472373921', 's103743317'] | [7276.0, 7832.0] | [2104.0, 200.0] | [754, 326] |
p03013 | u652081898 | 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 _ in range(m)]+[n+1]\nb = []\nans, mod = 1, 10**9+7\nfor i in range(m+1):\n b.append(a[i+1]-a[i]-1)\nprint(b)\nfor i in range(m+1):\n diff = b[i]\n dp = [1, 1]\n if i != 0 and diff == 0:\n print(0)\n exit()\n for j in range(diff... | ['Wrong Answer', 'Accepted'] | ['s164730908', 's967593308'] | [460020.0, 460020.0] | [439.0, 441.0] | [386, 378] |
p03013 | u652569315 | 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 import sys\n input = sys.stdin.readline\n n,m=map(int,input().split())\n a=[int(input()) for _ in [0]*m]\n mod=pow(10,9)+7\n ans=[0]*n\n ans[0]=1\n for i in range(n):\n if a.count(i+1)==1:\n ans[i]=0\n else:\n if i==1:\n ans[i]=ans[0]+1\n else:\n ans[i]=(ans[i-... | ['Runtime Error', 'Accepted'] | ['s138151801', 's367843773'] | [7848.0, 6900.0] | [2104.0, 51.0] | [382, 294] |
p03013 | u653837719 | 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)]\nb = [0, 1]\nc = []\nans = 1\n\nfor _ in range(n):\n b.append(b[-1] + b[-2])\n\nif m == 0:\n ans = b[n + 1]\nelse:\n c.append(a[0])\n for i in range(m - 1):\n c.append(a[i + 1] - a[i] - 1)\n c.append(n - a[m - 1])\n\n ... | ['Wrong Answer', 'Accepted'] | ['s382284606', 's824636665'] | [464144.0, 464868.0] | [2132.0, 537.0] | [366, 354] |
p03013 | u655663334 | 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 math\n\nN,M = list(map(int, input().split()))\n\naList = [int(input()) for _ in range(M)]\n\naList.insert(0,-1)\naList.append(N+1)\n\n#print(aList)\n\naArray = np.array(aList)\n\nkatamari = []\n\nfor i in range(M+1):\n katamari.append(aArray[i+1] - aArray[i] - 1)\n\n\n\nans = 1\nfor i in... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s179713040', 's245258418', 's475996259', 's186464510'] | [20620.0, 13944.0, 17856.0, 15836.0] | [1862.0, 452.0, 521.0, 503.0] | [469, 349, 375, 414] |
p03013 | u655975843 | 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 collections\nns = lambda: sys.stdin.readline().rstrip()\nni = lambda: int(ns())\nnm = lambda: map(int, sys.stdin.readline().split())\nnl = lambda: list(nm())\nnsm = lambda: map(str, sys.stdin.readline().split())\nnsl = lambda: list(nsm())\n\nmod = 1000000007\n\nn, m = nm()\ndp = [0] * (n + 2)\nfor ... | ['Runtime Error', 'Accepted'] | ['s422379013', 's579777717'] | [3064.0, 7284.0] | [17.0, 172.0] | [696, 697] |
p03013 | u656845405 | 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 ... | ['class MyClass:\n patternCount = 0\n\n def skip(self, maxNum, currentIndex):\n if currentIndex >= maxNum or currentIndex in brokenIndexList:\n return\n \n if maxNum -1 == currentIndex:\n self.patternCount += 1\n return\n\n self.skip(maxNum, currentInde... | ['Runtime Error', 'Accepted'] | ['s235780104', 's809128335'] | [7080.0, 13192.0] | [2103.0, 176.0] | [585, 309] |
p03013 | u656995812 | 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] * m\ndp = [1, 1]\n\nfor i in range(m):\n a[i] = int(input())\n\nfor i in range(len(a)-1):\n if a[i+1] - a[i] == 1:\n print(0)\n exit(0)\n\nx = 0\nfor i in range(1, n+1):\n if i != a[x]:\n dp.append((dp[-1] + dp[-2]) % 1000000007)\n else:\n ... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s380633606', 's520440176', 's895815181', 's761177864'] | [7428.0, 7060.0, 7428.0, 7852.0] | [176.0, 2104.0, 176.0, 177.0] | [388, 252, 387, 431] |
p03013 | u657994700 | 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 fibo(n):\n a, b = 0, 1\n if n == 1:\n return 1\n else:\n for i in range(n):\n a0 = a\n a = b\n b = a0 + b\n return b\n \nN, M = map(int, input().split())\na = []\n\nif M = 0:\n print(fibo(N))\n sys.exit()\n\nfor i in range(M... | ['Runtime Error', 'Accepted'] | ['s091945455', 's106708245'] | [2940.0, 7080.0] | [18.0, 178.0] | [653, 673] |
p03013 | u664373116 | 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\nN,M=list(map(int,input().split()))\ndansa=[int(input()) for _ in range(M)]\nans=1\nflag=True\nif dansa[0]==0:\n print("0")\nelse:\n if len(dansa)>1:\n for i in range(M-1):\n if dansa[i]+1==dansa[i+1]:\n print("0")\n flag=False\n ... | ['Runtime Error', 'Accepted'] | ['s292641955', 's065984344'] | [7080.0, 8180.0] | [301.0, 200.0] | [976, 620] |
p03013 | u666198201 | 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 ... | ['W,H,x,y = [int(i) for i in input().split()]\nflag=0\nif W==x*2 and H==y*2:\n flag=1\n\n\n\nprint(W*H/2,flag)\n\n\n', 'W,H,x,y = [int(i) for i in input().split()]\nflag=0\nif W==x+x and H==y+y:\n flag=1\n\n\n\nprint(W*H/2,flag)\n\n', '\n\nN, M = map(int, input().split())\na=[]\nstep=[0]*200000\ntotal=1\ncount=0\... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s269775376', 's486626179', 's764741536', 's608210944'] | [2940.0, 2940.0, 3064.0, 463476.0] | [19.0, 17.0, 17.0, 623.0] | [107, 106, 654, 655] |
p03013 | u667024514 | 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())\nlis = [int(input()) for i in range(m)]\ndp = [0 for i in range(n+2)]\ndp[0] = 1\ncou = 0\nco = 0\nfor i in range(n):\n if i+1 != lis[cou]:\n dp[i+1] += dp[i]\n dp[i+1] %= 10 ** 9+7\n else:\n cou +=1\n if i+2 != lis[co]:\n dp[i+2] += dp[i]\n dp[i+2] %= 10 ** 9 + 7\n ... | ['Runtime Error', 'Accepted'] | ['s548425996', 's977356937'] | [9256.0, 7856.0] | [225.0, 200.0] | [333, 369] |
p03013 | u668711082 | 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\nmod = int(1e9+7)\n\ndef dfs(i,dp,bad):\n if i == 0:\n return 1\n if i in dp:\n return dp[i]\n dp[i] = 0\n for d in (1,2):\n x = i-d;\n if 0 <= x and x not in bad:\n dp[i] += dfs(x)\n dp[i] %= mod\n return dp[i]\n\nn,m = (int(a) for a in input().split())\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s138625416', 's551817495', 's434014750'] | [3064.0, 2940.0, 108008.0] | [17.0, 18.0, 255.0] | [388, 405, 425] |
p03013 | u669787859 | 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 ... | ["# 2019 6/9\n\n# fn: ways from 0 to n\n# f(n) = f(n-1) + f(n-2)\n# DP\n\nimport sys\nimport numpy as np\n\n\ndef fib(n):\n a = (1 + np.sqrt(5)) / 2\n b = (1 - np.sqrt(5)) / 2\n ans = (a**n - b**n) / np.sqrt(5)\n return int(ans)\n\n\ndef check_hole(M, broken_stairs):\n if len(broken_stairs) <= 1:\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s034905106', 's117997774', 's302744933', 's600180068', 's624129853', 's685944735', 's697860307', 's779407018', 's269518976'] | [21304.0, 7868.0, 90676.0, 460020.0, 11884.0, 90676.0, 2940.0, 3828.0, 11884.0] | [378.0, 182.0, 247.0, 462.0, 59.0, 241.0, 17.0, 19.0, 59.0] | [881, 1517, 1779, 420, 438, 1779, 1560, 1756, 421] |
p03013 | u670133596 | 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 = 1000000007;\n\n\ndp = [0]*(N+1)\nbroken = [0]*(N+1)\n\n\ndp[0] = 1\ndp[1] = 1\n\n\nfor _ in range(M) :\n broken[int(input())] = -1\n\n\nfor i in range(2, N+1):\n if i == 3:\n print(dp[i-1])\n print(dp[i-2])\n \n if (broken[i-1] != -1):\n d... | ['Wrong Answer', 'Accepted'] | ['s609688075', 's750880253'] | [7780.0, 7772.0] | [209.0, 202.0] | [551, 491] |
p03013 | u670961163 | 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 fibona(x):\n import math\n return (((1/2+math.sqrt(5)/2)**(x+1))-((1/2-math.sqrt(5)/2)**(x+1)))//math.sqrt(5)\n\ndef main():\n n, m = map(int,input().split())\n mlis = []\n for _ in range(m):\n a = int(input())\n mlis.append(a)\n ans = 1\n mae = -1\n\n for i in range(m):\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s315946928', 's820795013', 's539805747'] | [12868.0, 9104.0, 12936.0] | [143.0, 30.0, 154.0] | [808, 864, 873] |
p03013 | u672475305 | 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())\n\ndp = [0]*(n+2)\ndp[0] = 1\n\nfor i in range(m):\n dp[int(input())] = -1\n\nfor i in range(m):\n if dp[i] != -1:\n if dp[i+1] != -1:\n dp[i+1] += dp[i]\n if dp[i+2] != -1:\n dp[i+2] += dp[i]\n\nprint(dp[n]%mod)', 'mod = 10**9+7\... | ['Wrong Answer', 'Accepted'] | ['s187370653', 's023849519'] | [12276.0, 462708.0] | [186.0, 612.0] | [284, 285] |
p03013 | u673361376 | 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\n\ndef cases(idx_start, idx_end):\n cases = 0\n for r in range((idx_end - idx_start)//2+1):\n n = idx_end - idx_start - r\n cases += factorial(n) / factorial(r) / factorial(n - r)\n return cases\n\nn, m = map(int, input().split())\nalist = [int(input()) for i in range(m)]\ndiv_num... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s097514944', 's123646480', 's272739071', 's571715559', 's687279677', 's792073366', 's397192941'] | [7080.0, 4016.0, 460056.0, 7080.0, 7080.0, 460056.0, 7832.0] | [164.0, 183.0, 420.0, 231.0, 164.0, 424.0, 189.0] | [517, 485, 485, 568, 488, 465, 374] |
p03013 | u677267454 | 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\npat = [0] * (n + 1)\npat[0] = 1\npat[1] = 1\nfor i in range(m):\n pat[i] = -1\n\npat = [1]\nfor i in range(2, n + 1):\n if pat[i] < 0:\n continue\n if pat[i - 1] > 0:\n pat[i] = (pat[i] + pat[i - 1]) % mod\n if pat[i - 2] > 0:\n pat... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s121465876', 's200608263', 's696878875'] | [3828.0, 3828.0, 6888.0] | [25.0, 18.0, 190.0] | [352, 386, 364] |
p03013 | u680851063 | 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\ndef basic_step_ptn_nums(x): \n if x == 1:\n print(1)\n else:\n dp = [0] * (x+1) \n dp[:2] = 1, 1 \n for i in range(2, x+1):\n dp[i] = dp[i-1] + dp[i-2] \n print(dp[-1])\n\nbasic_step_ptn_nums(8)\n', 'import sys\ninput = sys.... | ['Wrong Answer', 'Accepted'] | ['s136042018', 's036157730'] | [2940.0, 13192.0] | [18.0, 61.0] | [380, 605] |
p03013 | u681110193 | 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=[1 for i in range(n)]\nA[1]=2\nfor i in range(m):\n A[int(input())-1]=0\nif A[0]==0:\n A[1]=1\n\n\nfor i in range(2,n):\n if A[i]!=0:\n A[i]=(A[i-1]+A[i-2])\n A[i]%=MOD\n \n \nprint(A)', '=10**9+7\nn,m=map(int,input().split())\nA=[1 for i in range(n)]\nif n!... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s523982149', 's674020997', 's368813378'] | [10260.0, 2940.0, 7064.0] | [194.0, 17.0, 191.0] | [228, 271, 291] |
p03013 | u681150536 | 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 = []\n\nfor _ in range(M):\n A[int(input())] = True\n\nstep = [0] * (N + 1)\n\nstep[0] = 1\n\nfor s in range(1, N + 1):\n if A[s]:\n step[s] = 0\n continue\n if s == 1:\n step[s] = 1\n continue\n else:\n step[s] = step[s - 1] + step[... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s337394668', 's438817477', 's245666861'] | [3828.0, 5132.0, 7668.0] | [18.0, 109.0, 187.0] | [352, 446, 367] |
p03013 | u684625036 | 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 floor \nstairs_num, broken_num = tuple(int(i) for i in input().split(" "))\nbroken_list = []\nfor i in range(broken_num):\n broken_list.append(int(input()))\ntrance_num_list = []\nif len(broken_list) >= 1 and broken_list[0] == 1:\n trance_num_list.append(0)\nelse:\n trance_num_list.append(1... | ['Runtime Error', 'Accepted'] | ['s018225694', 's683827642'] | [7088.0, 7856.0] | [172.0, 1095.0] | [1196, 1198] |
p03013 | u685263709 | 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 defaultdict\nN, M = map(int, input().split())\nA = [int(input()) for i in range(M)]\ndict = defaultdict(int)\nfor a in A:\n dict[a] += 1\n\nmod = 10 ** 9 + 7\ndp = [0 for _ in range(N+1)]\ndp[0] = 1\ndp[1] = 1 if dict[1] == 0 else dp[1] = 0\nfor i in range(1, N):\n if dict[i] == 0 and di... | ['Runtime Error', 'Accepted'] | ['s300254481', 's554672596'] | [3064.0, 18960.0] | [17.0, 236.0] | [495, 488] |
p03013 | u685662874 | 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())\nitems=[int(input()) for i in range(M)]\nmod=10**9+7\ndp=[0 for i in range(N+1)]\ndp[N] = 1\nis_broken =[1 for i in range(N+1)]\n\nfor i in range(M):\n is_broken[items[i]] = 0\n\nfor i in reversed(range(N)):\n if is_broken[i]:\n dp[i] = 0\n continue\n dp[i] = (dp[... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s189221369', 's222899937', 's306161597', 's450231622', 's518482738', 's731151410', 's814389490', 's488881027'] | [8880.0, 852196.0, 7832.0, 8624.0, 6936.0, 8600.0, 852724.0, 7832.0] | [221.0, 2166.0, 200.0, 180.0, 201.0, 228.0, 2158.0, 208.0] | [344, 799, 324, 342, 324, 344, 845, 324] |
p03013 | u686036872 | 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 = 1000000007\n\nA = []\nfor i in range(M):\n A.append(int(input()))\n \nX = [0]*(N+2)\n\nfor i in range(2, N+2):\n if X[i] not in A:\n X[i] = min(X[i-1], X[i-2]) + 1\n\nprint(X[N+1]%mod)', 'N, M = map(int, input().split())\n\nmod = 1000000007\n\nA = []\nfor i in... | ['Wrong Answer', 'Accepted'] | ['s156350859', 's655415794'] | [7824.0, 13200.0] | [2104.0, 197.0] | [228, 252] |
p03013 | u686713618 | 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 =[str(input()) for _ in range(M)]\n DP = [0]*(N+1)\n num = 1000000007\n DP[0] = 1\n for i in range(N):\n if str(i) in a:\n DP[i] = (DP[i-1] + DP[i-2]) % num\n print(DP[-2]%num)\nif __name__ == "__main__":\n main()', 'def main():\n N, M= map(int, inp... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s002875094', 's778081865', 's436069369'] | [10768.0, 10768.0, 13192.0] | [2104.0, 2104.0, 189.0] | [270, 270, 275] |
p03013 | u688126754 | 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_lst = []\nfor _ in range(M):\n broken_lst.append(int(input()))\n\ncounter_arr = [0]*(N+1)\n\ncounter_arr[0] = 1\nnext_broken = -1\nif len(broken_lst) != 0:\n next_broken = broken_lst.pop(0)\nlast_broken = broken_lst[0]\n\nfor i in range(0, N-1):\n flug = 0\n if i+1... | ['Runtime Error', 'Accepted'] | ['s572530477', 's399830307'] | [7848.0, 7780.0] | [1721.0, 254.0] | [1066, 466] |
p03013 | u688219499 | 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 _ in range(m))\ndp = [[] for _ in range(n + 1)]\ndp[0] = 1\n# j = 0\nif m = 0:\n dp[1] = 1\n for i in range(2, n + 1):\n dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007\n print(dp[n])\n exit()\nif a[0] == 1:\n dp[1] = 0\n j = 1\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s078861602', 's396628720'] | [8972.0, 19884.0] | [28.0, 177.0] | [531, 532] |
p03013 | u689626103 | 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)\n\nmod = 1000000007\n\ndp = [0] * (N + 1)\n\nif len(dp) <= 2:\n return 1\n\ndp[-1] = 1\ndp[-2] = 1 if N - 1 not in A else 0\n\nfor i in range(N-2, -1, -1):\n if i not in A:\n dp[i] = dp[i+1] + dp[i+2]\n\nprint(dp[0] % mod)\n', 'N,... | ['Runtime Error', 'Accepted'] | ['s194318440', 's012655600'] | [3064.0, 460020.0] | [17.0, 364.0] | [293, 228] |
p03013 | u691896522 | 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())\ndata = []\nfor i in range(M):\n data.append(int(input()))\ndp = [-1] * (N + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in data:\n dp[i] = 0\nif 1 in data:\n dp[1] = 0\nmod = 10**9 + 7\nfor i in range(2,N + 1):\n if dp[i] != 0:\n dp[i] = dp[i - 1] + dp[i - 2]\nprint(dp)\nprint(... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s300704823', 's577376391', 's937526477', 's444218347'] | [499060.0, 7056.0, 499188.0, 12832.0] | [2133.0, 2104.0, 2133.0, 223.0] | [314, 456, 287, 379] |
p03013 | u693391925 | 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)]\nA.append(N+1)\nout = 1\ns = [1,2]\nif A[0] != 1:\n hoge = [A[0]-2]\nelse:\n hoge = []\n\nfor i in range(N-M):\n s.append(s[i]+s[i+1])\n\nfor k in range(M):\n if A[k+1]-A[k]-2 != int(-1):\n hoge.append(A[k+1]-A[k]-3)\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s499344365', 's385271192'] | [460148.0, 460020.0] | [1741.0, 489.0] | [424, 285] |
p03013 | u694810977 | 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())\ncnt = 0\nlists = []\nkaidan = list(range(N+1))\nans = []\nfor i in range(M):\n a = int(input())\n lists.append(a)\n\ndef dfs(i):\n if i == N:\n return cnt + 1\n \n if i > N:\n return False\n\n if i in lists:\n return False\n \n if dfs(i+1):\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s205517933', 's790094162', 's239698858'] | [11032.0, 3064.0, 13216.0] | [2104.0, 17.0, 185.0] | [409, 673, 673] |
p03013 | u696444274 | 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# a, b, c = list(map(int, input().split()))\na = [int(input()) for i in range(m)]\n\nmod = pow(10, 9)+7\npoint = [0]*(n+1)\npoint[0] = 1\nj = 0\nif 1 in a:\n point[1] = 0\n if m > 2:\n j += 1\nelse:\n point[1] = 1\n\nif m == 0:\n a = [0]\n\nfor i in range(2, ... | ['Wrong Answer', 'Accepted'] | ['s115021717', 's621449400'] | [8708.0, 7848.0] | [270.0, 191.0] | [475, 463] |
p03013 | u698756732 | 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=set([int(input()) for i in range(m)])\n\nprint(a)\n\nmod = 10 ** 9 + 7\n\ndp = [0] * (n+2)\ndp[1] = 1\n\nfor i in range(2,n+2):\n if i-1 not in a:\n dp[i] = dp[i-1] % mod + dp[i-2] % mod\n \nprint(dp[n+1] % mod)', 'n,m = list(map(int, input("").split()))\na=... | ['Wrong Answer', 'Accepted'] | ['s007087572', 's007472055'] | [19068.0, 18744.0] | [157.0, 149.0] | [257, 247] |
p03013 | u698902360 | 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, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nj = 0\nsum = []\n\nfor i in range(N+1):\n if i == A[j]:\n sum.append(0)\n if j < M-1:\n j += 1\n elif i == 0 or i == 1:\n sum.append(1)\n else:\n sum.append(sum[i-2] + sum[i-1])\n\n\nprint(sum[N]%1... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s412547697', 's915274751', 's442834032'] | [3064.0, 3064.0, 460020.0] | [17.0, 18.0, 495.0] | [311, 311, 322] |
p03013 | u701318346 | 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)]\na.sort()\npattern = []\nans = 1\n\n\ndef fibonacci(n):\n a, b = 0, 1\n for i in range(n):\n a, b = b, a + b\n return b\n\n\nR = len(a) - 1\nfor i in range(R):\n x = a[i + 1] - a[i] -1\n pattern.append(fibonacci(x))\n\n\nfor i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s270792916', 's569295942', 's672352578'] | [7856.0, 460020.0, 460020.0] | [251.0, 2119.0, 473.0] | [746, 306, 248] |
p03013 | u702144572 | 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)]\n\ndp =[0]*(n+1)\nif 0 in a:\n dp[0] =0\nelse:\n dp[0]=1\n\nif 1 in a:\n dp[1] =0\nelse:\n dp[1]=1\n\nfor i in range(2,n+1):\n\n if dp[i-1]==dp[i-2]==0:break\n\n dp[i] = (dp[i-2]+dp[i-1])\n\n if i in a[i]:\n dp[i] = 0\n\... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s478610588', 's538778191', 's571971680', 's754170168'] | [7848.0, 3064.0, 7844.0, 460020.0] | [173.0, 18.0, 333.0, 481.0] | [320, 683, 404, 362] |
p03013 | u707870100 | 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#ABC130C\nimport sys\n\n\ntmp = input().split()\nhoge = list(map(lambda a: int(a), tmp))\nn=hoge[0]\nm=hoge[1]\n\na=[]\nfor i in range(0,n):\n\ta.append(1)\n\nprint(a)\n\nfor i in range(0,m):\n\ttmp = int(input())\n\ta[tmp]=0\n\nprint(a)\n\nfor i in range(2,n):\n\ta[i]=a[i]*(a[i-1]+a[i-2])\n\... | ['Wrong Answer', 'Accepted'] | ['s957861722', 's408589886'] | [463228.0, 462744.0] | [572.0, 678.0] | [328, 358] |
p03013 | u714225686 | 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\nimport sys\nimport queue\nfrom collections import Counter\nfrom itertools import accumulate\nfrom fractions import gcd\nfrom functools import reduce\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\ndef combination_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s052030387', 's652206528', 's510295483'] | [462800.0, 462060.0, 460824.0] | [2104.0, 2119.0, 432.0] | [1132, 1066, 753] |
p03013 | u714378447 | 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)]\n\ndp=[0]*(N+1)\nidx=0\ndp[0]=1\nif idx<M:\n if A[idx]==1:\n dp[1]=0\n idx+=1\nelse:\n dp[1]=1\n\nfor i in range(2,N+1):\n if idx<M:\n if A[idx]==i:\n dp[i]=0\n idx+=1\n else:\n dp[i]=(dp[i-1... | ['Wrong Answer', 'Accepted'] | ['s450381016', 's017167616'] | [7844.0, 7848.0] | [196.0, 205.0] | [333, 345] |
p03013 | u720384347 | 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 ... | ['sum_ = [0]\n\nN,M = input().split()\nN,M = int(N),int(M)\nm_ = [0,N-1]\nfor i in range(M):\n m_.append(int(input()))\n\n\nm = [1 for i in range(N+1)]\nfor i in m_:\n m[i] = 0\nfor i in range(1,N+1):\n if(i==1):\n if(m[i]==1):\n sum_.append(1)\n else:\n sum_.append(0)\n ... | ['Wrong Answer', 'Accepted'] | ['s606959871', 's405106119'] | [466072.0, 460904.0] | [844.0, 957.0] | [534, 526] |
p03013 | u723345499 | 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())\nissafe = [True] * n\nfor _ in range(m):\n a = int(input())\n issafe[a] = False\n\ndp = [0] * n\ndp[0] = 1\nif issafe[1]:\n dp[1] = 1\n\nfor i in range(2, n + 1):\n if issafe[i - 1]:\n dp[i] = dp[i] + dp[i - 1]\n if issafe[i - 2]:\n dp[i] = dp[i - 2] + d... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s656104103', 's682543745', 's706673660', 's775566410', 's857776164', 's888907896', 's927500495', 's953096898', 's340305772'] | [13424.0, 9656.0, 8860.0, 8892.0, 8876.0, 8992.0, 8984.0, 13464.0, 17536.0] | [168.0, 25.0, 25.0, 27.0, 23.0, 23.0, 27.0, 166.0, 164.0] | [355, 364, 316, 606, 362, 320, 362, 357, 354] |
p03013 | u723554767 | 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 __ in range(m)]\nbef=0\nans=0\nfib=[0,2,3]\n \ndist=[]\nfor a in A:\n if a-bef-1 == 0 and a != 1:\n print(0)\n sys.exit()\n else:\n dist.append(a-bef-1)\n bef=a\ndist.append(n-bef-1)\n \nfor a in dist:\n if len(fib)<=a:\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s167609079', 's541261324', 's822678323', 's172407718'] | [460020.0, 460020.0, 460152.0, 13192.0] | [444.0, 445.0, 469.0, 170.0] | [469, 455, 485, 376] |
p03013 | u724707209 | 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 itertools import permutations\n\nN, M = map(int, input().split(" "))\nAL = list(map(int, [input() for _ in range(M)]))\n\npatterns = []\nfor i in range(N, -1, -2):\n pattern = [1] * i\n while sum(pattern) < N:\n pattern.append(2)\n else:\n patterns.extend(set(permutations(pattern)))\nimpor... | ['Runtime Error', 'Accepted'] | ['s328146033', 's605985788'] | [13368.0, 13352.0] | [2104.0, 154.0] | [519, 245] |
p03013 | u724742135 | 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 stdin\nN, M = [int(_) for _ in stdin.readline().rstrip().split()]\ndp = [1 for i in range(N+1)]\nMOD = 1000000007\nfor _ in range(M):\n a = int(stdin.readline().rstrip())\n dp[a] = 0\nfor i in range(2, n+1):\n if dp[i] == 0:\n continue\n dp[i] = dp[i-1]+dp[i-2]\nprint(dp[N] % MOD)\n', '... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s129467740', 's314352572', 's006361067'] | [3888.0, 4016.0, 460056.0] | [75.0, 74.0, 453.0] | [302, 302, 301] |
p03013 | u728274111 | 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(xi) for xi in input().split())\n\na = []\ndiff = []\na0 = 0\na1 = int(input())\na.append(a1)\ndiff.append(a1+1)\n\nif m>1:\n for xi in range(m-1):\n a0 = a1\n a1 = int(input())\n a.append(a1)\n diff.append(a1-a0)\n\nif a1==n-1:\n diff.append(n-a1+1)\nelse:\n diff.appen... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s265272901', 's406695602', 's514458081', 's447620219'] | [13460.0, 14392.0, 14580.0, 13508.0] | [176.0, 2013.0, 410.0, 168.0] | [581, 460, 446, 700] |
p03013 | u735069283 | 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=[1]*(N+1)\nfor i in range(M):\n a=int(input())\n A[a]=0\nprint(A)\nfor i in range(2,N+1):\n if A[i]!=0:\n A[i]=(A[i-1]+A[i-2])%mod\nprint(A[-1]%mod)\nprint(A)', 'N,M = map(int,input().split())\nmod=10**9+7\nA=[1]*(N+2)\nfor i in range(M):\n a=int(input())\n A[a+1... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s241610499', 's534780383', 's642788306'] | [10784.0, 6900.0, 11884.0] | [196.0, 198.0, 186.0] | [200, 184, 220] |
p03013 | u736729525 | 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 solve(N, M, A):\n answer = [0] * (N+1)\n answer[0] = 1\n if 1 in A:\n answer[1] = 0\n else:\n answer[1] = 1\n\n for s in range(2, N+1):\n if s in A:\n answer[s] = 0\n else:\n answer[s] = (answer[s-2] + answer[s-1])\n print(answer[N] % 1000000007)... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s021027059', 's823950896', 's807498898'] | [460020.0, 7668.0, 11884.0] | [435.0, 182.0, 228.0] | [425, 428, 417] |
p03013 | u744034042 | 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+2)\nmod = 10**9+7\nfor i in range(m):\n a[i] = False\n\ndp = [0]*(n+2)\ndp[0]=1\n\nfor i in range(n):\n if not a[i]:\n continue\n if a[i+1]:\n dp[i+1] += dp[i]\n dp[i+1] %= mod\n if a[i+2]:\n dp[i+2] += dp[i]\n dp[i+2] %= mod... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s080273204', 's123681305', 's618497596'] | [7668.0, 7668.0, 13216.0] | [115.0, 114.0, 177.0] | [318, 320, 405] |
p03013 | u750651325 | 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\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\ndef s(): return input()\ndef k(): return int(input())\ndef S(): return input().split()\ndef I(): return map(int,input().split())\ndef X(): return list(input())\ndef L():... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s072643841', 's317654003', 's872430109'] | [8964.0, 466424.0, 467732.0] | [28.0, 2219.0, 387.0] | [873, 990, 877] |
p03013 | u756399469 | 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 ... | ['zimport sys\ninputs = sys.stdin.readline\ndef main():\n\tans = 1\n\ta = 0\n\tb = 0\n\tN, M = map(int,inputs().split())\n\tA =[0]*(M+1)\n\tfor i in range(M):\n\t\ta = int(inputs())\n\t\tA[i] = a-1-b\n\t\tb = a + 1\n\tA[M] = N - b\n\tA.sort()\n\tif A [0] < 0:\n\t\tprint(0)\n\t\tsys.exit()\n\tp = 1\n\tq = 1\n\tt = 0\n\t... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s507378174', 's672417952', 's059294518'] | [2940.0, 4976.0, 3828.0] | [17.0, 163.0, 162.0] | [580, 577, 596] |
p03013 | u757274384 | 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)]\nfor i in range(m-1):\n if A[i]+1 == A[i+1]:\n print(0)\n exit()\n\nANS = [A[0]-0]\nfor i in range(m-1):\n ANS.append(A[i+1]-A[i]-1)\nANS.append(n-A[m-1])\n\nFib = [1,1,2]\nfor i in range(3,max(ANS)+4):\n Fib.append(Fib[i-1]+Fib[i-2])\n\np... | ['Runtime Error', 'Accepted'] | ['s660471671', 's071088849'] | [7076.0, 464816.0] | [166.0, 569.0] | [411, 436] |
p03013 | u764600134 | 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 solve(N, M, A):\n MOD = 10**9 + 7\n A = set(A)\n if N == 1:\n return 1\n\n dp = [0] * (N+1)\n dp[0] = 1\n dp[1] = 1 if 1 not in A else 0\n for i in range(2, N+1):\n if i in A:\n dp[i] = 0\n else:\n dp[i] = (dp[i-2] + dp[i-1]) % MOD\n return dp[-1]... | ['Runtime Error', 'Accepted'] | ['s558280727', 's304277691'] | [3064.0, 13184.0] | [17.0, 188.0] | [409, 570] |
p03013 | u767432305 | 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]\nfor _ in range(M):\n a.append(int(input()))\n\nb=[]\nnum=0\nif len(a)>1:\n b.append(a[1]-a[0]-1)\n for i in range(1,M):\n b.append(a[i+1]-a[i]-2)\n b.append(N-a[M]-1)\nelse:\n b.append(N)\n\nprint(b)\n\nnum=max(b)\n\nmod=1000000007\n\nfib=[0 for i in rang... | ['Wrong Answer', 'Accepted'] | ['s494785454', 's127807741'] | [460320.0, 460056.0] | [375.0, 365.0] | [493, 472] |
p03013 | u768559443 | 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[0]=1\na=[int(input()) for i in range(m)]\nfor i in range(1,n+1):\n dp[i]=(dp[i-1]+dp[i-2])%(1e9+7)\n if i in a:\n dp[i]=0\nprint(dp[n])', 'n,m=map(int,input().split())\ndp=[0]*(n+1)\ndp[0]=1\nmod=10**9+7\nbroken=[False for _ in range(n+1)]\nfor _ in range(m)... | ['Wrong Answer', 'Accepted'] | ['s948687242', 's076901177'] | [7848.0, 7832.0] | [2104.0, 183.0] | [187, 254] |
p03013 | u771007149 | 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\nif 1 not in a:\n dp[1] = 1\nelse:\n dp[1] = 0\n \nfor i in range(2,n+1):\n if i in a:\n pass\n else:\n dp[i] = dp[i-1] + dp[i-2]\n \nprint(dp[n]%MOD)', 'n,m = map(int,input().split(... | ['Runtime Error', 'Accepted'] | ['s520177449', 's987277758'] | [460020.0, 13192.0] | [2119.0, 187.0] | [270, 303] |
p03013 | u771804983 | 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())\na=[-1]+[int(input()) for i in range(M)]+[N+1]\nans=1\n\nfor i in range(M+1):\n dist=a[i+1]-a[i]-2\n if dist<0 and a[i]!=-1 and a[i+1]!=N+1:\n ans=0\n break\n \n val=0\n cnt1=dist%2\n cnt2=dist//2\n while cnt2 >= 0:\n val+=math.fact... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s024124968', 's216420577', 's546607938', 's806456727', 's523630687'] | [7848.0, 9508.0, 9868.0, 9892.0, 8612.0] | [231.0, 297.0, 2104.0, 2104.0, 184.0] | [448, 301, 251, 278, 278] |
p03013 | u776202654 | 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 selector(flag):\n if flag:\n return 0\n else:\n return 1\n\ndef func(x, a, n):\n if not a[n]:\n x[n] = selector(a[n-1]) * x[n-1] + selector(a[n-2]) * x[n-2]\n else:\n x[n] = 0\n\nK = 1000000007\nline = input().split(' ')\nN = int(line[0])\nM = int(line[1])\na = [False] * (N... | ['Wrong Answer', 'Accepted'] | ['s751312183', 's471904386'] | [466036.0, 466036.0] | [788.0, 731.0] | [501, 525] |
p03013 | u777028980 | 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 ... | ['fib=[0,1]\nfor i in range(9999):\n fib.append(fib[-1]+fib[-2])\n \nn,m=map(int,input().split())\nhoge=[0]\nans=1\nfor i in range(m):\n hoge.append(int(input()))\nhoge.append(n+1)\n\nfor i in range(len(hoge)-1):\n if(hoge[i+1]-hoge[i]==1):\n print(0)\n exit()\n \n ans=ans*max(1,fib[hoge[i+1]-hoge[i]-1])\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s478034025', 's572084251', 's633189735'] | [12044.0, 12048.0, 464164.0] | [190.0, 191.0, 526.0] | [347, 346, 366] |
p03013 | u780420070 | 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=[]\nb=[0]*N\nfor i in range(M):\n a.append(int(input()))\nj=0\nif a[0]==1:\n b[0]=0\n b[1]=1\nelif a[0]==2:\n b[0]=1\n b[1]=1\nelse:\n b[0]=1\n b[1]=2\nfor i in range(N-2):\n if j==M-1 or ((i+2)!=a[j] and (i+1)!=a[j]):\n b[i+2]=b[i+1]+b[i]\n if j>0 and... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s742292609', 's964341055', 's575542553'] | [500284.0, 9968.0, 463928.0] | [2133.0, 2104.0, 600.0] | [563, 805, 663] |
p03013 | u780475861 | 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 functools import lru_cache\nsys.setrecursionlimit(1000000)\nread=sys.stdin.read\nN,M,*alst=map(int,read().split())\nmod=10**9+7\ndp = [1, 1 if 1 not in alst else 0]\n@lru_cache(maxsize=None)\ndef a(n):\n if n==0:\n return dp[0]\n elif n==1:\n return dp[1]\n else:\n if n not in alst:\n ... | ['Wrong Answer', 'Accepted'] | ['s697889197', 's147924791'] | [14436.0, 14324.0] | [65.0, 52.0] | [371, 358] |
p03013 | u780962115 | 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 m>=2:\n lists=[]\n for i in range(m):\n a=int(input())\n lists.append(a)\n\n fiblist=[1,1]\n for j in range(10**5):\n nums=(fiblist[-1]+fiblist[-2])%(10**9+7)\n fiblist.append(nums)\n lists.insert(0,0)\n lists.append(n)\n ans=1\n for... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s092732097', 's098343556', 's609436787', 's877295719', 's992678926', 's182501551'] | [11048.0, 11056.0, 9128.0, 7076.0, 11628.0, 469276.0] | [211.0, 218.0, 179.0, 184.0, 217.0, 445.0] | [842, 799, 484, 473, 818, 408] |
p03013 | u783038859 | 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\n@lru_cache(maxsize=4096)\ndef fib(n):\n if n < 2:\n return n\n else:\n return fib(n - 1) + fib(n -2)\n\nsafe_area = []\na_p = int(input())\nsafe_area.append(a_p)\nfor i in range(M-1):\n a = int(input())\n diff = a - a_p\n if diff == 1:\n print... | ['Runtime Error', 'Accepted'] | ['s328419206', 's820437395'] | [3064.0, 5032.0] | [19.0, 138.0] | [462, 791] |
p03013 | u787456042 | 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()))\nalist = []\nfor m in range(M) :\n alist.append(int(input()))\n \na2 = 0\na1 = 1\nfor n in range(N) :\n a0 = (a1 + a2)*int((n+1) not in alist)%1000000007\n print(a0)\n a2, a1 = a1, a0\nelse :\n print(a0)', 'from functools import lru_cache\nfrom sys import setre... | ['Wrong Answer', 'Accepted'] | ['s266084138', 's031609507'] | [7696.0, 282388.0] | [2104.0, 943.0] | [248, 415] |
p03013 | u788703383 | 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**8)\nINF = float('inf')\nmod = 10**9 + 7\ninput = sys.stdin.readline\n\ndef inp():\n return int(input())\ndef inpl():\n return list(map(int,input().split()))\ndef inpm():\n return map(int,input().split())\n\nn,m = inpm()\ndp = [0] * (n+2)\nfor _ in range(m):\n a = int(... | ['Runtime Error', 'Accepted'] | ['s010019983', 's148965207'] | [6900.0, 6900.0] | [108.0, 215.0] | [537, 201] |
p03013 | u789565565 | 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())\nlis = [0]*n+1\na = []\nfor i in range(m):\n a.append(int(input()))\n \nmod = 10**9+7\nans = 0\nif n==1:\n print(1)\nelif n==2:\n if m==1:\n print(1)\n else:\n print(2)\nelse:\n if 1 in a and 2 in a:\n print(0)\n elif 1 in a:\n lis[1] = 1... | ['Runtime Error', 'Accepted'] | ['s240773335', 's899311029'] | [9688.0, 13424.0] | [25.0, 195.0] | [710, 315] |
p03013 | u790710233 | 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\ndp = [-1]*(n+1)\ndp[0] = dp[1] = 1\n\nfor x in a:\n dp[x] = 0\n\nfor i in range(2, n+1):\n if dp[i] == 0:\n continue\n dp[i] = (dp[i-1]+dp[i-2]) % MOD\n\n\nprint(dp[n] if dp[n] != INF else 0)', 'n, m = map(int, inpu... | ['Runtime Error', 'Accepted'] | ['s380696186', 's845509127'] | [7848.0, 7824.0] | [181.0, 180.0] | [279, 255] |
p03013 | u790922244 | 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 ... | ['OK = "O"\nBRO = "B"\n\nN,M=map(int, input().split())\nBroken=[int(input()) for i in range(M)]\nK = "".join(list(BRO if i in Broken else OK for i in range(N+1)))\n \nif BRO+BRO in K:\n print(0)\nelse:\n c=[0 for i in range(N+1)]\n if K[N-1]==OK:\n c[1]=1\n if K[N-2]==OK and K[N-1]==OK:\n c[2]=2\n if ... | ['Runtime Error', 'Accepted'] | ['s718675147', 's808789172'] | [7204.0, 8608.0] | [2104.0, 224.0] | [418, 661] |
p03013 | u794161347 | 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)] \nz = [0] * (N+1)\n\ndef rootCount(x):\n print(x)\n if x in a:\n z[x] = 0\n return 0\n elif x == 0:\n z[x] = 1\n return 1\n elif x == 1:\n z[x] = 1\n return 1\n elif x < N a... | ['Runtime Error', 'Accepted'] | ['s457942702', 's961764017'] | [107128.0, 460020.0] | [2104.0, 486.0] | [552, 392] |
p03013 | u794910686 | 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(map(int,open(0).read().split()))\n\nb=[0]*(N+2)\nb[0]=1\nb[1]=1\n\nfor j in range(M):\n b[a[j]]=-1\n\nfor i in range(2,N+2):\n if b[i] !=-1:\n if b[i-1]!=-1:\n b[i]+=b[i-1]\n if b[i-2]!=-1:\n b[i]+=b[i-2]\nprint(b[-2]%(1000000007))', 'N,M=... | ['Runtime Error', 'Accepted'] | ['s636467131', 's219318649'] | [462708.0, 462708.0] | [600.0, 600.0] | [294, 298] |
p03013 | u798260206 | 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)\nINF = 1000000007\n \ndp[0] = 1\nif 1 not in a:\n dp[1] = 1\nelse:\n dp[1] = 0\n \nfor i in range(2,n+1):\n if i in a :\n dp[i] += dp[i-1] +dp[i-2] \ndp[i] %= INF\n \nprint(dp[n])', 'n,m = map(int,input().split())\na =... | ['Runtime Error', 'Accepted'] | ['s129860565', 's431789853'] | [469768.0, 13216.0] | [643.0, 198.0] | [263, 341] |
p03013 | u798818115 | 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# Your code here!\nN,M=map(int,input().split())\nl=list(range(N+1))\n\nres=[1,1]\nfor i in range(10**5):\n res.append(res[-1]+res[-2])\n\nsum=1\nstart=0\njudge=True\n\nfor i in range(M):\n a=int(input())\n if (a-start)==1:\n if start==0:\n pass\n else:\n j... | ['Wrong Answer', 'Accepted'] | ['s030838004', 's919621445'] | [466868.0, 464116.0] | [2132.0, 500.0] | [457, 438] |
p03013 | u806855121 | 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 quit()\nif M > N//2:\n print(0)\n quit()\n\nA = list(int(input()) for _ in range(M))\nidx = 0\nP = 10**9 + 7\n\ndp = [0] * (N+1)\ndp[0] = 1\ndp[1] = 1\na = -1\nif len(A):\n if 1 == A[idx]:\n dp[1] = 0\n idx += 1\n\nif len(A) and le... | ['Wrong Answer', 'Accepted'] | ['s313367898', 's725916690'] | [7404.0, 7424.0] | [132.0, 131.0] | [577, 587] |
p03013 | u809849468 | 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 ... | ['print(1)', 'NM = [int(i) for i in input().split()]\na = [0] * NM[0]\nfor _ in range(NM[1]):\n a[int(input) - 1] = -1\n\nfor i in range(NM[0]):\n if (i == 0):\n if(a[i] != -1):\n a[i] = 1\n else:\n a[i] = 0\n elif(i == 1):\n if(a[i] != -1):\n a[i] = a[i - ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s142219376', 's190949518', 's214687519', 's404767811', 's548258968', 's941217929', 's411780402'] | [2940.0, 460020.0, 7828.0, 7892.0, 7900.0, 7848.0, 460020.0] | [17.0, 465.0, 273.0, 265.0, 274.0, 248.0, 481.0] | [8, 469, 1591, 1566, 1592, 1480, 475] |
p03013 | u810356688 | 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\ndef input(): return sys.stdin.readline().rstrip()\n \ndef main():\n n,m=map(int,input().split())\n A=[int(input())for _ in range(m)]\n flag=[True]\n for a in A:\n flag[a]=False\n mod=10**9+7\n dp=[0]*(n+1)\n dp[0]=1\n for i in range(n):\n if flag[i+1]:\n ... | ['Runtime Error', 'Accepted'] | ['s966253844', 's855113544'] | [7080.0, 8616.0] | [81.0, 89.0] | [444, 450] |
p03013 | u812803774 | 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 = [int(i) for i in input().split()]\np = [0 for i in range(n + 1)]\nfor _ in range(m):\n p[int(input())] = 1\n \na = []\na.append(1)\nif 1 in p:\n a.append(0)\nelse:\n a.append(1)\nfor i in range(2, n + 1):\n if p[i] == 1:\n a.append(0)\n else:\n a.append((a[i - 2] + ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s802595017', 's860237989', 's024876403'] | [7848.0, 7832.0, 7848.0] | [189.0, 195.0, 190.0] | [342, 342, 345] |
p03013 | u814781830 | 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 _ in range(M)]\nmod = 1000000007\nret = [0] * N\nfor i in range(N):\n if i in a:\n continue\n elif i < 2:\n ret[i] = ret[i]+1\n else:\n ret[i] = ret[i-2] + ret[i-1]\n if ret[i] == 0:\n break\n\n\nprint(ret[len(r... | ['Wrong Answer', 'Accepted'] | ['s050048061', 's069092508'] | [460020.0, 460020.0] | [2120.0, 457.0] | [315, 288] |
p03013 | u815878613 | 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 = np.array([int(input()) for _ in range(M)])\nq = 1000000007\n\nif N == 1:\n if M == 0:\n print(1)\n elif M == 1:\n print(0)\n else:\n cost = np.zeros(N + 1, dtype=np.int64)\n cost[0] = 1\n cost[1] = 1\n cost[... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s200621132', 's925800091', 's952246900'] | [17020.0, 15320.0, 460056.0] | [306.0, 587.0, 467.0] | [488, 756, 436] |
p03013 | u816265237 | 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 ... | ['#dp\nn,m = map(int,input().split())\nln = [-1 for i in range(n +1)]\nmod_1 = 10**9 + 7\nfor i in range(m):\n ln[int(input())] = 0\nline = []\nfor i in range(n+1):\n if ln[i] ==0\n pass\n elif i == 0:\n ln[i] = 1\n elif i == 1:\n ln[i] = 1\n else:\n line.append((line[-1] + l... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s545613272', 's689811332', 's978686443'] | [2940.0, 2940.0, 7064.0] | [17.0, 17.0, 188.0] | [337, 320, 340] |
p03013 | u818349438 | 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[1] = 1\n\nif 1 in a:\n dp[2] = 1\n dp[1] = 0\nelse:\n dp[2] = 2\nfor i in range(3,N+1):\n if i-1 in a:\n continue\n \n dp[i] = (dp[i-2]+dp[i-1])%1000000007\nans = dp[N]\nprint(ans)\n\n', 'N,M = map(i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s130148447', 's204923946', 's184454190'] | [13216.0, 7824.0, 13192.0] | [179.0, 2104.0, 175.0] | [285, 294, 258] |
p03013 | u821588465 | 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(list(int(input()) for _ in range(M)))\n\n\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])%(10**9+7)\n if i in A:\n dp[i] = 0\nprint(dp)\n', 'N, M = map(int, input().split())\nA = set(list(int(input()) for _ in range(M)))\n\n... | ['Wrong Answer', 'Accepted'] | ['s268034674', 's521626488'] | [18920.0, 19044.0] | [176.0, 168.0] | [218, 222] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.