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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03209 | u867320886 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['def count(n,x):\n print(n,x)\n if x<=n:\n return 0\n elif x>=2**(n+2)-2-n:\n return 2**(n+1)-1\n elif 2**(n+2)-3 > 2*x:\n return count(n-1,x-1)\n else:\n return 2**n + count(n-1,x-2**(n+1)+1)\n\nn,x=map(int,input().split())\nprint(count(n,x))', 'def count(n,x):\n if x<=n:\n return 0\n elif x>=2**(n+2)-3-n:\n return 2**(n+1)-1\n elif 2**(n+2)-3 > 2*x:\n return count(n-1,x-1)\n else:\n return 2**n + count(n-1,x-2**(n+1)+1)\n\nn,x=map(int,input().split())\nprint(count(n,x))'] | ['Runtime Error', 'Accepted'] | ['s810620276', 's252894705'] | [4060.0, 3060.0] | [77.0, 17.0] | [273, 258] |
p03209 | u893063840 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['# -*- coding: utf-8 -*- \n\nN, X = map(int, input().split())\n\na, p = [1], [1]\n\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\n\ndef f(N, X):\n if N == 0:\n\treturn 0 if X <= 0 else\t1\n elif X <= 1\t+ a[N-1]:\n return f(N-1, X-1)\n else:\n return p[N-1] +\t1 + f(N-1, X-2-a[N-1])\n\n\nprint(f(N, X))\n', '# -*- coding: utf-8 -*- \n\nN, X = map(int, input().split())\n\na, p = [1], [1]\n\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\n\ndef f(N, X):\n if N == 0:\n return 0 if X <= 0 else 1\n elif X <= 1 + a[N-1]:\n return f(N-1, X-1)\n else:\n return p[N-1] + 1 + f(N-1, X-2-a[N-1])\n\n\nprint(f(N, X))\n'] | ['Runtime Error', 'Accepted'] | ['s360989047', 's938970632'] | [2940.0, 3064.0] | [17.0, 17.0] | [411, 418] |
p03209 | u896741788 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['n,x=map(int,input().split())\na,p=[1],[1]\nfor i in range(n+1):\n a.append(3+2*a[-1])\n p.append(1+2*a[-1])\ndef f(l,x):\n if l==0:return int(x==1)\n if x<=1+a[n-1]:\n return f(l-1,x-1)\n else:return p[l-1]+1+f(l-1,x-2-a[l-1])\nprint(f(n,x))', 'n,x=map(int,input().split())\na,p=[1],[1]\nfor i in range(n):\n a.append(3+2*a[-1])\n p.append(1+2*a[-1])\ndef f(l,x):\n if l==0:return int(x==1)\n if x<=1+a[n-1]:\n return f(l-1,x-1)\n else:return p[l-1]+1+f(l-1,x-2-a[l-1])\nprint(f(n,x))', 'n,x=map(int,input().split())\na,p=[1],[1]\nfor i in range(n+1):\n a.append(3+2*a[-1])\n p.append(1+2*p[-1])\ndef f(l,x):\n if l==0:return int(x>=1)\n if x<=1+a[l-1]:\n return f(l-1,x-1)\n else:return p[l-1]+1+f(l-1,x-2-a[l-1])\nprint(f(n,x))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s015851410', 's630177611', 's605452778'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [254, 252, 254] |
p03209 | u898967808 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['n,x = map(int,input().split())\ndp_a=[1]\ndp_p=[1]\nfor i in range(1,n):\n dp_a.append(2*dp_a[i-1] + 3)\n dp_p.append(2*dp_p[i-1] + 1) \n \ndef burger(n,x):\n if n==0:\n if x==1: \n return 1\n else:\n return 0\n \n if x < dp_a[n-1]+1:\n return burger(n-1, x-1)\n else:\n return dp_p[n-1] +1 +burger(n-1, x-dp_a[n-1]-2) \n\nburger(n,x) ', 'n,x = map(int,input().split())\ndp_a=[1]\ndp_p=[1]\nfor i in range(1,n):\n dp_a.append(2*dp_a[i-1] + 3)\n dp_p.append(2*dp_p[i-1] + 1) \n \ndef burger(n,x):\n if n==0:\n if x <= 0: \n return 0\n else:\n return 1\n \n if x <= dp_a[n-1]+1:\n return burger(n-1, x-1)\n else:\n return dp_p[n-1] +1 +burger(n-1, x-dp_a[n-1]-2) \n\nprint(burger(n,x))'] | ['Wrong Answer', 'Accepted'] | ['s794635443', 's940102728'] | [3064.0, 3064.0] | [17.0, 17.0] | [355, 363] |
p03209 | u902376752 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['allEatCache = {}\nlenBurgerCache = {}\n\n\ndef nOfPatty(level, eat):\n if level == 0:\n return 1\n else:\n if level in allEatCache and eat >= lenBurger(level):\n return allEatCache[level]\n else:\n lenOfLowerLevel = lenBurger(level - 1)\n if eat <= 1:\n return 0\n if 2 <= eat <= 1 + lenOfLowerLevel:\n return nOfPatty(level - 1, eat - 1)\n if eat == 1 + lenOfLowerLevel + 1:\n return nOfPatty(level - 1, eat - 1) + 1\n else:\n tmp = nOfPatty(level - 1, eat - 1) + 1\n tmp += nOfPatty(level - 1, eat - 1 - lenOfLowerLevel - 1)\n allEatCache[level] = tmp\n return tmp\n\n\ndef lenBurger(level):\n if level == 0:\n return 1\n else:\n if level in lenBurgerCache:\n return lenBurgerCache[level]\n else:\n return 3 + lenBurger(level - 1) * 2\n\n\nprint(nOfPatty(50, 4321098765432109))\n', 'allEatCache = {}\nlenBurgerCache = {}\n\n\ndef nOfPatty(level, eat):\n if level == 0:\n return 1\n else:\n if level in allEatCache and eat >= lenBurger(level):\n return allEatCache[level]\n else:\n lenOfLowerLevel = lenBurger(level - 1)\n if eat <= 1:\n return 0\n if 2 <= eat <= 1 + lenOfLowerLevel:\n return nOfPatty(level - 1, eat - 1)\n if eat == 1 + lenOfLowerLevel + 1:\n return nOfPatty(level - 1, eat - 1) + 1\n else:\n tmp = nOfPatty(level - 1, eat - 1) + 1\n tmp += nOfPatty(level - 1, eat - 1 - lenOfLowerLevel - 1)\n allEatCache[level] = tmp\n return tmp\n\n\ndef lenBurger(level):\n if level == 0:\n return 1\n else:\n if level in lenBurgerCache:\n return lenBurgerCache[level]\n else:\n tmp = 3 + lenBurger(level - 1) * 2\n lenBurgerCache[level] = tmp\n return tmp\n\n\nstr = input().split()\nn = int(str[0])\nx = int(str[1])\n\nprint(nOfPatty(n, x))\n'] | ['Wrong Answer', 'Accepted'] | ['s556877475', 's097864174'] | [3064.0, 3064.0] | [19.0, 18.0] | [992, 1093] |
p03209 | u902973687 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['import math\n\n\n\n# if n == 0:\n# return int("101", 2)\n# else:\n# lt = burger_generator(n-1)\n# x1 = 1 + (lt << 1)\n# length = int(math.log2(x1)) + 1\n# x1 = x1 + (lt << length + 1)\n# length = int(math.log2(x1)) + 1\n# return x1 + (1 << length)\n\n\ndef f(N, X):\n if X == 1:\n return 0\n elif X <= 1 + size[N - 1]:\n return f(N - 1, X - 1)\n elif X == 2 + size[N - 1]:\n return patty[N - 1] + 1\n elif X <= 2 + 2 * size[N - 1]:\n return patty[N - 1] + 1 + f(N - 1, X - 2 - size[N - 1])\n elif X == 3 + 2 * size[N - 1]:\n return 2 * patty[N - 1] + 1\n\n\nN, X = map(int, input().split())\n\n\nsize, patty = [1], [1]\nfor i in range(N+1):\n size.append(size[i] * 2 + 3)\n patty.append(patty[i] * 2 + 1)\nfor i in range(N):\n print(size)\nfor i in range(N):\n print(patty)\nprint(f(N, X))\n', 'import math\n\n\n\n# if n == 0:\n# return int("101", 2)\n# else:\n# lt = burger_generator(n-1)\n# x1 = 1 + (lt << 1)\n# length = int(math.log2(x1)) + 1\n# x1 = x1 + (lt << length + 1)\n# length = int(math.log2(x1)) + 1\n# return x1 + (1 << length)\n\n\ndef f(N, X):\n if X == 1:\n return 0\n if 1 < X <= 1 + size[N - 1]:\n return f(N - 1, X - 1)\n if X == 2 + size[N]:\n return patty[N - 1] + 1\n if 2 + size[N - 1] < X <= 2 + 2 * size[N - 1]:\n return patty[N - 1] + 1 + f(N - 1, X - 2 - size[N - 1])\n if X == 3 + 2 * size[N - 1]:\n return 2 * patty[N - 1] + 1\n\n\nN, X = map(int, input().split())\nprint(N, X)\n\n\nsize, patty = [1], [1]\nfor i in range(N):\n size.append(size[i] * 2 + 3)\n patty.append(patty[i] * 2 + 1)\n\nprint(f(N, X))\n', 'import math\n\n\n\n# if n == 0:\n# return int("101", 2)\n# else:\n# lt = burger_generator(n-1)\n# x1 = 1 + (lt << 1)\n# length = int(math.log2(x1)) + 1\n# x1 = x1 + (lt << length + 1)\n# length = int(math.log2(x1)) + 1\n# return x1 + (1 << length)\n\n\ndef f(N, X):\n if X == 1:\n return 0\n if 1 < X <= 1 + size[N - 1]:\n return f(N - 1, X - 1)\n if X == 2 + size[N - 1]:\n return patty[N - 1] + 1\n if 2 + size[N - 1] < X <= 2 + 2 * size[N - 1]:\n return patty[N - 1] + 1 + f(N - 1, X - 2 - size[N - 1])\n if X == 3 + 2 * size[N - 1]:\n return 2 * patty[N - 1] + 1\n\n\nN, X = map(int, input().split())\nprint(N, X)\n\n\nsize, patty = [1], [1]\nfor i in range(N):\n size.append(size[i] * 2 + 3)\n patty.append(patty[i] * 2 + 1)\n\nprint(f(N, X))\n', 'import math\n\n\n\n# if n == 0:\n# return int("101", 2)\n# else:\n# lt = burger_generator(n-1)\n# x1 = 1 + (lt << 1)\n# length = int(math.log2(x1)) + 1\n# x1 = x1 + (lt << length + 1)\n# length = int(math.log2(x1)) + 1\n# return x1 + (1 << length)\n\n\ndef f(N, X):\n if X == 1:\n # print(1)\n return 0 if not N == 0 else 1\n elif X <= 1 + size[N - 1]:\n # print(2)\n return f(N - 1, X - 1)\n elif X == 2 + size[N - 1]:\n # print(3)\n return patty[N - 1] + 1\n elif X <= 2 + 2 * size[N - 1]:\n # print(4)\n return patty[N - 1] + 1 + f(N - 1, X - 2 - size[N - 1])\n elif X == 3 + 2 * size[N - 1]:\n # print(5)\n return 2 * patty[N - 1] + 1\n\n\nN, X = map(int, input().split())\n\n\nsize, patty = [1], [1]\nfor i in range(N):\n size.append(size[i] * 2 + 3)\n patty.append(patty[i] * 2 + 1)\n\n# print(size)\n\n\nprint(f(N, X))\n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s262082169', 's263673869', 's554923163', 's276168973'] | [3064.0, 3096.0, 3064.0, 3064.0] | [35.0, 21.0, 17.0, 18.0] | [977, 927, 931, 1099] |
p03209 | u903460784 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ["n,x=map(int,input().split())\n\ndef makeBurger(n):\n if n==1:\n return 'bpppb'\n else:\n burger=makeBurger(n-1)\n print(n)\n return 'b'+burger+'p'+burger+'b'\n\nburger=makeBurger(n)\ncnt=0\nfor i in range(x):\n if burger[i]=='p':\n cnt+=1\nprint(cnt)", 'n,x=map(int,input().split())\n\ndef makeBurger(n):\n if n==1:\n return [1,3,1]\n else:\n burger=makeBurger(n-1)\n newBurger=[*burger,1,*burger]\n newBurger[0]+=1\n newBurger[-1]+=1\n print(newBurger)\n return newBurger\n\nburger=makeBurger(n)\nsize=0\nindex=0\ncnt=0\nwhile size<=x:\n layerSize=burger[index]\n if index%2:\n if size+layerSize>x:\n cnt+=x-size\n break\n else:\n cnt+=layerSize\n size+=layerSize\n index+=1\nprint(cnt)', 'n,x=map(int,input().split())\n\nthickness=[1]\nfor i in range(1,n):\n thickness.append(2*thickness[i-1]+3)\npatty=[1]\nfor i in range(1,n):\n patty.append(2*patty[i-1]+1)\n\n\ndef pattyCnt(n,x):\n if n==0:\n return 0 if x<=0 else 1\n elif x<=1+thickness[n-1]:\n return pattyCnt(n-1,x-1)\n else:\n return patty[n-1]+1+pattyCnt(n-1,x-2-thickness[n-1])\n\nprint(pattyCnt(n,x))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s776665405', 's854426566', 's502210836'] | [3060.0, 3064.0, 3064.0] | [1785.0, 19.0, 18.0] | [279, 520, 391] |
p03209 | u909991537 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['N, X = (int(i) for i in input().split()) \nL = [1]\nP = [1]\n\nfor _ in range(N):\n L.append(L[-1] * 2 + 3)\n P.append(P[-1] * 2 + 1)\n\ndef count(x,n):\n if n == 0:\n return 0 if x <= 0 else 1\n elif x <= L[n-1] + 2:\n return count(x-1, n-1)\n else:\n return P[n-1] + 1 + count(x-(L[n-1]+2),n-1)\n\n#print(L,P)\nprint(count(X, N))', 'N, X = (int(i) for i in input().split()) \nL = [1]\nP = [1]\n\nfor _ in range(N):\n L.append(L[-1] * 2 + 3)\n P.append(P[-1] * 2 + 1)\n\ndef count(x,n):\n if n == 0:\n return 0 if x <= 0 else 1\n elif x <= L[n-1] + 1:\n return count(x-1, n-1)\n else:\n return P[n-1] + 1 + count(x-(L[n-1]+2),n-1)\n\n#print(L,P)\nprint(count(X, N))'] | ['Wrong Answer', 'Accepted'] | ['s462958265', 's702082089'] | [3064.0, 3064.0] | [17.0, 17.0] | [329, 329] |
p03209 | u923279197 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['n, x = map(int,input().split())\ndef ABC115D(n,x):\n if n == 0:\n return 1\n elif x == 1:\n return 0\n elif x >= 2**(n+1)-1:\n return ABC115D(n-1,x-2**(n+1)+1) + 2**n\n else:\n return ABC115D(n-1,x-1)\nprint(ABC115D(n,x))', 'n, x = map(int,input().split())\ndef ABC115D(n,x):\n if x == 1:\n return 0\n elif n == 0:\n return 1\n elif x >= 2**(n+1)-1:\n return ABC115D(n-1,x-2**(n+1)+1) + 2**n\n elif x == 2**(n+1)-2:\n return 2**n - 1\n else:\n return ABC115D(n-1,x-1)\nprint(ABC115D(n,x))', 'n, x = map(int,input().split())\ndef ABC115D(n,x):\n if n == 0:\n return 1\n elif x == 1:\n return 0\n elif x >= 2**(n+1)-1:\n return ABC115D(n-1,x-2**(n+1)+1) + 2**n\n elif x == 2**(n+1)-2:\n return 2**n - 1\n else:\n return ABC115D(n-1,x-1)\nprint(ABC115D(n,x))', 'n, x = map(int,input().split())\ndef ABC115D(n,x):\n if x == 0:\n return 0\n if n == 0:\n return 1\n elif x == 1:\n return 0\n elif x >= 2**(n+1)-1:\n return ABC115D(n-1,x-2**(n+1)+1) + 2**n\n else:\n return ABC115D(n-1,x-1)\nprint(ABC115D(n,x))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s184256832', 's793163510', 's836926589', 's575121807'] | [3060.0, 3060.0, 3060.0, 3060.0] | [18.0, 18.0, 18.0, 19.0] | [251, 301, 301, 283] |
p03209 | u934788990 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['N, X = map(int, input().split())\n\na, p = [1], [1]\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\ndef f(N, X): \nif N == 0:\n return 0 if X <= 0 else 1\nelif X <= 1 + a[N-1]:\n return f(N-1, X-1)\nelse:\n return p[N-1] + 1 + f(N-1, X-2-a[N-1])\n\nprint(f(N, X))', 'N, X = map(int, input().split())\n\na, p = [1], [1]\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\ndef f(N, X): \n if N == 0:\n return 0 if X <= 0 else 1\n elif X <= 1 + a[N-1]:\n return f(N-1, X-1)\n else:\n return p[N-1] + 1 + f(N-1, X-2-a[N-1])\n\nprint(f(N, X))'] | ['Runtime Error', 'Accepted'] | ['s378823504', 's462300296'] | [2940.0, 3064.0] | [17.0, 17.0] | [288, 312] |
p03209 | u938486382 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ["n, k = list(map(int, input().split(' ')))\nlens = {0: 1}\nfor i in range(1, 51):\n lens[i] = lens[i-1] * 2 + 3\nmemo = {}\n\ndef sumP(level, index):\n key = (level, index)\n if key in memo:\n return memo[key]\n if level == 0:\n memo[key] = int(index == 1)\n elif index < lens[level] // 2 + 1: \n memo[key] = sumP(level-1, index-1)\n elif index <= lens[level] // 2 + 1: \n memo[key] = + sumP(level-1, lens[level-1])\n else: \n memo[key] = sumP(level-1, lens[level-1]) + 1 + sumP(level-1, min(lens[level-1], index-lens[level-1]-2))\n return memo[key]\n\nprint(sumP(n, k))\n\n ", "n, k = list(map(int, input().split(' ')))\nlens = {0: 1}\nfor i in range(1, 51):\n lens[i] = lens[i-1] * 2 + 3\n\nmemo = {}\ndef sumP(level, index):\n key = (level, index)\n if key in memo:\n return memo[key]\n if level == 0: # |P or P|\n memo[key] = int(index == 1)\n elif index < lens[level] // 2 + 1: \n memo[key] = sumP(level-1, index-1)\n elif index <= lens[level] // 2 + 1: \n memo[key] = 1 + sumP(level-1, lens[level-1])\n else: \n memo[key] = sumP(level-1, lens[level-1]) + 1 + sumP(level-1, min(lens[level-1], index-lens[level-1]-2))\n return memo[key]\n\nprint(sumP(n, k))"] | ['Wrong Answer', 'Accepted'] | ['s136899501', 's204131060'] | [3064.0, 3064.0] | [17.0, 17.0] | [700, 730] |
p03209 | u946026022 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['N, X = map(int, input().split())\n\na, p = [1], [1]\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\ndef f(N, X):\n if N == 0:\n return 0\n elif X == 0:\n return 1\n elif X <= 1 + a[N-1]:\n return f(N-1, X-1)\n else:\n return p[N-1] + 1 + f(N-1, X-2-a[N-1])\n\n\nprint(f(N,X))\n\n', 'N, X = map(int, input().split())\n\na, p = [1], [1]\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\ndef f(N, X):\n if N == 0:\n return 0 if X <= 0 else 1\n elif X <= 1 + a[N-1]:\n return f(N-1, X-1)\n else:\n return p[N-1] + 1 + f(N-1, X-2-a[N-1])\n\n\nprint(f(N,X))\n\n'] | ['Wrong Answer', 'Accepted'] | ['s569507659', 's201510066'] | [3060.0, 3064.0] | [18.0, 18.0] | [330, 313] |
p03209 | u953237709 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['n, eat = map(int, input().split())\n\npattiesCount = lambda level: (1 << (level + 1)) - 1\nbunsCount = lambda level: (1 << (level + 1)) - 2\nbothCount = lambda level: (1 << (level + 2)) - 3\n\n\n\n\n\n\ndef doit(level, eat):\n if level == 0:\n return int(eat == 1)\n both = bothCount(level)\n patties = pattiesCount(level)\n if eat == both + 2:\n return 1 + patties\n if eat > both + 1:\n return 1 + patties + doit(level - 1, eat - 2 - both)\n return doit(level - 1, eat - 1)\n\nprint(doit(n, eat))\n', 'n, eat = map(int, input().split())\n\npattiesCount = lambda level: (1 << (level + 1)) - 1\nbunsCount = lambda level: (1 << (level + 1)) - 2\nbothCount = lambda level: (1 << (level + 2)) - 3\n\n\n\n\n\n\ndef doit(level, eat):\n if level == 0:\n return int(eat >= 1)\n both = bothCount(level - 1)\n patties = pattiesCount(level - 1)\n if eat == both + 2:\n return 1 + patties\n if eat > both + 1:\n return 1 + patties + doit(level - 1, eat - 2 - both)\n return doit(level - 1, eat - 1)\n\nprint(doit(n, eat))\n'] | ['Wrong Answer', 'Accepted'] | ['s804752397', 's462258540'] | [3064.0, 3188.0] | [18.0, 20.0] | [685, 670] |
p03209 | u962829271 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['import pdb\nimport sys\nsys.setrecursionlimit(10000)\n\ndef eat(n, x):\n ret = 0\n\n if x == 0:\n return 0, x\n\n if n == 0:\n x -= 1\n return 1, x\n\n if allnum[n] <= x:\n x -= allnum[n]\n return pnum[n], x\n \n \n x -= 1 # eat bread\n if x == 0:\n return 0, x\n\n # eat n-1 beager\n tmp, x = eat(n - 1, x)\n ret += tmp\n if x == 0:\n return ret, x\n\n # eat patty\n x -= 1\n ret += 1\n if x == 0:\n return ret, x\n\n # eat n-1 beager\n tmp, x = eat(n - 1, x)\n ret += tmp\n if x == 0:\n return ret, x\n\n x -= 1 # eat bread\n \n return ret, x\n\n\ndef main():\n tmp = input().split()\n n = int(tmp[0])\n x = int(tmp[1])\n global pnum\n global allnum\n pnum = [1]\n allnum = [1]\n for i in range(1, 52):\n pnum.append(pnum[i-1] * 2 + 1)\n allnum.append(allnum[i-1] * 2 + 3)\n print(len(pnum))\n print(len(allnum))\n \n ans, tmp = eat(n, x)\n\n print("%d" % ans)\n\n \nif __name__ == \'__main__\':\n main()\n', "import pdb\n\ndef eat(n, x):\n ret = 0\n\n if x == 0:\n return 0, x\n\n if n == 0:\n x -= 1\n return 1, x\n\n if allnum[n] <= x:\n x -= allnum[n]\n return pnum[n], x\n \n # eat bread\n x -= 1 \n if x == 0:\n return 0, x\n\n # eat n-1 beager\n tmp, x = eat(n - 1, x)\n ret += tmp\n if x == 0:\n return ret, x\n\n # eat patty\n x -= 1\n ret += 1\n if x == 0:\n return ret, x\n\n # eat n-1 beager\n tmp, x = eat(n - 1, x)\n ret += tmp\n if x == 0:\n return ret, x\n\n # eat bread\n x -= 1 \n \n return ret, x\n\n\ndef main():\n tmp = input().split()\n n = int(tmp[0])\n x = int(tmp[1])\n global pnum\n global allnum\n pnum = [1]\n allnum = [1]\n for i in range(1, 51):\n pnum.append(pnum[i-1] * 2 + 1)\n allnum.append(allnum[i-1] * 2 + 3)\n\n ans, tmp = eat(n, x)\n\n print(ans)\n\n \nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s955396054', 's318825001'] | [5896.0, 5768.0] | [70.0, 67.0] | [1043, 953] |
p03209 | u977389981 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['n, x = map(int, input().split())\n\nP = [0] * (n + 1)\nP[0] = 1\nA = [0] * (n + 1)\nA[0] = 1\nfor i in range(1, n + 1):\n P[i] = P[i - 1] * 2 + 1\n A[i] = A[i - 1] * 2 + 3\n\n#print(P)\n#print(A)\n\ndef dfs(n, x):\n if n == 0:\n return 1\n elif x <= 1 + A[n - 1]:\n return dfs(n - 1, x - 1)\n else:\n return P[n - 1] + 1 + dfs(n - 1, x - 1 - A[n - 1] - 1)\n\nprint(dfs(n, x))', 'n, x = map(int, input().split())\n \nP = [0] * (n + 1)\nP[0] = 1\nfor i in range(1, n + 1):\n P[i] = P[i - 1] * 2 + 1\n\nA = [0] * (n + 1)\nA[0] = 1\nfor i in range(1, n + 1):\n A[i] = A[i - 1] * 2 + 3\n\n#print(P)\n#print(A)\n \ndef dfs(n, x):\n if n == 0:\n return 1\n if x == 1:\n return 0\n elif 1 < x <= 1 + A[n - 1]:\n return dfs(n - 1, x - 1)\n elif x == 1 + A[n - 1] + 1:\n return P[n - 1] + 1\n elif 1 + A[n - 1] + 1 < x < 1 + A[n - 1] + 1 + A[n - 1] + 1:\n return P[n - 1] + 1 + dfs(n - 1, x - 1 - A[n - 1] - 1)\n elif x >= 1 + A[n - 1] + 1 + A[n - 1] + 1:\n return P[n - 1] + 1 + P[n - 1]\n \nprint(dfs(n, x)) '] | ['Wrong Answer', 'Accepted'] | ['s634691166', 's856916811'] | [3064.0, 3064.0] | [17.0, 17.0] | [390, 664] |
p03209 | u978178314 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['import sys\nsys.setrecursionlimit(10**5)\n\ndef solve(n, x):\n if n == 0:\n if x > 1:\n return 1\n else:\n return 0\n else:\n ans = 0\n burger_prev = 2**(n+1)-3\n pate_prev = 2**n-1\n if x > 1:\n if x < burger_prev+1:\n ans += solve(n-1 ,x-1)\n else:\n ans += pate_prev\n if x > burger_prev+2:\n ans += 1\n if x > burger_prev*2+2:\n ans += pate_prev\n else:\n ans += solve(n-1, x-2-burger_prev)\n return ans\n\nN, X = map(int, input().split())\nprint(solve(N, X))\n\n', 'import sys\nsys.setrecursionlimit(10**5)\n\ndef solve(n, x):\n if n == 0:\n if x > 0:\n return 1\n else:\n return 0\n else:\n ans = 0\n burger_prev = 2**(n+1)-3\n pate_prev = 2**n-1\n if x > 1:\n if x < burger_prev+1:\n ans += solve(n-1 ,x-1)\n else:\n ans += pate_prev\n if x > burger_prev+1:\n ans += 1\n if x > burger_prev*2+2:\n ans += pate_prev\n else:\n ans += solve(n-1, x-2-burger_prev)\n return ans\n\nN, X = map(int, input().split())\nprint(solve(N, X))\n'] | ['Wrong Answer', 'Accepted'] | ['s827411612', 's124483090'] | [3064.0, 3188.0] | [17.0, 19.0] | [551, 550] |
p03209 | u981931040 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['N, X = map(int, input().split())\npatty = [1]\nbuns = [0]\n\nfor i in range(0, N):\n patty.append(patty[i] * 2 + 1)\n buns.append(buns[i] * 2 + 2)\n\nprint(patty)\nprint(buns)\n\nburger_high = patty[N] + buns[N]\nprint("burger : ", burger_high)\nprint("burger/2 : ", burger_high/2)\n\n\ndef dfs(now_runrun, now_burger_high, dimension):\n if dimension == 0:\n return 1\n \n elif now_runrun == 1:\n return 0\n\n \n elif now_runrun == now_burger_high // 2 + 1:\n return patty[dimension - 1] + 1\n\n \n elif now_runrun == now_burger_high:\n return patty[dimension]\n\n\n next_burger = now_burger_high // 2 - 1\n next_dimension = dimension - 1\n\n if now_runrun <= now_burger_high // 2:\n return dfs(now_runrun - 1, next_burger, next_dimension)\n else:\n return dfs(now_runrun - (patty[next_dimension] + buns[next_dimension] + 2),\n next_burger, next_dimension) + patty[next_dimension] + 1\n\n\nprint(dfs(X, burger_high, N))\n', 'N, X = map(int, input().split())\npattis = [1]\nbuns = [0]\n\nfor i in range(N):\n pattis.append(pattis[i] * 2 + 1)\n buns.append(buns[i] * 2 + 2)\n\n\n# print(buns)\n\ndef dfs(n , x):\n \n if n == 0:\n return 1\n\n\n \n burger_high = pattis[n] + buns[n]\n if x == 1:\n return 0\n elif x == burger_high:\n return pattis[n - 1] * 2 + 1\n elif x == burger_high // 2 + 1:\n return pattis[n - 1] + 1\n\n \n if 1 < x <= burger_high // 2:\n return dfs(n - 1, x - 1)\n elif burger_high // 2 < x < burger_high:\n return dfs(n - 1, x - (pattis[n - 1] + buns[n - 1] + 2)) + pattis[n - 1] + 1\n\n\nprint(dfs(N, X))'] | ['Wrong Answer', 'Accepted'] | ['s602471270', 's133393867'] | [3064.0, 3064.0] | [17.0, 25.0] | [1202, 757] |
p03209 | u983918956 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['N,X = map(int,input().split())\nif N == 0:\n print(1)\n exit()\n\na,b = [1],[1]\nfor i in range(N):\n a.append(2*a[i] + 3)\n b.append(2*b[i] + 1)\ndef f(N,X):\n if X == 1:\n return 0\n elif 1 < X <= a[N-1] + 1:\n return f(N-1,X-1)\n elif X == a[N-1] + 2:\n return b[N-1] + 1\n elif a[N-1] + 2 < X <= 2*a[N-1] + 2:\n return b[N-1] + 1 + f(N-1,X-(a[N-1]+2))\n elif X = 2*a[N-1] + 3:\n return 2*b[N-1] + 1\nans = f(N,X)\nprint(ans)', 'N,X = map(int,input().split())\nif N == 0:\n print(1)\n exit()\n\na,b = [1],[1]\nfor i in range(N):\n a.append(2*a[i] + 3)\n b.append(2*b[i] + 1)\ndef f(N,X):\n if X == 1:\n return 0\n elif 1 < X <= a[N-1] + 1:\n return f(N-1,X-1)\n elif X == a[N-1] + 2:\n return b[N-1] + 1\n elif a[N-1] + 2 < X <= 2*a[N-1] + 2:\n return b[N-1] + 1 + f(N-1,X-(a[N-1]+2))\n elif X = 2*a[N-1] + 3:\n return 2*b[N-1] + 1\nans = def(N,X)\nprint(ans)', 'N,X = map(int,input().split())\n\n\n# B[0] = 1\ndef Ber(L):\n if L == 0:\n return 1\n return 2*Ber(L-1) + 3\n\n\n# P[L] = 1\ndef Patty(L):\n if L == 0:\n return 1\n return 2*Patty(L-1) + 1\n\ndef rec(L=N,bottom=X):\n if L == 0:\n return 1\n if bottom <= 1:\n return 0\n elif bottom <= 1 + Ber(L-1):\n return rec(L-1,bottom-1)\n elif bottom == 1 + Ber(L-1) + 1:\n return Patty(L-1) + 1\n elif bottom <= 1 + Ber(L-1) + 1 + Ber(L-1):\n return Patty(L-1) + 1 + rec(L-1,bottom-(1+Ber(L-1)+1))\n elif bottom <= 1 + Ber(L-1) + 1 + Ber(L-1) + 1:\n return Patty(L-1) + 1 + Patty(L-1)\n\nprint(rec())'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s707143337', 's890889605', 's830960725'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 19.0] | [504, 506, 710] |
p03209 | u988402778 | 2,000 | 1,048,576 | In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A _level- L burger_ (L is an integer greater than or equal to 0) is the following thing: * A level-0 burger is a patty. * A level-L burger (L \geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom. For example, a level-1 burger and a level-2 burger look like `BPPPB` and `BBPPPBPBPPPBB` (rotated 90 degrees), where `B` and `P` stands for a bun and a patty. The burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat? | ['def main():\n\n """ convenient functions\n # for i, a in enumerate(iterable)\n # q, mod = divmod(a, b)\n # divmod(x, y) returns the tuple (x//y, x%y)\n # Higher-order function: reduce(operator.mul, xyz_count, 1)\n # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f\n """\n\n """convenient decorator\n # @functools.lru_cache():\n # to facilitate use of recursive function\n # ex:\n # from functools import lru_cache\n # import sys\n # sys.setrecursionlimit(10**9)\n # @lru_cache(maxsize=None)\n # def fib(n):\n # if n < 2:\n # return n\n # return fib(n-1) + fib(n-2)\n # print(fib(1000))\n """\n \n # import numpy as np\n import sys\n sys.setrecursionlimit(10**7)\n from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html\n # accumulate() returns iterator! to get list: list(accumulate())\n from math import factorial, ceil, floor, sqrt\n def factorize(n):\n """return the factors of the Arg and count of each factor\n \n Args:\n n (long): number to be resolved into factors\n \n Returns:\n list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]\n """\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n def combinations_count(n, r):\n """Return the number of selecting r pieces of items from n kinds of items.\n \n Args:\n n (long): number\n r (long): number\n \n Raises:\n Exception: not defined when n or r is negative\n \n Returns:\n long: number\n """\n # TODO: How should I do when n - r is negative?\n if n < 0 or r < 0:\n raise Exception(\'combinations_count(n, r) not defined when n or r is negative\')\n if n - r < r: r = n - r\n if r < 0: return 0\n if r == 0: return 1\n if r == 1: return n\n numerator = [n - r + k + 1 for k in range(r)]\n denominator = [k + 1 for k in range(r)]\n for p in range(2,r+1):\n pivot = denominator[p - 1]\n if pivot > 1:\n offset = (n - r) % p\n for k in range(p-1,r,p):\n numerator[k - offset] /= pivot\n denominator[k] /= pivot\n result = 1\n for k in range(r):\n if numerator[k] > 1:\n result *= int(numerator[k])\n return result\n def combinations_with_replacement_count(n, r):\n """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.\n \n Args:\n n (long): number\n r (long): number\n \n Raises:\n Exception: not defined when n or r is negative\n \n Returns:\n long: number\n """\n if n < 0 or r < 0:\n raise Exception(\'combinations_with_replacement_count(n, r) not defined when n or r is negative\')\n elif n == 0:\n return 1\n else:\n return combinations_count(n + r - 1, r)\n from bisect import bisect_left, bisect_right\n from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque\n from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html\n from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html\n import operator\n from operator import itemgetter #sort \n # ex1: List.sort(key=itemgetter(1))\n # ex2: sorted(tuples, key=itemgetter(1,2))\n from functools import reduce, lru_cache\n def chmin(x, y):\n """change minimum\n if x > y, x = y and return (x, True).\n convenient when solving problems of dp[i]\n \n Args:\n x (long): current minimum value\n y (long): potential minimum value\n \n Returns:\n (x, bool): (x, True) when updated, else (x, False)\n """\n if x > y:\n x = y\n return (x, True)\n else:\n return (x, False)\n def chmax(x, y):\n """change maximum\n if x < y, x = y and return (x, True).\n convenient when solving problems of dp[i]\n \n Args:\n x (long): current maximum value\n y (long): potential maximum value\n \n Returns:\n (x, bool): (x, True) when updated, else (x, False)\n """\n if x < y:\n x = y\n return (x, True)\n else:\n return (x, False)\n\n from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.\n def gcds(numbers):\n return reduce(gcd, numbers)\n def lcm(x, y):\n return (x * y) // gcd(x, y)\n def lcms(numbers):\n return reduce(lcm, numbers, 1)\n\n # first create factorial_list\n # fac_list = mod_factorial_list(n)\n INF = 10 ** 18\n MOD = 10 ** 9 + 7\n modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!\n def modinv(a, p = MOD):\n # evaluate reciprocal using Fermat\'s little theorem:\n # a**(p-1) is identical to 1 (mod p) when a and p is coprime\n return modpow(a, p-2, p)\n def modinv_list(n, p = MOD):\n if n <= 1:\n return [0,1][:n+1]\n else:\n inv_t = [0,1]\n for i in range(2, n+1):\n inv_t += [inv_t[p % i] * (p - int(p / i)) % p]\n return inv_t\n def modfactorial_list(n, p = MOD):\n if n == 0:\n return [1]\n else:\n l = [0] * (n+1)\n tmp = 1\n for i in range(1, n+1):\n tmp = tmp * i % p\n l[i] = tmp\n return l\n def modcomb(n, k, fac_list = [], p = MOD):\n # fac_list = modfactorial_list(100)\n # print(modcomb(100, 5, modfactorial_list(100)))\n from math import factorial\n if n < 0 or k < 0 or n < k: return 0\n if n == 0 or k == 0: return 1\n if len(fac_list) <= n:\n a = factorial(n) % p\n b = factorial(k) % p\n c = factorial(n-k) % p\n else:\n a = fac_list[n]\n b = fac_list[k]\n c = fac_list[n-k]\n return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p\n def modadd(a, b, p = MOD):\n return (a + b) % MOD\n def modsub(a, b, p = MOD):\n return (a - b) % p\n def modmul(a, b, p = MOD):\n return ((a % p) * (b % p)) % p\n def moddiv(a, b, p = MOD):\n return modmul(a, modpow(b, p-2, p))\n\n class UnionFindTree:\n """union find tree class\n TODO: fix this description...\n how to use (example):\n >> uf = UnionFindTree(N) \n >> if uf.find_root(a) == uf.find_root(b):\n >> do something\n >> else:\n >> do something\n >> uf.unite(a, b)\n """\n def __init__(self, N):\n self.root = [-1] * (N+1)\n self.rank = [0] * (N+1)\n self.connected_num = [1] * (N+1)\n \n def find_root(self,x):\n root = self.root\n while root[x] != -1:\n x = root[x]\n return x\n \n def unite(self,x,y):\n root = self.root\n rank = self.rank\n connected_num = self.connected_num\n find_root = self.find_root\n \n rx = find_root(x)\n ry = find_root(y)\n if rx != ry:\n if rank[rx] < rank[ry]:\n root[rx] = ry\n rx,ry = ry,rx\n else:\n if rank[rx] == rank[ry]:\n rank[rx] += 1\n root[ry] = rx \n connected_num[rx] += connected_num[ry]\n\n """ initialize variables and set inputs\n # initialize variables\n # to initialize list, use [0] * n\n # to initialize two dimentional array, use [[0] * N for _ in range(N)]\n # set inputs\n # put inputs between specific values (almost as quickly)\n # ex) S = [-INF] + [int(r()) for _ in range(A)] + [INF]\n # open(0).read() is sometimes useful:\n # ex) n, m, *x = map(int, open(0).read().split())\n # min(x[::2]) - max(x[1::2])\n # ex2) *x, = map(int, open(0).read().split())\n # don\'t forget to add comma after *x if only one variable is used\n # preprocessing\n # transpose = [x for x in zip(*data)]\n # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]\n # flat = [flatten for inner in data for flatten in inner]\n # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]\n # calculate and output\n # output pattern\n # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6\n """\n\n # functions used\n r = lambda: sys.stdin.readline().strip()\n r_int = lambda: int(r())\n R = lambda: list(map(int, r().split()))\n Rmap = lambda: map(int, r().split())\n Rfloat = lambda: list(map(float, r().split()))\n Rtuple = lambda: tuple(map(int, r().split()))\n\n """ how to treat input\n # single int: int(r())\n # single string: r()\n # single float: float(r())\n # line int: R()\n # line string: r().split()\n # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]\n # lines int: [R() for _ in range(n)]\n """\n\n if __name__ != \'__main__\':\n # for test\n sys.stdin = open(\'sample.txt\')\n \n # ----------------------------------\n # main\n\n N, X = R()\n @lru_cache(maxsize=None)\n def burger(l):\n if l == 0:\n return \'P\'\n else:\n return \'B\' + burger(l-1) + \'P\' + burger(l-1) + \'B\'\n print(burger(N)[-X:].count(\'P\'))\n # end of main\n # ----------------------------------\n\n """memo: how to use defaultdict of list\n # initialize\n Dic = defaultdict(list)\n # append / extend\n Dic[x].append(y)\n # three methods for loop: keys(), values(), items()\n for k, v in Dic.items():\n """\n \n """memo: how to solve binary problems\n # to make binary digits text\n >>> a = 5\n >>> bin_str_a = format(a, \'#06b\')\n >>> print(bin_str_a)\n 0b0101 # first 2 strings (=\'0b\') indicates it is binary\n """\n \n """memo: how to solve the problem\n creating simple test/answer\n greed\n simple dp\n graph\n """\n\nif __name__ == \'__main__\':\n main()', 'N, X = map(int, input().split())\na, p = [1], [1]\nfor i in range(N):\n\ta.append(a[i] * 2 + 3)\n\tp.append(p[i] * 2 + 1)\n\ndef f(N, X): \n if N == 0:\n return 0 if X = 0 else 1\n elif X <= 1 + a[N-1]:\n return f(N-1, X-1)\n else:\n return p[N-1] + 1 + f(N-1, X-2-a[N-1])\nprint(f(N, X))\n', 'def main():\n\n """ convenient functions\n # for i, a in enumerate(iterable)\n # q, mod = divmod(a, b)\n # divmod(x, y) returns the tuple (x//y, x%y)\n # Higher-order function: reduce(operator.mul, xyz_count, 1)\n # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f\n """\n\n """convenient decorator\n # @functools.lru_cache():\n # to facilitate use of recursive function\n # ex:\n # from functools import lru_cache\n # import sys\n # sys.setrecursionlimit(10**9)\n # @lru_cache(maxsize=None)\n # def fib(n):\n # if n < 2:\n # return n\n # return fib(n-1) + fib(n-2)\n # print(fib(1000))\n """\n \n # import numpy as np\n import sys\n sys.setrecursionlimit(10**7)\n from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html\n # accumulate() returns iterator! to get list: list(accumulate())\n from math import factorial, ceil, floor, sqrt\n def factorize(n):\n """return the factors of the Arg and count of each factor\n \n Args:\n n (long): number to be resolved into factors\n \n Returns:\n list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]\n """\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n def combinations_count(n, r):\n """Return the number of selecting r pieces of items from n kinds of items.\n \n Args:\n n (long): number\n r (long): number\n \n Raises:\n Exception: not defined when n or r is negative\n \n Returns:\n long: number\n """\n # TODO: How should I do when n - r is negative?\n if n < 0 or r < 0:\n raise Exception(\'combinations_count(n, r) not defined when n or r is negative\')\n if n - r < r: r = n - r\n if r < 0: return 0\n if r == 0: return 1\n if r == 1: return n\n numerator = [n - r + k + 1 for k in range(r)]\n denominator = [k + 1 for k in range(r)]\n for p in range(2,r+1):\n pivot = denominator[p - 1]\n if pivot > 1:\n offset = (n - r) % p\n for k in range(p-1,r,p):\n numerator[k - offset] /= pivot\n denominator[k] /= pivot\n result = 1\n for k in range(r):\n if numerator[k] > 1:\n result *= int(numerator[k])\n return result\n def combinations_with_replacement_count(n, r):\n """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.\n \n Args:\n n (long): number\n r (long): number\n \n Raises:\n Exception: not defined when n or r is negative\n \n Returns:\n long: number\n """\n if n < 0 or r < 0:\n raise Exception(\'combinations_with_replacement_count(n, r) not defined when n or r is negative\')\n elif n == 0:\n return 1\n else:\n return combinations_count(n + r - 1, r)\n from bisect import bisect_left, bisect_right\n from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque\n from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html\n from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html\n import operator\n from operator import itemgetter #sort \n # ex1: List.sort(key=itemgetter(1))\n # ex2: sorted(tuples, key=itemgetter(1,2))\n from functools import reduce, lru_cache\n def chmin(x, y):\n """change minimum\n if x > y, x = y and return (x, True).\n convenient when solving problems of dp[i]\n \n Args:\n x (long): current minimum value\n y (long): potential minimum value\n \n Returns:\n (x, bool): (x, True) when updated, else (x, False)\n """\n if x > y:\n x = y\n return (x, True)\n else:\n return (x, False)\n def chmax(x, y):\n """change maximum\n if x < y, x = y and return (x, True).\n convenient when solving problems of dp[i]\n \n Args:\n x (long): current maximum value\n y (long): potential maximum value\n \n Returns:\n (x, bool): (x, True) when updated, else (x, False)\n """\n if x < y:\n x = y\n return (x, True)\n else:\n return (x, False)\n\n from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.\n def gcds(numbers):\n return reduce(gcd, numbers)\n def lcm(x, y):\n return (x * y) // gcd(x, y)\n def lcms(numbers):\n return reduce(lcm, numbers, 1)\n\n # first create factorial_list\n # fac_list = mod_factorial_list(n)\n INF = 10 ** 18\n MOD = 10 ** 9 + 7\n modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!\n def modinv(a, p = MOD):\n # evaluate reciprocal using Fermat\'s little theorem:\n # a**(p-1) is identical to 1 (mod p) when a and p is coprime\n return modpow(a, p-2, p)\n def modinv_list(n, p = MOD):\n if n <= 1:\n return [0,1][:n+1]\n else:\n inv_t = [0,1]\n for i in range(2, n+1):\n inv_t += [inv_t[p % i] * (p - int(p / i)) % p]\n return inv_t\n def modfactorial_list(n, p = MOD):\n if n == 0:\n return [1]\n else:\n l = [0] * (n+1)\n tmp = 1\n for i in range(1, n+1):\n tmp = tmp * i % p\n l[i] = tmp\n return l\n def modcomb(n, k, fac_list = [], p = MOD):\n # fac_list = modfactorial_list(100)\n # print(modcomb(100, 5, modfactorial_list(100)))\n from math import factorial\n if n < 0 or k < 0 or n < k: return 0\n if n == 0 or k == 0: return 1\n if len(fac_list) <= n:\n a = factorial(n) % p\n b = factorial(k) % p\n c = factorial(n-k) % p\n else:\n a = fac_list[n]\n b = fac_list[k]\n c = fac_list[n-k]\n return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p\n def modadd(a, b, p = MOD):\n return (a + b) % MOD\n def modsub(a, b, p = MOD):\n return (a - b) % p\n def modmul(a, b, p = MOD):\n return ((a % p) * (b % p)) % p\n def moddiv(a, b, p = MOD):\n return modmul(a, modpow(b, p-2, p))\n\n class UnionFindTree:\n """union find tree class\n TODO: fix this description...\n how to use (example):\n >> uf = UnionFindTree(N) \n >> if uf.find_root(a) == uf.find_root(b):\n >> do something\n >> else:\n >> do something\n >> uf.unite(a, b)\n """\n def __init__(self, N):\n self.root = [-1] * (N+1)\n self.rank = [0] * (N+1)\n self.connected_num = [1] * (N+1)\n \n def find_root(self,x):\n root = self.root\n while root[x] != -1:\n x = root[x]\n return x\n \n def unite(self,x,y):\n root = self.root\n rank = self.rank\n connected_num = self.connected_num\n find_root = self.find_root\n \n rx = find_root(x)\n ry = find_root(y)\n if rx != ry:\n if rank[rx] < rank[ry]:\n root[rx] = ry\n rx,ry = ry,rx\n else:\n if rank[rx] == rank[ry]:\n rank[rx] += 1\n root[ry] = rx \n connected_num[rx] += connected_num[ry]\n\n """ initialize variables and set inputs\n # initialize variables\n # to initialize list, use [0] * n\n # to initialize two dimentional array, use [[0] * N for _ in range(N)]\n # set inputs\n # put inputs between specific values (almost as quickly)\n # ex) S = [-INF] + [int(r()) for _ in range(A)] + [INF]\n # open(0).read() is sometimes useful:\n # ex) n, m, *x = map(int, open(0).read().split())\n # min(x[::2]) - max(x[1::2])\n # ex2) *x, = map(int, open(0).read().split())\n # don\'t forget to add comma after *x if only one variable is used\n # preprocessing\n # transpose = [x for x in zip(*data)]\n # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]\n # flat = [flatten for inner in data for flatten in inner]\n # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]\n # calculate and output\n # output pattern\n # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6\n """\n\n # functions used\n r = lambda: sys.stdin.readline().strip()\n r_int = lambda: int(r())\n R = lambda: list(map(int, r().split()))\n Rmap = lambda: map(int, r().split())\n Rfloat = lambda: list(map(float, r().split()))\n Rtuple = lambda: tuple(map(int, r().split()))\n\n """ how to treat input\n # single int: int(r())\n # single string: r()\n # single float: float(r())\n # line int: R()\n # line string: r().split()\n # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]\n # lines int: [R() for _ in range(n)]\n """\n\n if __name__ != \'__main__\':\n # for test\n sys.stdin = open(\'sample.txt\')\n \n # ----------------------------------\n # main\n\n N, X = R()\n """\n A_n = 2A_(n-1) + 3, A_0 = 1\n B_n = 2B_n-1 + 1, B_0 = 0\n """\n A = [1] * 50\n B = [1] * 50\n for i in range(1, 50):\n A[i] = 2 * A[i-1] + 3\n for i in range(1, 50):\n B[i] = 2 * B[i-1] + 1\n \n @lru_cache(maxsize=None)\n def burg(l, x):\n if x == 1:\n if l == 0:\n return 1\n return 0\n elif x <= 1 + A[l-1]:\n return 0 + burg(l-1, x-1)\n elif x == 2 + A[l-1]:\n return 1 + B[l-1]\n elif x <= 2 + 2*A[l-1]:\n return 1 + B[l-1] + burg(l-1, x-2-A[l-1])\n else:\n return B[l]\n \n # print(N, i, \':\',burg(N, i))\n print(burg(N, X))\n \n \n # if l == 0:\n # return \'P\'\n # else:\n # return \'B\' + burger(l-1) + \'P\' + burger(l-1) + \'B\'\n # print(burger(3))\n \n # end of main\n # ----------------------------------\n\n """memo: how to use defaultdict of list\n # initialize\n Dic = defaultdict(list)\n # append / extend\n Dic[x].append(y)\n # three methods for loop: keys(), values(), items()\n for k, v in Dic.items():\n """\n \n """memo: how to solve binary problems\n # to make binary digits text\n >>> a = 5\n >>> bin_str_a = format(a, \'#06b\')\n >>> print(bin_str_a)\n 0b0101 # first 2 strings (=\'0b\') indicates it is binary\n """\n \n """memo: how to solve the problem\n creating simple test/answer\n greed\n simple dp\n graph\n """\n\nif __name__ == \'__main__\':\n main()', 'def main():\n\n """ convenient functions\n # for i, a in enumerate(iterable)\n # q, mod = divmod(a, b)\n # divmod(x, y) returns the tuple (x//y, x%y)\n # Higher-order function: reduce(operator.mul, xyz_count, 1)\n # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f\n """\n\n """convenient decorator\n # @functools.lru_cache():\n # to facilitate use of recursive function\n # ex:\n # from functools import lru_cache\n # import sys\n # sys.setrecursionlimit(10**9)\n # @lru_cache(maxsize=None)\n # def fib(n):\n # if n < 2:\n # return n\n # return fib(n-1) + fib(n-2)\n # print(fib(1000))\n """\n \n # import numpy as np\n import sys\n sys.setrecursionlimit(10**7)\n from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html\n # accumulate() returns iterator! to get list: list(accumulate())\n from math import factorial, ceil, floor, sqrt\n def factorize(n):\n """return the factors of the Arg and count of each factor\n \n Args:\n n (long): number to be resolved into factors\n \n Returns:\n list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]\n """\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n def combinations_count(n, r):\n """Return the number of selecting r pieces of items from n kinds of items.\n \n Args:\n n (long): number\n r (long): number\n \n Raises:\n Exception: not defined when n or r is negative\n \n Returns:\n long: number\n """\n # TODO: How should I do when n - r is negative?\n if n < 0 or r < 0:\n raise Exception(\'combinations_count(n, r) not defined when n or r is negative\')\n if n - r < r: r = n - r\n if r < 0: return 0\n if r == 0: return 1\n if r == 1: return n\n numerator = [n - r + k + 1 for k in range(r)]\n denominator = [k + 1 for k in range(r)]\n for p in range(2,r+1):\n pivot = denominator[p - 1]\n if pivot > 1:\n offset = (n - r) % p\n for k in range(p-1,r,p):\n numerator[k - offset] /= pivot\n denominator[k] /= pivot\n result = 1\n for k in range(r):\n if numerator[k] > 1:\n result *= int(numerator[k])\n return result\n def combinations_with_replacement_count(n, r):\n """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.\n \n Args:\n n (long): number\n r (long): number\n \n Raises:\n Exception: not defined when n or r is negative\n \n Returns:\n long: number\n """\n if n < 0 or r < 0:\n raise Exception(\'combinations_with_replacement_count(n, r) not defined when n or r is negative\')\n elif n == 0:\n return 1\n else:\n return combinations_count(n + r - 1, r)\n from bisect import bisect_left, bisect_right\n from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque\n from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html\n from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html\n import operator\n from operator import itemgetter #sort \n # ex1: List.sort(key=itemgetter(1))\n # ex2: sorted(tuples, key=itemgetter(1,2))\n from functools import reduce, lru_cache\n def chmin(x, y):\n """change minimum\n if x > y, x = y and return (x, True).\n convenient when solving problems of dp[i]\n \n Args:\n x (long): current minimum value\n y (long): potential minimum value\n \n Returns:\n (x, bool): (x, True) when updated, else (x, False)\n """\n if x > y:\n x = y\n return (x, True)\n else:\n return (x, False)\n def chmax(x, y):\n """change maximum\n if x < y, x = y and return (x, True).\n convenient when solving problems of dp[i]\n \n Args:\n x (long): current maximum value\n y (long): potential maximum value\n \n Returns:\n (x, bool): (x, True) when updated, else (x, False)\n """\n if x < y:\n x = y\n return (x, True)\n else:\n return (x, False)\n\n from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.\n def gcds(numbers):\n return reduce(gcd, numbers)\n def lcm(x, y):\n return (x * y) // gcd(x, y)\n def lcms(numbers):\n return reduce(lcm, numbers, 1)\n\n # first create factorial_list\n # fac_list = mod_factorial_list(n)\n INF = 10 ** 18\n MOD = 10 ** 9 + 7\n modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!\n def modinv(a, p = MOD):\n # evaluate reciprocal using Fermat\'s little theorem:\n # a**(p-1) is identical to 1 (mod p) when a and p is coprime\n return modpow(a, p-2, p)\n def modinv_list(n, p = MOD):\n if n <= 1:\n return [0,1][:n+1]\n else:\n inv_t = [0,1]\n for i in range(2, n+1):\n inv_t += [inv_t[p % i] * (p - int(p / i)) % p]\n return inv_t\n def modfactorial_list(n, p = MOD):\n if n == 0:\n return [1]\n else:\n l = [0] * (n+1)\n tmp = 1\n for i in range(1, n+1):\n tmp = tmp * i % p\n l[i] = tmp\n return l\n def modcomb(n, k, fac_list = [], p = MOD):\n # fac_list = modfactorial_list(100)\n # print(modcomb(100, 5, modfactorial_list(100)))\n from math import factorial\n if n < 0 or k < 0 or n < k: return 0\n if n == 0 or k == 0: return 1\n if len(fac_list) <= n:\n a = factorial(n) % p\n b = factorial(k) % p\n c = factorial(n-k) % p\n else:\n a = fac_list[n]\n b = fac_list[k]\n c = fac_list[n-k]\n return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p\n def modadd(a, b, p = MOD):\n return (a + b) % MOD\n def modsub(a, b, p = MOD):\n return (a - b) % p\n def modmul(a, b, p = MOD):\n return ((a % p) * (b % p)) % p\n def moddiv(a, b, p = MOD):\n return modmul(a, modpow(b, p-2, p))\n\n class UnionFindTree:\n """union find tree class\n TODO: fix this description...\n how to use (example):\n >> uf = UnionFindTree(N) \n >> if uf.find_root(a) == uf.find_root(b):\n >> do something\n >> else:\n >> do something\n >> uf.unite(a, b)\n """\n def __init__(self, N):\n self.root = [-1] * (N+1)\n self.rank = [0] * (N+1)\n self.connected_num = [1] * (N+1)\n \n def find_root(self,x):\n root = self.root\n while root[x] != -1:\n x = root[x]\n return x\n \n def unite(self,x,y):\n root = self.root\n rank = self.rank\n connected_num = self.connected_num\n find_root = self.find_root\n \n rx = find_root(x)\n ry = find_root(y)\n if rx != ry:\n if rank[rx] < rank[ry]:\n root[rx] = ry\n rx,ry = ry,rx\n else:\n if rank[rx] == rank[ry]:\n rank[rx] += 1\n root[ry] = rx \n connected_num[rx] += connected_num[ry]\n\n """ initialize variables and set inputs\n # initialize variables\n # to initialize list, use [0] * n\n # to initialize two dimentional array, use [[0] * N for _ in range(N)]\n # set inputs\n # put inputs between specific values (almost as quickly)\n # ex) S = [-INF] + [int(r()) for _ in range(A)] + [INF]\n # open(0).read() is sometimes useful:\n # ex) n, m, *x = map(int, open(0).read().split())\n # min(x[::2]) - max(x[1::2])\n # ex2) *x, = map(int, open(0).read().split())\n # don\'t forget to add comma after *x if only one variable is used\n # preprocessing\n # transpose = [x for x in zip(*data)]\n # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]\n # flat = [flatten for inner in data for flatten in inner]\n # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]\n # calculate and output\n # output pattern\n # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6\n """\n\n # functions used\n r = lambda: sys.stdin.readline().strip()\n r_int = lambda: int(r())\n R = lambda: list(map(int, r().split()))\n Rmap = lambda: map(int, r().split())\n Rfloat = lambda: list(map(float, r().split()))\n Rtuple = lambda: tuple(map(int, r().split()))\n\n """ how to treat input\n # single int: int(r())\n # single string: r()\n # single float: float(r())\n # line int: R()\n # line string: r().split()\n # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]\n # lines int: [R() for _ in range(n)]\n """\n\n if __name__ != \'__main__\':\n # for test\n sys.stdin = open(\'sample.txt\')\n \n # ----------------------------------\n # main\n\n N, X = R()\n """\n A_n = 2A_(n-1) + 3, A_0 = 1\n B_n = 2B_n-1 + 1, B_0 = 0\n """\n A = [1] * 50\n B = [0] * 50\n for i in range(1, 50):\n A[i] = 2 * A[i-1] + 3\n for i in range(1, 50):\n B[i] = 2 * B[i-1] + 1\n @lru_cache(maxsize=None)\n def burg(l, x):\n if x == 1:\n return 0\n elif x <= 1 + A[l-1]:\n return 0 + burg(l-1, x-1)\n elif x == 2 + A[l-1]:\n return 1 + B[l-1]\n elif x <= 2 + 2*A[l-1]:\n return 1 + B[l-1] + burg(l-1, x-2-A[l-1])\n else:\n return 1 + 2*B[l-1]\n print(2*burg(N, X))\n \n \n # if l == 0:\n # return \'P\'\n # else:\n # return \'B\' + burger(l-1) + \'P\' + burger(l-1) + \'B\'\n # print(burger(3))\n \n # end of main\n # ----------------------------------\n\n """memo: how to use defaultdict of list\n # initialize\n Dic = defaultdict(list)\n # append / extend\n Dic[x].append(y)\n # three methods for loop: keys(), values(), items()\n for k, v in Dic.items():\n """\n \n """memo: how to solve binary problems\n # to make binary digits text\n >>> a = 5\n >>> bin_str_a = format(a, \'#06b\')\n >>> print(bin_str_a)\n 0b0101 # first 2 strings (=\'0b\') indicates it is binary\n """\n \n """memo: how to solve the problem\n creating simple test/answer\n greed\n simple dp\n graph\n """\n\nif __name__ == \'__main__\':\n main()', 'N, X = map(int, input().split())\na, p = [1], [1]\nfor i in range(N):\n\ta.append(a[i] * 2 + 3)\n\tp.append(p[i] * 2 + 1)\n\ndef f(N, X): \n if N == 0:\n return 0 if X <= 0 else 1\n elif X <= 1 + a[N-1]:\n return f(N-1, X-1)\n else:\n return p[N-1] + 1 + f(N-1, X-2-a[N-1])\nprint(f(N, X))\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s006856318', 's183465679', 's358053113', 's930344045', 's224531985'] | [6320.0, 2940.0, 5368.0, 5316.0, 3064.0] | [1771.0, 18.0, 39.0, 39.0, 20.0] | [10863, 352, 11550, 11439, 353] |
p03210 | u003501233 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x=int(input())\nif x = 7 or x = 5 or x = 3:\n print("YES")\nelse:\n print("NO")', 'x=int(input())\nif x = 7 and x = 5 and x = 3:\n print("YES")\nelse:\n print("NO")', 'x=int(input())\nif x == 7 or x == 5 or x == 3:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s056756587', 's560974156', 's614566728'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [77, 79, 80] |
p03210 | u006721330 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['num = input()\nli = []\n\nfor i in range(len(num) - 2):\n li.append(abs(int(num[i]) * 100 + int(num[i+1]) * 10 + int(num[i+2]) - 753))\n\nprint(min(li))\n', 'num = int(input())\n\nif num == 3or num == 5 or num == 7:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s463877739', 's435960672'] | [2940.0, 2940.0] | [18.0, 18.0] | [148, 90] |
p03210 | u013756322 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['if (input() == \'3\') or (input() == \'5\') or (input() == \'7\'):\n print("YES")\nelse:\n print("NO")', 'if (input() == \'3\') or (input() == \'5\') or (input() == \'7\'):\n print("YES")\nelse:\n print("NO")n = input()\nif (n == \'3\') or (n == \'5\') or (n == \'7\'):\n print("YES")\nelse:\n print("NO")\n', 'n = input()\nif (n == \'3\') or (n == \'5\') or (n == \'7\'):\n print("YES")\nelse:\n print("NO")\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s039334024', 's996324262', 's529158672'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [95, 189, 94] |
p03210 | u014139588 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['print("YES" if input() == "3" or input() == "5" or input() == "7" else "NO") ', 'n = input()\nprint("YES" if n == "3" or n == "5" or n == "7" else "NO")'] | ['Runtime Error', 'Accepted'] | ['s208384169', 's846247914'] | [9008.0, 8896.0] | [26.0, 25.0] | [77, 70] |
p03210 | u023958502 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nif a == 3 or a == 5 or a == 7:\n print("YES")\nelse:\n print("NO")', 'x = int(input())\nif x == 3 or x == 5 or x == 7:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s246256398', 's599577957'] | [2940.0, 2940.0] | [17.0, 17.0] | [82, 82] |
p03210 | u025363805 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['a = int(input())\nif a == 3 or a == 5 or a == 7:\n print("Yes")\nelse:\n print("No")\n', 'a = input()\nif a == 3 or 5 or 7:\n print("Yes")\nelse:\n print("No")\n', 'a = int(input())\nif a == 3 or a == 5 or a == 7:\n print("YES")\nelse:\n print("NO")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s635905798', 's748809644', 's244291885'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [87, 72, 87] |
p03210 | u027675217 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nans ="NO"\nif 2<x<8 and x%2==1:\n ans ="YES"\nprint("ans")', 'x = int(input())\nans ="NO"\nif 2<x<8 and x%2==1:\n ans ="YES"\nprint("NO")\n', 'x = int(input())\nans ="NO"\nif 2<x<8 and x%2==1:\n ans ="YES"\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s137267079', 's950800965', 's117233402'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [75, 75, 73] |
p03210 | u029000441 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['import math\nimport collections\nimport sys\n\n#input = sys.stdin.readline\ndef I(): return int(input())\ndef MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\ndef LI2(): return [int(input()) for i in range(n)]\ndef MXI(): return [[LI()]for i in range(n)]\n\nx=I()\nif x==3 or x==5 or x==7:\n print("Yes")\nelse:\n print("No")', 'import math\nimport collections\nimport sys\n\n#input = sys.stdin.readline\ndef I(): return int(input())\ndef MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\ndef LI2(): return [int(input()) for i in range(n)]\ndef MXI(): return [[LI()]for i in range(n)]\n\nx=I()\nif x==3 or x==5 or x==7:\n print("Yes")\nelse:\n print("No")', 'x=int(input())\nif x==3 or x==5 or x==7:\n print("Yes")\nelse:\n print("No")', 'import math\nimport collections\nimport sys\n\n#input = sys.stdin.readline\ndef I(): return int(input())\ndef MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\ndef LI2(): return [int(input()) for i in range(n)]\ndef MXI(): return [[LI()]for i in range(n)]\n\nx=I()\nif x==3 or x==5 or x==7:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s340428389', 's472654949', 's812280475', 's172626923'] | [3316.0, 3316.0, 3064.0, 3316.0] | [21.0, 21.0, 18.0, 21.0] | [357, 357, 78, 357] |
p03210 | u031157253 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["print('YNeos'[input() not in '753'::2])", "print('YNEOS'[input() not in '753'::2])"] | ['Wrong Answer', 'Accepted'] | ['s440813245', 's785159521'] | [2940.0, 3064.0] | [17.0, 19.0] | [39, 39] |
p03210 | u032310798 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['X=int(input())\nSichiGoSan=[3,5,7]\nif X in SichiGoSan:\n print("yes")\nelse:\n print("no")', 'X=int(input())\nSichiGoSan=[3,5,7]\nif X in SichiGoSan:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s590469630', 's384648166'] | [3064.0, 2940.0] | [19.0, 18.0] | [94, 94] |
p03210 | u033627628 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['print("Yes" if input() in "753" else "No")', 'print("YES" if input() in "753" else "NO")'] | ['Wrong Answer', 'Accepted'] | ['s276920477', 's330694883'] | [2940.0, 2940.0] | [17.0, 17.0] | [42, 42] |
p03210 | u038676814 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nif x == 7 or x == 5 or x == 3 :\n print("Yes")\nelse :\n print("No")\n', 'x = int(input())\nif x == 7 or x == 5 or x == 3 :\n print("YES")\nelse :\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s709840687', 's748374210'] | [2940.0, 2940.0] | [17.0, 17.0] | [89, 88] |
p03210 | u039623862 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x=int(input())\nprint('YES' if x in [3,5,7] 'NO')", "print('YES' if int(input()) in [3,5,7] else 'NO']", "x=int(input())\nprint('YES' if x in [3,5,7] else 'NO')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s749951439', 's987322082', 's967466197'] | [2940.0, 2940.0, 2940.0] | [18.0, 18.0, 18.0] | [48, 49, 53] |
p03210 | u043074390 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nif x = 3 oe x = 5 or x= 7:\n print("YES")\nelse:\n print("NO")', 'x = int(input())\nif x == 3 or x == 5 or x == 7:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s838898085', 's025571683'] | [2940.0, 2940.0] | [17.0, 18.0] | [78, 82] |
p03210 | u045408189 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x=input()\nList=['3','5','7']\nif x in List:\n print('Yes')\nelse:\n print('No')", "x=input()\nList=['3','5','7']\nif x in List:\n print('YES')\nelse:\n print('NO')\n"] | ['Wrong Answer', 'Accepted'] | ['s244593816', 's696288219'] | [2940.0, 2940.0] | [17.0, 17.0] | [77, 78] |
p03210 | u046313635 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = input()\nif "753" in x:\n print("Yes")\nelse:\n print("No")', 'x = input()\nprint("YES" if "753" in x else "NO")', 'x = input()\nif x in "753":\n print("Yes")\nelse:\n print("No")', 'x = int(input())\nif "7" or "5" or "3" in x:\n print("Yes")\nelse:\n print("No")', 'x = input()\nprint("YES" if x in "753" else "NO")'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s172213867', 's253246585', 's305521495', 's475971293', 's607891841'] | [3188.0, 2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0, 18.0, 19.0] | [61, 48, 61, 78, 48] |
p03210 | u047023156 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x = input()\n\nif x == 3 or x == 5 or x == 7:\n print('Yes')\nelse:\n print('No')", "x = int(input())\n\nif x == 3 or x == 5 or x == 7:\n print('Yes')\nelse:\n print('No')", "x = int(input())\n\nif x == 3 or x == 5 or x == 7:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s453591137', 's958565148', 's606536663'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [82, 87, 87] |
p03210 | u050708958 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["print('Yes' if input() in '753' else 'No')", "print('YES' if input() in '753' else 'NO')"] | ['Wrong Answer', 'Accepted'] | ['s258961560', 's280104893'] | [2940.0, 2940.0] | [17.0, 17.0] | [42, 42] |
p03210 | u053003310 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["n=int(input())\nif n%7==0 or n%5==0 or n%3==0:\n\tptint('YES')\nelse:\n\tprint('NO')", "n = int(input())\n\nif n == 7 or n == 5 or n == 3:\n print('YES')\n\nelse\n print('NO')", "n = int(input())\n\nif n == 7 or n == 5 or n == 3:\n print('YES')\n\nelse:\n print('NO')\n "] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s646323391', 's891555571', 's480294078'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [78, 87, 97] |
p03210 | u056599756 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['n=input()\n\nif "9" in n:\n print("Yes")\nelse:\n print("No")', 'x=input()\n\nprint("YES" if x in "357" else "NO")'] | ['Wrong Answer', 'Accepted'] | ['s457492915', 's225528102'] | [2940.0, 2940.0] | [17.0, 17.0] | [62, 47] |
p03210 | u057429331 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['ソースコード \n\nCopy\nCopy\nX=int(input())\nif X==3 or X==5 or X==7:\n print("YES")\nelse:\n print("NO")', 'X=int(input())\nif X==3 or x==5 or X==7:\n \tprint("YES")\nelse:\n print("NO")', 'X=int(input())\nif X==3 or x==5 or X==7:\n print("YES")\nelse:\n print("NO")', 'X=int(input())\nif X==3 or X==5 or X==7:\n print("YES")\nelse:\n print("NO")\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s575275883', 's636112794', 's897436849', 's442540038'] | [3320.0, 2940.0, 2940.0, 2940.0] | [21.0, 18.0, 20.0, 18.0] | [105, 75, 74, 75] |
p03210 | u059684735 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x = int(input())\nprint('Yes' if x in [7, 5, 3] else 'No')", "x = int(input())\nprint('YES' if x in [7, 5, 3] else 'NO')"] | ['Wrong Answer', 'Accepted'] | ['s005975790', 's439548697'] | [2940.0, 2940.0] | [17.0, 17.0] | [57, 57] |
p03210 | u063052907 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['# coding: utf-8\nprint("YES" if input()==("3" or "5" or "7") else "NO")', '# coding: utf-8\nprint("YES" if input()==(3 or 5 or 7) else "NO")', '# coding: utf-8\nprint("YES" if input() in "357" else "NO")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s454425935', 's839741634', 's771921956'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [70, 64, 59] |
p03210 | u066455063 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['def number(X):\n if int(X) == 7 or int(X) == 5 or int(X) == 3 and 1 < X < 9:\n print("YES")\n else:\n print("NO")', 'def number(X):\n if X == 7 or X == 5 or X == 3:\n return "YES"\n else:\n return "NO"', 'def number(X):\n if X == 7 or X == 5 or X == 3:\n print("YES")\n else:\n print("NO")', 'def number(x):\n if x == 7 or x == 5 or x == 3:\n print("YES")\n else:\n print("NO")', 'num = 7, 5, 3\nif int(input()) in num:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s173931183', 's394117866', 's694310432', 's826444661', 's310636417'] | [2940.0, 2940.0, 2940.0, 3064.0, 2940.0] | [18.0, 17.0, 17.0, 17.0, 17.0] | [129, 100, 100, 100, 76] |
p03210 | u072472435 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['age = int(input())\nshichigosanAges = {3, 5, 7}\nprint(age in shichigosanAges ? "YES" : "NO")', 'age = int(input())\nshichigosanAges = {3, 5, 7}\nprint("YES" if age in shichigosanAges else "NO")'] | ['Runtime Error', 'Accepted'] | ['s771813376', 's007349310'] | [2940.0, 2940.0] | [17.0, 17.0] | [91, 95] |
p03210 | u077816564 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["a=int(input())\nprint(['No','Yes'][a == 7 or a==5 or a==3])", "a=int(input())\nprint(['NO','YES'][a == 7 or a==5 or a==3])"] | ['Wrong Answer', 'Accepted'] | ['s418429570', 's804839333'] | [9016.0, 9120.0] | [27.0, 26.0] | [58, 58] |
p03210 | u077898957 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x=int(input())\nprint('Yes' if x in (3,5,7) else 'No')\n", "x=int(input())\nprint('YES' if x in (3,5,7) else 'NO')\n"] | ['Wrong Answer', 'Accepted'] | ['s750446538', 's733519520'] | [2940.0, 2940.0] | [17.0, 17.0] | [54, 54] |
p03210 | u078349616 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['S = int(input())\nif S == 7 or S == 5 or S == 3:\n print("Yes")\nelse:\n print("No")', 'S = int(input())\nif S == 7 or S == 5 or S == 3:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s066366295', 's147513523'] | [2940.0, 2940.0] | [17.0, 17.0] | [82, 82] |
p03210 | u083960235 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['n=int(input(()))\nif(n==7 or n==5 or n==3):\n print("YES")\nelse:\n print("NO")', 'n=int(input(()))\nif(n==7 or n==5 or n==3):\n print("YES")\nelse:\n print("NO")', 'n=int(input())\nif(n==7 or n==5 or n==3):\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s463707549', 's739451832', 's802432803'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 18.0] | [81, 81, 79] |
p03210 | u084662422 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['X = int(input())\n\nif X\u3000== 3, 5, 7:\n print("YES")\nelse:\n print("NO")', 'X = int(input())\n\nif X == 3:\n print("YES")\nelif X == 5:\n print("YES")\nelif X == 7:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s555852874', 's092611974'] | [3064.0, 2940.0] | [19.0, 18.0] | [71, 119] |
p03210 | u085530099 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x = int(input())\nif x == 3 or x == 5 or x == 7:\n print('Yes')\nelse:\n print('No')", "x = int(input())\nif x == 3 or x == 5 or x == 7:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s952505563', 's890208036'] | [2940.0, 2940.0] | [17.0, 17.0] | [82, 82] |
p03210 | u088020258 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["X=int(input())\nif X==7:\n print('YES')\nif X==5:\n print('YES')\nif X==3:\n print('YES')\nelse:\n print('NO')", "X=int(input())\nif X==7:\n print('YES')\nelif X==5:\n print('YES')\nelif X==3:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s503282612', 's942236007'] | [2940.0, 2940.0] | [17.0, 19.0] | [106, 110] |
p03210 | u089668660 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['k = int(input())\n\nif k%105== 0: \n print("YES")\nelse:\n print("NO")', 'k = int(input())\n\nif 105%k== 0 and k!=1: \n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s355122253', 's244413537'] | [2940.0, 2940.0] | [17.0, 17.0] | [67, 76] |
p03210 | u093033848 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['S = input()\nmin = 5000\nfor i in range(len(S) - 2):\n diff = abs(int(S[i:i+3]) - 753)\n if diff < min:\n min = diff\n\nprint(min)', "X = int(input())\nif X == 7 or X == 5 or X == 3:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s466497830', 's058314270'] | [2940.0, 2940.0] | [17.0, 18.0] | [136, 86] |
p03210 | u096359533 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["X = int(input())\nif X==3 or X==5 or X==7:\n print('Yes')\nelse:\n print('No')", "X = int(input())\nif X==3 or X==5 or X==7:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s824162487', 's882158641'] | [2940.0, 2940.0] | [18.0, 17.0] | [80, 80] |
p03210 | u097148635 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['X=input()\nif X==("3" or "5" or "7"):\n print("YES\\n")\nelse:\n print("NO\\n")\n', 'X=input()\nif X==("3" or "5" or "7"):\n print("YES")\nelse:\n print("NO")', 'X=input()\nif X=="3" or X=="5" or X=="7":\n print("YES")\nelse:\n print("NO")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s040345763', 's235399452', 's026161658'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 18.0] | [80, 75, 80] |
p03210 | u099059563 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["n=input()\nn=int(n)\n\nif n=3 or 5 or 7:\n print('YES')\n \nelse:\n print('NO')", "n=input()\nn=int(n)\n\nif n==3 or n==5 or n==7:\n print('YES')\n \nelse:\n print('NO')\n"] | ['Runtime Error', 'Accepted'] | ['s248146166', 's340560571'] | [2940.0, 2940.0] | [17.0, 17.0] | [75, 83] |
p03210 | u103902792 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["y = input()\nprint(y in ['7','5','3'])", "y = input()\nif y in ['7','5','3']:\n print('YES')\nelse:\n print('NO')\n"] | ['Wrong Answer', 'Accepted'] | ['s533247727', 's829053266'] | [2940.0, 2940.0] | [17.0, 17.0] | [37, 70] |
p03210 | u106181248 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(imput())\n\nif x == 7 or x == 5 or x == 3:\n print("YES")\nelse:\n print("NO")', 'x = int(input())\n \nif x == 7 or x == 5 or x == 3:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s958413454', 's415602543'] | [2940.0, 2940.0] | [17.0, 17.0] | [83, 84] |
p03210 | u107091170 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x=int(input())\nif x == 3 or x == 5 x == 7:\n print("YES")\nelse:\n print("NO")\n ', 'x=int(input())\nif x == 3 or x == 5 or x == 7:\n print("YES")\nelse:\n print("NO")\n'] | ['Runtime Error', 'Accepted'] | ['s739912938', 's193838871'] | [2940.0, 2940.0] | [17.0, 17.0] | [80, 81] |
p03210 | u110580875 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x=int(input())\nif x==7 or x==5 or x==3:\n print("Yes")\nelse:\n print("No")', 'x=int(input())\nif x==7 or x==5 or x==3:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s978786104', 's375850490'] | [2940.0, 2940.0] | [17.0, 18.0] | [74, 74] |
p03210 | u110943895 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['n = input()\nprint("YES" if "753" in n else "NO")', 'y = input()\nprint("YES" if y in "753" else "NO")'] | ['Wrong Answer', 'Accepted'] | ['s537915802', 's959509410'] | [2940.0, 2940.0] | [17.0, 17.0] | [48, 48] |
p03210 | u116233709 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x=int(input())\nli=[3,5,7]\nif x in li:\n print("Yes")\nelse:\n print("No")', 'x=int(input())\nli=[3,5,7]\nif x in li:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s744692476', 's968814492'] | [2940.0, 2940.0] | [17.0, 17.0] | [72, 72] |
p03210 | u117193815 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nif x==7 or x==5 or x==3:\n print("yes")\nelse:\n print("no")', 'x = int(input())\nif x==7 or x==5 or x==3:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s856835053', 's679056731'] | [2940.0, 2940.0] | [17.0, 19.0] | [76, 76] |
p03210 | u119655368 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['def sft(n, num, add):\n int_sft = int(num+add)\n if int_sft > n:\n return True\n else:\n l.append(int_sft)\n sft(n, num+add, "3")\n sft(n, num+add, "5")\n sft(n, num+add, "7")\n\nn = int(input())\nsft(n, "", "3")\nsft(n, "", "5")\nsft(n, "", "7")\nle = []\nfor i in range(len(l)):\n c3 = str(l[i]).count("3")\n c5 = str(l[i]).count("5")\n c7 = str(l[i]).count("7")\n if c3 > 0 and c5 > 0 and c7 > 0:\n le.append(l[i])\nprint(len(list(set(le))))', 'n = int(input())\nif n == 7 or n == 5 or n == 3:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s170974176', 's301346399'] | [3064.0, 2940.0] | [17.0, 17.0] | [486, 86] |
p03210 | u121732701 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = input()\nif x == "7"or"5"or"3"\n print("YES")\nelse:\n print("NO")', 'x = input()\nif x == "7"or x=="5"or x=="3":\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s747902931', 's056384306'] | [2940.0, 2940.0] | [17.0, 18.0] | [72, 81] |
p03210 | u122195031 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nif x == 7 or x == 5 or x == 3:\n print("Yes")\nelse:\n print("No")', 'x = int(input())\nif x == 7 or x == 5 or x == 3:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s782725347', 's735524495'] | [2940.0, 2940.0] | [17.0, 17.0] | [82, 82] |
p03210 | u123745130 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['n=int(input())\nprint(["NO","YES"][n==7 or n==5 orn==3])', 'n=int(input())\nprint(["NO","YES"][n==7 |n==5|n==3])', 'n=int(input())\nprint(["NO","YES"][n==7 or n==5 or n==3])'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s363194204', 's535869726', 's863613828'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [55, 51, 56] |
p03210 | u124070765 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x=int(input())\nif x == 7 or x == 5 or x == 3:\n\tprint('YES')\nelse:\n\tprint('NO')p", "x=int(input())\nif x == 7 or x == 5 or x == 3:\n\tprint('Yes')\nelse:\n\tprint('No')", "x=int(input())\nif x == 7 or x == 5 or x == 3:\n\tprint('YES')\nelse:\n\tprint('NO')"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s203157038', 's337152100', 's395114733'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [79, 78, 78] |
p03210 | u125417984 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["if int(input()) == (7 or 5 or 3):\n print('YES')\nelse:\n print('NO')", "print(['NO', 'YES'][[7, 5, 3].count(int(input()))])"] | ['Wrong Answer', 'Accepted'] | ['s842212476', 's205968882'] | [2940.0, 2940.0] | [17.0, 18.0] | [68, 51] |
p03210 | u127499732 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['s=list(input())\nm=753\nfor i in range(0,len(s)-2):\n x=int("".join(s[i:i+3]))\n m=min(m,abs(753-x))\nprint(m)', 'print("YES" if int(input()) in [3,5,7] else "NO")'] | ['Wrong Answer', 'Accepted'] | ['s327330953', 's657236958'] | [2940.0, 2940.0] | [17.0, 17.0] | [107, 49] |
p03210 | u130900604 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | [' print("NO")', 'print("NYOE S"[input()in"753"::2])'] | ['Runtime Error', 'Accepted'] | ['s186929015', 's141181983'] | [2940.0, 2940.0] | [17.0, 17.0] | [15, 34] |
p03210 | u131411061 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["X = int(input())\n\nif X == 7 or X == 5 or X == 3:\n print('Yes')\nelse:\n print('No')", "X = int(input())\n\nif X == 7 or X == 5 or X == 3:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s790574995', 's005603617'] | [2940.0, 2940.0] | [17.0, 17.0] | [87, 87] |
p03210 | u131666536 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["a = [7, 5, 3]\nx = int(input())\n\nif x in a:\n print('YES)\nelse:\n print('NO')\n", "a = [7, 5, 3]\nx = int(input())\n \nif x in a:\n print('YES')\nelse:\n print('NO')"] | ['Runtime Error', 'Accepted'] | ['s631343859', 's228811670'] | [2940.0, 2940.0] | [18.0, 18.0] | [81, 82] |
p03210 | u132892633 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["n = int(input())\nif n == 3 or n ==5 or n ==7:\n print ('Yes')\nelse:\n print('No')", "n = int(input())\nif n == 3 or n ==5 or n ==7:\n print ('YES')\nelse:\n print('NO')\n"] | ['Wrong Answer', 'Accepted'] | ['s954618130', 's082382207'] | [2940.0, 2940.0] | [17.0, 18.0] | [85, 86] |
p03210 | u133347536 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nif x == 3 or x == 5 or x == 7:\n print("Yes")\nelse:\n print("No")\n', 'x = int(input())\nif x == 3 or x == 5 or x == 7:\n print("YES")\nelse:\n print("NO")\n'] | ['Wrong Answer', 'Accepted'] | ['s472263130', 's527039477'] | [2940.0, 2940.0] | [18.0, 17.0] | [87, 87] |
p03210 | u135204039 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['s = input()\nif s==3 or s==5 or s==7:\n print("YES")\nelse:\n print("NO")', 'import numpy as np\n#s = "1234567"\ns = input()\n#print(len(s))\n\nss = []\n\nfor i in range(len(s)-2):\n #print(s[i:i+3])\n ss.append(int(s[i:i+3]))\n\nss = np.array(ss)\nprint(np.abs((ss - 753)).min())', 'import numpy as np\n#s = "1234567"\ns = input()\n#print(len(s))\n\nss = []\n\nfor i in range(len(s)-2):\n #print(s[i:i+3])\n ss.append(int(s[i:i+3]))\n\nss = np.array(ss)\nprint((ss - 753).max())', 'import numpy as np\n#s = "1234567"\ns = input()\n#print(len(s))\n\nss = []\n\nfor i in range(len(s)-2):\n print(s[i:i+3])\n ss.append(int(s[i:i+3]))\n\nss = np.array(ss)\nprint((ss - 753).max())', 's = int(input())\nif s==3 or s==5 or s==7:\n\tprint("YES")\nelse:\n\tprint("NO")'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s116732095', 's302920530', 's925162070', 's967560328', 's121612639'] | [2940.0, 12504.0, 12404.0, 12396.0, 2940.0] | [18.0, 150.0, 151.0, 150.0, 17.0] | [71, 197, 189, 188, 74] |
p03210 | u143173995 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["X = int(input())\nres = 'no'\nif X == 3 or X == 5 or X == 7:\n res = 'yes'\nprint(res)\n", "\nX = int(input())\nres = 'NO'\nif X == 3 or X == 5 or X == 7:\n res = 'YES'\nprint(res)\n"] | ['Wrong Answer', 'Accepted'] | ['s571369380', 's273774710'] | [2940.0, 2940.0] | [17.0, 17.0] | [86, 101] |
p03210 | u144203608 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['X=input()\nif X==3:\n print("YES")\nelif X==5:\n print("YES")\nelif X==7:\n print("YES”)\nelse :\n print("NO")', 'X=int(input())\nif X==3:\n print("YES")\nelif X==5:\n print("YES")\nelif X==7:\n print("YES”)\nelse :\n print("NO")', 'X=int(input())\nif X==3:\n print("YES")\nelif X==5:\n print("YES")\nelif X==7:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s067778550', 's810175380', 's085543140'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [108, 113, 110] |
p03210 | u148540382 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["X = int(input())\nprint('Yes' if X == 3 or X == 5 or X == 7 else 'No')\n", "X = int(input())\nprint('YES' if X == 3 or X == 5 or X == 7 else 'NO')\n"] | ['Wrong Answer', 'Accepted'] | ['s836275283', 's353607119'] | [2940.0, 2940.0] | [18.0, 17.0] | [70, 70] |
p03210 | u149073695 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['age = int(input())\n\nif age == 7|5|3:\n print("YES")\nelse:\n print("NO)', 'age = int(input())\n\nif age == 7 or age == 5 or age == 3:\n print("YES")\nelse:\n print("NO")\n'] | ['Runtime Error', 'Accepted'] | ['s150943153', 's072640738'] | [3064.0, 2940.0] | [18.0, 18.0] | [70, 92] |
p03210 | u150641538 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['print(\'Yes\' if int(input()) <7 else "No")', 'print("YES" if int(input()) in [7,5,3] else "NO")'] | ['Wrong Answer', 'Accepted'] | ['s554118944', 's804138861'] | [2940.0, 2940.0] | [17.0, 17.0] | [41, 49] |
p03210 | u151625340 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["X = int(input())\nif X == 3 or X == 5 or X == 7:\n print('Yes')\nelse:\n print('No')\n", "X = int(input())\nif X == 3 or X == 5 or X == 7:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s508053271', 's692509123'] | [2940.0, 2940.0] | [18.0, 17.0] | [87, 86] |
p03210 | u153094838 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['# -*- coding: utf-8 -*-\nimport math\na = int(input())\nc = str(a)\nb = 0\n\n\n\nketa = int (math.log10(a) + 1)\nlist = []\nif a >= 357:\n count = 0\n for i in range(3, keta):\n c = 1\n b = 3\n for j in range(0, i):\n c *= 3\n b *= 2\n list.append(c - b +3)\n start = pow(10, keta - 1) * 3\n while start - 1 <= a:\n start += 1\n flg3 = 0\n flg5 = 0\n flg7 = 0\n\n if math.floor(start / (pow(10, keta - 1))) == 4:\n start += pow(10, keta - 1)\n if math.floor(start / (pow(10, keta - 1))) == 6:\n start += pow(10, keta - 1)\n if math.floor(start / (pow(10, keta - 1))) == 8:\n break\n \n for j in range(0, keta):\n if (str(start)[j] == "3"):\n flg3 = 1\n elif (str(start)[j] == "5"):\n flg5 = 1\n elif (str(start)[j] == "7"):\n flg7 = 1\n else:\n break\n if (j == keta - 1 and flg3 == 1 and flg5 == 1 and flg7 == 1):\n count += 1\n \n b = count + sum(list)\nprint(b)\n \n\n', '# -*- coding: utf-8 -*-\nimport math\na = int(input())\nc = str(a)\nb = 0\n\n\n\nketa = int (math.log10(a) + 1)\nlist = []\nif a >= 357:\n count = 0\n for i in range(3, keta):\n c = 1\n b = 3\n for j in range(0, i):\n c *= 3\n b *= 2\n list.append(c - b +3)\n start = pow(10, keta - 1) * 3\n print(a / pow(10, keta - 1))\n while start - 1 <= a:\n start += 1\n flg3 = 0\n flg5 = 0\n flg7 = 0\n\n if math.floor(start / (pow(10, keta - 1))) == 4:\n start += pow(10, keta - 1)\n if math.floor(start / (pow(10, keta - 1))) == 6:\n start += pow(10, keta - 1)\n if math.floor(start / (pow(10, keta - 1))) == 8:\n break\n \n for j in range(0, keta):\n if (str(start)[j] == "3"):\n flg3 = 1\n elif (str(start)[j] == "5"):\n flg5 = 1\n elif (str(start)[j] == "7"):\n flg7 = 1\n else:\n break\n if (j == keta - 1 and flg3 == 1 and flg5 == 1 and flg7 == 1):\n count += 1\n \n b = count + sum(list)\nprint(b)\n \n\n', '# -*- coding: utf-8 -*-\na = int(input())\nif (a == 3 or a== 5 or a ==7):\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s171987000', 's593784010', 's952675886'] | [3064.0, 3064.0, 2940.0] | [17.0, 17.0, 17.0] | [1188, 1221, 110] |
p03210 | u153419200 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['a=int(input())\nif a==3 or a==5 or a==7:\n print(YES)\nelse:\n print(NO)', "a=int(input())\nif a==3 or a==5 or a==7:\n print('YES')\nelse:\n print('NO')\n"] | ['Runtime Error', 'Accepted'] | ['s200255774', 's816141809'] | [2940.0, 2940.0] | [17.0, 17.0] | [70, 75] |
p03210 | u158628538 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['i=int(input())\nif(i==7 or i==5 or i==3):\n print("Yes")\nelse:\n print("No")', 'i=int(input())\nif(i==7 or i==5 or i==3):\n print("Yes")\nelse:\n print("No")', 'i=int(input())\nif(i==7 or i==5 or i==3):\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s084272507', 's532261920', 's115950862'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0] | [79, 79, 79] |
p03210 | u159994501 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = input()\nif x ==3 or x == 5 or x == 7:\n print("YES")\nelse:\n print("NO")', 'x = int(input())\nif x ==3 or x == 5 or x == 7:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s063136655', 's550716128'] | [2940.0, 2940.0] | [17.0, 17.0] | [80, 85] |
p03210 | u160659351 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['#114 753\n\nX = int(input())\n\nif X == 3 or X == 5 or X == 7:\n print("Yes")\nelse:\n print("No")', '#114 753\n\nX = int(input())\n\nif X == 3 or X == 5 or X == 7:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s887240164', 's721684513'] | [2940.0, 2940.0] | [17.0, 17.0] | [97, 97] |
p03210 | u160939083 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['X = int(input())\n\nif X = 7 or X = 5 or X = 3:\n\tprint("YES")\nelse:\n\tprint("NO")\n\n\n', 'X = int(input())\n\nif X == 7 or X == 5 or X == 3:\n\tprint("YES")\nelse:\n\tprint("NO")\n\n\n'] | ['Runtime Error', 'Accepted'] | ['s409533260', 's320458799'] | [3064.0, 2940.0] | [19.0, 18.0] | [81, 84] |
p03210 | u161442663 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['X=input()\nif X==3 or X==5 or X==7:\n print("YES")\nelse:\n print("NO")', 'X=int(input())\nif X==3 or X==5 or X==7:\n print("YES")\nelse:\n print("NO")\n'] | ['Wrong Answer', 'Accepted'] | ['s571341726', 's524512574'] | [3064.0, 2940.0] | [17.0, 17.0] | [69, 75] |
p03210 | u162893962 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["X = int(input())\nif X == 3 or X == 5 or X == 7:\n print('Yes')\nelse:\n print('No')", "X = int(input())\nif X == 3 or X == 5 or X == 7:\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s997901206', 's789104625'] | [2940.0, 2940.0] | [17.0, 17.0] | [86, 86] |
p03210 | u162911959 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['X=input()\nif x in "753";\n print("YES")\nelse;\n print("NO")', 'X-input()\nif x in "753";\n print("YES")\nelse;\n print("NO")\n', 'X=input()\nif x in "753":\n print("YES")\nelse:\n print("NO")', 'X=input()\nif X in "753":\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s144172111', 's472636301', 's779569329', 's854209984'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [63, 64, 63, 63] |
p03210 | u163791883 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["print('Yes' if int(input()) in [3, 5, 7] else 'No')", "print('YES' if int(input()) in [3, 5, 7] else 'NO')"] | ['Wrong Answer', 'Accepted'] | ['s340880196', 's914023154'] | [2940.0, 3060.0] | [17.0, 19.0] | [51, 51] |
p03210 | u165268875 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['x = int(input())\nif x in [7,5,3]:\n print("Yes")\nelse :\n print("No")\n', 'x = input()\nif x in "753" :\n print("Yes")\nelse :\n print("No")\n', 'x = int(input())\nif x in [7,5,3]:\n print("YES")\nelse :\n print("NO")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s898794688', 's920899419', 's009911376'] | [2940.0, 3060.0, 2940.0] | [18.0, 19.0, 17.0] | [75, 68, 75] |
p03210 | u166306121 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['N = int(input())\n\nif n == 3:\n print("YES")\nelif n == 5:\n print("YES")\nelif n == 7:\n print("YES")', 'N = int(input())\n\nif N == 3:\n print("YES")\nelif N == 5:\n print("YES")\nelif N == 7:\n print("YES")\nelse:\n print("NO")'] | ['Runtime Error', 'Accepted'] | ['s255577555', 's391533739'] | [2940.0, 2940.0] | [18.0, 17.0] | [99, 127] |
p03210 | u168416324 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['if input() in "753":\n print("Yes")\nelse:\n print("No")', 'def ya(boo):\n if boo:\n print("Yes")\n else:\n print("No")\ndef yay(boo):\n if boo:\n print("YES")\n else:\n print("NO")\nyay(input() in "753")'] | ['Wrong Answer', 'Accepted'] | ['s207367852', 's006707891'] | [8984.0, 8740.0] | [23.0, 23.0] | [55, 150] |
p03210 | u170324846 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['S = input()\nSS = 99999999999\nfor i in range(0, len(S)):\n for j in range(0, i):\n for k in range(0, j):\n X = int(S[k] + S[j] + S[i])\n if abs(753 - X) < SS:\n SS = abs(753 - X)\nprint(SS)', 'X = int(input())\nif X == 3 or X == 5 or X == 7:\n print("YES")\nelse:\n print("NO")'] | ['Wrong Answer', 'Accepted'] | ['s341307737', 's677348632'] | [3060.0, 2940.0] | [17.0, 18.0] | [229, 82] |
p03210 | u170765582 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["print('YNeos'[input()not in'357'::2])", "print('YNEOS'[input()not in'357'::2])"] | ['Wrong Answer', 'Accepted'] | ['s843467872', 's527691750'] | [2940.0, 2940.0] | [17.0, 17.0] | [37, 37] |
p03210 | u172873334 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ['a=int(input())\nb=0;\nif a==3:\n b=1\nelif a==5:\n b=1:\nelif a==7:\n b=1:\nif b==1:\n print("YES")\nelse:\n print("NO")', "print('YES' if int(input()) in [3,5,7] else 'NO')"] | ['Runtime Error', 'Accepted'] | ['s139293839', 's209241725'] | [2940.0, 2940.0] | [18.0, 17.0] | [114, 49] |
p03210 | u185037583 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["age = int(print())\nif age==7 || age==5 || age==3:\n print('YES')\nelse:\n print('NO')\n\n", "age = int(input())\nif age == 7 or age == 5 or age == 3:\n print('YES')\nelse:\n print('NO')\n"] | ['Runtime Error', 'Accepted'] | ['s304518270', 's540155037'] | [2940.0, 2940.0] | [17.0, 17.0] | [86, 95] |
p03210 | u185354171 | 2,000 | 1,048,576 | _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children. Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time? | ["x = int(input())\nif x == 7:\n ans = 'YES'\nelif x == 5:\n ans = 'YES\nelif x == 3:\n ans = 'YES'\nelse:\n ans = 'NO'\nprint(ans)\n ", "x = int(input())\nif x == 7:\n ans = 'YES'\nelif x == 5:\n ans = 'YES'\nelif x == 3:\n ans = 'YES'\nelse:\n ans = 'NO'\nprint(ans)\n "] | ['Runtime Error', 'Accepted'] | ['s277405994', 's531727775'] | [2940.0, 2940.0] | [17.0, 17.0] | [129, 130] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.