mirror of https://github.com/inclusionAI/AReaL
6 lines
74 KiB
JSON
Executable File
6 lines
74 KiB
JSON
Executable File
{"prompt": "<\uff5cUser\uff5c>Takahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n - If Takahashi has one or more cookies, eat one of his cookies.\n - Otherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n - If they both have no cookies, do nothing.\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\n-----Constraints-----\n - 0 \\leq A \\leq 10^{12}\n - 0 \\leq B \\leq 10^{12}\n - 0 \\leq K \\leq 10^{12}\n - All values in input are integers.\n\n-----Input-----\nInput is given from Standard Input in the following format:\nA B K\n\n-----Output-----\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\n-----Sample Input-----\n2 3 3\n\n-----Sample Output-----\n0 2\n\nTakahashi will do the following:\n - He has two cookies, so he eats one of them.\n - Now he has one cookie left, and he eats it.\n - Now he has no cookies left, but Aoki has three, so Takahashi eats one of them.\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n<\uff5cAssistant\uff5c><think>\n", "question": "Takahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n - If Takahashi has one or more cookies, eat one of his cookies.\n - Otherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n - If they both have no cookies, do nothing.\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\n-----Constraints-----\n - 0 \\leq A \\leq 10^{12}\n - 0 \\leq B \\leq 10^{12}\n - 0 \\leq K \\leq 10^{12}\n - All values in input are integers.\n\n-----Input-----\nInput is given from Standard Input in the following format:\nA B K\n\n-----Output-----\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\n-----Sample Input-----\n2 3 3\n\n-----Sample Output-----\n0 2\n\nTakahashi will do the following:\n - He has two cookies, so he eats one of them.\n - Now he has one cookie left, and he eats it.\n - Now he has no cookies left, but Aoki has three, so Takahashi eats one of them.\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.", "query_id": "deepcoder_taco_754161b853b1e0b1c02ee9667cd50f8c", "id": "deepcoder_taco_754161b853b1e0b1c02ee9667cd50f8c", "starter_code": null, "input_output": "{\"inputs\": [\"2 3 3\\n\", \"500000000000 500000000000 1000000000000\\n\", \"500000000000 500000000001 1000000000000\\n\", \"500000000000 499999999999 1000000000000\\n\", \"0 0 0\\n\", \"0 0 1000000000000\\n\", \"0 1000000000000 0\\n\", \"0 1000000000000 1000000000000\\n\", \"1000000000000 0 0\\n\", \"1000000000000 0 1000000000000\\n\", \"1000000000000 1000000000000 0\\n\", \"1000000000000 1000000000000 1000000000000\\n\", \"999664720736 99150401673 9177110689\\n\", \"999553244087 9473760141 99451169880\\n\", \"99818575601 999284522381 9657141929\\n\", \"99374288514 9551434405 999519154734\\n\", \"9352360840 999532174388 99550343731\\n\", \"9839285289 99663130322 999454076321\\n\", \"500000000000 274588616851 1000000000000\", \"2 3 1\", \"2 3 2\", \"2 3 0\", \"2 6 0\", \"4 6 0\", \"8 6 0\", \"10 6 0\", \"498881727339 49011419508 0000000100000\", \"0 6 0\", \"498881727339 49011419508 0000001100000\", \"0 9 0\", \"498881727339 50858735181 0000001100000\", \"498881727339 64133142411 0000001100000\", \"498881727339 86551688904 0000001100000\", \"498881727339 86551688904 0000000100000\", \"498881727339 88952939337 0000000100000\", \"498881727339 88952939337 0000010100000\", \"623031139973 88952939337 0000010100000\", \"623031139973 53371298929 0000010100000\", \"488984103352 53371298929 0000010100000\", \"488984103352 28853843669 0000010100000\", \"488984103352 44514766879 0000010100000\", \"488984103352 24648370780 0000010100000\", \"488984103352 11555398095 0000010100000\", \"551061056476 11555398095 0000010100000\", \"551061056476 2744039490 0000010100000\", \"551061056476 2744039490 0000010100100\", \"551061056476 2744039490 0010010100100\", \"690068676694 2744039490 0010010100100\", \"810189303696 2744039490 0010010100100\", \"810189303696 304656088 0010010100100\", \"810189303696 304656088 0010010101100\", \"810189303696 559952381 0010010101100\", \"878339967763 559952381 0010010101100\", \"878339967763 559952381 0010010101101\", \"1138880556104 559952381 0010010101101\", \"1138880556104 516416634 0010010101101\", \"637172716773 516416634 0010010101101\", \"1127076073437 516416634 0010010101101\", \"1127076073437 516416634 0010010100101\", \"1127076073437 516416634 0010010100001\", \"1485644197907 516416634 0010010100001\", \"40795666163 516416634 0010010100001\", \"40795666163 581054487 0010010100001\", \"40795666163 581054487 0010010110001\", \"22565061889 581054487 0010010110001\", \"22565061889 581054487 0010110110001\", \"18064166595 581054487 0010110110001\", \"9875757521 933260677 0010110110000\", \"1547869 73650225 0000000111100\", \"204065 73650225 0000000111100\", \"362104 73650225 0000000111100\", \"362104 24404642 0000000111100\", \"362104 16911655 0000000111100\", \"283244830608 274588616851 1000000000000\", \"498881727339 274588616851 1000000000000\", \"498881727339 92988479429 1000000000000\", \"498881727339 92988479429 1010000000000\", \"498881727339 92988479429 1000000100000\", \"498881727339 49011419508 1000000100000\", \"0 0 0\", \"-1 0 0\", \"-1 0 1\", \"-2 0 1\", \"0 0 1\", \"0 -1 1\", \"0 -1 2\", \"4188594464 581054487 0010110110001\", \"7578113331 581054487 0010110110001\", \"7578113331 581054487 0010110110000\", \"7578113331 933260677 0010110110000\", \"9875757521 933260677 1010110110000\", \"9875757521 933260677 1010110100000\", \"9875757521 933260677 1110110100000\", \"9875757521 933260677 1110110100001\", \"8901212864 933260677 1110110100001\", \"8901212864 933260677 1110010100001\", \"9957043226 933260677 1110010100001\", \"9957043226 933260677 1110110100001\", \"13071060683 933260677 1110110100001\", \"13071060683 933260677 1010110100001\", \"24844196728 933260677 1010110100001\", \"24844196728 933260677 1010010100001\", \"46282745761 933260677 1010010100001\", \"46282745761 933260677 1010010100011\", \"46282745761 1063903834 1010010100011\", \"46282745761 1953749145 1010010100011\", \"46282745761 3894888655 1010010100011\", \"82916368507 3894888655 1010010100011\", \"125508515642 3894888655 1010010100011\", \"250272688906 3894888655 1010010100011\", \"250272688906 5812721198 1010010100011\", \"250272688906 9468746842 1010010100011\", \"143395449423 9468746842 1010010100011\", \"223869749260 9468746842 1010010100011\", \"223869749260 13514692621 1010010100011\", \"223869749260 13514692621 1010010101011\", \"223869749260 13514692621 1011010101011\", \"223869749260 13514692621 1011010101111\", \"500000000000 500000000000 1000000000000\", \"2 3 3\"], \"outputs\": [\"0 2\\n\", \"0 0\\n\", \"0 1\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 1000000000000\\n\", \"0 0\\n\", \"1000000000000 0\\n\", \"0 0\\n\", \"1000000000000 1000000000000\\n\", \"0 1000000000000\\n\", \"990487610047 99150401673\\n\", \"900102074207 9473760141\\n\", \"90161433672 999284522381\\n\", \"0 0\\n\", \"0 909334191497\\n\", \"0 0\\n\", \"0 0\\n\", \"1 3\\n\", \"0 3\\n\", \"2 3\\n\", \"2 6\\n\", \"4 6\\n\", \"8 6\\n\", \"10 6\\n\", \"498881627339 49011419508\\n\", \"0 6\\n\", \"498880627339 49011419508\\n\", \"0 9\\n\", \"498880627339 50858735181\\n\", \"498880627339 64133142411\\n\", \"498880627339 86551688904\\n\", \"498881627339 86551688904\\n\", \"498881627339 88952939337\\n\", \"498871627339 88952939337\\n\", \"623021039973 88952939337\\n\", \"623021039973 53371298929\\n\", \"488974003352 53371298929\\n\", \"488974003352 28853843669\\n\", \"488974003352 44514766879\\n\", \"488974003352 24648370780\\n\", \"488974003352 11555398095\\n\", \"551050956476 11555398095\\n\", \"551050956476 2744039490\\n\", \"551050956376 2744039490\\n\", \"541050956376 2744039490\\n\", \"680058576594 2744039490\\n\", \"800179203596 2744039490\\n\", \"800179203596 304656088\\n\", \"800179202596 304656088\\n\", \"800179202596 559952381\\n\", \"868329866663 559952381\\n\", \"868329866662 559952381\\n\", \"1128870455003 559952381\\n\", \"1128870455003 516416634\\n\", \"627162615672 516416634\\n\", \"1117065972336 516416634\\n\", \"1117065973336 516416634\\n\", \"1117065973436 516416634\\n\", \"1475634097906 516416634\\n\", \"30785566162 516416634\\n\", \"30785566162 581054487\\n\", \"30785556162 581054487\\n\", \"12554951888 581054487\\n\", \"12454951888 581054487\\n\", \"7954056594 581054487\\n\", \"0 698908198\\n\", \"1436769 73650225\\n\", \"92965 73650225\\n\", \"251004 73650225\\n\", \"251004 24404642\\n\", \"251004 16911655\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\\n\", \"0 0\", \"0 2\"], \"remote\": false}", "task": "code", "language": "PYTHON", "solutions": ["(a, b, k) = map(int, input().split())\nprint(max(a - k, 0), max(b - max(k - a, 0), 0))\n", "(a, b, k) = map(int, input().split())\nnum = min(a, k)\na -= num\nk -= num\nprint(a, max(b - k, 0))\n", "(A, B, K) = map(int, input().split())\nprint(max(0, A - K), max(0, min(B, A + B - K)))\n", "(A, B, K) = map(int, input().split())\nt = max(0, A - K)\na = max(0, A + B - K - t)\nprint(t, a)\n", "(A, B, K) = map(int, input().split())\na = max(A - K, 0)\nK -= A - a\nb = max(B - K, 0)\nprint(a, b)\n", "(a, b, k) = map(int, input().split())\nif a >= k:\n\tprint(a - k, b)\nelse:\n\tprint(0, max(b - (k - a), 0))\n", "(a, b, k) = map(int, input().split())\nif a < k:\n\tb -= k - a\n\ta = 0\n\tif b < 0:\n\t\tb = 0\nelif a - k > 0:\n\ta -= k\nelse:\n\ta = 0\nprint(a, b)\n", "a = input()\na = a.split()\nk = int(a[2])\nb = int(a[1])\na = int(a[0])\nd = b\nc = a - k\nif c < 0:\n\tc = 0\nif c == 0:\n\td = b - k + a\nif d < 0:\n\td = 0\nprint(c, d)\n", "(a, b, k) = map(int, input().split())\nc = max(a - k, 0)\nk -= a - c\nd = max(b - k, 0)\nprint(c, d)\n", "(a, b, c) = map(int, input().split())\naa = max(0, a - c)\nprint(aa, max(0, a + b - aa - c))\n", "(a, b, n) = map(int, input().split())\nprint(max(a - n, 0), max(b - max(n - a, 0), 0))\n", "(a, b, k) = map(int, input().split())\nprint(str(max(a - k, 0)) + ' ' + str(max(min(b, a + b - k), 0)))\n", "(a, b, k) = map(int, input().split())\nta = a - min(a, k)\nk -= a - ta\nb -= min(b, k)\nprint(ta, b)\n", "(a, b, k) = map(int, input().split())\nn = min(a, k)\nk -= n\nprint(a - n, max(0, b - k))\n", "(t, a, k) = map(int, input().split())\nT = max(t - k, 0)\nk -= t - T\nA = max(a - k, 0)\nprint(T, A)\n", "(A, B, K) = map(int, input().split())\nk = max(K - A, 0)\nprint(max(A - K, 0), max(B - k, 0))\n", "(a, b, k) = map(int, input().split())\nremain = a - k\ntakahashi = remain\naoki = b\nif remain < 0:\n\ttakahashi = 0\n\taoki = b + remain\nprint(str(takahashi) + ' ' + str(aoki if aoki > 0 else 0))\n", "(a, b, k) = map(int, input().split())\nA = max(a - k, 0)\nB = max(b - max(k - a, 0), 0)\nprint(A, B)\n", "(a, b, c) = input().split()\na = int(a)\nb = int(b)\nc = int(c)\nif a >= c:\n\tprint(a - c, b)\nif a < c <= a + b:\n\tprint(0, a + b - c)\nif c > a + b:\n\tprint(0, 0)\n", "(a, b, k) = list(map(int, input().split()))\nprint(max(0, a - k), max(0, min(b, a + b - k)))\n", "def slove():\n\t(A, B, K) = map(int, input().split())\n\tif A > K:\n\t\tprint(A - K, B)\n\telse:\n\t\tprint(0, max(0, -K + (A + B)))\n\ndef __starting_point():\n\tslove()\n__starting_point()\n", "(a, b, k) = map(int, input().split())\neat1 = min(a, k)\nk -= eat1\neat2 = min(b, k)\nprint(a - eat1, b - eat2)\n", "(a, b, k) = (int(i) for i in input().split())\ne = min(a, k)\na -= e\nk -= e\nb -= min(b, k)\nprint(a, b)\n", "(a, b, k) = (int(x) for x in input().split())\nc = a\nif a + b <= k:\n\ta = 0\n\tb = 0\nelif a <= k:\n\ta = 0\n\tb = b + c - k\nelif a > k:\n\ta = a - k\nc = str(a) + ' ' + str(b)\nprint(c)\n", "(a, b, k) = map(int, input().split())\nta = max(0, a - k)\nk -= a - ta\ntb = max(0, b - k)\nprint(ta, tb)\n", "(t, a, k) = map(int, input().split())\nt = t - k\nif t < 0:\n\ta += t\n\tt = 0\nif a < 0:\n\ta = 0\nprint(t, a)\n", "(a, b, k) = map(int, input().split())\nm = min(a, k)\na -= m\nk -= m\nb -= k\nprint(a, max(b, 0))\n", "(A, B, K) = map(int, input().split())\nx = min(A, K)\ny = min(B, K - x)\nprint(A - x, B - y)\n", "(A, B, K) = list(map(int, input().split()))\nk = min(A, K)\nprint(A - k, max(0, B - (K - k)))\n", "(A, B, K) = map(int, input().split())\nprint(max(0, A - K), max(0, B - abs(max(0, K - A))))\n", "import numpy as np\n(A, B, K) = map(int, input().split())\nif K > A:\n\ta = 0\n\tB = max(B - (K - A), 0)\nelse:\n\ta = A - K\nprint(a, B)\n", "[A, B, K] = list(map(int, input().split()))\nX = max(0, A - K)\nY = max(0, min(B, B - (K - A)))\nprint(X, Y)\n", "(A, B, K) = map(int, input().split())\nprint(A - min(A, K), B - min(B, K - min(A, K)))\n", "(a, b, k) = map(int, input().split())\ny = min(a, k)\nz = min(b, k - y)\nprint(a - y, b - z)\n", "(a, b, k) = map(int, input().split())\nt = min(a, k)\na -= t\nk -= t\nu = min(b, k)\nb -= u\nprint(a, b)\n", "(A, B, K) = map(int, input().split())\nprint(max(0, A - K), end=' ')\nK = max(0, K - A)\nprint(max(0, B - K))\n", "(a, b, k) = map(int, input().split())\nra = max(a - k, 0)\nif k > a:\n\tb = max(b - (k - a), 0)\nprint(ra, b)\n", "(a, b, k) = map(int, input().split())\ntakahashi = [0, a - k]\naoki = [0, b + min(takahashi)]\nprint('{takahashi} {aoki}'.format(takahashi=max(takahashi), aoki=max(aoki)))\n", "(a, b, k) = map(int, input().split())\naa = max(0, a - k)\nb = b + min(0, a - k)\nprint(aa, max(b, 0))\n", "(a, b, k) = map(int, input().split())\nx = min(a, k)\na -= x\nk -= x\ny = min(b, k)\nb -= y\nprint(a, b)\n", "(a, b, c) = map(int, input().split())\nx = max(0, a - c)\nbb = max(0, c - a)\nprint(x, max(0, b - bb))\n", "(A, B, K) = map(int, input().split())\nT = max(0, A - K)\nprint(T, max(0, B - K + A - T))\n", "(A, B, K) = map(int, input().split())\nd = A - K\nif A + B >= K:\n\tif d < 0:\n\t\tprint(0, B + d)\n\telse:\n\t\tprint(d, B)\nelse:\n\tprint(0, 0)\n", "(a, b, k) = map(int, input().split())\naa = max(a - k, 0)\nrest = max(k - a, 0)\nbb = max(b - rest, 0)\nprint(f'{aa} {bb}')\n", "(a, b, c) = map(int, input().split())\nrem = min(a, c)\na -= rem\nc -= rem\nrem = min(b, c)\nb -= rem\nprint(a, b)\n", "(a, b, k) = [int(i) for i in input().split()]\nif a <= k:\n\tb = b - k + a if b - k + a >= 0 else 0\n\ta = 0\nelse:\n\ta -= k\nprint(a, b)\n", "(A, B, K) = map(int, input().split())\nrA = max(0, A - K)\nrB = max(0, B - (K - (A - rA)))\nprint(rA, rB)\n", "(A, B, K) = map(int, input().split())\ntemp = A\nif K >= A:\n\tK = K - A\n\tA = 0\nelse:\n\tA = A - K\n\tK = 0\nif B >= K:\n\tB = B - K\nelse:\n\tB = 0\nprint('{} {}'.format(A, B))\n", "(a, b, k) = [int(x) for x in input().split()]\nif a > k:\n\tprint(a - k, b)\nelse:\n\tprint(0, max(0, a + b - k))\n", "(a, b, k) = map(int, input().split())\ntaka = a - k\nif taka < 0:\n\taoki = b - abs(taka)\n\ttaka = 0\n\tif aoki < 0:\n\t\taoki = 0\nelse:\n\taoki = b\nprint(taka, aoki)\n", "(a, b, n) = map(int, input().split())\nif a >= n:\n\ta -= n\n\tprint(a, b)\nelif a < n:\n\tn -= a\n\tif n >= b:\n\t\tprint(0, 0)\n\telse:\n\t\tprint(0, b - n)\n", "(a, b, k) = map(int, input().split())\nprint(' '.join(map(str, [max(0, a - k), max(0, b - max(0, k - a))])))\n", "(T, A, K) = map(int, input().split())\nS = T\nT -= min(T, K)\nK = K - (S - T)\nA -= min(A, K)\nprint(T, A)\n", "import sys\n(a, b, k) = map(int, input().split())\nif a >= k:\n\tprint(a - k, b)\n\treturn\nif b >= k - a:\n\tprint(0, b - (k - a))\n\treturn\nprint(0, 0)\n", "(A, B, K) = map(int, input().split())\n\ndef sum():\n\tnonlocal A, B, K\n\tif A >= K:\n\t\treturn (A - K, B)\n\telse:\n\t\ta = K - A\n\t\tA = 0\n\t\tif B >= a:\n\t\t\treturn (A, B - a)\n\t\telse:\n\t\t\treturn (A, 0)\nprint(*sum())\n", "(A, B, K) = map(int, input().split())\n(A, rem) = (max(A - K, 0), max(K - A, 0))\nB = max(B - rem, 0)\nprint(A, B)\n"], "verify": 1, "wrong_type": null}
|
|
{"prompt": "<\uff5cUser\uff5c>Write a program which prints $n$-th fibonacci number for a given integer $n$. The $n$-th fibonacci number is defined by the following recursive formula:\n\n\\begin{equation*} fib(n)= \\left \\\\{ \\begin{array}{ll} 1 & (n = 0) \\\\\\ 1 & (n = 1) \\\\\\ fib(n - 1) + fib(n - 2) & \\\\\\ \\end{array} \\right. \\end{equation*}\n\nConstraints\n\n* $0 \\leq n \\leq 44$\n\nInput\n\nAn integer $n$ is given.\n\nExample\n\nInput\n\n3\n\n\nOutput\n\n3\n<\uff5cAssistant\uff5c><think>\n", "question": "Write a program which prints $n$-th fibonacci number for a given integer $n$. The $n$-th fibonacci number is defined by the following recursive formula:\n\n\\begin{equation*} fib(n)= \\left \\\\{ \\begin{array}{ll} 1 & (n = 0) \\\\\\ 1 & (n = 1) \\\\\\ fib(n - 1) + fib(n - 2) & \\\\\\ \\end{array} \\right. \\end{equation*}\n\nConstraints\n\n* $0 \\leq n \\leq 44$\n\nInput\n\nAn integer $n$ is given.\n\nExample\n\nInput\n\n3\n\n\nOutput\n\n3", "query_id": "deepcoder_taco_d46ca8a56178d77918f5a864bdf4de7c", "id": "deepcoder_taco_d46ca8a56178d77918f5a864bdf4de7c", "starter_code": null, "input_output": "{\"inputs\": [\"1\", \"2\", \"4\", \"8\", \"6\", \"15\", \"7\", \"24\", \"14\", \"5\", \"13\", \"11\", \"22\", \"9\", \"29\", \"12\", \"10\", \"41\", \"16\", \"30\", \"21\", \"28\", \"17\", \"34\", \"18\", \"38\", \"31\", \"44\", \"36\", \"32\", \"33\", \"23\", \"19\", \"27\", \"20\", \"37\", \"25\", \"26\", \"42\", \"43\", \"35\", \"39\", \"40\", \"001\", \"6\", \"12\", \"17\", \"24\", \"31\", \"5\", \"2\", \"4\", \"15\", \"30\", \"8\", \"1\", \"10\", \"11\", \"16\", \"9\", \"7\", \"13\", \"27\", \"25\", \"14\", \"19\", \"44\", \"22\", \"23\", \"43\", \"21\", \"36\", \"20\", \"18\", \"29\", \"38\", \"32\", \"35\", \"33\", \"40\", \"28\", \"41\", \"26\", \"34\", \"39\", \"42\", \"37\", \"001\", \"3\"], \"outputs\": [\"1\\n\", \"2\\n\", \"5\\n\", \"34\\n\", \"13\\n\", \"987\\n\", \"21\\n\", \"75025\\n\", \"610\\n\", \"8\\n\", \"377\\n\", \"144\\n\", \"28657\\n\", \"55\\n\", \"832040\\n\", \"233\\n\", \"89\\n\", \"267914296\\n\", \"1597\\n\", \"1346269\\n\", \"17711\\n\", \"514229\\n\", \"2584\\n\", \"9227465\\n\", \"4181\\n\", \"63245986\\n\", \"2178309\\n\", \"1134903170\\n\", \"24157817\\n\", \"3524578\\n\", \"5702887\\n\", \"46368\\n\", \"6765\\n\", \"317811\\n\", \"10946\\n\", \"39088169\\n\", \"121393\\n\", \"196418\\n\", \"433494437\\n\", \"701408733\\n\", \"14930352\\n\", \"102334155\\n\", \"165580141\\n\", \"1\\n\", \"13\\n\", \"233\\n\", \"2584\\n\", \"75025\\n\", \"2178309\\n\", \"8\\n\", \"2\\n\", \"5\\n\", \"987\\n\", \"1346269\\n\", \"34\\n\", \"1\\n\", \"89\\n\", \"144\\n\", \"1597\\n\", \"55\\n\", \"21\\n\", \"377\\n\", \"317811\\n\", \"121393\\n\", \"610\\n\", \"6765\\n\", \"1134903170\\n\", \"28657\\n\", \"46368\\n\", \"701408733\\n\", \"17711\\n\", \"24157817\\n\", \"10946\\n\", \"4181\\n\", \"832040\\n\", \"63245986\\n\", \"3524578\\n\", \"14930352\\n\", \"5702887\\n\", \"165580141\\n\", \"514229\\n\", \"267914296\\n\", \"196418\\n\", \"9227465\\n\", \"102334155\\n\", \"433494437\\n\", \"39088169\\n\", \"1\\n\", \"3\"], \"remote\": false}", "task": "code", "language": "PYTHON", "solutions": ["n = int(input())\nnum = [1, 1]\nfor i in range(2, 45):\n\tf = num[i - 1] + num[i - 2]\n\tnum.append(f)\nprint(num[n])\n", "n = int(input())\nfib_b = [1, 1]\nif n > 1:\n\tfor i in range(2, n + 1):\n\t\tfib_b.append(fib_b[i - 1] + fib_b[i - 2])\nprint(fib_b[n])\n", "n = int(input())\na = b = 1\nwhile n:\n\t(a, b) = (b, a + b)\n\tn -= 1\nprint(a)\n", "n = int(input())\nfib = [1, 1]\nfor i in range(2, n + 1):\n\tfib.append(fib[-1] + fib[-2])\nprint(fib[-1])\n", "n = int(input())\na1 = 1\na = 1\ni = 1\nwhile i < n:\n\t(a1, a) = (a, a1 + a)\n\ti += 1\nprint(a)\n", "n = int(input())\ndp = [0] * (n + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[-1])\n", "n = int(input())\nfib = [1, 1, 2]\nfor i in range(3, n + 1):\n\ttmp = fib[i - 1] + fib[-2]\n\tfib.append(tmp)\nprint(fib[n])\n", "n = int(input())\ndp = [1, 1]\nif n > 1:\n\tfor i in range(2, n + 1):\n\t\tdp.append(dp[i - 1] + dp[i - 2])\nprint(dp[n])\n", "a = [1, 1]\n\ndef fib(n):\n\ttry:\n\t\treturn a[n]\n\texcept:\n\t\ta.append(fib(n - 2) + fib(n - 1))\n\t\treturn a[n]\nn = int(input())\nprint(fib(n))\n", "N = int(input())\ndp = [1] * (N + 1)\nfor n in range(2, N + 1):\n\tdp[n] = dp[n - 1] + dp[n - 2]\nprint(dp[N])\n", "n = int(input())\nfib = [-1] * (n + 1)\n(fib[0], fib[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[-1])\n", "n = int(input())\narr = [1, 1]\nfor i in range(2, 45):\n\tarr.append(arr[i - 1] + arr[i - 2])\nprint(arr[n])\n", "n = int(input())\n\ndef fib(n):\n\ta = 1\n\tb = 1\n\tfor _ in range(n):\n\t\t(a, b) = (b, a + b)\n\treturn a\nprint(fib(n))\n", "def fb(num):\n\t(a, b) = (1, 0)\n\tfor _ in range(num):\n\t\t(a, b) = (a + b, a)\n\treturn b\nn = int(input())\nprint(fb(n + 1))\n", "def fib(n):\n\tfib = [1, 1]\n\tfor i in range(2, n + 1):\n\t\tfib.append(fib[i - 2] + fib[i - 1])\n\treturn fib[n]\nn = int(input())\nprint(fib(n))\n", "l = [1, 1]\nn = int(input())\nfor i in range(n):\n\tfib = [l[i] + l[i + 1]]\n\tl = l + fib\nprint(l[n])\n", "(a, b) = (1, 1)\nfor i in range(int(input())):\n\t(a, b) = (b, a + b)\nprint(a)\n", "n = int(input()) + 1\ndp = [1] * n\nfor i in range(n):\n\tif i < 2:\n\t\tcontinue\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n - 1])\n", "n = int(input())\nif n <= 1:\n\tprint(1)\n\texit()\nx = [1, 1]\nfor i in range(n - 1):\n\tx.append(x[-1] + x[-2])\nprint(x[-1])\n", "a = 1\nb = 1\nlist = []\nn = int(input())\nlist.append(a)\nlist.append(b)\nfor i in range(n):\n\tlist.append(a + b)\n\td = b\n\tb += a\n\ta = d\nprint(list[n])\n", "N = int(input())\ndp = [0] * 50\nfor i in range(N + 1):\n\tif i < 2:\n\t\tdp[i] = 1\n\telse:\n\t\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[N])\n", "n = int(input())\nn1 = 1\nn2 = 1\nfor i in range(n):\n\t(n1, n2) = (n2, n1 + n2)\nprint(n1)\n", "n = int(input())\nl = [1, 1]\nfor i in range(n - 1):\n\tl.append(l[-1] + l[-2])\nprint(l[n])\n", "fib = [0] * 45\nfib[0] = 1\nfib[1] = 1\nn = int(input())\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "n = int(input())\nDP = [0] * 45\n(DP[0], DP[1]) = (1, 1)\nfor i in range(2, 45):\n\tDP[i] = DP[i - 1] + DP[i - 2]\nprint(DP[n])\n", "n = int(input())\nfib = [0] * (n + 1)\n(fib[0], fib[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "fib = [0] * 45\nfib[0] = fib[1] = 1\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[int(input())])\n", "N = int(input())\nD = [0] * (N + 1)\nD[0] = 1\nD[1] = 1\nfor i in range(2, N + 1):\n\tD[i] = D[i - 1] + D[i - 2]\nprint(D[N])\n", "n = int(input())\nF = [0] * (n + 1)\nF[0] = 1\nF[1] = 1\nfor i in range(2, len(F)):\n\tF[i] = F[i - 1] + F[i - 2]\nprint(F[n])\n", "N = int(input())\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, N + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nans = dp[N]\nprint(ans)\n", "n = int(input())\ndp = [0] * (n + 1)\nfor i in range(n + 1):\n\tif i <= 1:\n\t\tdp[i] = 1\n\t\tcontinue\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[-1])\n", "f = [1, 1] + [0] * (int(input()) - 1)\nfor i in range(2, len(f)):\n\tf[i] = f[i - 2] + f[i - 1]\nprint(f[-1])\n", "n = int(input())\nf = [0] * 45\nf[0] = 1\nf[1] = 1\nfor i in range(2, 45):\n\tf[i] = f[i - 1] + f[i - 2]\nprint(f[n])\n", "n = int(input())\nfi = [1] * 50\nfor i in range(2, n + 1):\n\tfi[i] = fi[i - 1] + fi[i - 2]\nprint(fi[n])\n", "n = int(input())\ndp = [0 for i in range(1000)]\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "n = int(input())\nfirst = 1\nsecond = 1\nfor i in range(n - 1):\n\t(second, first) = (first + second, second)\nprint(second)\n", "N = int(input())\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, N + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[N])\n", "n = int(input())\nf = [1, 1]\nfor i in range(2, n + 1):\n\tnf = f[i - 2] + f[i - 1]\n\tf.append(nf)\nprint(f[n])\n", "n = int(input())\ndp = [0] * (n + 10)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "n = int(input())\nfib = [1] * 45\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "n = int(input())\ndp = [1, 1]\nfor i in range(n):\n\tdp.append(dp[i] + dp[i + 1])\nprint(dp[n])\n", "fib = [0 for i in range(45)]\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\na = int(input())\nprint(fib[a])\n", "def Fibonacci(n, a1, a2):\n\tif n < 1:\n\t\treturn a1\n\treturn Fibonacci(n - 1, a1 + a2, a1)\nprint(Fibonacci(int(input()), 1, 0))\n", "def fibonacci(n):\n\t(a, b) = (1, 0)\n\tfor _ in range(0, n):\n\t\t(a, b) = (b, a + b)\n\treturn b\nn = int(input())\nn += 1\nprint(fibonacci(n))\n", "n = int(input())\nf = [0] * 45\nf[0] = f[1] = 1\nfor i in range(2, 45):\n\tf[i] = f[i - 2] + f[i - 1]\nprint(f[n])\n", "(a, b) = (1, 1)\nn = int(input())\nfor i in range(n):\n\t(a, b) = (b, a + b)\nprint(a)\n", "n = int(input())\nx = 0\ny = 1\nif n == 0 or n == 1:\n\tprint(1)\nelse:\n\tfor i in range(n):\n\t\t(x, y) = (y, x + y)\n\t\ti += 1\n\tprint(y)\n", "n = int(input())\na = b = 1\nfor i in range(n):\n\t(a, b) = (b, a + b)\n\tn -= 1\nprint(a)\n", "n = int(input())\nfib = [0 for i in range(n + 1)]\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "n = int(input())\nA = []\nA.append(1)\nA.append(1)\nif n > 1:\n\tfor i in range(n - 1):\n\t\tA.append(A[i] + A[i + 1])\nprint(A[n])\n", "def fib(n):\n\tn1 = n2 = tmp = 1\n\tfor _ in range(n - 1):\n\t\ttmp = n1 + n2\n\t\t(n1, n2) = (n2, tmp)\n\treturn tmp\nprint(fib(int(input())))\n", "n = int(input())\ndp = [1, 1]\nfor i in range(2, n + 1):\n\tdp = [dp[-1], dp[-2] + dp[-1]]\nprint(dp[-1])\n", "n = int(input())\na = 1\nb = 1\nif n == 0 or n == 1:\n\tprint(1)\nelse:\n\tfor i in range(n):\n\t\t(a, b) = (b, a + b)\n\tprint(a)\n", "N = int(input())\ndp = {0: 1, 1: 1}\nfor i in range(1, N):\n\tdp[i + 1] = dp[i] + dp[i - 1]\nprint(dp[N])\n", "N = int(input())\nL = [0 for i in range(N + 1)]\nL[0] = 1\nL[1] = 1\nfor i in range(2, N + 1):\n\tL[i] = L[i - 1] + L[i - 2]\nprint(L[N])\n", "n = int(input())\nL = [0] * (n + 1)\nL[0] = 1\nL[1] = 1\nfor i in range(n - 1):\n\tL[i + 2] = L[i + 1] + L[i]\nprint(L[n])\n", "F = [1, 1] + [0 for i in range(44)]\nn = int(input())\nfor i in range(2, n + 1):\n\tF[i] = F[i - 1] + F[i - 2]\nprint(F[n])\n", "n = int(input())\nmemo = [1] * (n + 1)\nfor i in range(2, n + 1):\n\tmemo[i] = memo[i - 1] + memo[i - 2]\nprint(memo[n])\n", "n = int(input())\ndp = [0] * 45\ndp[:2] = [1, 1]\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 2] + dp[i - 1]\nprint(dp[n])\n", "def fib(n):\n\tx = [1, 1]\n\tfor i in range(n + 1):\n\t\ty = x[i] + x[i + 1]\n\t\tx.append(y)\n\tprint(x[n])\na = int(input())\nfib(a)\n", "n = int(input())\nif n < 2:\n\tans = 1\nelse:\n\ta = [0] * (n + 1)\n\ta[0] = a[1] = 1\n\tfor i in range(2, n + 1):\n\t\ta[i] = a[i - 1] + a[i - 2]\n\tans = a[n]\nprint(ans)\n", "n = int(input())\ndp = [None] * (n + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(n - 1):\n\tdp[i + 2] = dp[i] + dp[i + 1]\nprint(dp[n])\n", "y = [1, 1]\nn = int(input())\nfor i in range(0, n):\n\ta = y[i] + y[i + 1]\n\ty.append(a)\nprint(y[n])\n", "def fibonacci(n):\n\ta = [1] * 2\n\tfor i in range(2, n + 1):\n\t\t(a[0], a[1]) = (a[1], a[0] + a[1])\n\treturn a[1]\nn = int(input())\nprint(fibonacci(n))\n", "n = int(input())\npair = [1, 1]\nfor i in range(n - 1):\n\tpair[i % 2] = sum(pair)\nprint(pair[n % 2])\n", "n = int(input())\na = 1\nb = 1\nlist = []\nlist.append(a)\nlist.append(b)\nfor i in range(n):\n\tlist.append(a + b)\n\td = b\n\tb += a\n\ta = d\nprint(list[n])\n", "n = int(input())\nfib = [-1] * (n + 1)\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "n = int(input())\nfib = [1, 1]\nfor i in range(2, n + 1):\n\ta = fib[i - 1] + fib[i - 2]\n\tfib.append(a)\nprint(fib[n])\n", "Fib = [1, 1]\nfor i in range(2, 45):\n\tFib.append(Fib[i - 1] + Fib[i - 2])\nn = int(input())\nprint(Fib[n])\n", "n = int(input())\na = 1\nb = 1\ni = 0\nwhile i < n:\n\t(a, b) = (b, a + b)\n\ti += 1\nprint(a)\n", "fib = [0 for i in range(45)]\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nn = int(input())\nprint(fib[n])\n", "n = int(input())\nfib = [1, 1]\nfor i in range(2, n + 1):\n\tfib.append(fib[i - 2] + fib[i - 1])\nprint(fib[n])\n", "def resolve():\n\tn = int(input())\n\tA = [1, 1]\n\tfor i in range(1, 45):\n\t\tA.append(A[i - 1] + A[i])\n\tprint(A[n])\nresolve()\n", "n = int(input())\n\ndef Fib(n):\n\t(a, b) = (0, 1)\n\tfor i in range(n):\n\t\t(a, b) = (b, a + b)\n\treturn b\nprint(Fib(n))\n", "N = int(input())\nfib = [1, 1]\nfor i in range(50):\n\tfib.append(fib[-1] + fib[-2])\nprint(fib[N])\n", "n = int(input())\nn_L = [0] * 45\nn_L[0] = 1\nn_L[1] = 1\nfor i in range(2, n + 1):\n\tn_L[i] = n_L[i - 1] + n_L[i - 2]\nprint(n_L[n])\n", "N = int(input())\none = 1\ntwo = 1\nfor _ in range(1, N):\n\tthree = one + two\n\t(one, two) = (two, three)\nprint(two)\n", "n = int(input())\nfib = [1, 1]\nfor i in range(2, n + 1):\n\tfib.append(fib[i - 1] + fib[i - 2])\nprint(fib.pop())\n", "N = int(input())\nDP = []\nDP.append(1)\nDP.append(1)\nfor i in range(2, N + 1):\n\tDP.append(DP[i - 1] + DP[i - 2])\nprint(DP[N])\n", "(p, n) = ((1 + 5 ** 0.5) / 2, int(input()) + 1)\nprint(int((p ** n - (1 - p) ** n) / 5 ** 0.5))\n", "x = [1, 1]\nn = int(input())\nfor i in range(n):\n\ta = [x[i] + x[i + 1]]\n\tx = x + a\nprint(x[n])\n", "n = int(input())\nn += 1\ndp = [1 for i in range(n)]\nfor i in range(2, n):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[-1])\n", "n = int(input())\nf = [0] * (n + 3)\n(f[0], f[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tf[i] = f[i - 1] + f[i - 2]\nprint(f[n])\n", "n = int(input())\na = [1, 1]\nif n < 2:\n\tpass\nelse:\n\tfor i in range(2, n + 1):\n\t\ta.append(a[i - 1] + a[i - 2])\nprint(a[n])\n", "n = int(input())\ndp = [0] * (n + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nans = dp[n]\nprint(ans)\n", "n = int(input())\nnum = [1, 1]\nfor i in range(43):\n\tb = num[-2] + num[-1]\n\tnum.append(b)\nprint(num[n])\n", "N = int(input())\na = b = 1\nwhile N:\n\t(a, b) = (b, a + b)\n\tN -= 1\nprint(a)\n", "n = int(input())\ndp = [0 for _ in range(46)]\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, 46):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "lis = []\nlis.append(1)\nlis.append(1)\nfor i in range(2, 45):\n\tlis.append(lis[i - 1] + lis[i - 2])\nn = int(input())\nprint(lis[n])\n", "fib = [1 for i in range(45)]\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\ni = int(input())\nprint(fib[i])\n", "n = int(input())\nA = [1] * (n + 1)\nfor i in range(2, n + 1):\n\tA[i] = A[i - 1] + A[i - 2]\nprint(A[-1])\n", "n = int(input())\nmap = [0] * (n + 1)\nmap[0] = 1\nmap[1] = 1\nfor i in range(n - 1):\n\tmap[i + 2] = map[i] + map[i + 1]\nprint(map[-1])\n", "n = int(input())\nfib = [0] * (n + 1)\nfib[0] = 1\nif n > 0:\n\tfib[1] = 1\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "n = int(input())\ndp = [0] * (n + 1)\ndp[0] = 1\nfor i in range(1, n + 1):\n\tif i == 1:\n\t\tdp[1] = 1\n\telse:\n\t\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "ii = lambda : int(input())\nn = ii()\nw = [-1] * 50\nw[0] = 1\nw[1] = 1\nfor i in range(2, 45):\n\tw[i] = w[i - 2] + w[i - 1]\nprint(w[n])\n", "n = int(input())\ndp = [0] * (n + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(1, n):\n\ti += 1\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "def fib2(n):\n\t(a1, a2) = (1, 0)\n\twhile n > 0:\n\t\t(a1, a2) = (a1 + a2, a1)\n\t\tn -= 1\n\treturn a1\nn = int(input())\nprint(fib2(n))\n", "n = int(input())\n\ndef fib(n):\n\t(a, b) = (1, 1)\n\tfor i in range(n):\n\t\t(a, b) = (b, a + b)\n\treturn a\nprint(fib(n))\n", "n = int(input())\nF = [None for i in range(n + 1)]\n(F[0], F[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tF[i] = F[i - 2] + F[i - 1]\nanswer = F[n]\nprint(answer)\n", "a = int(input())\nn = [0] * (a + 1)\nn[0] = 1\nn[1] = 1\nfor i in range(2, a + 1):\n\tn[i] = n[i - 1] + n[i - 2]\nprint(n[a])\n", "n = int(input())\nif n < 2:\n\tprint(1)\nelse:\n\t(a, b) = (1, 1)\n\tfor k in range(n - 1):\n\t\t(a, b) = (b, a + b)\n\tprint(b)\n", "n = int(input())\ndp = [0] * (n + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "n = int(input())\nfib = []\nfib.append(1)\nfib.append(1)\nfor i in range(2, n + 1):\n\tfib.append(fib[i - 1] + fib[i - 2])\nprint(fib[n])\n", "n = int(input())\nif n == 0 or n == 1:\n\tprint(1)\nelse:\n\ta = [1, 1]\n\tfor i in range(n - 1):\n\t\ta.append(a[i] + a[i + 1])\n\tprint(a[-1])\n", "n = int(input()) + 1\na = [0] * n\na[0] = 1\na[1] = 1\nfor i in range(2, n):\n\ta[i] = a[i - 1] + a[i - 2]\nprint(a[-1])\n", "a = b = 1\nfor i in range(int(input())):\n\t(a, b) = (b, a + b)\nprint(a)\n", "n = int(input())\na = 1\nb = 1\nfor i in range(n - 1):\n\tc = b\n\tb += a\n\ta = c\nprint(b)\n", "n = int(input())\ndp = [0 for _ in range(n + 1)]\n(dp[0], dp[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "F = [1, 1]\nfor i in range(2, int(input()) + 1):\n\tF.append(F[i - 2] + F[i - 1])\nprint(F[-1])\n", "n = int(input())\nF = [1, 1]\nfor i in range(2, n + 1):\n\tF.append(F[i - 1] + F[i - 2])\nprint(F[n])\n", "n = int(input())\ndp = [0 for _ in range(45)]\n(dp[0], dp[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "n = int(input())\ndp = [1] * 50\nfor i in range(n):\n\tdp[i + 2] = dp[i + 1] + dp[i]\nprint(dp[n])\n", "fib = [0] * 45\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nn = int(input())\nprint(fib[n])\n", "n = int(input())\nF = [1] * 50\nfor i in range(2, n + 1):\n\tF[i] = F[i - 1] + F[i - 2]\nprint(F[n])\n", "N = int(input())\ndp = [1] * (N + 1)\nfor i in range(2, N + 1):\n\tdp[i] = dp[i - 2] + dp[i - 1]\nprint(dp[N])\n", "N = int(input())\nDP = [0 for _ in range(N + 1)]\nDP[0] = 1\nDP[1] = 1\nfor i in range(2, N + 1):\n\tDP[i] = DP[i - 1] + DP[i - 2]\nprint(DP[N])\n", "N = int(input())\nfib = [None] * (N + 1)\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, N + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[N])\n", "n = int(input())\ndp = [0] * (n + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, n + 1, 1):\n\tdp[i] = dp[i - 2] + dp[i - 1]\nprint(dp[n])\n", "def fib(n):\n\t(f0, f1) = (1, 1)\n\tfor i in range(n - 1):\n\t\t(f1, f0) = (f1 + f0, f1)\n\treturn f1\nn = int(input())\nans = fib(n)\nprint(ans)\n", "n = int(input())\ndp = [-1] * (n + 1)\n(dp[0], dp[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[-1])\n", "import sys\ninput = sys.stdin.readline\nn = int(input())\nfib = [1] * 50\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "def g(a, b, n):\n\tif n == 1:\n\t\treturn a\n\telse:\n\t\treturn g(a + b, a, n - 1)\nprint(g(1, 1, int(input())))\n", "n = int(input())\ndp = [0] * 50\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, 46):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "a = [0] * 45\na[0] = 1\na[1] = 1\nfor i in range(2, 45):\n\ta[i] = a[i - 1] + a[i - 2]\nn = int(input())\nprint(a[n])\n", "n = int(input())\na = list(range(n + 1))\na[0] = 1\ni = 2\nwhile i <= n:\n\ta[i] = a[i - 1] + a[i - 2]\n\ti += 1\nprint(a[n])\n", "n = int(input())\na = b = 1\nwhile range(n):\n\t(a, b) = (b, a + b)\n\tn -= 1\nprint(a)\n", "n = int(input())\n\ndef func(n):\n\tfib = [1, 1]\n\tfor i in range(2, n):\n\t\tfib.append(fib[i - 2] + fib[i - 1])\n\treturn fib[n - 1]\nprint(func(n + 1))\n", "a = 1\nb = 1\nc = []\nn = int(input())\nc.append(a)\nc.append(b)\nfor i in range(n):\n\tc.append(a + b)\n\td = b\n\tb += a\n\ta = d\nprint(c[n])\n", "def g(a, b, n):\n\tif n == 1:\n\t\treturn a\n\telse:\n\t\treturn g(a + b, a, n - 1)\n(a, b) = (1, 1)\nprint(g(a, b, int(input())))\n", "n = int(input())\nx = 1\ny = 1\na = 0\nfor i in range(n):\n\ta = x\n\tx = y\n\ty = a + y\nprint(x)\n", "n = int(input())\na = 1\nb = 1\nwhile n:\n\t(a, b) = (b, a + b)\n\tn -= 1\nprint(a)\n", "n = int(input())\n(a, b) = (1, 1)\nif n <= 1:\n\tprint(1)\nelse:\n\tfor i in range(n - 1):\n\t\tc = a + b\n\t\ta = b\n\t\tb = c\n\tprint(c)\n", "n = int(input()) - 1\nfib = [1, 2]\nfor i in range(2, n + 1):\n\tfib.append(fib[i - 1] + fib[i - 2])\nprint(fib[n])\n", "c = int(input())\n(a, b) = (1, 1)\nwhile c - 1:\n\t(a, b) = (a + b, a)\n\tc -= 1\nprint(a)\n", "a = b = 1\nfor _ in range(int(input())):\n\t(a, b) = (b, a + b)\nprint(a)\n", "n = int(input())\nfib = [1, 1]\nfor i in range(2, n + 1):\n\tfib.append(fib[i - 1] + fib[i - 2])\nprint(fib[n])\n", "num = int(input())\narr = [0] * 45\narr[0] = 1\narr[1] = 1\nfor i in range(2, 45):\n\tarr[i] = arr[i - 1] + arr[i - 2]\nprint(arr[num])\n", "n = int(input())\ndp = [0] * (n + 1)\n(dp[0], dp[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "n = int(input())\ndp = [1] * 45\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "N = int(input())\n(a, b) = (1, 1)\nn = 0\nwhile n <= N:\n\tif n > 1:\n\t\t(a, b) = (b, a + b)\n\tn += 1\nprint(b)\n", "n = int(input())\ntable = [0] * 45\ntable[0] = 1\ntable[1] = 1\nfor i in range(2, 45):\n\ttable[i] = table[i - 1] + table[i - 2]\nprint(table[n])\n", "def fib(a, b, c):\n\tif c == 0:\n\t\treturn a\n\treturn fib(a + b, a, c - 1)\nn = int(input().rstrip())\nprint(fib(0, 1, n + 1))\n", "n = int(input())\np = [1, 1]\nif n <= 1:\n\tprint(1)\n\texit(0)\nfor i in range(2, n + 1):\n\tp.append(p[i - 2] + p[i - 1])\nprint(p[n])\n", "N = int(input())\ndp = [0] * (N + 1)\n(dp[0], dp[1]) = (1, 1)\nfor i in range(2, N + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[N])\n", "n = int(input())\na = [1, 1]\nfor i in range(2, n + 1):\n\ta.append(a[i - 1] + a[i - 2])\nprint(a[n])\n", "f = [1, 1]\nfor _ in [0] * 43:\n\tf += [f[-2] + f[-1]]\nprint(f[int(input())])\n", "n = int(input())\nfib = []\nfib.append(1)\nfib.append(1)\nfor _ in range(n - 1):\n\tfib.append(fib[-2] + fib[-1])\nprint(fib[-1])\n", "a = [1] * 45\nfor i in range(2, len(a)):\n\ta[i] = a[i - 1] + a[i - 2]\nprint(a[int(input())])\n", "f = [1, 1]\nfor _ in range(2, 45):\n\tf += [sum(f[-2:])]\nprint(f[int(input())])\n", "N = int(input())\ndp = [-1] * (N + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, N + 1):\n\tdp[i] = dp[i - 2] + dp[i - 1]\nprint(dp[-1])\n", "n = int(input())\na = []\na.append(1)\na.append(1)\nmamo = [-1] * 100\nfor i in range(2, n + 1):\n\ta.append(a[i - 1] + a[i - 2])\n\ti += 1\nprint(a[n])\n", "n = int(input())\n\ndef fib(n):\n\ta = 1\n\tb = 1\n\tfor _ in range(n):\n\t\t(a, b) = (b, a + b)\n\treturn a\nprint(fib(n))\n", "n = int(input())\nfib = [0] * (n + 1)\nfib[0] = 1\nfib[1] = 1\nfor ni in range(2, n + 1):\n\tfib[ni] = fib[ni - 1] + fib[ni - 2]\nprint(fib[n])\n", "n = int(input())\ndp = [0] * 45\n(dp[0], dp[1]) = (1, 1)\nfor i in range(2, 44 + 1):\n\tdp[i] += dp[i - 1] + dp[i - 2]\nprint(dp[n])\n", "fib = [0] * 45\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nx = int(input())\nprint(fib[x])\n", "n = int(input())\nfib = [1, 1]\nif n >= 2:\n\tfor i in range(2, n + 1):\n\t\tfib.append(fib[i - 1] + fib[i - 2])\nprint(fib[n])\n", "import sys\ninput = sys.stdin.readline\nn = int(input())\nF = [1] * 50\nfor i in range(2, n + 1):\n\tF[i] = F[i - 1] + F[i - 2]\nprint(F[n])\n", "n = int(input())\na = 1\nb = 1\nmlist = []\nmlist.append(a)\nmlist.append(b)\nfor i in range(n):\n\tmlist.append(a + b)\n\td = b\n\tb += a\n\ta = d\nprint(mlist[n])\n", "import sys\nn = int(input())\nif n < 2:\n\tprint(1)\n\tsys.exit()\n(a, b) = (1, 1)\nfor i in range(n - 1):\n\tc = a + b\n\ta = b\n\tb = c\nprint(c)\n", "n = int(input())\nf = [1, 1]\nfor i in range(n - 1):\n\tfib = f[-1] + f[-2]\n\tf.append(fib)\nprint(f[n])\n", "n = int(input())\nA = [0 for _ in range(n + 1)]\nA[0] = A[1] = 1\nfor i in range(2, n + 1):\n\tA[i] = A[i - 1] + A[i - 2]\nprint(A[n])\n", "n = int(input())\nfib = [1] * 2 + [0] * (n - 1)\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "inf = 10 ** 9 + 7\nmod = 10 ** 9 + 7\nn = int(input())\ndp = [1 for i in range(n + 1)]\nfor i in range(2, n + 1):\n\tdp[i] = dp[i - 2] + dp[i - 1]\nprint(dp[n])\n", "n = int(input())\nfor i in range(n + 1):\n\tif i == 0 or i == 1:\n\t\ta = b = c = 1\n\telse:\n\t\tc = a + b\n\t\t(a, b) = (b, c)\nprint(c)\n", "def f(n):\n\tf = [1, 1]\n\tfor i in range(2, n):\n\t\tf.append(f[i - 2] + f[i - 1])\n\treturn f[n - 1]\nn = int(input())\nprint(f(n + 1))\n", "n = int(input())\nfib = [1] * (n + 1)\nfor i in range(2, n + 1):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "n = int(input())\nfib = [0] * 45\nfib[0] = 1\nfib[1] = 1\nfor i in range(2, 45):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[n])\n", "n = int(input())\n(x, y) = (1, 1)\nfor i in range(n):\n\t(x, y) = (y, x + y)\nprint(x)\n", "def g(a, b, n):\n\tif n == 0 or n == 1:\n\t\treturn a\n\telse:\n\t\treturn g(a + b, a, n - 1)\n(a, b) = (1, 1)\nprint(g(a, b, int(input())))\n", "N = int(input())\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1\nfor i in range(2, N + 1):\n\tdp[i] = dp[i - 1] + dp[i - 2]\nprint(dp[-1])\n", "n = int(input())\nif n == 0 or n == 1:\n\tprint(1)\nelse:\n\tN = 1\n\tm = 1\n\tfor i in range(n - 1):\n\t\tM = N + m\n\t\tm = N\n\t\tN = M\n\tprint(M)\n", "res = [1, 1]\nn = int(input())\nfor i in range(n - 1):\n\tres.append(res[i] + res[i + 1])\nprint(res[n])\n", "fib = [1] * 100\nfor i in range(2, 100):\n\tfib[i] = fib[i - 1] + fib[i - 2]\nprint(fib[int(input())])\n", "n = int(input())\nDP = [0 for _ in range(n + 1)]\nDP[0] = 1\nDP[1] = 1\nfor i in range(2, n + 1):\n\tDP[i] = DP[i - 1] + DP[i - 2]\nprint(DP[n])\n", "a = 1\nb = 1\nlist = []\nn = int(input())\nlist.append(a)\nlist.append(b)\nfor i in range(n):\n\tlist.append(a + b)\n\tc = b\n\tb += a\n\ta = c\nprint(list[n])\n", "def fib(n):\n\tglobal F\n\tif n not in F:\n\t\tF[n] = fib(n - 1) + fib(n - 2)\n\treturn F[n]\nF = {0: 1, 1: 1}\nprint(fib(int(input())))\n", "n = int(input())\nF = [1, 1]\nfor i in range(n - 1):\n\tF.append(F[-2] + F[-1])\nprint(F[n])\n", "n = int(input())\nfib_ls = [0] * (n + 1)\n(fib_ls[0], fib_ls[1]) = (1, 1)\nfor i in range(2, n + 1):\n\tfib_ls[i] = fib_ls[i - 1] + fib_ls[i - 2]\nprint(fib_ls[n])\n", "n = int(input())\nf = [0] * (n + 1)\nf[0] = 1\nf[1] = 1\nfor i in range(2, n + 1):\n\tf[i] = f[i - 1] + f[i - 2]\nprint(f[n])\n", "n = int(input())\n(x, y) = (0, 1)\nfor i in range(1, n + 1):\n\t(x, y) = (y, x + y)\nprint(y)\n"], "verify": 1, "wrong_type": null}
|
|
{"prompt": "<\uff5cUser\uff5c>There are N integers written on a blackboard. The i-th integer is A_i, and the greatest common divisor of these integers is 1.\n\nTakahashi and Aoki will play a game using these integers. In this game, starting from Takahashi the two player alternately perform the following operation:\n\n* Select one integer on the blackboard that is not less than 2, and subtract 1 from the integer.\n* Then, divide all the integers on the black board by g, where g is the greatest common divisor of the integers written on the blackboard.\n\n\n\nThe player who is left with only 1s on the blackboard and thus cannot perform the operation, loses the game. Assuming that both players play optimally, determine the winner of the game.\n\nConstraints\n\n* 1 \u2266 N \u2266 10^5\n* 1 \u2266 A_i \u2266 10^9\n* The greatest common divisor of the integers from A_1 through A_N is 1.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\n\nN\nA_1 A_2 \u2026 A_N\n\n\nOutput\n\nIf Takahashi will win, print `First`. If Aoki will win, print `Second`.\n\nExamples\n\nInput\n\n3\n3 6 7\n\n\nOutput\n\nFirst\n\n\nInput\n\n4\n1 2 4 8\n\n\nOutput\n\nFirst\n\n\nInput\n\n5\n7 8 8 8 8\n\n\nOutput\n\nSecond\n<\uff5cAssistant\uff5c><think>\n", "question": "There are N integers written on a blackboard. The i-th integer is A_i, and the greatest common divisor of these integers is 1.\n\nTakahashi and Aoki will play a game using these integers. In this game, starting from Takahashi the two player alternately perform the following operation:\n\n* Select one integer on the blackboard that is not less than 2, and subtract 1 from the integer.\n* Then, divide all the integers on the black board by g, where g is the greatest common divisor of the integers written on the blackboard.\n\n\n\nThe player who is left with only 1s on the blackboard and thus cannot perform the operation, loses the game. Assuming that both players play optimally, determine the winner of the game.\n\nConstraints\n\n* 1 \u2266 N \u2266 10^5\n* 1 \u2266 A_i \u2266 10^9\n* The greatest common divisor of the integers from A_1 through A_N is 1.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\n\nN\nA_1 A_2 \u2026 A_N\n\n\nOutput\n\nIf Takahashi will win, print `First`. If Aoki will win, print `Second`.\n\nExamples\n\nInput\n\n3\n3 6 7\n\n\nOutput\n\nFirst\n\n\nInput\n\n4\n1 2 4 8\n\n\nOutput\n\nFirst\n\n\nInput\n\n5\n7 8 8 8 8\n\n\nOutput\n\nSecond", "query_id": "deepcoder_taco_b5ba27229515b9362e4ef106dccc7486", "id": "deepcoder_taco_b5ba27229515b9362e4ef106dccc7486", "starter_code": null, "input_output": "{\"inputs\": [\"3\\n3 9 7\", \"4\\n1 2 1 9\", \"4\\n1 2 1 8\", \"5\\n7 2 8 8 8\", \"3\\n3 9 9\", \"3\\n3 1 9\", \"4\\n1 2 1 13\", \"3\\n1 1 9\", \"4\\n1 2 1 22\", \"3\\n0 1 9\", \"4\\n1 1 1 22\", \"3\\n0 1 5\", \"4\\n0 1 1 22\", \"4\\n0 0 1 22\", \"4\\n0 -1 1 22\", \"4\\n0 0 1 1\", \"4\\n0 0 1 2\", \"4\\n1 0 1 2\", \"4\\n1 1 1 2\", \"4\\n1 1 1 4\", \"4\\n2 1 1 4\", \"4\\n2 1 1 1\", \"4\\n2 0 1 1\", \"4\\n2 0 0 1\", \"4\\n2 1 0 1\", \"4\\n2 1 0 0\", \"4\\n2 1 0 -1\", \"4\\n2 1 -1 0\", \"3\\n3 6 4\", \"5\\n7 8 4 8 8\", \"3\\n3 4 7\", \"4\\n1 2 1 5\", \"5\\n7 2 8 8 2\", \"3\\n3 9 2\", \"4\\n1 2 1 11\", \"3\\n3 1 3\", \"4\\n1 1 1 13\", \"3\\n1 2 9\", \"4\\n2 2 1 22\", \"3\\n0 1 15\", \"4\\n1 0 1 22\", \"4\\n-1 0 1 22\", \"4\\n0 -1 2 22\", \"4\\n0 1 1 1\", \"4\\n0 -1 1 2\", \"4\\n1 0 0 2\", \"4\\n1 1 2 2\", \"4\\n1 0 1 4\", \"4\\n3 1 1 4\", \"4\\n-1 1 1 1\", \"4\\n1 1 1 1\", \"4\\n0 0 0 1\", \"4\\n2 1 0 2\", \"4\\n4 1 0 0\", \"4\\n2 1 1 -1\", \"4\\n2 2 -1 0\", \"3\\n2 6 4\", \"5\\n7 8 4 8 11\", \"4\\n1 2 0 5\", \"5\\n7 2 8 12 2\", \"3\\n5 9 2\", \"4\\n1 2 0 11\", \"3\\n5 1 3\", \"4\\n1 1 1 14\", \"3\\n1 4 9\", \"4\\n1 2 1 19\", \"4\\n-1 0 1 33\", \"4\\n-1 0 1 23\", \"4\\n1 -1 2 22\", \"4\\n-1 1 1 2\", \"4\\n-1 -1 1 2\", \"4\\n1 -1 0 2\", \"4\\n1 1 2 4\", \"4\\n1 0 0 4\", \"4\\n2 1 1 8\", \"4\\n-1 1 0 1\", \"4\\n0 2 1 1\", \"4\\n0 -1 0 1\", \"4\\n0 1 0 2\", \"4\\n3 1 0 0\", \"4\\n2 0 -1 0\", \"3\\n4 6 4\", \"5\\n7 8 4 5 11\", \"4\\n1 2 -1 5\", \"5\\n7 2 10 12 2\", \"3\\n5 10 2\", \"3\\n5 2 3\", \"4\\n1 1 1 3\", \"3\\n1 0 9\", \"4\\n1 0 1 19\", \"4\\n-1 1 1 33\", \"4\\n-1 0 1 28\", \"4\\n0 -1 2 3\", \"4\\n-1 1 2 2\", \"4\\n-1 -1 1 0\", \"4\\n1 -1 1 2\", \"4\\n2 1 2 4\", \"4\\n1 -1 0 4\", \"4\\n2 1 1 15\", \"4\\n-1 2 0 1\", \"3\\n3 6 7\", \"4\\n1 2 4 8\", \"5\\n7 8 8 8 8\"], \"outputs\": [\"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"Second\\n\", \"Second\\n\", \"Second\\n\", \"First\\n\", \"First\\n\", \"First\\n\", \"Second\\n\", \"First\\n\", \"Second\\n\", \"First\", \"First\", \"Second\"], \"remote\": false}", "task": "code", "language": "PYTHON", "solutions": ["import sys\n\ndef I():\n\treturn int(sys.stdin.readline().rstrip())\n\ndef LI():\n\treturn list(map(int, sys.stdin.readline().rstrip().split()))\nN = I()\nA = LI()\nif N == 1:\n\tprint('Second')\n\texit()\nif N == 2:\n\tprint('First')\n\texit()\nfrom math import gcd\nr = 0\nwhile True:\n\tif (sum(A) - N) % 2 == 1:\n\t\tif r == 0:\n\t\t\tprint('First')\n\t\telse:\n\t\t\tprint('Second')\n\t\tbreak\n\telse:\n\t\ta = 0\n\t\tb = 0\n\t\tfor i in range(N):\n\t\t\tif A[i] % 2 == 1:\n\t\t\t\ta += 1\n\t\t\tif A[i] == 1:\n\t\t\t\tb += 1\n\t\tif a != 1 or b > 0:\n\t\t\tif r == 0:\n\t\t\t\tprint('Second')\n\t\t\telse:\n\t\t\t\tprint('First')\n\t\t\tbreak\n\t\telse:\n\t\t\tg = 0\n\t\t\tfor i in range(N):\n\t\t\t\tif A[i] % 2 == 1:\n\t\t\t\t\tg = gcd(g, A[i] - 1)\n\t\t\t\telse:\n\t\t\t\t\tg = gcd(g, A[i])\n\t\t\tfor i in range(N):\n\t\t\t\tA[i] = A[i] // g\n\t\t\tr = 1 - r\n", "import random\n\ndef tester(N=0):\n\tmaxno1 = 100000.0\n\tmaxno2 = 1000000000.0\n\ts = input()\n\tif s != '':\n\t\treturn s\n\tif N == 0:\n\t\treturn random.randint(2, maxno1)\n\telse:\n\t\tprint('Testing...')\n\t\tprint('N=', N)\n\t\tA = []\n\t\tfor i in range(N):\n\t\t\tA.extend([random.randint(1, maxno2)])\n\t\treturn ' '.join(list(map(str, A)))\nimport copy\n\ndef gcd(a, b):\n\twhile b:\n\t\t(a, b) = (b, a % b)\n\treturn a\n\ndef gcdm(x):\n\tg = x[0]\n\tfor i in range(1, len(x)):\n\t\tif g == 1:\n\t\t\treturn g\n\t\tg = gcd(g, x[i])\n\treturn g\n\ndef playmove(A, i):\n\tA[i] -= 1\n\tg = gcdm(A)\n\treturn [x // g for x in A]\n\ndef noofevens(A):\n\tr = 0\n\tfor i in A:\n\t\tif i % 2 == 0:\n\t\t\tr += 1\n\treturn r\nN = int(tester())\nA = [int(x) for x in tester(N).split()]\nisFirstmove = True\nwhile True:\n\te = noofevens(A)\n\tif e % 2 == 1:\n\t\tif isFirstmove:\n\t\t\tprint('First')\n\t\telse:\n\t\t\tprint('Second')\n\t\tbreak\n\telif N - e > 1:\n\t\tif isFirstmove:\n\t\t\tprint('Second')\n\t\telse:\n\t\t\tprint('First')\n\t\tbreak\n\telse:\n\t\tfor i in range(N):\n\t\t\tif A[i] % 2 == 1:\n\t\t\t\tbreak\n\t\tif A[i] == 1:\n\t\t\tif isFirstmove:\n\t\t\t\tprint('Second')\n\t\t\telse:\n\t\t\t\tprint('First')\n\t\t\tbreak\n\t\telse:\n\t\t\tA = playmove(A, i)\n\t\t\tisFirstmove = isFirstmove != True\n", "import sys\nreadline = sys.stdin.readline\nfrom functools import reduce\n\ndef gcd(a, b):\n\twhile b:\n\t\t(a, b) = (b, a % b)\n\treturn a\n\ndef calc(A):\n\tN = len(A)\n\tif N == 1:\n\t\treturn A[0] % 2 == 0\n\tK = sum((1 for a in A if a % 2 == 0))\n\tif K & 1:\n\t\treturn True\n\tif N - K != 1:\n\t\treturn False\n\tif min(A) == 1:\n\t\treturn False\n\tA = [a - a % 2 for a in A]\n\tg = reduce(gcd, A)\n\tA = [a // g for a in A]\n\treturn not calc(A)\nN = int(readline())\nA = list(map(int, readline().split()))\nprint('First' if calc(A) else 'Second')\n"], "verify": 1, "wrong_type": null}
|
|
{"prompt": "<\uff5cUser\uff5c>A game is played on a strip consisting of N cells consecutively numbered from 1 to N.\n\nAlice has her token on cell A. Borys has his token on a different cell B.\n\nPlayers take turns, Alice moves first. The moving player must shift his or her token from its current cell X to the neighboring cell on the left, cell X-1, or on the right, cell X+1. Note that it's disallowed to move the token outside the strip or to the cell with the other player's token. In one turn, the token of the moving player must be shifted exactly once.\n\nThe player who can't make a move loses, and the other player wins.\n\nBoth players want to win. Who wins if they play optimally?\n\nConstraints\n\n* 2 \\leq N \\leq 100\n* 1 \\leq A < B \\leq N\n* All input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\nN A B\n\n\nOutput\n\nPrint `Alice` if Alice wins, `Borys` if Borys wins, and `Draw` if nobody wins.\n\nExamples\n\nInput\n\n5 2 4\n\n\nOutput\n\nAlice\n\n\nInput\n\n2 1 2\n\n\nOutput\n\nBorys\n\n\nInput\n\n58 23 42\n\n\nOutput\n\nBorys\n<\uff5cAssistant\uff5c><think>\n", "question": "A game is played on a strip consisting of N cells consecutively numbered from 1 to N.\n\nAlice has her token on cell A. Borys has his token on a different cell B.\n\nPlayers take turns, Alice moves first. The moving player must shift his or her token from its current cell X to the neighboring cell on the left, cell X-1, or on the right, cell X+1. Note that it's disallowed to move the token outside the strip or to the cell with the other player's token. In one turn, the token of the moving player must be shifted exactly once.\n\nThe player who can't make a move loses, and the other player wins.\n\nBoth players want to win. Who wins if they play optimally?\n\nConstraints\n\n* 2 \\leq N \\leq 100\n* 1 \\leq A < B \\leq N\n* All input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\nN A B\n\n\nOutput\n\nPrint `Alice` if Alice wins, `Borys` if Borys wins, and `Draw` if nobody wins.\n\nExamples\n\nInput\n\n5 2 4\n\n\nOutput\n\nAlice\n\n\nInput\n\n2 1 2\n\n\nOutput\n\nBorys\n\n\nInput\n\n58 23 42\n\n\nOutput\n\nBorys", "query_id": "deepcoder_taco_b47de59fdd041aad05039e69af13d5e6", "id": "deepcoder_taco_b47de59fdd041aad05039e69af13d5e6", "starter_code": null, "input_output": "{\"inputs\": [\"9 23 42\", \"8 2 4\", \"3 1 2\", \"9 23 18\", \"3 2 2\", \"8 2 3\", \"9 23 23\", \"0 2 2\", \"7 2 3\", \"9 44 23\", \"0 2 1\", \"7 2 5\", \"9 44 0\", \"0 0 1\", \"7 1 5\", \"9 38 0\", \"0 1 1\", \"7 1 4\", \"1 38 0\", \"0 1 0\", \"8 1 4\", \"1 38 1\", \"0 2 0\", \"8 1 7\", \"1 31 0\", \"0 0 0\", \"8 0 7\", \"2 31 0\", \"1 0 0\", \"8 0 3\", \"2 31 -1\", \"2 0 0\", \"8 1 3\", \"2 53 -1\", \"0 0 -1\", \"3 1 3\", \"2 64 -1\", \"0 -1 -1\", \"0 1 3\", \"0 64 -1\", \"-1 -1 -1\", \"-1 1 3\", \"0 64 0\", \"0 -2 -1\", \"-1 1 4\", \"1 64 0\", \"0 1 -1\", \"-1 1 7\", \"1 103 0\", \"1 1 -1\", \"-1 1 13\", \"1 103 1\", \"2 1 -1\", \"-1 1 2\", \"2 103 1\", \"4 1 -1\", \"0 1 2\", \"2 79 1\", \"4 1 0\", \"0 1 4\", \"2 79 2\", \"7 1 0\", \"0 1 6\", \"2 56 2\", \"7 0 0\", \"0 0 6\", \"2 56 4\", \"11 0 0\", \"-1 0 6\", \"2 12 4\", \"11 -1 0\", \"-1 0 8\", \"2 21 4\", \"21 -1 0\", \"-1 0 10\", \"2 21 0\", \"21 -2 0\", \"0 0 10\", \"2 35 0\", \"21 -2 1\", \"1 0 -1\", \"2 35 1\", \"16 -2 1\", \"1 -1 -1\", \"2 30 1\", \"16 -3 1\", \"2 -1 -1\", \"2 11 1\", \"16 -3 2\", \"2 -1 -2\", \"0 11 1\", \"5 -3 2\", \"0 -1 -2\", \"-1 11 1\", \"7 -3 2\", \"0 -1 -3\", \"-1 22 1\", \"13 -3 2\", \"0 0 -3\", \"-1 22 2\", \"58 23 42\", \"2 1 2\", \"5 2 4\"], \"outputs\": [\"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Alice\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\\n\", \"Borys\\n\", \"Borys\\n\", \"Alice\\n\", \"Borys\", \"Borys\", \"Alice\"], \"remote\": false}", "task": "code", "language": "PYTHON", "solutions": ["(n, a, b) = map(int, input().split())\nprint('Alice' if (a - b - 1) % 2 == 1 else 'Borys')\n", "(n, a, b) = map(int, input().split())\nprint('Alice' if abs(a - b) % 2 == 0 else 'Borys')\n", "(N, A, B) = map(int, input().split())\nprint('Borys' if (B - A) % 2 else 'Alice')\n", "print('ABloircyes'[eval(input()[2:].replace(' ', '-')) % 2::2])\n", "(n, a, b) = map(int, input().split())\nans = ['Alice', 'Borys']\nprint(ans[(a - b) % 2])\n", "(N, A, B) = [int(x) for x in input().split()]\nprint('Alice' if (B - A - 1) % 2 == 1 else 'Borys')\n", "(n, a, b) = map(int, input().split())\nprint('ABloircyes'[(b - a) % 2::2])\n", "(_, A, B) = list(map(int, input().split()))\nx = A + B\nprint('Alice' if x % 2 == 0 else 'Borys')\n", "(N, A, B) = map(int, input().split(' '))\nprint(['Alice', 'Borys'][(B - A) % 2])\n", "(a, b, c) = map(int, input().split(' '))\nif (c - b) % 2 == 0:\n\tprint('Alice')\nelse:\n\tprint('Borys')\n", "(N, A, B) = map(int, input().split())\nans = 'Alice'\nif (B - A) % 2 == 1:\n\tans = 'Borys'\nprint(ans)\n", "(N, A, B) = map(int, input().split())\nC = B - A - 1\nif C % 2 != 0:\n\tprint('Alice')\nelse:\n\tprint('Borys')\n", "(n, x, y) = map(int, input().split())\nif (x - y) % 2 == 0:\n\tprint('Alice')\nelse:\n\tprint('Borys')\n", "(a, b, c) = map(int, input().split())\nprint('ABloircyes'[(c - b) % 2::2])\n", "(a, b, c) = [int(i) for i in input().split()]\nif abs(b - c) % 2 == 0:\n\tprint('Alice')\nelse:\n\tprint('Borys')\n", "a = list(map(int, input().split()))\nprint('ABloircyes'[(a[2] - a[1]) % 2::2])\n", "(n, a, b) = (int(x) for x in input().split())\nprint('Alice' if (b - a) % 2 == 0 else 'Borys')\n", "(n, a, b) = list(map(int, input().split()))\nans = 'Borys' if (b - a) % 2 else 'Alice'\nprint(ans)\n", "(_, a, b) = map(int, input().split())\nprint(['Alice', 'Borys'][abs(b - a) % 2 == 1])\n", "(a, b, c) = map(int, input().split())\nprint('Alice' if abs(b - c) % 2 != 1 else 'Borys')\n", "(n, a, b) = [int(i) for i in input().split()]\nprint(['Alice', 'Borys'][(a - b) % 2])\n", "(_, a, b) = map(int, input().split())\nprint(['Alice', 'Borys'][(b - a) % 2])\n", "(N, A, B) = map(int, input().split())\nprint('ABloircyes'[(B - A) % 2::2])\n", "(_, A, B) = map(int, input().split())\nprint('ABloircyes'[(B - A) % 2::2])\n", "(N, A, B) = [int(i) for i in input().split()]\nprint('Alice') if (A - B) % 2 == 0 else print('Borys')\n", "(N, a, b) = map(int, input().split())\nif (b - a - 1) % 2 == 0:\n\tprint('Borys')\nelse:\n\tprint('Alice')\n", "(n, a, b) = list(map(int, input().split()))\nprint(['Alice', 'Borys'][(b - a) % 2])\n", "(_, x, y) = map(int, input().split())\nprint(['Alice', 'Borys'][(x - y) % 2])\n", "(_, A, B) = map(int, input().split())\nprint(['Alice', 'Borys'][(B - A) % 2])\n", "(_, a, b) = map(int, open(0).read().split())\nprint('Borys' if (a - b) % 2 else 'Alice')\n", "(x, y, z) = list(map(int, input().split()))\nk = y - z\nif k % 2 == 1:\n\tprint('Borys')\nelse:\n\tprint('Alice')\n", "print('ABloircyes'[sum(map(int, input().split()[1:])) % 2::2])\n", "(N, A, B) = map(int, input().split())\nprint(('Borys', 'Alice')[(abs(A - B) - 1) % 2 == 1])\n"], "verify": 1, "wrong_type": null}
|
|
{"prompt": "<\uff5cUser\uff5c>problem\n\nThere are $ N $ propositions, named $ 1, 2, \\ cdots, N $, respectively. Also, $ M $ information about the propositions is given. The $ i $ th information is \"$ a_i $$\". Given in the form \"b_i $\", which means that $ a_i $ is $ b_i $. (\"If\" is a logical conditional and the transition law holds.) $ For each proposition $ i $ Output all propositions that have the same value as i $ in ascending order. However, proposition $ i $ and proposition $ i $ are always the same value. Proposition $ X $ and proposition $ Y $ have the same value as \"$ if $ X $\". It means \"Y $\" and \"$ X $ if $ Y $\".\n\n\n\noutput\n\nOn the $ i $ line, output all propositions that have the same value as the proposition $ i $, separated by blanks in ascending order. Also, output a line break at the end of each line.\n\nExample\n\nInput\n\n5 2\n1 2\n2 1\n\n\nOutput\n\n1 2\n1 2\n3\n4\n5\n<\uff5cAssistant\uff5c><think>\n", "question": "problem\n\nThere are $ N $ propositions, named $ 1, 2, \\ cdots, N $, respectively. Also, $ M $ information about the propositions is given. The $ i $ th information is \"$ a_i $$\". Given in the form \"b_i $\", which means that $ a_i $ is $ b_i $. (\"If\" is a logical conditional and the transition law holds.) $ For each proposition $ i $ Output all propositions that have the same value as i $ in ascending order. However, proposition $ i $ and proposition $ i $ are always the same value. Proposition $ X $ and proposition $ Y $ have the same value as \"$ if $ X $\". It means \"Y $\" and \"$ X $ if $ Y $\".\n\n\n\noutput\n\nOn the $ i $ line, output all propositions that have the same value as the proposition $ i $, separated by blanks in ascending order. Also, output a line break at the end of each line.\n\nExample\n\nInput\n\n5 2\n1 2\n2 1\n\n\nOutput\n\n1 2\n1 2\n3\n4\n5", "query_id": "deepcoder_taco_446be192f6149c3de610a3122f476230", "id": "deepcoder_taco_446be192f6149c3de610a3122f476230", "starter_code": null, "input_output": "{\"inputs\": [\"5 2\\n1 2\\n2 2\", \"3 2\\n1 2\\n2 1\", \"3 2\\n1 2\\n3 1\", \"6 2\\n1 2\\n2 1\", \"9 2\\n1 2\\n2 4\", \"6 2\\n1 1\\n2 1\", \"17 2\\n1 2\\n2 4\", \"4 2\\n2 2\\n3 1\", \"26 2\\n2 2\\n4 4\", \"12 2\\n2 2\\n4 4\", \"1 0\\n2 2\\n1 1\", \"17 2\\n1 2\\n2 1\", \"7 1\\n2 1\\n3 0\", \"28 2\\n1 2\\n4 6\", \"18 2\\n1 3\\n2 2\", \"10 2\\n1 2\\n4 6\", \"48 0\\n4 3\\n8 4\", \"94 0\\n4 3\\n0 3\", \"178 0\\n4 3\\n0 3\", \"8 1\\n4 1\\n1 -1\", \"211 0\\n4 2\\n0 3\", \"9 2\\n1 2\\n2 1\", \"42 2\\n2 2\\n4 4\", \"2 0\\n1 3\\n1 1\", \"11 1\\n1 2\\n2 1\", \"2 2\\n1 2\\n2 1\", \"5 2\\n2 3\\n3 2\", \"20 2\\n1 1\\n4 6\", \"14 2\\n1 2\\n2 1\", \"39 0\\n2 2\\n8 0\", \"22 2\\n1 1\\n4 6\", \"24 0\\n4 5\\n8 4\", \"14 0\\n7 1\\n-1 0\", \"15 1\\n1 1\\n0 -1\", \"21 1\\n1 1\\n2 1\", \"38 1\\n2 2\\n6 4\", \"77 0\\n2 2\\n8 0\", \"75 0\\n5 2\\n0 3\", \"13 0\\n2 0\\n6 4\", \"65 0\\n5 2\\n0 3\", \"25 1\\n2 1\\n1 4\", \"40 0\\n4 0\\n14 3\", \"5 2\\n1 2\\n2 4\", \"5 2\\n2 2\\n2 1\", \"3 2\\n1 2\\n2 2\", \"5 2\\n1 2\\n3 1\", \"5 2\\n2 2\\n3 1\", \"17 2\\n1 2\\n4 4\", \"4 1\\n2 2\\n3 1\", \"5 2\\n2 2\\n2 2\", \"5 2\\n2 2\\n1 1\", \"3 0\\n1 2\\n3 1\", \"6 2\\n1 2\\n2 2\", \"17 2\\n1 4\\n2 4\", \"17 2\\n2 2\\n4 4\", \"4 1\\n2 2\\n3 0\", \"5 2\\n2 2\\n3 2\", \"5 0\\n2 2\\n1 1\", \"3 0\\n1 1\\n3 1\", \"6 2\\n1 3\\n2 2\", \"4 1\\n2 1\\n3 0\", \"5 2\\n2 2\\n1 2\", \"6 0\\n2 2\\n1 1\", \"6 2\\n1 3\\n2 3\", \"6 0\\n0 2\\n1 1\", \"6 2\\n1 5\\n2 3\", \"12 2\\n2 2\\n3 4\", \"6 0\\n0 4\\n1 1\", \"6 2\\n2 5\\n2 3\", \"5 2\\n1 2\\n3 2\", \"6 1\\n1 2\\n2 1\", \"3 2\\n1 2\\n2 3\", \"5 1\\n1 2\\n3 1\", \"17 0\\n1 4\\n2 4\", \"17 2\\n1 2\\n4 6\", \"5 2\\n1 2\\n5 1\", \"4 1\\n2 2\\n6 1\", \"4 0\\n1 2\\n3 1\", \"4 2\\n1 2\\n2 2\", \"4 1\\n2 2\\n2 0\", \"5 2\\n2 4\\n3 2\", \"5 0\\n2 4\\n1 1\", \"3 0\\n1 1\\n3 0\", \"9 2\\n1 3\\n2 2\", \"26 2\\n2 2\\n8 4\", \"6 0\\n2 1\\n1 1\", \"6 0\\n0 2\\n1 2\", \"12 2\\n2 2\\n3 1\", \"6 0\\n1 4\\n1 1\", \"6 2\\n2 5\\n1 3\", \"5 0\\n1 2\\n3 2\", \"6 0\\n1 2\\n2 1\", \"3 2\\n1 3\\n2 2\", \"5 1\\n1 3\\n3 1\", \"17 0\\n0 4\\n2 4\", \"4 1\\n2 2\\n6 2\", \"1 0\\n2 2\\n1 0\", \"4 0\\n1 2\\n5 1\", \"7 2\\n1 2\\n2 2\", \"6 0\\n1 2\\n3 1\", \"5 2\\n1 2\\n2 1\"], \"outputs\": [\"1\\n2\\n3\\n4\\n5\\n\", \"1 2\\n1 2\\n3\\n\", \"1\\n2\\n3\\n\", \"1 2\\n1 2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n\", \"1\\n\", \"1 2\\n1 2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\\n51\\n52\\n53\\n54\\n55\\n56\\n57\\n58\\n59\\n60\\n61\\n62\\n63\\n64\\n65\\n66\\n67\\n68\\n69\\n70\\n71\\n72\\n73\\n74\\n75\\n76\\n77\\n78\\n79\\n80\\n81\\n82\\n83\\n84\\n85\\n86\\n87\\n88\\n89\\n90\\n91\\n92\\n93\\n94\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\\n51\\n52\\n53\\n54\\n55\\n56\\n57\\n58\\n59\\n60\\n61\\n62\\n63\\n64\\n65\\n66\\n67\\n68\\n69\\n70\\n71\\n72\\n73\\n74\\n75\\n76\\n77\\n78\\n79\\n80\\n81\\n82\\n83\\n84\\n85\\n86\\n87\\n88\\n89\\n90\\n91\\n92\\n93\\n94\\n95\\n96\\n97\\n98\\n99\\n100\\n101\\n102\\n103\\n104\\n105\\n106\\n107\\n108\\n109\\n110\\n111\\n112\\n113\\n114\\n115\\n116\\n117\\n118\\n119\\n120\\n121\\n122\\n123\\n124\\n125\\n126\\n127\\n128\\n129\\n130\\n131\\n132\\n133\\n134\\n135\\n136\\n137\\n138\\n139\\n140\\n141\\n142\\n143\\n144\\n145\\n146\\n147\\n148\\n149\\n150\\n151\\n152\\n153\\n154\\n155\\n156\\n157\\n158\\n159\\n160\\n161\\n162\\n163\\n164\\n165\\n166\\n167\\n168\\n169\\n170\\n171\\n172\\n173\\n174\\n175\\n176\\n177\\n178\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\\n51\\n52\\n53\\n54\\n55\\n56\\n57\\n58\\n59\\n60\\n61\\n62\\n63\\n64\\n65\\n66\\n67\\n68\\n69\\n70\\n71\\n72\\n73\\n74\\n75\\n76\\n77\\n78\\n79\\n80\\n81\\n82\\n83\\n84\\n85\\n86\\n87\\n88\\n89\\n90\\n91\\n92\\n93\\n94\\n95\\n96\\n97\\n98\\n99\\n100\\n101\\n102\\n103\\n104\\n105\\n106\\n107\\n108\\n109\\n110\\n111\\n112\\n113\\n114\\n115\\n116\\n117\\n118\\n119\\n120\\n121\\n122\\n123\\n124\\n125\\n126\\n127\\n128\\n129\\n130\\n131\\n132\\n133\\n134\\n135\\n136\\n137\\n138\\n139\\n140\\n141\\n142\\n143\\n144\\n145\\n146\\n147\\n148\\n149\\n150\\n151\\n152\\n153\\n154\\n155\\n156\\n157\\n158\\n159\\n160\\n161\\n162\\n163\\n164\\n165\\n166\\n167\\n168\\n169\\n170\\n171\\n172\\n173\\n174\\n175\\n176\\n177\\n178\\n179\\n180\\n181\\n182\\n183\\n184\\n185\\n186\\n187\\n188\\n189\\n190\\n191\\n192\\n193\\n194\\n195\\n196\\n197\\n198\\n199\\n200\\n201\\n202\\n203\\n204\\n205\\n206\\n207\\n208\\n209\\n210\\n211\\n\", \"1 2\\n1 2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n\", \"1\\n2\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n\", \"1 2\\n1 2\\n\", \"1\\n2 3\\n2 3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n\", \"1 2\\n1 2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\\n51\\n52\\n53\\n54\\n55\\n56\\n57\\n58\\n59\\n60\\n61\\n62\\n63\\n64\\n65\\n66\\n67\\n68\\n69\\n70\\n71\\n72\\n73\\n74\\n75\\n76\\n77\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\\n51\\n52\\n53\\n54\\n55\\n56\\n57\\n58\\n59\\n60\\n61\\n62\\n63\\n64\\n65\\n66\\n67\\n68\\n69\\n70\\n71\\n72\\n73\\n74\\n75\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\\n51\\n52\\n53\\n54\\n55\\n56\\n57\\n58\\n59\\n60\\n61\\n62\\n63\\n64\\n65\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1\\n2\\n3\\n\", \"1\\n2\\n3\\n4\\n5\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n\", \"1\\n2\\n3\\n4\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n7\\n\", \"1\\n2\\n3\\n4\\n5\\n6\\n\", \"1 2\\n1 2\\n3\\n4\\n5\"], \"remote\": false}", "task": "code", "language": "PYTHON", "solutions": ["import sys\ninput = sys.stdin.readline\n\ndef inpl():\n\treturn list(map(int, input().split()))\n(N, M) = inpl()\nG = [[] for _ in range(N)]\nrG = [[] for _ in range(N)]\nfor i in range(M):\n\t(a, b) = inpl()\n\tG[a - 1].append(b - 1)\n\trG[b - 1].append(a - 1)\n\ndef SCC(G, rG):\n\tN = len(G)\n\n\tdef dfs(i):\n\t\tnonlocal t, rorder, searched\n\t\tsearched[i] = True\n\t\tfor j in G[i]:\n\t\t\tif not searched[j]:\n\t\t\t\tdfs(j)\n\t\trorder[t] = i\n\t\tt += 1\n\n\tdef rdfs(i):\n\t\tnonlocal t, group, g\n\t\tgroup[i] = g\n\t\tfor j in rG[i]:\n\t\t\tif group[j] == -1:\n\t\t\t\trdfs(j)\n\tt = 0\n\trorder = [-1] * N\n\tsearched = [0] * N\n\tgroup = [-1] * N\n\tfor i in range(N):\n\t\tif not searched[i]:\n\t\t\tdfs(i)\n\tg = 0\n\tfor i in range(N - 1, -1, -1):\n\t\tif group[rorder[i]] == -1:\n\t\t\trdfs(rorder[i])\n\t\t\tg += 1\n\treturn (group, g)\n(group, g) = SCC(G, rG)\nans = [[] for _ in range(g)]\nfor i in range(N):\n\tans[group[i]].append(i + 1)\nfor i in range(N):\n\tprint(*ans[group[i]])\n", "def scc(N, G, RG):\n\torder = []\n\tused = [0] * N\n\tgroup = [None] * N\n\n\tdef dfs(s):\n\t\tused[s] = 1\n\t\tfor t in G[s]:\n\t\t\tif not used[t]:\n\t\t\t\tdfs(t)\n\t\torder.append(s)\n\n\tdef rdfs(s, col):\n\t\tgroup[s] = col\n\t\tused[s] = 1\n\t\tfor t in RG[s]:\n\t\t\tif not used[t]:\n\t\t\t\trdfs(t, col)\n\tfor i in range(N):\n\t\tif not used[i]:\n\t\t\tdfs(i)\n\tused = [0] * N\n\tlabel = 0\n\tfor s in reversed(order):\n\t\tif not used[s]:\n\t\t\trdfs(s, label)\n\t\t\tlabel += 1\n\treturn (label, group)\n(N, M) = map(int, input().split())\nE1 = [[] for _ in range(N + 1)]\nE2 = [[] for _ in range(N + 1)]\nfor _ in range(M):\n\t(a, b) = map(int, input().split())\n\tE1[a].append(b)\n\tE2[b].append(a)\n(label, group) = scc(N + 1, E1, E2)\nfor g in group[1:]:\n\tans = []\n\tfor (n, gg) in enumerate(group[1:], 1):\n\t\tif g == gg:\n\t\t\tans.append(n)\n\tprint(' '.join(map(str, ans)))\n", "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\nsys.setrecursionlimit(1000000000)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\nmod = 10 ** 9 + 7\ninf = float('inf')\n\ndef I():\n\treturn int(sys.stdin.readline())\n\ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n(n, m) = LI()\ngraph = [[] for _ in range(n)]\nfor _ in range(m):\n\t(a, b) = LI()\n\tgraph[a - 1].append(b - 1)\n\ndef dfs(s, lst, graph, check):\n\tlst.append(s)\n\tcheck[s] = False\n\tfor v in graph[s]:\n\t\tif check[v]:\n\t\t\tdfs(v, lst, graph, check)\n\treturn lst\nL = []\nfor i in range(n):\n\tc = [True] * n\n\tl = dfs(i, [], graph, c)\n\tl.sort()\n\tL.append(l)\nans = [[] for _ in range(n)]\nfor i in range(n):\n\tfor j in L[i]:\n\t\tif i in L[j]:\n\t\t\tans[i].append(j + 1)\nfor i in range(n):\n\tprint(*ans[i])\n"], "verify": 1, "wrong_type": null}
|