{"similarity_score": 0.9923319801533604, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=input()\ncard=raw_input().split()\ntable=[[[[-1 for x in range(52)] for w in range(53)] for y in range(53)] for z in range(53)]\n#maisuu(0index) -1 -2 -3\n\ndef ok(t,u):\n\treturn t[0]==u[0] or t[1]==u[1]\n\nmark={}\nmark[\"2\"]=0\nmark[\"3\"]=1\nmark[\"4\"]=2\nmark[\"5\"]=3\nmark[\"6\"]=4\nmark[\"7\"]=5\nmark[\"8\"]=6\nmark[\"9\"]=7\nmark[\"T\"]=8\nmark[\"J\"]=9\nmark[\"Q\"]=10\nmark[\"K\"]=11\nmark[\"A\"]=12\nnum={}\nnum[\"S\"]=0\nnum[\"D\"]=1\nnum[\"H\"]=2\nnum[\"C\"]=3\n\ndef tonum(kard):\n\treturn mark[kard[0]]+13*num[kard[1]]\n\ndef solve(kard):\n\tif len(kard)==1:\n\t\treturn True\n\tif len(kard)==2:\n\t\tif ok(kard[0],kard[1]):\n\t\t\treturn True\n\t\treturn False\n\tif table[len(kard)-1][tonum(kard[-1])][tonum(kard[-2])][tonum(kard[-3])]!=-1:\n\t\treturn \ttable[len(kard)-1][tonum(kard[-1])][tonum(kard[-2])][tonum(kard[-3])]\n\tres=False\n\tkk=kard[::]\n\tif ok(kard[-1],kard[-2]):\n\t\tkk[-2]=kk[-1]\n\t\tkk.pop()\n\t\tres=res or solve(kk)\n\tkk=kard[::]\n\tif len(kard)>3 and ok(kard[-1],kard[-4]):\n\t\tkk[-4]=kk[-1]\n\t\tkk.pop()\n\t\tres=res or solve(kk)\n\ttable[len(kard)-1][tonum(kard[-1])][tonum(kard[-2])][tonum(kard[-3])]=res\n\treturn res\n\nprint len(card)\t\nif solve(card):\n\tprint \"YES\"\nelse:\n\tprint \"NO\"\n", "lang": "Python 2", "bug_code_uid": "6f2511d5704681b9c2c9809f25fc550c", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "0d424326f33cc9b739a10cfaf973d49d", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.986784140969163, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = int(raw_input())\nc = raw_input().split()\nq = [c]\nv = set([tuple(c)])\nwhile len(q) > 0:\n\tc = q.pop();\n\tif len(c) == 1:\n\t\tprint 'YES'\n\t\texit()\n\tfor i in [-2,-4]:\n\t\tif len(c)>=abs(i) and (c[-1][0]==c[i][0] or c[-1][1]==c[i][1]):\n\t\t\td = c\n\t\t\td[i] = d[-1]\n\t\t\td.pop()\n\t\t\tif tuple(d) not in v:\n\t\t\t\tv.add(tuple(d))\n\t\t\t\tq.append(d)\nprint 'NO'\n", "lang": "Python 2", "bug_code_uid": "07009818d7188b4a43971aafb1b823de", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "7766253d5d0fefab39f9f100a1cf15ad", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6458333333333334, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n=int(input())\nif (n%5==0):\n print(\"%d\",(n//5))\nelse:\n print(\"%d\",(n//5)+1)\n", "lang": "Python 3", "bug_code_uid": "a9431abd194582ba196f7fcdc81cf176", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "6c104e6fe067aa36a7315ab4963a1b58", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6008298755186722, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\nimport sys\nimport math\nimport random\nimport operator\nfrom fractions import Fraction, gcd\nfrom decimal import Decimal, getcontext\nfrom itertools import product, permutations, combinations\ngetcontext().prec = 100\n\nMOD = 10**9 + 7\nINF = float(\"+inf\")\n\nh, n = map(int, raw_input().split())\n\n\nres = n - 1\nfor i in xrange(h):\n n = (n >> 1) + (n & 1)\n res += n\n\nprint res\n", "lang": "Python 2", "bug_code_uid": "36a09dae35ddd5c0e25c19ceed890a2f", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "3d406ec5c38bf67cfe0ada575114431c", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.539906103286385, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def solve(n, verts):\n\tif n == 1:\n\t\treturn -1\n\tif n == 2:\n\t\tif verts[0][0] == verts[1][0] or verts[0][1] == verts[1][1]:\n\t\t\treturn -1\n\t\telse:\n\t\t\treturn abs(verts[0][0] - verts[1][0]) * abs(verts[0][1] - verts[1][1])\n\tif n == 3 or n == 4:\n\t\tlowest = [0, 0]\n\t\tbiggest = [0, 0]\n\t\tfor i in verts:\n\t\t\tif i[0] <= lowest[0] and i[1] <= lowest[1]:\n\t\t\t\tlowest = i\n\t\tfor i in verts:\n\t\t\tif i[0] >= biggest[0] and i[1] >= biggest[1]:\n\t\t\t\tbiggest = i\n\t\treturn abs(lowest[0] - biggest[0]) * abs(lowest[1] - biggest[1])\n\nn = int(raw_input())\nverts = [map(int, raw_input().split()) for i in range(n)]\nprint solve(n, verts)\n", "lang": "Python 2", "bug_code_uid": "cca9094162cd39ec15f17e1757ce4821", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "5be400b2dd2038ed6842a4c2abc5354b", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4219409282700422, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "import math\na=input()\nans=int(a,2)\nn=int(math.sqrt(ans))\nan=[int(4**x) for x in range(n+1) ]\nc=0\ni=0\nwhile(an[i] powers[i]:\n c += 1\nprint(c)\n\n", "lang": "PyPy 3", "bug_code_uid": "05d11c0e065a3b689f8fb2d0722944a6", "src_uid": "d8ca1c83b431466eff6054d3b422ab47", "apr_id": "763abd1b241e3eb52bbb5472e1c4b3bb", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5708418891170431, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a = []\nn = input()\nm = input()\nfor i in range(n):\n a.append(input())\nif sum(a) + m <= max(a) * n:\n print max(a)\nelse:\n print (sum(a) + m) / n + (sum(a) + m) % n\n", "lang": "Python 2", "bug_code_uid": "4b2be5f173f7a9a22b7968bb8cb8cc10", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "b30632c5fa09edcee1e2ad7dbe46e013", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.978328173374613, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "s = raw_input()\nresult = \"NO\"\nfor i in range(len(s)):\n\tfor j in range(len(s)):\n\t\tif (s[:i] + s[j:] == \"CODEFORCES\"):\n\t\t\tresult = \"YES\"\n\t\t\tbreak\n\nprint result\n", "lang": "Python 2", "bug_code_uid": "202a85ff7e69ea5570e48f2584b54f5f", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "apr_id": "52cb99d6632428087b3be0aca4347046", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7303370786516854, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "k=int(input())\nl=int(input())\nm=int(input())\nn=int(input())\nd=int(input())\ni=1\ncount=0\nwhile i<=n:\n if n<=i:\n if i%k!=0 and i%l!=0 and i%m!=0 and i%n!=0:\n count=count+1\n elif m<=i 1 and j > 1:\n array[i][j] = max(array[i - 2][j - 1], array[i - 1][j - 2]) + 1\n elif i > 1 and j:\n array[i][j] = array[i - 2][j - 1] + 1\n elif i and j > 1:\n array[i][j] = array[i - 1][j - 2] + 1\n return array[m][n]\nprint team(min(m, n), max(m, n))", "lang": "Python 2", "bug_code_uid": "095bd1113e35ba9a84705043a636b5f3", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "3f473e1092d5bf5ae64867442784f4f7", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9228650137741047, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/python\n\ndef ir():\n return int(raw_input())\n\ndef ia():\n line = raw_input()\n line = line.split()\n return map(int, line)\n\nd1, d2, d3 = ia()\nr1 = d1 + d3 + d2\nr2 = d1 + d1 + d2 + d2\nr3 = d2 + d3 + d2\nr4 = d2 + d2 + d1 + d1\n\nprint min(r1, r2, r3, r4)\n\n#H -- d1 -- S1\n#| /\n#| d3 /\n#d2 / \n#| / \n#| /\n#S2\n\n\n", "lang": "Python 2", "bug_code_uid": "13c714d15491bfd1d7d750fbe06e4710", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "df68c822cfa96e3095fc8b4da17af729", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6847599164926931, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "l, r = map(int, raw_input().strip().split(' '))\n\nans = 0\n\ncnt = 31\nfor i in xrange(cnt):\n for j in xrange(cnt):\n if i == 0 and j == 0:\n continue\n cur = (2 ** i) * (3 ** j)\n if l <= cur and cur <= r:\n ans += 1\n\nprint ans", "lang": "Python 2", "bug_code_uid": "817b0431b8c91ab04d47679135bcbcb0", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "ccdffa807f51f81b66fdc6b94195fbcc", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9949392712550608, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "h1, h2= tuple(map(int, input().split()))\na, b= tuple(map(int, input().split()))\n\"\"\"\na =2 #\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0432\u0435\u0440\u0445\nb =1 #\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u043f\u043e\u043b\u0437\u0430\u043d\u0438\u044f\nh1 =1 #\u0441\u0442\u0430\u0440\u0442 \u0447\u0435\u0440\u0432\u044f\nh2 =300 #\u0432\u044b\u0441\u043e\u0442\u0430 \u044f\u0431\u043b\u043e\u043a\u0430\nr = a #\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f\n\"\"\"\n\n#if h2 < h1: #\u043f\u0440\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0432\u0432\u0435\u0440\u0445\n #print('false')\n\n \nday = 0\nr = a*8+h1 #\u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u0435\u043d\u044c \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 (\u0441 14 \u0434\u043e 22) \n\n\nif a<=b and a*8 + h1 <= h2: #\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0443\u0441\u043f\u0435\u043b \u043b\u0438 \u0447\u0435\u0440\u0432\u044f\u043a \u0437\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0434\u043d\u044f \u0438 \u0435\u0441\u043b\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0442\u0434\u0430\u0435\u043c -1\n day = -1 \nelse: \n if a<=b and r < h2: #\u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f - \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0446\u0438\u043a\u043b\n day = -1\n else: \n while r < h2: #\u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430: \u043f\u043e\u043a\u0430 R \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u044b\u0441\u043e\u0442\u044b 2 \n r = r - b * 12 #\u0441\u043f\u043e\u043b\u0437\u0430\u0435\u043c \u0432\u043d\u0438\u0437\n #print ('v',r)\n r = r + a * 12 #\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u043d\u0435\u0432\u043d\u043e\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0432\u0432\u0435\u0440\u0445\n #print ('^', r) \n day = day +1 #\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0434\u043d\u0435\u0439\n \n \n\n \n\n\nprint (day)\n\n", "lang": "Python 3", "bug_code_uid": "b376488ba98441d258d0703f2c5eea13", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "d25fe0c8e3f8079959bebc6cc3bd096f", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7272727272727273, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "def lexicographically_next_permutation(a):\n i = len(a) - 2\n while not (i < 0 or a[i] < a[i+1]):\n i -= 1\n if i < 0:\n return False\n # else\n j = len(a) - 1\n while not (a[j] > a[i]):\n j -= 1\n a[i], a[j] = a[j], a[i] \n a[i+1:] = reversed(a[i+1:]) \n return True\n\nif __name__ == '__main__':\n per = [1, 2, 3, 4, 5]\n\n ls = []\n for i in xrange(5):\n ls.append([])\n ls[i] = [int(x) for x in raw_input().split(' ')]\n\n # print ls[0][4]\n large = 0\n s = ( (ls[per[0]-1][per[1]-1] + ls[per[1]-1][per[0]-1] + ls[per[2]-1][per[3]-1] + ls[per[3]-1][per[2]-1]) +\n (ls[per[1]-1][per[2]-1] + ls[per[2]-1][per[1]-1] + ls[per[3]-1][per[4]-1] + ls[per[4]-1][per[3]-1]) +\n (ls[per[2]-1][per[3]-1] + ls[per[3]-1][per[2]-1]) +\n (ls[per[3]-1][per[4]-1] + ls[per[4]-1][per[3]-1]) )\n\n i = 0\n while lexicographically_next_permutation(per) != False:\n if s > large:\n large = s\n s = ( (ls[per[0]-1][per[1]-1] + ls[per[1]-1][per[0]-1] + ls[per[2]-1][per[3]-1] + ls[per[3]-1][per[2]-1]) +\n (ls[per[1]-1][per[2]-1] + ls[per[2]-1][per[1]-1] + ls[per[3]-1][per[4]-1] + ls[per[4]-1][per[3]-1]) +\n (ls[per[2]-1][per[3]-1] + ls[per[3]-1][per[2]-1]) +\n (ls[per[3]-1][per[4]-1] + ls[per[4]-1][per[3]-1]) )\n i += 1\n\n print large\n\n\n\n\n", "lang": "Python 2", "bug_code_uid": "5a091d93e6193461fc0fa418735c0f8d", "src_uid": "be6d4df20e9a48d183dd8f34531df246", "apr_id": "ba7957e54203a61473fee87c8ca6150e", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9927360774818402, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def digitsum(n):\n n= list(map(int,str(n)))\n if sum(l)%4==0:\n return True\n else:\n return False\nn=int(input())\nfor i in range(n,n+10):\n if digitsum(i):\n print(i)\n break\n", "lang": "Python 3", "bug_code_uid": "814ccd0c117b51727adacf5ef35bdf2f", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "f47a2737ace3380eadf9e955855275b5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9565217391304348, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\ns = ''\nfor i in range(2, n):\n if n%i == 0:\n s = int(i) + str(n/i)\nprint(s)", "lang": "Python 3", "bug_code_uid": "ff6d6bd373191e216cf1fce6dd5b1cca", "src_uid": "7220f2da5081547a12118595bbeda4f6", "apr_id": "e7987afe5bc1f597f931a54d421feb01", "difficulty": null, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.017660044150110375, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "\nn,p = map(int,input().split())\ns = bin(n)\nr = s.count('1')\nyy = r * p\nn-=yy\nif n < 0:\n print(-1)\nelse:\n s = bin(n)\n r = s.count('1')\n print(r)", "lang": "Python 3", "bug_code_uid": "b1cc31576af6b78d7bf8132d8e0bc496", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "d6afc0991ce15e929b17a8660896f9d8", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.109717868338558, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "from math import sqrt\n\n\ndef primes(n):\n sieve = set(range(3, n + 1, 2))\n if n >= 2:\n sieve.add(2)\n for i in range(3, int(sqrt(n)) + 1, 2):\n if i in sieve:\n sieve -= set(range(2 * i, n + 1, i))\n return sieve\n\n\nn = int(input())\nres = 1\nfor el in primes(n):\n if n % el == 0:\n res *= el\nprint(res)", "lang": "Python 3", "bug_code_uid": "bb0b313b80b773a566cd76c4a1378adb", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "c0c6cdbb8109f01d7961e047a082cd79", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5843881856540084, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import itertools\nans=10000000000000\nn=map(int, raw_input().split())\nx=map(str, raw_input().split())\nnl=list(itertools.permutations(n))\nxl=list(itertools.permutations(x))\nnl=set(nl); nl=list(nl)\nxl=set(xl); xl=list(xl)\n\nfor i in range(len(nl)):\n for j in range(len(xl)):\n e='(('+nl[i][0]+xl[j][0]+nl[i][1]+')'+xl[j][1]+nl[i][2]+')'+xl[j][2]+nl[i][3]\n f='('+nl[i][0]+xl[j][0]+nl[i][1]+')'+xl[j][1]+'('+nl[i][2]+xl[j][2]+nl[i][3]+')'\n ans=min(ans,eval(e),eval(f))\nprint ans", "lang": "Python 2", "bug_code_uid": "59968402372dbcd31246fbe7be86b9df", "src_uid": "7a66fae63d9b27e444d84447012e484c", "apr_id": "b167c51700169c68a821c8c4e253bf59", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9932756964457252, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def f(q, t):\n a, b, c = sorted(q)\n if t == '**': return a * b * c\n if t == '++': return a + b + c\n if t == '*+': return a * b + c\n if t == '+*': return a * (b + c)\n\np = sorted(list(map(int, input().split())))\nt = input()[:: 2]\nx, t = t[0], t[1: ]\nif x == '*':\n s = p[0] * p[1] * p[2] * p[3]\n for i in range(3):\n for j in range(i + 1, 4):\n q = p[:]\n q[i] *= q[j]\n q.pop(j)\n s = min(f(q, t), s)\n print(s)\nelse: print(f([p[0], p[1], p[2] + p[3]]))", "lang": "Python 3", "bug_code_uid": "2acd9dba4508591f8625ab02b57aa9c5", "src_uid": "7a66fae63d9b27e444d84447012e484c", "apr_id": "83c137290e26b6b1828a95a8c77e30b3", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8190954773869347, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "d,k,a,b,t=map(int,raw_input().split())\ns=min(d,k)\nc=min(b*s,a*s+t)\nn=c*(d/k)+[[0,min(b*(d%k),a*(d%k))][d%k],[-t,min(-t+b*(d%k),a*(d%k))][d%k]][c==a*s+t]\nprint min(d*b,d*a+t*((d-1)/k),a*s+b*(d-s),n)", "lang": "Python 2", "bug_code_uid": "9e0014aece30b217bd1c99c25d74c8b3", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "apr_id": "bd85c6bafb3af8d3f5b172327e2bb38a", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.890625, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "d,k,a,b,t=map(int,input().split())\ns=min(d,k)\nc=min(b*s,a*s+t)\nn=c*(d/k)+[[0,min(b*(d%k),a*(d%k))][d%k>0],[-t,min(-t+b*(d%k),a*(d%k))][d%k>0]][c==a*s+t]\nprint min(d*b,d*a+t*((d-1)/k),a*s+b*(d-s),n)", "lang": "Python 2", "bug_code_uid": "5d5072828676786a3126a9908cc42de3", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "apr_id": "bd85c6bafb3af8d3f5b172327e2bb38a", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9580093312597201, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\nfactor = [ 1]\nfac, ans=1,0 \nfor i in range (1,31):\n fac*=i \n factor.append(fac)\nn , m ,t = map(int,input().split())\n\nfor i in range (4,t+1):\n if t-i <=m and t-i >0:\n ans+= (factor[n]//(factor[n-i]*factor[i] )) *(factor[m]//(factor[m-(t-i)]*factor[t-i]))\n \nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "a62396c4c29d90894af72138a340b1c0", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "ed9391e8c49f2a4963fe31bbe1db9847", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4767277856135402, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "n = int(input())\np = 0\nfor a in range(1,810):\n for b in range(1,(8101-10*a)):\n if c >= 1234:\n c = n - a*1234567-b*123456\n if c>0:\n if c % 1234 == 0:\n p = 1\n break\n\nif p == 1:\n print(\"YES\")\nelif p == 0:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "5dc30f2ae373264d5e373530b1a20452", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "35af92eef99a2492c724151612c8cefd", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6084558823529411, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "n,a,b,c=map(int,input().split())\nf,d=n,n\ne=0\nif n%4==0:\n print(0)\nelse:\n w=[]\n for i in range(10**9):\n if (n+i)%4==0:\n w.append(i*a)\n e+=1\n if (f+i*2)%4==0:\n w.append(i*b)\n e+=1\n if (d+i*3)%4==0:\n w.append(min(i*c,i*a+i*b))\n e+=1\n if (d+i*5)%4==0:\n w.append(min(i*c,i*a+i*b)+i*b)\n e+=1\n if (d+i*4)%4==0:\n w.append(min(i*c,i*a+i*b)+i*a)\n e+=1\n if e==5:\n break\n print(min(w))", "lang": "PyPy 3", "bug_code_uid": "8e66dcf2e967e490b44a2f036435fe33", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "bd8c951878b5e2a9fe504079303a7c3c", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.40749414519906324, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "def f(n):\n m = int(n ** 0.5) + 1\n t = [1] * (n + 1)\n for i in range(3, m):\n if t[i]: t[i * i :: 2 * i] = [0] * ((n - i * i) // (2 * i) + 1)\n return [2] + [i for i in range(3, n + 1, 2) if t[i]]\n\na, b, k = map(int, input().split())\nk -= 1; b += 1\n\nt, p, x = [-1] * (b + 100), f(b + 100), -1\n\nfor i in range(len(p) - k):\n t[p[i]] = p[i + k] - p[i]\n\nt.reverse()\nfor i in range(1, b + 100):\n if t[i] < 0: t[i] = t[i - 1] + 1\nt.reverse()\n\nif len(p) > k: \n for i in range(a + 1, b):\n t[i] = max(t[i], t[i - 1])\n\n for l in range(1, b - a + 1):\n if t[b - l] < l:\n x = l\n break\nprint(x)", "lang": "Python 3", "bug_code_uid": "55a432d4f761a2cd2de11a79ba0514c0", "src_uid": "3e1751a2990134f2132d743afe02a10e", "apr_id": "21262e4c0e565499a127673bae8ffe5d", "difficulty": 1600, "tags": ["binary search", "number theory", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9218921892189219, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def f(a, b):\n t = [1] * (b + 1)\n for i in range(3, int(b ** 0.5) + 1):\n if t[i]: t[i * i :: 2 * i] = [0] * ((b - i * i) // (2 * i) + 1)\n return [i for i in range(3, b + 1, 2) if t[i] and i > a]\n\na, b, k = map(int, input().split())\n\np = f(a - 1, b)\nif 3 > a: p = [2] + p\n \nif k > len(p): print(-1)\nelse: print(max(p[k - 1] - a + 1, b - p[len(p) - k] + 1, max(p[i + k] - p[i] for i in range(len(p) - k))))", "lang": "Python 3", "bug_code_uid": "9cb32a65888f943d7c2fdb7bace3140a", "src_uid": "3e1751a2990134f2132d743afe02a10e", "apr_id": "21262e4c0e565499a127673bae8ffe5d", "difficulty": 1600, "tags": ["binary search", "number theory", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8968968968968969, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nl=int(input())\nr=int(input())\na=[]\nt=1\nfor i in range(l):\n a.append(t)\n t=t*2\nb=[]*n\ni=0\nwhile(i= d:\n if n % d == 0:\n if prime_dict[d]:\n prime_dict[d] = prime_dict[d] + 1\n else:\n prime_dict[d] = 1\n else:\n d = d + 1\n return prime_dict\n\n_ = input()\nn, d = _.split()\nn, d = int(n), int(d)\nprime_dict = prime(d)\nn_prime_dict = dict()\nanswer = 10000000\nfor key in prime_dict:\n _pow_key = key\n n_prime_key = 0\n while _pow_key < n:\n n_prime_key = n_prime_key + n // _pow_key\n _pow_key = _pow_key * key\n answer = min(answer, n_prime_key // prime_dict[key])\nprint(answer)", "lang": "Python 3", "bug_code_uid": "80d929f2a1d4cd9b4b6992037abf2411", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "e0c4a04550c9c3b3ce8815b2da846d6c", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6129184347006129, "equal_cnt": 21, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 21, "bug_source_code": "from bisect import bisect_left as bl\nfrom bisect import bisect_right as br\nimport heapq\nimport math\nfrom collections import *\nfrom functools import reduce,cmp_to_key\nimport sys\ninput = sys.stdin.readline\n \nM = mod = 998244353\ndef factors(n):return sorted(list(set(reduce(list.__add__,([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))))\n# def inv_mod(n):return pow(n, mod - 2, mod)\n \ndef li():return [int(i) for i in input().rstrip('\\n').split()]\ndef st():return input().rstrip('\\n')\ndef val():return int(input().rstrip('\\n'))\ndef li2():return [i for i in input().rstrip('\\n').split(' ')]\ndef li3():return [int(i) for i in input().rstrip('\\n')]\n\ndef compare(a,b):\n if a[-1]b[-1]:return 1\n else:\n if sum(a[:-1]) > sum(b[:-1]):return -1\n return 1\n\nt1, t2, x1, x2, t = li()\nbestans = []\nif t == t1 and t1 == t2:\n print(x1,x2)\nelif t == t1:\n print(x1,0)\n\nelif t == t2:\n print(0,x2)\nelse:\n\n r = (t2 - t)/(t - t1)\n\n\n for i in range(1,x2 + 1):\n curry1 = i*r\n if 0 <= int(curry1) <= x1:\n bestans.append([int(curry1),i,curry1 - int(curry1)])\n if 0 <= math.ceil(curry1) <= x1:\n bestans.append([math.ceil(curry1),i,math.ceil(curry1) - curry1])\n\n\n for i,(a,b,c) in enumerate(bestans):\n if ((a*t1 + b*t2)/(a + b)) < t:\n bestans[i][-1] = 1000\n continue\n bestans[i][-1] = abs(t - ((a*t1 + b*t2)/(a + b)))\n\n bestans.sort(key=cmp_to_key(compare))\n # print(bestans)\n print(*bestans[0][:-1])", "lang": "PyPy 3", "bug_code_uid": "f974ef0d5cd4b19c44d38d6a3264f004", "src_uid": "87a500829c1935ded3ef6e4e47096b9f", "apr_id": "25ecaf7507dc7ffc8b7b4968473e98c5", "difficulty": 1900, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8595505617977528, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 9, "bug_source_code": "l=int(input())\nr=int(input())\na=int(input())\nans=0\nif(a>=abs(l-r)):\n\tif(l>r):\n\t\ta=a-(l-r)\n\t\tans=l*2+(a//2)\n\telse:\n\t\ta=a-(r-l)\n\t\tans=r*2+(a//2)\nelse:\n\tans=(min(l,r)+a)*2\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "099844a156d3cee4937696ca3e7f77b3", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "6000e95b112ba2d2347065897850f060", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.938860103626943, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import sys\nl=sys.stdin.read()\nl1 = l.split('\\n')\nl_int = []\nfor j in l1:\n l_int.append(int(j))\n\ninit = [1, 2]\nrest = 3\ntotal = l_int[0]\nt = 0\nfor i in l_int[1:]:\n t += 1\n if i not in init:\n print 'NO'\n break\n else:\n for k in init:\n if k != i:\n init.remove(k)\n init.append(rest)\n rest = k\n if t == total:\n print 'YES'\n break\n\n\n\n \n", "lang": "Python 2", "bug_code_uid": "6fa51ec641cd905ea769a9cc564faaa3", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "apr_id": "8521112fab0d9293b2af0b1f79871048", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.09826589595375723, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "\n\n\n\n\nif __name__==\"__main__\":\n n,k = map(int, input().strip().split())\n t= 240 - k\n i=0\n while(True):\n i += 1\n t = t-5*i\n if t < 0:\n i -= 1\n break\n\n print(min(i,n))\n\n\n\n", "lang": "Python 3", "bug_code_uid": "c844566ba04a8d3de8fe3b69a8233c20", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "6fb95449e9d18d2fd59e844943a519e8", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8779552715654952, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "import time\nimport numpy as np\n\n\ncoord = set()\nflows = int(input())\nstart = time.time()\nt = list(map(int, input().split()))\ndirections = {0: (0, 1), 1: (1, 1), 2: (1, 0), 3: (1, -1), 4: (0, -1), 5: (-1, -1), 6: (-1, 0), 7: (-1, 1)}\nwas = np.zeros([600,600,31,8])\n\n\ndef flight(n, x=0, y=0, direction=0):\n if was[x][y][n][direction]:\n #print(x, y, direction, n, len(was))\n return\n was[x][y][n][direction] = 1\n if n:\n for _ in range(t[flows - n]):\n x += directions[direction][0]\n y += directions[direction][1]\n coord.add((x, y))\n flight(n - 1, x, y, (direction + 1) % 8)\n flight(n - 1, x, y, (direction - 1) % 8)\n\nflight(flows)\n# print(coord)\nprint(len(coord))\nprint(time.time() - start)\n", "lang": "PyPy 3", "bug_code_uid": "7c92b55e49bcfcc9b0934162a8fd1086", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "0d214145d24ecc7e94674aba7906f6e9", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6828106391425168, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a1 = int(input())\na2 = int(input())\na3 = int(input())\na4 = int(input())\nproduct = a1 * 8 + a2 * 4 + a3 * 2 + a4\n\nif product == 0:\n print(0)\n exit(0)\n \nif product == 1:\n print(1)\n exit(0)\n \nif product == 2:\n print(0)\n exit(0)\n \nif product == 3:\n print(1)\n exit(0)\n\nif product == 4:\n print(0)\n exit(0)\n \nif product == 5:\n print(0)\n exit(0)\n \nif product == 6:\n print(0)\n exit(0)\n\nif product == 7:\n print(0)\n exit(0)\n\nif product == 8:\n print(1)\n exit(0)\n \nif product == 9:\n print(1)\n exit(0)\n \nif product == 10:\n print(0)\n exit(0)\n\nif product == 11:\n print(1)\n exit(0)\n \nif product == 12:\n print(1)\n exit(0)\n \nif product == 13:\n print(0)\n exit(0)\n\nif product == 14:\n print(1)\n exit(0)\n\na1 = int(input())\na2 = int(input())\na3 = int(input())\na4 = int(input())\nproduct = a1 * 8 + a2 * 4 + a3 * 2 + a4\n\nif product == 0:\n print(0)\n exit(0)\n \nif product == 1:\n print(1)\n exit(0)\n \nif product == 2:\n print(0)\n exit(0)\n \nif product == 3:\n print(1)\n exit(0)\n\nif product == 4:\n print(0)\n exit(0)\n \nif product == 5:\n print(0)\n exit(0)\n \nif product == 6:\n print(0)\n exit(0)\n\nif product == 7:\n print(1)\n exit(0)\n\nif product == 8:\n print(1)\n exit(0)\n \nif product == 9:\n print(1)\n exit(0)\n \nif product == 10:\n print(0)\n exit(0)\n\nif product == 11:\n print(1)\n exit(0)\n \nif product == 12:\n print(1)\n exit(0)\n \nif product == 13:\n print(0)\n exit(0)\n\nif product == 14:\n print(1)\n exit(0)\n\nif product == 15:\n print(1)\n exit(0)\n\nwhile True:\n\tNone", "lang": "Python 3", "bug_code_uid": "c5e90fa797f0de0465ecbaa9cd2ec639", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "06adc8f96396a09a6963c2e0534f16fa", "difficulty": 2000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9949748743718593, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,s,a=raw_input(),[],0\nfor i in map(int,raw_input().split(' ')):\n while len(s)>1 and min(s[-2],i)>=s[-1]:\n ans+=min(i,s[-2])\n del(s[-1])\n s.append(i)\ns.sort()\nprint a+sum(s[0:-2])\n", "lang": "Python 2", "bug_code_uid": "359fa56f286f9c22c34f9b45e76fc53d", "src_uid": "e7e0f9069166fe992abe6f0e19caa6a1", "apr_id": "bc5ece742b42617fc6c56407e4aca11a", "difficulty": 2500, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9997057958223007, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\n\nn=int(sys.stdin.readline().strip('\\n'))\nline=sys.stdin.readline().strip('\\n').split(' ')\nvalues=map(lambda x:int(x),line)\n\ndef evaluateBothSides(start,stop):\n print start,stop\n if stop-start==1:\n return min(values[start-1],values[stop])\n elif stop-start==0:\n return 0\n else: \n maxNum=0\n maxPos=0\n for i in xrange(start,stop):\n if values[i]>maxNum:\n maxPos=i\n maxNum=values[i]\n return evaluateBothSides(start,maxPos)+evaluateBothSides(maxPos+1,stop)+min(values[start-1],values[stop])\n\ndef evaluateMax(stop):\n 2+2\n\ndef evaluate(start,stop):\n 2+2\n \n\ndef addToQueue(inp,queue):\n out=0\n if inpqueue[-1]:\n out+=queue.pop()\n queue.append(inp)\n return out\n\ndef queueEvaluate():\n maxLeft=0\n maxRight=0\n maxPos=0\n maxNum=0\n for i in xrange(0,n):\n if values[i]>maxNum:\n maxPos=i\n maxNum=values[i]\n out=0\n queue=[maxNum]\n for i in xrange(maxPos+1,n):\n out+=addToQueue(values[i],queue)\n #print queue\n if len(queue)==1:\n pass\n else:\n maxRight=queue[1]\n for i in xrange(2,len(queue)):\n out+=queue[i]\n queue=[maxNum]\n for i in xrange(maxPos-1,-1,-1):\n out+=addToQueue(values[i],queue)\n #print queue\n if len(queue)==1:\n pass\n else:\n maxLeft=queue[1]\n for i in xrange(2,len(queue)):\n out+=queue[i]\n out+=min(maxLeft,maxRight)\n return out\n\nprint queueEvaluate()\n \n \n", "lang": "Python 2", "bug_code_uid": "aaa22c36ea9633ecbc11523b20033b3d", "src_uid": "e7e0f9069166fe992abe6f0e19caa6a1", "apr_id": "1066dde92f8870bd8fe0d30736fa7ec5", "difficulty": 2500, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9935649935649936, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from math import factorial as fac\n\nn, t = map(int, input().split())\nif t & (t - 1):\n ans = 0\nelse:\n ans = c = 0\n s = bin(n + 2)[2:] \n l = len(s)\n for i in range(l):\n if s[i] == '1':\n m, k = l - i - 1, t.bit_length() - c\n if k <= m:\n ans += fac(m) // fac(k) // fac(m - k)\n c += 1\n if t == 1: ans -= 1\nprint(ans)", "lang": "Python 3", "bug_code_uid": "260071dbf72e3bf4c2e89a92c8d23b3d", "src_uid": "727d5b601694e5e0f0cf3a9ca25323fc", "apr_id": "686e65be4a33999006f86628b5ccb000", "difficulty": 2000, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7323943661971831, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import math\nn, t = map(int, raw_input().split())\n\nfor i in range(55):\n comb = [[0]*55 for _ in range(55)]\nfor i in range(55):\n for j in range(i+1):\n if (i == 0 or j == 0): comb[i][j] = 1\n else:\n comb[i][j] = comb[i-1][j] + comb[i-1][j-1]\n\ndef gao(m, k):\n ret = 0\n while m > 0:\n p = int(math.log(m, 2))\n ret += comb[p][k]\n k -= 1\n m -= 2**p\n if m == 0:\n if k == 0:\n ret += 1\n break\n if k < 0:\n break\n return ret\n\nk = int(math.log(t, 2))\ntmp = 0\nwhile (t > 0):\n if (t % 2 == 1):\n tmp += 1\n t /= 2\n if (tmp > 1):\n break\nif (tmp > 1):\n print 0\nelse:\n ans = gao(n+1, k+1)\n if t == 1:\n ans -= 1\n print ans\n", "lang": "Python 2", "bug_code_uid": "9a8acb68ac726dfc62a5e5f90a04c61f", "src_uid": "727d5b601694e5e0f0cf3a9ca25323fc", "apr_id": "0f8647c4cffca7a890acbf6b8266a193", "difficulty": 2000, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.45109780439121755, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from sys import stdin\na,b,c,d,e,f = stdin.readline().strip().split()\na=int(i);b=int(b);c=int(c);d=int(d);e=int(e);f=int(f);\nfir = b*b * d*f;\nsec = a*a * c *e;\nif fir>sec:\n print 'Ron'\nelse:\n print 'Hermione'", "lang": "Python 2", "bug_code_uid": "ff6ccbc43adba3df1b2ea225f7ec7e75", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "186d48fc836949e904881943b1290401", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8240740740740741, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import math\nn, m, a = map(int, input().split())\nprint (sum([1 for i in range(math.ceil(n/a)) for i in range(math.ceil(m/a))]))", "lang": "PyPy 3", "bug_code_uid": "afe09a260a83f9f779fff321a544c865", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "01531c90201a09597bb4d9150b21a432", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9971988795518207, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from sys import stdin\nrr = stdin.readline\nrrm = lambda: map(int, rr().strip().split())\nYES, NO, MOD = \"YES\", \"NO\", 10**9 + 7\n\ndef solve(N,K,A):\n ans = 0\n for b in xrange(K):\n opn = [x for i,x in enumerate(A) if i%k != b]\n val = abs(sum(opn))\n ans = max(ans, val)\n return ans\n \n \nN, K = rrm()\nA = rrm()\nprint solve(N,K,A)\n", "lang": "PyPy 2", "bug_code_uid": "7a384b63473cd7317df813ee489c7c9b", "src_uid": "6119258322e06fa6146e592c63313df3", "apr_id": "1d18e4e13bf21db74627348a5acc081d", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.044709388971684055, "equal_cnt": 8, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "import heapq\nn,k,q=[int(i) for i in input().split()];\nt=[int(i) for i in input().split()];\nh=[]\nisnew=False;\nr=[];\nfor i in range(q):\n type,id=[int(i) for i in input().split()];\n if(type==1):\n if(k>len(h)):\n heapq.heappush(h,t[id-1])\n else:\n heapq.heappushpop(h,t[id-1])\n else:\n if t[id-1] in h:\n r.append(\"YES\");\n else:\n r.append(\"NO\");\nprint(*r,sep='\\n');\n", "lang": "Python 3", "bug_code_uid": "b7586e5e57356ae73390374406bedb3e", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "047961952a20e4bdac6a9f01e44d2366", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3673469387755102, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Mar 19 20:14:41 2019\n\n@author: KIIT\n\"\"\"\n\nimport math\nimport os\nimport random\nimport re\nimport sys\nfrom itertools import permutations\n\nif __name__ == '__main__':\n a = list(map(int, input().rstrip().split()))\n if(a[1]==a[0]):\n print(0)\n if(a[0]==0):\n print(-1)\n elif(a[1]%a[0]==0):\n d=a[1]/a[0]\n k,p=0,0\n if(d%2==0):\n k=2\n p=3\n elif(d%3==0):\n k=3\n p=2\n c=0\n while(d%k==0):\n \n c=c+1\n d=d/k\n while(d%p==0):\n c=c+1\n d=d/p\n print(c)\n \n else:\n print(-1)\n \n \n \n \n ", "lang": "Python 3", "bug_code_uid": "a2874d37a226d075e69a8dc3ec2e6d6d", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "c5e98d8a74aeb701fca33020c338595f", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5775401069518716, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "vvod=input()\nn,m=vvod.split()\nn=int(n)\nm=int(m)\n\nk=m/n\nif k!=int:\n print('-1')\nelse:\n c=0\nwhile k>1:\n if k%3==0:\n k=k/3\n else:\n k=k/2\n c=c+1\nprint(c)", "lang": "Python 3", "bug_code_uid": "f589a37c27837b83b62d50cb4c423a09", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "43536ab86c201a1b192211f94379386e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6991869918699187, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "def ornaments(y,b,r):\n\tl = min(y,b,r)\n\tprint((l+1) + l + (l-1))\n\ny = int(input())\nb = int(input())\nr = int(input())\nornaments(y,b,r)", "lang": "Python 3", "bug_code_uid": "e508587ca4f1869d11816fb1a373dd29", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "4bebaff79ac8a18790f2d6860bae979c", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.964824120603015, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,k,M,D = map(int, input().split())\nprint(max([ d*min(m, n//(k*(d-1)+1)) for d in range(1,D+1)]))", "lang": "Python 3", "bug_code_uid": "ef00571dae82162942fe312d84245777", "src_uid": "ac2e795cd44061db8da13e3947ba791b", "apr_id": "f92cc28dea353e0730f7239eb971707b", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9910714285714286, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "read = lambda: map(int, input().split())\nn, v, e = read()\nadj = [[]] * (n + 1)\nAs = [0] + list(read())\nBs = [0] + list(read())\nans = []\n\nfor _ in range(e):\n a, b = map(int, input().split())\n adj[a].append(b)\n adj[b].append(a)\n\n\ndef flow(a, b, d):\n As[a] -= d\n As[b] += d\n ans.append((a, b, d));\n\ndef augment(path, e, d):\n if e:\n dd = min(d, As[path[e - 1]], v - As[path[e]])\n flow(path[e - 1], path[e], dd)\n augment(path, e - 1, d)\n if d > dd:\n flow(path[e - 1], path[e], d - dd);\n \ndef adjust(s):\n pre = [0] * (n + 1)\n pre[s] = -1\n stk = [s]\n e = 0\n while len(stk):\n p = stk[-1]\n del stk[-1]\n if As[p] < Bs[p]:\n e = p\n break\n for to in adj[p]:\n if not pre[to]:\n pre[to] = p\n stk.append(to)\n \n if not e:\n raise Exception\n \n path = []\n while e > 0:\n path.insert(0, e)\n e = pre[e]\n\n augment(path, len(path) - 1, min(Bs[path[-1]] - As[path[-1]], As[s] - Bs[s])) \n\ntry:\n while True:\n check = False\n for i in range(1, n + 1):\n if As[i] > Bs[i]:\n adjust(i)\n check = True\n if not check: \n break\n for i in range(1, n + 1):\n if As[i] != Bs[i]:\n raise Exception\n print(len(ans))\n for tp in ans:\n print(*tp)\nexcept Exception:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "7a695f4d491f7f9c0f7537a78dcde45e", "src_uid": "0939354d9bad8301efb79a1a934ded30", "apr_id": "6931aa323d92d9a4ff7a662505ee209f", "difficulty": 2500, "tags": ["dfs and similar", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.984352773826458, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import numpy as np\nfrom sys import stdin, stdout\na, b, c = map(int, stdin.readline().rstrip().split())\ndays=['f', 'r', 'c', 'f', 'c', 'r', 'f']\ndivs=[a//3, b//2, c//2]\ndivmin = np.min(divs)\nmaxi=divmin*7\n#print(\"divmin : \", divmin)\n#print(\"maxi : \", maxi)\nif maxi!=0:\n a, b, c = a-(divmin*3), b-(divmin*2), c-(divmin*2)\n#print(\"a : \", a, \"b : \", b, \"c : \", c)\nfor i in range(0, 7):\n dayfood={'f':a, 'r':b, 'c':c}\n #print(\"i : \", i)\n k=divmin*7\n while 1:\n l=days[(k+i)%7]\n #print(\"l : \", l, \" value : \", dayfood[l], \" indice : \", (k+i)%7)\n k+=1\n if dayfood[l]==0:\n break\n else :\n dayfood[l]-=1\n if k-1 > maxi:\n maxi = k-1\nprint(maxi)", "lang": "Python 3", "bug_code_uid": "ccc3c6255d750ecd379b9727fd5c75b8", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "055e2885b16679daf6a4a2e59ffb78f8", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3865546218487395, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n,m,k=map(int,input().split())\nif k%2==0:\n z=k//2\n d='R'\nelse:\n z=(k+1)//2\n d='L'\nb=[]\nc=1\ne=[]\nfor i in range(n):\n for j in range(m):\n e.append(c)\n c+=1\n b.append(e)\n e=[]\ny=[]\nfor i in range(len(b)):\n if z in b[i]:\n l=i+1\n y=b[i]\n break\nfor i in range(len(y)):\n if y[i]==z:\n v=i+1\n break\nprint(l,v,d)", "lang": "PyPy 3", "bug_code_uid": "4fc6cec90337b65a5b0e24216d6efdf6", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "937f9ffa4b8dc3acd4c9cad4e5cc548c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5862068965517241, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 8, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "a=list(map(int,input().split()))\nb=[]\nfor x in range(a[0]):\n\tfor y in range(a[0]):\n\t\tb.append((x+1)*(y+1))\nprint(b.count(a[1]))", "lang": "PyPy 3", "bug_code_uid": "a842e07946236c4f4991f0f8fafa4ed1", "src_uid": "c4b139eadca94201596f1305b2f76496", "apr_id": "c6deca0863f4be8365d50ec9bf0bc380", "difficulty": 1000, "tags": ["number theory", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8994413407821229, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a = int(input())\nA = []\nb = int(input())\nA.append(b)\nwhile b != a:\n if (b-1) % 10 == 0 and b >= a:\n b = (b-1)//10\n A.append(b)\n elif b % 2 == 0 and b >= a: \n b = b//2\n A.append(b)\n else:\n break\nif a == b:\n A = sorted(A)\n print('YES')\n print(len(A))\n print(*A,sep = ' ')\nelse:\n print('NO')", "lang": "Python 3", "bug_code_uid": "6f99019aebdf0c8de64ed8c768b06cd7", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "7bbcfb758efb4809759dc63bf19cfcbb", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9364406779661016, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "s1=raw_input()\nn=len(s1)\ns2=raw_input()\nm=len(s2)\nif '?' not in s1 and '?' not in s2:\n sm1=0 \n sm2=0 \n for i in s1:\n if i=='+':sm1+=1 \n else: sm1-=1 \n \n for i in s2:\n if i=='+': sm2+=1 \n else: sm2-=1 \n print(1 if sm1==sm2 else 0)\n exit()\nsm1=0 \nfor i in s1:\n if i=='+':sm1+=1 \n else: sm1-=1 \n#make1=[s1]\nmake2=[s2]\nans=[]\nwhile any('?' in i for i in make2):\n n=[]\n for i in make2:\n if '?' not in i:\n ans.append(i)\n for j in range(len(i)):\n if i[j]=='?':\n n.append(i[0:j]+\"-\"+i[j+1:])\n n.append(i[0:j]+'+'+i[j+1:])\n make2=n\n #print(make2)\n#make2=ans\nmake2=[i for i in make2 if '?' not in make2]\n#print(make2)\n#make2=list(set(make2))\n#print(make2)\ndef sum_now(s):\n sum=0 \n for i in s:\n if i=='+': sum+=1 \n else: sum-=1 \n return sum \nmake2=[sum_now(i) for i in make2]\n#print(make2)\nprint(sum(i==sm1 for i in make2)*(1.0)/len(make2))", "lang": "PyPy 2", "bug_code_uid": "8f2815bc7db9d00bb260d427edde2c0b", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "925566eb8eba18590ac0c8a13ad06d3d", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6515837104072398, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# Contest: 21 - Codeforces Rating >= 2200 (https://a2oj.com/ladder?ID=21)\n# Problem: (25) Hexagons (Difficulty: 5) (http://codeforces.com/problemset/problem/615/E)\n\ndef rint():\n return int(input())\n\n\ndef rints():\n return list(map(int, input().split()))\n\n\nn = rint()\nif n == 0:\n print(0, 0)\n exit(0)\nn -= 1\nl, h = 0, 10**9\nwhile h - l > 1:\n m = (h + l) // 2\n if 3 * m * (m + 1) > n:\n h = m - 1\n else:\n l = m\nc = h if 3 * h * (h + 1) <= n else l\nn -= 3 * c * (c + 1)\n\nfields = [(2 * (c + 1), 0)]\nfor dx, dy in [(-1, 2), (-2, 0), (-1, -2), (1, -2), (2, 0), (1, 2)]:\n for i in range(c + 1):\n x, y = fields[-1]\n fields.append((x + dx, y + dy))\nprint(*fields[n + 1])\n", "lang": "PyPy 3", "bug_code_uid": "a88a4c5936b0bb14e4c2fe019fb5b530", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "de946c046d047cc56b639b5ea2a3f1a1", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6876971608832808, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "lista = list(map(int, input().split()))\na = lista[0]\nb = lista[1]\nimport math\n\ndef resta(a,b):\n\tif a==0 or b==0:\n\t\treturn(f\"{a} {b}\")\n\telse:\n\t\tif a>=(2*b):\n\t\t\tc = (math.floor((a/(2*b))-1))\n\t\t\tif c >= 1:\n\t\t\t\ta = a - 2*b*c\n\t\t\t\treturn(resta(a,b))\n\t\t\telse:\n\t\t\t\ta = a - 2*b\n\t\t\t\treturn(resta(a,b))\n\t\tif b>=(2*a):\n\t\t\td = (math.floor((b/(2*a))-1))\n\t\t\tif d >= 1:\n\t\t\t\tb = b - 2*a*d\n\t\t\t\treturn(resta(a,b))\n\t\t\telse:\n\t\t\t\tb = b - 2*a\n\t\t\t\treturn(resta(a,b))\n\t\telse:\n\t\t\treturn(f\"{a} {b}\")\n\n\n\nprint(resta(a,b))", "lang": "Python 3", "bug_code_uid": "e0834b9ec1e2d631f2fbcbf199b56f9b", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "5345355cdd37b85468f0760ffe1094f9", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.40169851380042465, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "from math import factorial\nfac = factorial\n\ndef dfs(lst):\n sums = [[] for i in xrange(k+1)]\n sums[0].append(0)\n while len(lst)>0:\n cur = lst.pop(0)\n length = [len(sums[i]) for i in xrange(k+1)]\n for i in xrange(k+1):\n for j in xrange(length[i]):\n if sums[i][j] + cur <=s:\n sums[i].append(sums[i][j]+cur)\n if cur<19 and i S:\n break\n\n if opt == 1:\n s += l[i]\n elif opt == 2:\n if l[i] <= 18:\n s += factorials[l[i]]\n marks += 1\n else:\n s = S + 1\n\n if s <= S:\n d[s][marks] += 1\n\n return d\n\n\n[n, K, S] = map(int, sys.stdin.next().split(' '))\nl = sorted(map(int, sys.stdin.next().split(' ')))\n\np1 = enum(l[:(len(l) / 2)][::-1])\np2 = enum(l[(len(l) / 2):][::-1])\n\nvariants = 0\nfor s in p1:\n if S - s in p2:\n m1 = p1[s]\n m2 = p2[S - s]\n for (k1, c1) in enumerate(m1):\n for (k2, c2) in enumerate(m2):\n if k1 + k2 <= K:\n variants += c1 * c2\n\nprint(variants)\n", "lang": "PyPy 2", "bug_code_uid": "b7a77da71b8a358788ff83f3bd2493d2", "src_uid": "2821a11066dffc7e8f6a60a8751cea37", "apr_id": "137308d04cc0e4bc637c2d651f55a972", "difficulty": 2100, "tags": ["dp", "meet-in-the-middle", "bitmasks", "math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9425981873111783, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "m=input()\nn=input()\no=input()\nr1,r2=m.split(\" \")\nc1,c2=n.split(\" \")\nd1,d2=o.split(\" \")\nx=int((int(r1)+int(d1)-int(c2))/2)\nw=int((int(r2)+int(d2)-int(c2))/2)\ny=int((int(r1)+int(d2)-int(c1))/2)\nz=int((int(r2)+int(d1)-int(c1))/2) \nif x==y or y==z or z==w or w==x or y==w or x==z:\n print(-1)\nelif x>9 or y>9 or w>9 or z>9 or x<1 or y<1 or w<1 or z<1:\n print(-1)\nelif a!=b or b!=c or c!=a:\n print(-1)\nelse:\n print(str(x)+\" \"+str(y))\n print(str(w)+\" \"+str(z))", "lang": "Python 3", "bug_code_uid": "694549921d5daa5de322a79dd1b99b7f", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "48a3a952833f580ee35e897fa3631097", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6756476683937824, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "# a = [0] * 34\n# a[10] = 1\n# for i in range(10, 34):\n# \tif i + 1 <= 33:\n# \t\ta[i + 1] += a[i]\n# \tif i + 10 <= 33:\n# \t\ta[i + 10] += a[i]\n\n# print(a[33])\n\n\nx, y = map(int, input().split())\na = [0] * (y+1)\na[x] = 1\n\nfor i in range(x, y+1):\n\tif 2 * i <= y:\n\t\ta[2*i] += a[i]\n\tif (i * 10) + 1 <= y:\n\t\ta[(i * 10) + 1] += a[i]\n\nif a[-1]:\n\n\tresult = [y]\n\twhile y > x:\n\t\tif (y - 2) % 2 == 0:\n\t\t\ty //= 2\n\t\t\tresult.append(y)\n\t\telif y % 10 == 1:\n\t\t\ty //= 10\n\t\t\tresult.append(y)\n\n\tprint(\"YES\", len(result), sep=\"\\n\")\n\tprint(\" \".join(map(str, result[::-1])))\n\nelse:\n\tprint(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "ef0ce9606fb557ae0d0df95c929ad71b", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "7ed265491fa2a00f167148dda1845dc8", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3333333333333333, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "input()\nc=a=r=0\nfor i in input().split():c=(a==i)*c+1;a=i;r+=c\nprint(r)", "lang": "Python 3", "bug_code_uid": "b010beec15f21bc16d0e8f98b1e5d711", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "3a43c5eb4aa8f0770bd362cd50add328", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.994413407821229, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def solve(a,b):\n\tif b==1:\n\t\treturn a\n\tk=int(a/b)\n\tc=b-a%b\n\tif c==1:\n\t\treturn k+a%b +1\n\telse:\n\t\treturn k+solve(c,a) +1\n\n(a,b) = map(int, raw_input().split(' '))\n\nprint solve(a,b)\n", "lang": "Python 2", "bug_code_uid": "db4b6aa0c17ec6f05a5e5c9686b3cb4d", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "76a7e018910fd780e9074692f753aaf9", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.21374045801526717, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "from math import sqrt\na,b,c = map(int, raw_input().split())\nd = (b**2) - 4*a*c\nd = sqrt(d)\n\nlist = [(-b-d)/ 2 / a,(-b+d)/2 / a]", "lang": "PyPy 2", "bug_code_uid": "8163c84e8b2efbb93506820488c2f24f", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "126987af84596f601a406c2a9630ba84", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3694741740344346, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "from math import sqrt\ndef F(n):\n n += 2\n return int(round(((1+sqrt(5))**n-(1-sqrt(5))**n)/(2**n*sqrt(5))))\n\n\nn, k, l, m= map(int,raw_input().split())\n\nans = 1\n\nif k >= (2< 0:\n bit = k&1\n k = k >> 1\n l -= 1\n\n if bit == 0:\n ans *= F(n)\n ans %= m\n else:\n ans *= ((1<= l:\n\tprint 0\nelse:\n\tt = f(n, m)\n\tmul = 1\n\tfor i in range(l):\n\t\tbit = k % 2\n\t\tif bit == 0:\n\t\t\tmul = (mul * t) % m\n\t\telse:\n\t\t\tx = mod_expo(2, n, m)\n\t\t\tif(x >= t):\n\t\t\t\tmul = (mul * (x - t)) % m\n\t\t\telse:\n\t\t\t\tmul = (mul * (x - t + m)) % m\n\t\tk = k / 2\n\tprint mul\n", "lang": "Python 2", "bug_code_uid": "5b96d17a0e5362db43592c03d3f313e8", "src_uid": "2163eec2ea1eed5da8231d1882cb0f8e", "apr_id": "5c4f4da4fd00c26dc556742e20b83529", "difficulty": 2100, "tags": ["combinatorics", "matrices", "number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9503759398496241, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "from math import sqrt\n\ndef is_square(n):\n r = sqrt(n)\n return int(r * r) == n\n\n\nn = input()\nmx = 0\nL = len(n)\nfor i in range(1 << L):\n s = ''\n for j in range(L):\n if i & (1 << (L - j - 1)):\n s += n[j]\n if s[0] != '0' and is_square(int(s)) and len(s) > mx:\n mx = len(s)\nprint(L - mx)", "lang": "PyPy 3", "bug_code_uid": "3d05e8598b2fe724b60dabf164793260", "src_uid": "fa4b1de79708329bb85437e1413e13df", "apr_id": "27b13bb238ba18a79a259740c1f3908e", "difficulty": 1400, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9007633587786259, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "k,l=raw_input().split()\nk=int(k)\nl=int(l)\ncount=0;\nwhile (l%k==0):\n l/=k\n count=count+1\nif l==1:\n print \"YES\\n%d\"%(count-1)\nelse:\n print \"NO\"\n", "lang": "Python 2", "bug_code_uid": "628c77c73e75d7e9971b58279ac45c93", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "e28c66867783d4fc76c07f509df2bfa2", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6771428571428572, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "input()\nstring = list(input())\nres = list()\nif len(string) > 1:\n for i in range(len(string) // 2):\n if len(string) <= 1:\n res.append(string)\n break\n a = string[:i+1]\n if len(a) > 0:\n res.append(a[0])\n del string[:i+1]\nelse:\n res.append(string[0])\nprint(\"\".join(res))\n", "lang": "Python 3", "bug_code_uid": "8481ae21c0a4328c4286f88683a1879d", "src_uid": "08e8c0c37b223f6aae01d5609facdeaf", "apr_id": "8180bbc2294d5cb6e9d76f531d505218", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.536097212294496, "equal_cnt": 31, "replace_cnt": 20, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 30, "bug_source_code": "from sys import stdin, stdout\nimport sys\nsys.setrecursionlimit(1500)\n\n\n# 7 3\n# n % 2 % 3 % 4 = n % 3 % 2 % 4\n# 8 % 3 % 6 = 2 = 8 % 6 % 3 =\n# 8 % 5 % 10 = 3 = 8 % 10 % 5 = 3\n# 8 % 2 % 5, 8 % 5 % 2\n\n# 1 => (2 3) 4 5 6 =>\n# 1 => (2, 3) 4 => 3*2 / 2\n# 1 => any\n# 2 => 2*1, 2*2, 2*3, 2*4\n# 3 => 3*1, 3*2, 3*3, 3*4\n# 5 => 5*1, 5*2, 5*3, 5*4\ndef modular_stability(n, k):\n\n if k > n:\n return 0\n\n if k == 1:\n return n\n\n res = 0\n # 1\n res += com(n-1, k-1)\n res %= 998244353\n\n # prime numbers\n for i in range(2, n+1):\n #if isprime(i):\n cnt = n // i\n if cnt == k:\n res += 1\n elif cnt > k:\n res += com(cnt-1, k-1)\n res %= 998244353\n\n #print(faca)\n return res\n\n\ndef isprime(n):\n\n j = 2\n while j*j <= n:\n if n%j == 0:\n return False\n j += 1\n\n return True\n\n\ndef com(p1, p2):\n return fac(p1) // fac(p1-p2) // fac(p2)\n\n\nfaca = [0, 1]\ndef fac(n):\n if len(faca) > n:\n return faca[n]\n r = n*fac(n-1)\n faca.append(r)\n\n return r\n\n\nif __name__ == '__main__':\n (n,k) = list(map(int, stdin.readline().split()))\n for i in range(1, n+1):\n fac(i)\n\n print(modular_stability(n, k))\n", "lang": "PyPy 3", "bug_code_uid": "adc5641a4f7117e9e44e9714557ed852", "src_uid": "8e8eb64a047cb970a549ee870c3d280d", "apr_id": "1d97e1e71a2f8eea6d2084ca544610e4", "difficulty": 2000, "tags": ["math", "combinatorics", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5986078886310905, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "\nn=int(input())\nl=[]\nc=0\nfor i in range(n):\n\tl.append(list(map(int,input().split())))\nfor i in range(n):\n\tc+=l[i][i]+l[n-1-i][n-1-i]+l[(n+1)//2][i]+l[i][(n+1)//2]\nc=c-3*(l[(n+1)//2][(n+1)//2])\nprint(c)", "lang": "Python 3", "bug_code_uid": "c1c3b82692592068c51e4863b12c3f31", "src_uid": "5ebfad36e56d30c58945c5800139b880", "apr_id": "f1cfd06f2f8d20973095fac9a0c95dff", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9609544468546638, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "t, k = input(), 0\np = defaultdict(list)\nfor j, i in enumerate(t, 1):\n p[i].append(j)\nfor i in list(p.keys()):\n if len(p[i]) < 2: p.pop(i)\nif p:\n k = 1\n while True:\n q = defaultdict(list)\n for i in p:\n for j in p[i]:\n if j < len(t): q[i + t[j]].append(j + 1)\n p = q\n for i in list(p.keys()):\n if len(p[i]) < 2: p.pop(i)\n if not p: break\n k += 1\nprint(k)", "lang": "Python 3", "bug_code_uid": "5c4fb46ce32bb90557e9c44253e0a0d5", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7", "apr_id": "ddcb68784eb3ba93c6ad094afbe4c691", "difficulty": 1200, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6858407079646017, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n=int(input())\ndef sumd(n) : \n sumf=0\n p=len(str(n))\n for i in range(p):\n sumf+=n//10**(p-1-i)\n n=n%10**(p-1-i)\n return sumf\nif n%2==0:\n x=n/2+1\n y=n/2-1\nelse:\n x=n//2\n y=n-x\nprint(int(sumd(x)+sumd(y)))", "lang": "PyPy 3", "bug_code_uid": "b891a30eff4e79d3b79cefc38283d7c3", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "40347be635e262fe55cd647bb0c88e8f", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.24433249370277077, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "n=input()\nn=int(n)\ncheck=0\nwhile(True):\n n-=i*1359257\n i+=1\n if(n-i*1359257<0):\n break\nfor a in range(0,n//1234567+1):\n for b in range(0,n//123456+1):\n for c in range(0,n//1234+1):\n if(n==1234567*a+123456*b+1234*c):\n check=1\n break\n if(1234567*a+123456*b+1234*c>n):\n break\nif(check==0):\n print(\"NO\")\nelse:\n print(\"YES\")", "lang": "Python 3", "bug_code_uid": "e9e0c97979754e80fe14bf127ad66b8f", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "117771c5fd10df65d4af0ea571543c72", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.857707509881423, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "Y, W = map(int, input().split())\n\nif (Y < W):\n Y = W\n \nif (x == 1):\n print('1/1')\nelif (x == 2):\n print('5/6')\nelif (x == 3):\n print('2/3')\nelif (x == 4):\n print('1/2')\nelif (x == 5):\n print('1/3')\nelse:\n print('1/6')\n\n\n \n", "lang": "Python 3", "bug_code_uid": "c877c21e0545016f926ac4186300c421", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "77b016e820ed89fd12166227723b1b26", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5975903614457831, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a,b=map(int,raw_input().split())\n\ndef gcd(a,b):\n while a!=b:\n if a>b:\n a-=b\n if b>a:\n b-=a\n return a\n\na=a*1L\nn=a*b/gcd(a,b)\n\n\nl=[]\n\nfor i in xrange(a,n,a):\n l.append([i,1])\n\nfor i in xrange(b,n,b):\n l.append([i,2])\n \ni=j=p=0\n\nif aj: print \"Dasha\"\nelif i l.index(s[2])):\n print(\"YES\")\nelif (s[1] == c) and (s[3] != c):\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 2", "bug_code_uid": "e6731cb962afffcbca9e83ff1bfb019a", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "172e89962bd3cb1cfc86465439169382", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7125, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n = int(input())\nmin=10000\nmax=0\nfor i in range(0,n):\n year=int(input())\n if min>year: min=year\n if max other.votes\n\ndef main():\n candidates, seats, people, voted = map(int, input().split())\n votes = [0 for i in range(candidates)]\n last_vote = [0 for i in range(candidates)]\n\n if candidates == 1:\n print(1)\n return\n\n v = list(map(int, input().split()))\n for t in range(voted):\n cand = v[t] - 1\n votes[cand] += 1\n last_vote[cand] = t\n\n states = [State(i, votes[i], last_vote[i]) for i in range(candidates)]\n states = sorted(states, key = lambda x : (x.votes, -x.last_vote))\n res = [0 for i in range(candidates)]\n\n for i in range(candidates):\n if i < candidates - seats:\n low = candidates - seats\n if states[i].beats(states[low], people - voted):\n res[states[i].candidate] = 2\n else:\n res[states[i].candidate] = 3\n else:\n extra = people - voted\n other = i - 1\n place = i\n\n if extra == 0 and states[i].votes == 0:\n res[states[i].candidate] = 3\n continue\n\n while other >= 0 and extra > 0:\n needed = states[i].votes - states[other].votes + 1\n if needed <= extra:\n extra -= needed;\n place -= 1\n other -= 1\n else:\n break\n\n res[states[i].candidate] = (1 if place + seats >= candidates else 2)\n\n for i in res:\n print(i, end = ' ')\n\nmain()\n", "lang": "Python 3", "bug_code_uid": "7577b290ca5a6349ddb31b22b56b4933", "src_uid": "81a890bd542963bbcec7a041dde5c247", "apr_id": "d95c0e7dd9fccf0fa0b0e68a94d1ea80", "difficulty": 2100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9529103989535644, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "from copy import deepcopy\nn, k, m, a = [int(i) for i in input().split()]\ncn = [0] * (n + 1)\nlast = [-1] * (n + 1)\nv = [int(i) for i in input().split()]\n\nfor i in range(len(v)):\n last[v[i]] = i\n cn[v[i]] += 1\n\ncn1 = deepcopy(cn)\nlast1 = deepcopy(last)\n\nfor i in range(1, n + 1):\n cn = deepcopy(cn1)\n last = deepcopy(last1)\n res = [i1 for i1 in range(1, n + 1)]\n res.sort(key=lambda x: (cn[x], -last[x]), reverse = True)\n \n for j in range(len(res)):\n if res[j] != i:\n continue\n j1 = j + 1\n lft = m - a\n while j1 < n and lft:\n cn[res[j1]] += min(lft, cn[i] - cn[res[j1]] + 1)\n last[res[j1]] = m\n lft -= min(lft, cn[i] - cn[res[j1]] + 1)\n j1 += 1\n\n res.sort(key=lambda x: (cn[x], -last[x]), reverse = True)\n sans = 0\n for j in range(len(res)):\n if res[j] != i:\n continue\n if cn[i] == 0 or j >= k:\n sans = 0\n else:\n sans = 1\n break\n\n if sans == 1:\n print(1, end= ' ')\n continue\n \n cn = deepcopy(cn1)\n last = deepcopy(last1)\n\n if m - a:\n cn[i] += m - a\n last[i] = m - 1\n\n res.sort(key=lambda x: (cn[x], 0 -last[x]), reverse = True)\n for j in range(len(res)):\n if res[j] != i:\n continue\n if cn[i] == 0 or j >= k:\n sans = 0\n else:\n sans = 1\n break\n \n if sans:\n print(2, end=' ')\n else:\n print(3, end=' ')\n", "lang": "PyPy 3", "bug_code_uid": "85b273dc341511dc0e2621a30a2ed680", "src_uid": "81a890bd542963bbcec7a041dde5c247", "apr_id": "72c19e2ac27fdb32a3847765a86a0c66", "difficulty": 2100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.42780748663101603, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "k, n, w = [int(s) for s in input().split()]\nprint (k*w*(w+1)/2-n)", "lang": "Python 2", "bug_code_uid": "43cf88c43a5659c0bb52501bfad3dd89", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "64f6418f0e54a16ba44f4022c7059e2e", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7856485740570377, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 12, "bug_source_code": "#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\nimport sys, math, random, operator\nfrom string import ascii_lowercase, ascii_uppercase\nfrom fractions import Fraction, gcd\n#from decimal import Decimal, getcontext\nfrom itertools import product, permutations, combinations\nfrom Queue import Queue, PriorityQueue\nfrom collections import deque, defaultdict, Counter\n#getcontext().prec = 100\n\nMOD = 10**9 + 7\nINF = float(\"+inf\")\n\nif sys.subversion[0] == \"PyPy\":\n import io, atexit\n sys.stdout = io.BytesIO()\n atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))\n sys.stdin = io.BytesIO(sys.stdin.read())\n raw_input = lambda: sys.stdin.readline().rstrip()\npr = lambda *args: sys.stdout.write(\" \".join(str(x) for x in args) + \"\\n\")\nepr = lambda *args: sys.stderr.write(\" \".join(str(x) for x in args) + \"\\n\")\ndie = lambda *args: pr(*args) ^ exit(0)\n\nread_str = raw_input\nread_strs = lambda: raw_input().split()\nread_int = lambda: int(raw_input())\nread_ints = lambda: map(int, raw_input().split())\nread_float = lambda: float(raw_input())\nread_floats = lambda: map(float, raw_input().split())\n\n\"---------------------------------------------------------------\"\n\nn = read_int()\ns = read_str()\n\nnum = []\nfor i in xrange(len(s)):\n num.append([None])\n for j in xrange(i + 1, len(s)+1):\n num[i].append( int(s[i:j], 2) )\n\nneeded_for_m = [None]\ncur = 0\nfor x in xrange(1, 100):\n cur += len(str(bin(x)[2:]))\n needed_for_m.append(cur)\n\nbins = [bin(x)[2:] for x in xrange(0, 100)]\n\ncache = {}\ndef solve(state, used, maxm, pos):\n key = state, pos\n if key not in cache:\n res = 0\n\n # already good?\n # print \"(%s)\" % bin(state)[2:-1], maxm\n if state == (1 << (maxm + 1)) - 1:\n # print \"good\"\n res += 1\n\n # continue cuts\n for add in xrange(1, 100):\n if pos + add > len(s):\n break\n val = num[pos][add]\n if val == 0:\n continue\n\n used2 = used\n if state & (1 << val) == 0:\n used2 += len(bins[val])\n maxm2 = max(maxm, val)\n pos2 = pos + add\n # print \"pos\", pos, \"+\", add\n if needed_for_m[maxm2] - used2 <= len(s) - pos2:\n res += solve(state | (1 << val), used2, maxm2, pos2)\n cache[key] = res\n return cache[key]\n\nans = 0\nfor i in xrange(len(s)):\n cur = solve(1, 0, 1, i)\n ans += cur\n epr(i, cur, ans)\nprint ans\n", "lang": "PyPy 2", "bug_code_uid": "6ca28e180f922798ff757a5543bdfd94", "src_uid": "61f88159762cbc7c51c36e7b56ecde48", "apr_id": "e7235977a7abdef16e6ef51a9eb917ec", "difficulty": 2200, "tags": ["dp", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8085173501577287, "equal_cnt": 28, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 18, "fix_ops_cnt": 27, "bug_source_code": "rr=raw_input\nrrI = lambda: int(rr())\nrrM = lambda: map(int,rr().split())\ndebug=0\nif debug:\n fi = open('t.txt','r')\n rr=lambda: fi.readline().replace('\\n','')\n\ndef good_mask(x):\n if x == 0: return False\n return (x+1) & x == 0\n\nN = rrI()\nS = rr()\n#N = 75\n#from time import time\n#S = '100000111111101000100001011100010111110011111011100011001111101111100011110'\n#tt = time()\n#print tt\n\nMOD = 10**9 + 7\nUPPER = 22\n\nnumber = [ [0]*(N+1) for _ in xrange(N) ]\nfor i in xrange(N):\n for j in xrange(i+1, N+1):\n number[i][j] = int(S[i:j],2)\n\nmemo = [ [None]*(1<= UPPER: break\n ans += dp(j, mask | (1<<(num-1)))\n if ans >= MOD:\n ans %= MOD\n memo[i][mask] = ans\n return ans\n\nfans = i = 0\nwhile i < N:\n fans += dp(i, 0)\n fans %= MOD\n i += 1\nprint fans\n#print time()-tt\n\n\n\"\"\"\ndef good_mask(x):\n if x == 0: return False\n return (x+1) & x == 0\n\nN = rrI()\nS = rr()\n##print '.'\n#N = 75\n#import random\n#S = \"\".join(str(random.randint(0,1)) for _ in xrange(N))\nMOD = 10**9 + 7\nUPPER = 22\n\nmemoslide = {N : 0, N-1:0}\ndef slide(j):\n if j in memoslide:\n return memoslide[j]\n if S[j] == '1':\n memoslide[j] = 0\n return 0\n else:\n k = j\n while k < len(S) and S[k] == '0':\n k += 1\n memoslide[j] = k - j\n return k - j\n \nmemo = {}\ndef dp(i, mask):\n #Having made a cut already before position i,\n #and having a set of mask taken\n #how many ways?\n if i == N:\n return 1 if good_mask(mask) else 0\n if (i,mask) in memo:\n return memo[i,mask]\n ans = 1 if good_mask(mask) else 0\n for j in xrange(i+1, N+1):\n num = int(S[i:j], 2)\n if num == 0: continue\n if num >= UPPER: break\n if num > 8:\n #prune\n newmask = mask\n ii = excess = 0\n while newmask:\n if newmask%2 == 0:\n excess += len(bin(ii)) - 2\n ii += 1\n newmask /= 2\n if excess > N-j+1:\n break\n k = slide(j)\n newmask = mask | (1<<(num-1))\n bns = dp(j + k, newmask)\n for kk in xrange(k):\n memo[(j + kk, newmask)] = bns\n ans += (1+k) * bns\n\n if ans >= MOD:\n ans %= MOD\n memo[i, mask] = ans\n return ans\n\nfans = 0\nfor i in xrange(N):\n fans += dp(i, 0)\n if fans >= MOD:\n fans %= MOD\nprint fans\n\"\"\"\n", "lang": "PyPy 2", "bug_code_uid": "9cce2b5d6c9ff5f57b09d879f085592a", "src_uid": "61f88159762cbc7c51c36e7b56ecde48", "apr_id": "43826dca2d495e33f7df18fc8f18f4f9", "difficulty": 2200, "tags": ["dp", "bitmasks"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9969135802469136, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "g,s=[input() for i in range(4)],set\nfor i in range(4):\n\ts.add(g[i][:3])\n\ts.add(g[i][1:])\n\ts.add(g[0][i]+g[1][i]+g[2][i])\n\ts.add(g[1][i]+g[2][i]+g[3][i])\nfor i in range(2):\n\tfor j in range(2):\n\t\ts.add(g[i][j]+g[i+1][j+1]+g[i+2][j+2])\n\t\ts.add(g[i][j+2]+g[i+1][j+1]+g[i+2][j])\nprint('YES' if {'.xx','x.x','xx.'} & s else 'NO')", "lang": "Python 3", "bug_code_uid": "6bb04370451bf38b0b34f267cc5612f7", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "576120ec9f8db3cbeba4eeb9cbcdad81", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9550072568940493, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n,m,k = map(int,raw_input().split());\nd = [];\nfor i in range(1,m+1):\n\tif m%i == 0:\n\t\tif i>=k: d.append(i);\n\t\tif len(d)>0 and d[len(d)-1]==m: d.remove(m);\n\t\tif m//i >= k: d.append(m//i);\n\t\tif len(d)>0 and d[len(d)-1]==m: d.remove(m);\nif len(d) == 0:\n\tprint \"Marsel\";\n\texit();\nif n%2 == 1:\n\tprint \"Timur\";\n\texit();\nprint \"Marsel\";\n\n", "lang": "Python 2", "bug_code_uid": "78b8c9a00399e2de69766cc298d86cb7", "src_uid": "4a3767011ddac874efa021fff7c94432", "apr_id": "1b25bdd168947b30e283d5104127bccd", "difficulty": 2000, "tags": ["dp", "games", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3888888888888889, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "l1,r1,l2,r2,k = map(int,input().split())\ns = set(range(l1,r1+1)).intersection(set(range(l2,r2+1)))\ns.discard(k)\nprint(len(s))\n\n\n", "lang": "Python 3", "bug_code_uid": "9aa3a5072f1bfc34c67cd020d97ef206", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "e98f4c8b1e6d29ea092f15dfe5bd715a", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9847715736040609, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from collections import defaultdict\ndef primeFactors(n):\n factors = []\n while n%2==0:\n factors.append(2)\n n = n//2\n \n k = 3\n while k <= math.sqrt(n):\n if n%k==0:\n n= n//k\n factors.append(k)\n else:\n k+=2\n if n>1:\n factors.append(n)\n return factors\n\nn = int(input())\nfactors = primeFactors(n)\ncount = defaultdict(int)\nfor a in factors:\n count[a]+=1\nans = 1\nfor a in count.values():\n ans*=(a+1)\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "732de0f1dab215044302f5d17fed1c0e", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "324f985abc3ee28b636d533d947f4c91", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9461077844311377, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "a = int(input())\nx = []\nfor i in range(6):\n x.append(a % 2)\n a //= 2\nx = reversed(x)\nprint(x[0] * 1 + x[5] * 2 + x[3] * 4 + x[2] * 8 + x[4] * 16 + x[1] * 32)\n", "lang": "Python 3", "bug_code_uid": "a61a16f5ba1f97a07cefe5d53a180803", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "apr_id": "6fd47ef4122ba56d54f9544b70675596", "difficulty": null, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8556149732620321, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = bin(int(input()))[2:]\nprint(int(f'{a[0]}{a[5]}{a[3]}{a[2]}{a[4]}{a[1]}', 2))", "lang": "Python 3", "bug_code_uid": "f1d16bb634174fd88e9954c5debd614a", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "apr_id": "5f848d151379abbf6a7dd13982c8e0ca", "difficulty": null, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.951310861423221, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,x,y=map(int,input().strip().split()[:3])\nif x>=(math.ceil(y*n)/100):\n\tprint(0)\nelse:\n\tk=math.ceil((y*n)/100)\n\tp=k-x\n\tprint(p)", "lang": "PyPy 3", "bug_code_uid": "459f6b1686654f8b8746a17d621fda1f", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "61f651b99d0972ca1f3865ff7f874724", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7970787689097548, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "\nf0 = \"What are you doing at the end of the world? Are you busy? Will you save us?\"\ng0 = \"What are you doing while sending \\\"\"\ng1 = \"\\\"? Are you busy? Will you send \\\"\"\ng2 = \"\\\"?\"\nN = 100000 + 10\ndp = [0 for i in range(N)]\ndp[0] = len(f0)\nfor i in range(1,N):\n dp[i] = len(g0) + len(g1) + len(g2) + 2 * dp[i-1]\n\n\ndef getAns(x,y):\n if y >= dp[x]:\n return \".\"\n elif x == 0:\n return f0[y]\n elif y < len(g0):\n return g0[y]\n elif y < len(g0) + dp[x-1]:\n return getAns(x-1,y-len(g0))\n elif y < len(g0) + dp[x-1] + len(g1):\n return g1[y-len(g0)-dp[x-1]]\n elif y < len(g0) + 2*dp[x-1] + len(g1):\n return getAns(x-1,y-len(g0)-len(g1)-dp[x-1])\n else:\n return g2[y-len(g0)-len(g1)-2*dp[x-1]]\n\nn = int(raw_input())\nans = \"\"\nfor i in range(n):\n x,y = map(int,raw_input().split())\n ans = ans + getAns(x,y-1)\nprint(ans)\n\n", "lang": "Python 2", "bug_code_uid": "35a7128ca3b565a1f8f5edb0df055657", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "20301c4091036cc8a601a2be86e99a9b", "difficulty": 1700, "tags": ["dfs and similar", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7954545454545454, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "n,k=int(input())\nprint(3*int(n)-int(k))", "lang": "Python 3", "bug_code_uid": "4f13dce8f081b3a46f74e8e66c3d8209", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "cfe8cc8ad155df64c1f641eb2aa3d15d", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8802698145025295, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s=raw_input()\nadd=int(raw_input())\ns1=s.split(\":\")\n\n#out=(int(s[0]))*60+int(s[1])+int(add)\n\nhour=((add+int(s1[1]))/60+int(s1[0]))%24\nmini=(int(s1[1])+add)%60\n#print hour,\":\",mini\nif len(str(hour))==1:\n hour=\"0\"+str(hour)\nif len(str(mini))==1:\n mini=\"0\"+str(mini)\nprint hour+\":\"+mini\n", "lang": "Python 2", "bug_code_uid": "8fd938a0a4123fc878f52868cbb7af80", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "apr_id": "25026bbae9eaafd704766c2422708fd2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.04621309370988447, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import sys\n\na, b = map(int, sys.stdin.readline().strip().split(' '))\nplayers = ['Ciel','Hanako']\n\nc = {'Ciel': [(2, 2), (1,12), (0,22)], 'Hanako':[(0, 22), (1,12), (2,2)]}\n\nwhile True:\n player = players.pop(0)\n sum = 0\n\n for ai, bi in c[player]:\n if ai <= a and bi <= b:\n a -= ai\n b -= bi\n break\n else:\n if player == 'Ciel':\n print 'Hanako'\n else:\n print 'Ciel'\n break\n", "lang": "Python 2", "bug_code_uid": "ea85b9bcdc6c7ed62fb0c9b2fbffd324", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "6fa886bbc133899bdeeb7be929508738", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9787398531117124, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nRead = lambda:map(int, input().split())\nfrom functools import reduce\n\ndef init():\n g = [[False] * (n + 1) for _ in range(n + 1)]\n for _ in range(m):\n x, y = Read()\n g[x][y] = g[y][x] = True\n return g\n\ndef solve():\n color = [0 for _ in range(n+1)]\n g = init()\n for i in range(1, n + 1):\n if reduce(lambda x, y : x and y, g[i][1:i] + g[i][i + 1:]):\n color[i] = 2 # 'b'\n\n for u in range(1, n + 1):\n if not color[u]:\n color[u] = 1 # 'a'\n for v in range(1, n + 1):\n if u != v and g[u][v] and not color[v]:\n color[v] = 1\n break\n\n for i in range(1, n + 1):\n for j in range(1, n + 1):\n if i == j:\n continue\n if g[i][j] and color[i] + color[j] == 1:\n return 'No'\n if not g[i][j] and color[i] == color[j]:\n return 'No'\n\n def judge(x):\n if x == 1:\n return 'a'\n elif x == 2:\n return 'b'\n else:\n return 'c'\n return 'Yes\\n' + ''.join(map(judge, color[1:]))\n\n\nif __name__ == '__main__':\n while True:\n try:\n n, m = Read()\n except:\n break\n\n print(solve())\n", "lang": "Python 3", "bug_code_uid": "c7f471bc01ac59d96c1c72bda1aafc7b", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "d5626c638c7181e832eb666adc7ead3a", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9860939005920418, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "# http://codeforces.com/contest/623/problem/A\n\nimport math\n\nnm = raw_input()\nnm = nm.split(' ')\nn = int(nm[0])\nm = int(nm[1])\n\nedges = [[False for i in range(n)] for x in range(n)] # False: no such edge\nnodes = [[True for i in range(3)] for x in range(n)] # True: possible\n\n# read edges\nfor i in range(m):\n ab = raw_input()\n ab = ab.split(' ')\n a = int(ab[0]) - 1\n b = int(ab[1]) - 1\n edges[a][b] = True\n #print 'add edge:',a,b\n\ndef hasEdge(a,b):\n if edges[a][b] or edges[b][a]:\n return True\n else:\n return False\n\n# True if has deduction\ndef deduce(n1,n2):\n # if has edge, same\n if hasEdge(n1,n2) and certain(n1):\n val_1 = get(n1)\n # n1 is 'a', n2 isn't 'c'\n if val_1 == 0:\n nodes[n2][2] = False\n #print 'node',n2,'is a'\n return True\n # n1 is 'c', n2 isn't 'a'\n if val_1 == 2:\n nodes[n2][0] = False\n #print 'node',n2,'is a'\n return True\n # if no edge, different\n elif not hasEdge(n1,n2) and certain(n1):\n val_1 = get(n1)\n if val_1 == 0:\n nodes[n2][0] = False\n #print 'node',n2,'is c'\n return True\n if val_1 == 2:\n nodes[n2][2] = False\n #print 'node',n2,'is a'\n return True\n return False\n \ndef deductions():\n for i in range(n):\n for j in range(n):\n if i != j:\n deduce(i,j)\n \n# only has one possibility\ndef certain(k):\n if (nodes[k][0] + nodes[k][1] + nodes[k][2]) == 1:\n return True\n return False\n \ndef freeNode(k):\n if (nodes[k][0] + nodes[k][1] + nodes[k][2]) == 3:\n return True\n return False\n \ndef isDeadNode(k):\n if (nodes[k][0] + nodes[k][1] + nodes[k][2]) == 0:\n return True\n return False\n\n# get the node first possible node, not certain\ndef get(k):\n if nodes[k][0]:\n return 0\n if nodes[k][1]:\n return 1\n if nodes[k][2]:\n return 2\n\ndef incompleteSolution():\n for k in range(n):\n if not certain(k):\n return k\n return False\n\ndef genSolution():\n tmp = incompleteSolution()\n # loop if node id returned\n while isinstance(tmp, int):\n deductions()\n tmp = incompleteSolution()\n \ndef printSolution():\n ss = []\n for i in range(n):\n theChar = get(i)\n if theChar == 0:\n theChar = 'a'\n elif theChar == 1:\n theChar = 'b'\n else:\n theChar = 'c'\n ss.append(theChar)\n print ''.join(ss)\n\n# main\n# no edge, no b\ncomplete = True\nfirstMissingEdge = []\nfor i in range(n):\n for j in range(n):\n if (i != j) and not hasEdge(i,j):\n #print 'no edge: ',i,j\n if complete:\n complete = False\n firstMissingEdge.append(i)\n firstMissingEdge.append(j)\n #print 'missing edge',i,j\n # must not b\n nodes[i][1] = False\n nodes[j][1] = False\n\n# if free node => is b\nfor i in range(n):\n if freeNode(i):\n nodes[i][0] = False\n nodes[i][2] = False\n #print 'node',i,'is \\'b\\''\n \n# complete graph\nif complete:\n ss = []\n for i in range(n):\n ss.append('b')\n print Yes\n print ''.join(ss)\n\nelse:\n # 1. guess one node to be 'a'\n a = firstMissingEdge[0]\n b = firstMissingEdge[1]\n nodes[a][2] = False # node[a] be 'a'\n nodes[b][0] = False # node[b] be 'c'\n #print 'let node',a,'be a, node',b,'be c'\n # loop check, deduction...\n updated = True\n hasDeadNode = False\n while updated:\n updated = False\n for i in range(n):\n for j in range(n):\n if i != j:\n if deduce(i,j):\n updated = True\n if isDeadNode(j):\n hasDeadNode = True\n break\n if hasDeadNode:\n break\n if hasDeadNode:\n break\n\n if hasDeadNode:\n print 'No'\n else:\n print 'Yes'\n \n \n\n", "lang": "Python 2", "bug_code_uid": "2783ca6fbb9de5a8ae96be539c7c8336", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "7bc2a6179abbc39573600a1c9e01ff22", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.1293800539083558, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "K = input()\nprint \"codeforce\" + \"s\"*K", "lang": "PyPy 2", "bug_code_uid": "5e83b6824b661e01a287c6af75e39b29", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "019e07602524120144412bc9c35c3bcc", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2774566473988439, "equal_cnt": 16, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 11, "fix_ops_cnt": 16, "bug_source_code": "x,y,z,k=map(int,input().split())\nif k=1:\n print (2)\nif k=2:\n print (4)\nif k=3:\n print (8)\nif k>=(x-1)+(y-1)+(z-1):\n print (x*y*z)\nelse:\n print (4*k-4)\n", "lang": "Python 3", "bug_code_uid": "c7c56fc7d292aa672c8ed5a19cf6f098", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "3470ca6f621f31a9352403c6bc6f7d80", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9962864721485412, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\na = [\"\",\"\",\"\"]\nfor i in range(n):\n l = input()\n a[i] = l.split();\n for j in range(6):\n a[i][j] = int(a[i][j])\n\nx = 1;\nwhile(x<=9):\n it = 0\n i = 0\n while i 0 and a[0][i]*10 + a[1][j] == x:\n x = x + 1\n it = 1\n break\n if n > 0 and a[1][i]*10 + a[0][j] == x:\n x = x + 1\n it = 1\n break\n if n > 1 and a[0][i]*10 + a[2][j] == x:\n x = x + 1\n it = 1\n break\n if n > 1 and a[2][i]*10 + a[0][j] == x:\n x = x + 1\n it = 1\n break\n if n > 1 and a[1][i]*10 + a[2][j] == x:\n x = x + 1\n it = 1\n break\n if n > 1 and a[2][i]*10 + a[1][j] == x:\n x = x + 1\n it = 1\n break\n j = j + 1\n if it==1:\n break\n i = i + 1\n if it == 0:\n break\nwhile ( 99 < x < 1000):\n it = 0\n i = 0\n while i < 6:\n j = 0\n while j < 6:\n k = 0\n while k < 6: \n if n > 1 and a[0][i]*100 + 10*a[1][j] + a[2][k] == x:\n x = x + 1\n it = 1\n break\n k = k + 1\n if it == 1:\n break\n j = j + 1\n if it == 1:\n break\n i = i + 1\n if it == 0:\n break\nprint (x - 1)\n", "lang": "Python 3", "bug_code_uid": "a7620b0d90cdf49fb01683962a1581fa", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "2b781a37d331ce6389af818582ee9e12", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9948453608247423, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a,b,x,y = [int(x) for x in input().split()]\n\ndef gcd(r,s):\n if (r == 0 or s == 0):\n return r+s\n else:\n if r > s:\n return gcd(r-s,s)\n else:\n return gcd(r,s-r)\n\ng = gcd(x,y)\nx1 = int(x/g)\ny1 = int(y/g)\n\nif (x1 <= a and y1 <=b): \n c = 0\n while (x1*c <= a and y1*c<= b):\n c += 1\n print(x1*(c-1),y1*(c-1))\nelse:\n print(0,0)", "lang": "Python 3", "bug_code_uid": "11c300343bc88b147c4e6b7e82175cb5", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "690f334bd320af31909da36e96302b8e", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7310704960835509, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/python3\n\nn, a, b, c = [int(x) for x in input().split()]\n\nmn = min(a, b, c)\n\nif n == 1:\n\tprint('0')\nelif n == 2:\n\tprint(min(a, b))\nelse :\n\tprint(min(a, b) + (n-2) * mn)\n\t\n", "lang": "Python 3", "bug_code_uid": "6cef1a7d232325a2d8f1a69e3ed3fa31", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "7cd492e997f0e38846c7083be44c38e2", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9943227899432279, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#cf288b.py\nimport sys\n(n,k)=map(int,sys.stdin.readline().split())\nmod_prime=1000000007\nf=[0]*k \n#f(x)= the number of ways that a group of x elements eventually leads to 1 (1 is not part of the group and does not points to anywhere)\nf[0]=1\nf[1]=1\nc=[[1 for j in range(i+1)] for i in range (k)]\nfor i in range(1,len(c)):\n\tfor j in range(1,len(c[i])-1):\n\t\tc[i][j]=(c[i-1][j-1]+c[i-1][j])%mod_prime\n#print (c)\nfor x in range(2,k):\n\tf[x]=0\n\tfor i in range(0,x):\n\t\tf[x]+=c[x-1][i]*f[i]*f[x-1-i]*(i+1)%mod_prime\n\t\t#print(\"x={0},i={1},f[x]={2}\".format(x,i,f[x]))\n\nans=(k*f[k-1]*(n-k)**(n-k))%mod_prime\n#print(f)\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "e58cf2f1a3f6d4999520cb1c384297b7", "src_uid": "cc838bc14408f14f984a349fea9e9694", "apr_id": "6e55ce6e4b046bb77b4bf4b97ed8e1a5", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6746987951807228, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n = input()\nk = input()\nprint(((n-k)**(n-k)*(k)**(k-1))%1000000007)\n", "lang": "Python 2", "bug_code_uid": "da51498bea1ad2b2b9fd0d1cacf9f48c", "src_uid": "cc838bc14408f14f984a349fea9e9694", "apr_id": "ffa1b1d2e1cbe431e0ced8c87b701622", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6520926756352765, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "from math import sqrt\n\nclass vector:\n\tdef __init__(self, _x = 0, _y = 0):\n\t\tself.x = _x\n\t\tself.y = _y\n\tdef len(self):\n\t\treturn sqrt(self.x ** 2 + self.y ** 2)\n\tdef len_sq(self):\n\t\treturn self.x ** 2 + self.y ** 2\n\tdef __mul__(self, other):\n\t\tif (type(self) == type(other)):\n\t\t\treturn self.x * other.x + self.y * other.y\n\t\treturn vector(self.x * other, self.y * other)\n\tdef __mod__(self, other):\n\t\treturn self.x * other.y - self.y * other.x\n\tdef normed(self):\n\t\tlength = self.len()\n\t\treturn vector(self.x / length, self.y / length)\n\tdef normate(self):\n\t\tself = self.normed()\n\tdef __str__(self):\n\t\treturn \"(\" + str(self.x) + \", \" + str(self.y) + \")\"\n\tdef __add__(self, other):\n\t\treturn vector(self.x + other.x, self.y + other.y);\n\tdef __sub__(self, other):\n\t\treturn vector(self.x - other.x, self.y - other.y);\n\tdef __eq__(self, other):\n\t\treturn self.x == other.x and self.y == other.y\n\tdef rot(self):\n\t\treturn vector(self.y, -self.x)\n\nclass line:\n\tdef __init__(self, a = 0, b = 0, c = 0):\n\t\tself.a = a\n\t\tself.b = b\n\t\tself.c = c\n\tdef intersect(self, other):\n\t\td = self.a * other.b - self.b * other.a\n\t\tdx = self.c * other.b - self.b * other.c\n\t\tdy = self.a * other.c - self.c * other.a\n\t\treturn vector(dx / d, dy / d)\n\tdef fake(self, other):\n\t\td = self.a * other.b - self.b * other.a\n\t\treturn d\n\tdef __str__(self):\n\t\treturn str(self.a) + \"*x + \" + str(self.b) + \"*y = \" + str(self.c) \n\ndef line_pt(A, B):\n\t\td = (A - B).rot()\n\t\treturn line(d.x, d.y, d * A)\n\nclass circle:\n\tdef __init__(self, O = vector(0, 0), r = 0):\n\t\tself.O = O\n\t\tself.r = r\n\tdef intersect(self, other):\n\t\tO1 = self.O\n\t\tO2 = other.O\n\t\tr1 = self.r\n\t\tr2 = other.r\n\t\tif (O1 == O2):\n\t\t\treturn []\n\t\tif ((O1 - O2).len_sq() > r1 ** 2 + r2 ** 2 + 2 * r1 * r2):\n\t\t\treturn []\n\t\trad_line = line(2 * (O2.x - O1.x), 2 * (O2.y - O1.y), r1 ** 2 - O1.len_sq() - r2 ** 2 + O2.len_sq())\n\t\tcentral = line_pt(O1, O2)\n\t\tM = rad_line.intersect(central)\n\t\t# print(M)\n\t\tif ((O1 - O2).len_sq() == r1 ** 2 + r2 ** 2 + 2 * r1 * r2):\n\t\t\treturn [M]\n\t\td = (O2 - O1).normed().rot()\n\t\tif (r1 ** 2 - (O1 - M).len_sq() < 0):\n\t\t\treturn []\n\t\td = d * (sqrt(r1 ** 2 - (O1 - M).len_sq()))\n\t\treturn [M + d, M - d]\n\tdef fake(self, other):\n\t\tO1 = self.O\n\t\tO2 = other.O\n\t\tr1 = self.r\n\t\tr2 = other.r\n\t\tif (O1 == O2):\n\t\t\treturn 1\n\t\tif ((O1 - O2).len_sq() > r1 ** 2 + r2 ** 2 + 2 * r1 * r2):\n\t\t\treturn 1\n\t\trad_line = line(2 * (O2.x - O1.x), 2 * (O2.y - O1.y), r1 ** 2 - O1.len_sq() - r2 ** 2 + O2.len_sq())\n\t\tcentral = line_pt(O1, O2)\n\t\treturn rad_line.fake(central)\n\n\n# a = vector(3, 4)\n# b = vector(4, 4)\n# print(circle(vector(1, 2), 3).intersect(circle(vector(2, 1), 5)))\nn = int(input())\narr = []\nm = 1\nfor i in range(n):\n\tx, y, r = map(int, input().split())\n\tarr.append(circle(vector(x, y), r))\nfor i in range(n):\n\tfor j in range(i + 1, n):\n\t\tm *= arr[i].fake(arr[j])\nfor i in range(n):\n\tarr[i].O = arr[i].O * m\n\tarr[i].r = arr[i].r * m\n# print(m)\ns = set()\nV = 0\nfor i in range(n):\n\tfor j in range(i + 1, n):\n\t\ttmp = arr[i].intersect(arr[j])\n\t\tfor e in tmp:\n\t\t\ts.add((round(e.x, 100), round(e.y, 100)))\nV += len(s)\nE = 0\n\npar = [i for i in range(n)]\n\ndef get_par(v):\n\tif (par[v] != v):\n\t\tpar[v] = get_par(par[v])\n\treturn par[v]\ndef unite(v, u):\n\tpar[get_par(v)] = get_par(u)\nfor i in range(n):\n\ts = set()\n\tfor j in range(n):\t\n\t\ttmp = arr[i].intersect(arr[j])\n\t\tif (len(tmp)):\n\t\t\tunite(i, j)\n\t\tfor e in tmp:\n\t\t\ts.add((round(e.x, 100), round(e.y, 100)))\n\tE += len(s)\n# print(V, E)\n# print(len({get_par(i) for i in range(n)}))\nprint(E - V + 1 + len({get_par(i) for i in range(n)}))\n\t\t\tunite(i, j)\n\t\tfor e in tmp:\n\t\t\ts.add((round(e.x, 100), round(e.y, 100)))\n\tE += len(s)\n# print(V, E)\n# print(len({get_par(i) for i in range(n)}))\nprint(E - V + 1 + len({get_par(i) for i in range(n)}))from math import sqrt\n\nclass vector:\n\tdef __init__(self, _x = 0, _y = 0):\n\t\tself.x = _x\n\t\tself.y = _y\n\tdef len(self):\n\t\treturn sqrt(self.x ** 2 + self.y ** 2)\n\tdef len_sq(self):\n\t\treturn self.x ** 2 + self.y ** 2\n\tdef __mul__(self, other):\n\t\tif (type(self) == type(other)):\n\t\t\treturn self.x * other.x + self.y * other.y\n\t\treturn vector(self.x * other, self.y * other)\n\tdef __mod__(self, other):\n\t\treturn self.x * other.y - self.y * other.x\n\tdef normed(self):\n\t\tlength = self.len()\n\t\treturn vector(self.x / length, self.y / length)\n\tdef normate(self):\n\t\tself = self.normed()\n\tdef __str__(self):\n\t\treturn \"(\" + str(self.x) + \", \" + str(self.y) + \")\"\n\tdef __add__(self, other):\n\t\treturn vector(self.x + other.x, self.y + other.y);\n\tdef __sub__(self, other):\n\t\treturn vector(self.x - other.x, self.y - other.y);\n\tdef __eq__(self, other):\n\t\treturn self.x == other.x and self.y == other.y\n\tdef rot(self):\n\t\treturn vector(self.y, -self.x)\n\nclass line:\n\tdef __init__(self, a = 0, b = 0, c = 0):\n\t\tself.a = a\n\t\tself.b = b\n\t\tself.c = c\n\tdef intersect(self, other):\n\t\td = self.a * other.b - self.b * other.a\n\t\tdx = self.c * other.b - self.b * other.c\n\t\tdy = self.a * other.c - self.c * other.a\n\t\treturn vector(dx / d, dy / d)\n\tdef fake(self, other):\n\t\td = self.a * other.b - self.b * other.a\n\t\treturn d\n\tdef __str__(self):\n\t\treturn str(self.a) + \"*x + \" + str(self.b) + \"*y = \" + str(self.c) \n\ndef line_pt(A, B):\n\t\td = (A - B).rot()\n\t\treturn line(d.x, d.y, d * A)\n\nclass circle:\n\tdef __init__(self, O = vector(0, 0), r = 0):\n\t\tself.O = O\n\t\tself.r = r\n\tdef intersect(self, other):\n\t\tO1 = self.O\n\t\tO2 = other.O\n\t\tr1 = self.r\n\t\tr2 = other.r\n\t\tif (O1 == O2):\n\t\t\treturn []\n\t\tif ((O1 - O2).len_sq() > r1 ** 2 + r2 ** 2 + 2 * r1 * r2):\n\t\t\treturn []\n\t\trad_line = line(2 * (O2.x - O1.x), 2 * (O2.y - O1.y), r1 ** 2 - O1.len_sq() - r2 ** 2 + O2.len_sq())\n\t\tcentral = line_pt(O1, O2)\n\t\tM = rad_line.intersect(central)\n\t\t# print(M)\n\t\tif ((O1 - O2).len_sq() == r1 ** 2 + r2 ** 2 + 2 * r1 * r2):\n\t\t\treturn [M]\n\t\td = (O2 - O1).normed().rot()\n\t\tif (r1 ** 2 - (O1 - M).len_sq() < 0):\n\t\t\treturn []\n\t\td = d * (sqrt(r1 ** 2 - (O1 - M).len_sq()))\n\t\treturn [M + d, M - d]\n\tdef fake(self, other):\n\t\tO1 = self.O\n\t\tO2 = other.O\n\t\tr1 = self.r\n\t\tr2 = other.r\n\t\tif (O1 == O2):\n\t\t\treturn 1\n\t\tif ((O1 - O2).len_sq() > r1 ** 2 + r2 ** 2 + 2 * r1 * r2):\n\t\t\treturn 1\n\t\trad_line = line(2 * (O2.x - O1.x), 2 * (O2.y - O1.y), r1 ** 2 - O1.len_sq() - r2 ** 2 + O2.len_sq())\n\t\tcentral = line_pt(O1, O2)\n\t\treturn rad_line.fake(central)\n\n\n# a = vector(3, 4)\n# b = vector(4, 4)\n# print(circle(vector(1, 2), 3).intersect(circle(vector(2, 1), 5)))\nn = int(input())\narr = []\nm = 1\nfor i in range(n):\n\tx, y, r = map(int, input().split())\n\tarr.append(circle(vector(x, y), r))\nfor i in range(n):\n\tfor j in range(i + 1, n):\n\t\tm *= arr[i].fake(arr[j])\nfor i in range(n):\n\tarr[i].O = arr[i].O * m\n\tarr[i].r = arr[i].r * m\n# print(m)\ns = set()\nV = 0\nfor i in range(n):\n\tfor j in range(i + 1, n):\n\t\ttmp = arr[i].intersect(arr[j])\n\t\tfor e in tmp:\n\t\t\ts.add((round(e.x, 100), round(e.y, 100)))\nV += len(s)\nE = 0\n\npar = [i for i in range(n)]\n\ndef get_par(v):\n\tif (par[v] != v):\n\t\tpar[v] = get_par(par[v])\n\treturn par[v]\ndef unite(v, u):\n\tpar[get_par(v)] = get_par(u)\nfor i in range(n):\n\ts = set()\n\tfor j in range(n):\t\n\t\ttmp = arr[i].intersect(arr[j])\n\t\tif (len(tmp)):\n\t\t\tunite(i, j)\n\t\tfor e in tmp:\n\t\t\ts.add((round(e.x, 100), round(e.y, 100)))\n\tE += len(s)\n# print(V, E)\n# print(len({get_par(i) for i in range(n)}))\nprint(E - V + 1 + len({get_par(i) for i in range(n)}))", "lang": "Python 3", "bug_code_uid": "b764ea97720fdee65402ffbd49252d8c", "src_uid": "bda5879e94a82c6fd499796f258c4691", "apr_id": "1c3aa71909841b916fe8c7aae3d98a9c", "difficulty": 2700, "tags": ["graphs", "geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2300194931773879, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "from sys import stdin\nimport functools\nimport operator\n\ndef modpow(n, p, m):\n\te = 1\n\tfor i in range(p):\n\t\te = (e * n) % m\n\t\tprint e\n\n\treturn e\n\nnum = stdin.readline().strip()\nnew_num = num[0] + num[2] + num[4] + num[3] + num[1]\n\nprint(modpow(int(new_num), 5, 10 ** 5))\n", "lang": "Python 3", "bug_code_uid": "7177d889b194c6ebbba368899b81bfc1", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "8be2299798ec5c6c452c8fefc529996c", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7692307692307693, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "a,b,m,r0=0,0,0,0\na,b,m,r0=map(int,input().split())\nri=r0\ni=0\nR=[]\nI=[]\nwhile (ri) not in R:\n R.append(ri)\n I.insert(ri,i)\n ri=(a*ri+b)%m\n i+=1\n##print(R)\n##print(I)\n##print (i-R.index(ri))\nprint (i-I[ri]) \n", "lang": "Python 3", "bug_code_uid": "a3a0ebb0c18c55f6d0a50fcc46b1b180", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "403e0b1e966184803ddb25912449a388", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5092838196286472, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "import time\na,b,m,r=map(int, raw_input().split())\nif a==1:\n time.sleep(0.1)\n print m/b\nelse:\n Posl=()\n r= (a*r+b)%m \n while not Posl.count(r):\n Posl+=(r,)\n r=(a*r+b)%m \n print len(Posl[Posl.index(r):])\n ", "lang": "Python 2", "bug_code_uid": "cf21d77ba1a5f565f616edfc1aeb92fe", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "e6e599766600e0352b844d1b358bf806", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9981515711645101, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "A, B, C = list(map(int, input().split())), list(map(int, input().split())), list(map(int, input().split()))\nAB = [B[0] - A[0], B[1] - A[1]]\nBC = [C[0] - B[0], C[1] - B[1]]\n\ns = AB[0] * BC[1] - AB[1] * BC[0]\nprint(['RIGHT', 'TOWARDS', 'LEFT'][1 + int(s > 0) - int(s < 0)]", "lang": "Python 3", "bug_code_uid": "6332da291905231cf0b4de7b274d05f0", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "04bb909f661178bdd33eaba71225cae0", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.12685982772122162, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n, m = map(int, input().split())\nl = list(map(int, input().split()))\na= [0] + [0] * n\ncheck = 1\nfor i in range(m-1):\n if l[i+1] - l[i] <= 0:\n d = l[i+1] + n - l[i]\n else:\n d = l[i+1] - l[i]\n if d in a:\n check = 0\n break\n else:\n a[l[i]] = str(d)\nif check == 0:\n print('-1')\nelse:\n print(' '.join(a[1:]))\n", "lang": "Python 3", "bug_code_uid": "756d27da0b1aab26131a4938805e5d70", "src_uid": "4a7c959ca279d0a9bd9bbf0ce88cf72b", "apr_id": "e403a4fd2cced27aac96329415afcb2e", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1308411214953271, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "from fractions import Fraction \n\nclass UnionFind(object):\n def __init__(self, n):\n self.table = [-1 for _ in xrange(n)]\n\n def unite(self, x, y):\n x = self.find(x)\n y = self.find(y)\n if x == y:\n return\n if self.table[x] >= self.table[y]:\n self.table[y] += self.table[x]\n self.table[x] = y\n else:\n self.table[x] += self.table[y]\n self.table[y] = x\n\n def find(self, x):\n if self.table[x] < 0:\n return x\n self.table[x] = self.find(self.table[x])\n return self.table[x]\n\n\ndef main():\n N, M = map(int, raw_input().split())\n edges = [map(int, raw_input().split()) for _ in xrange(M)]\n\n hi = Fraction(10**12)\n lo = Fraction(0)\n\n for _ in xrange(100):\n mid = (hi + lo) / 2\n edges.sort(key=lambda x:Fraction(x[2], x[3]))\n uf = UnionFind(N)\n nume = 0\n deno = 0\n for e in edges:\n if Fraction(e[2], e[3]) <= mid or uf.find(e[0]) != uf.find(e[1]):\n nume += e[2]\n deno += e[3]\n uf.unite(e[0], e[1])\n if Fraction(nume, deno) <= mid:\n hi = mid\n else:\n lo = mid\n\n print \"%.9f\" % hi\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 2", "bug_code_uid": "018f2503fa068fe88779268f1822ac16", "src_uid": "4a7c959ca279d0a9bd9bbf0ce88cf72b", "apr_id": "127fcf085c6b70d538e3808cde1b8a69", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.875629043853343, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "class Solution:\n \n \n\n\n @staticmethod\n def bookreading(pages , firstday , threshold , addingFactor , gobackPages):\n pages = pages-firstday\n day = 1\n while pages>0:\n pages = pages+gobackPages\n \n factor = firstday+day*addingFactor\n if factor <= threshold:\n pages_read = factor\n pages = pages - pages_read\n\n day += 1\n \n\n return day\n \n\n\nif __name__ == \"__main__\":\n \n c, v0, v1, a , l = map(int , input().split())\n \n days = Solution.bookreading(c, v0, v1, a , l)\n print(days)\n\n\n \n", "lang": "Python 3", "bug_code_uid": "9f679db7071315291f0afd1f5a11aaca", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "653a2aad66582e5b948f022e7c0aa9ec", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7104136947218259, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import sys\nsys.setrecursionlimit(20000)\n\ndef gcd(a, b):\n if b is 0:\n return a\n else:\n return gcd(b, a % b)\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nt, w, b = tuple(int(i) for i in raw_input().strip().split())[:3]\n\nif b <= w:\n w, b = b, w\n\nlc = lcm(w, b)\n\nfits = t // lc\n\nsol = 0\n\nif w <= t:\n sol += w - 1\n\nif fits > 0:\n sol += w * (fits - 1)\n\n last = fits * lc\n\n if last + w - 1 <= t:\n sol += w\n elif last <= t:\n sol += t - last + 1\n\nif sol == 0:\n sol = t\n\nup = sol\ndown = t\ng = gcd(up, down)\n\nup //= g\ndown //= g\n\nprint \"{}/{}\".format(up, down)\n", "lang": "Python 3", "bug_code_uid": "776c5b27798ec802bff81d7c4a3cc92a", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "ec36a504fc1a9c1f53cf2f3b737a854a", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8970588235294118, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "import sys\n\nvec = []\nfor line in sys.stdin:\n vec.extend(line.split())\n\nvec = vec[1:]\na=max(vec)\nb=vec[-1]\nprint(a ^ b)\n", "lang": "Python 3", "bug_code_uid": "4bfd224e11bbeec3c29e8616cc63b253", "src_uid": "f45c769556ac3f408f5542fa71a67d98", "apr_id": "89029f7353e9ff406004d782c0f2fe73", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7592954990215264, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "MOD = 998244353\ndef inv(x):\n return pow(x, MOD - 2, MOD)\n \nn, m = map(int, input().split())\n \nmult = n * inv(m + 1) + 1\nmult %= MOD\n\nout = m + 1\nfor currN in range(1, n):\n out += m * inv(currN)\n out %= MOD\n \nout *= mult\nprint(out % MOD)", "lang": "PyPy 3", "bug_code_uid": "b7610f905079d1bfcb4c4b74b2f88888", "src_uid": "9f2b59df7bef2aeee0ce71facd2b1613", "apr_id": "51f325abdedebdb85de544de22bb5a5c", "difficulty": 3000, "tags": ["dp", "math", "combinatorics", "probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9905482041587902, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "MOD = 998244353\ndef inv(x):\n return pow(x, MOD - 2, MOD)\n \nn, m = map(int, input().split())\n \nmult = n * inv(m + 1) + 1\nmult %= MOD\n \ncurrN = 1\nout = m + 1\nwhile currN < n:\n currN += 1\n \n out = (out + m * inv(currN)) % MOD\n \nout *= mult\nprint(out % MOD)\n", "lang": "PyPy 2", "bug_code_uid": "c7a8c80b2ba8a76bd9d9748672f93ff1", "src_uid": "9f2b59df7bef2aeee0ce71facd2b1613", "apr_id": "51f325abdedebdb85de544de22bb5a5c", "difficulty": 3000, "tags": ["dp", "math", "combinatorics", "probabilities"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.05448717948717949, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \nusing namespace std;\n\n\nint main() {\n\n int n , temp;\n cin >> n;\n\n int arr[n+1];\n for (int i=0 ; i> arr[i];\n temp = arr[0] - arr[1];\n for (int i=1 ; i 1 and i >= 0:\n if n % base[i] == 0:\n n /= base[i]\n if base[i] in fact: fact[base[i]] += 1\n else: fact[base[i]] = 1\n else:\n i -= 1\n start = int(math.sqrt(n))\n pairs = []\n factors = set([1, n])\n for i in range(start,n):\n for j in range(len(base)):\n lhs = i ** 2 % n\n rhs = base[j] ** 2 % n\n if lhs == rhs: \n pairs.append([i,base[j]]);\n for i in range(len(pairs)):\n factors |= set([fractions.gcd(pairs[i][0]-pairs[i][1],n)])\n res = list(factors)\n res.sort()\n return res\n\"\"\"\n\ndef mod_equation(a, b):\n if a < b: return 0\n if a == b: return 'infinity'\n if a - b == 1:\n if a == 1: return 1\n else: return 0\n c = a - b\n res = 0\n for i in range(b + 1, (a + b) / 2 + 1):\n if c % i == 0: res += 1\n if a > 1: res += 1\n return res\n \n \"\"\"\n i = 0\n j = len(fact) - 1\n while j - i > 1:\n mid = (i + j) / 2\n if fact[mid] > b: j = mid\n else: i = mid\n return len(fact) - j\n \"\"\"\n \nif __name__ == '__main__':\n num = sys.stdin.readline().split()\n a = int(num[0])\n b = int(num[1])\n print mod_equation(a, b)\n \n #print factor(9435152-272)", "lang": "Python 2", "bug_code_uid": "247f99021952a562d77544a26f579984", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "6b6fffe17eceb776f7d043d29a1b4fb2", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9977528089887641, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "MONTH=[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\ncmonth=input()\nnextmonth=int(input())\nprint (MONTH[(MONTH.index(cmonth)+nextmonth)%12]", "lang": "Python 3", "bug_code_uid": "e23487efc022feaa07311cbe612eaee0", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "a7dd9db466bf1f24d352894d7cf533fc", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.04524421593830334, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "b = int(raw_input())\ndef sieveOfEratosthenes(N, s):\n # Create a boolean array\n # \"prime[0..n]\" and initialize\n # all entries in it as false.\n prime = [False] * (N + 1)\n\n # Initializing smallest factor\n # equal to 2 for all the even\n # numbers\n for i in range(2, N + 1, 2):\n s[i] = 2\n\n # For odd numbers less then\n # equal to n\n for i in range(3, N + 1, 2):\n if (prime[i] == False):\n\n # s(i) for a prime is\n # the number itself\n s[i] = i\n\n # For all multiples of\n # current prime number\n for j in range(i, int(N / i) + 1, 2):\n if (prime[i * j] == False):\n prime[i * j] = True\n\n # i is the smallest\n # prime factor for\n # number \"i*j\".\n s[i * j] = i\n\n # Function to generate prime\n\n\n# factors and its power\ndef generatePrimeFactors(N):\n total = 1\n s = [0] * (N + 1)\n\n sieveOfEratosthenes(N, s)\n\n curr = s[N]\n cnt = 1\n\n # Printing prime factors and\n # their powers\n while (N > 1):\n N //= s[N]\n\n # N is now N/s[N]. If new N\n # als has smallest prime\n # factor as curr, increment\n # power\n if (curr == s[N]):\n cnt += 1\n continue\n\n total *= (cnt+1)\n\n # Update current prime factor\n # as s[N] and initializing\n # count as 1.\n curr = s[N]\n cnt = 1\n return total\n\n\n# Driver Program\nprint generatePrimeFactors(b)\n\n\n\n\n\n\n", "lang": "PyPy 2", "bug_code_uid": "89b99f20f9e8aa9c6ebd187d421c09fc", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "9d970b800edae50ea9efef8dfe5bbb59", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9972826086956522, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from itertools import permutations\nl=list(permutations(range(0, 5))) \np=[]\nm=[]\nfor _ in range(5):\n m=list(map(int,input().split()))\n p.append(m)\nres=0\nfor i in range(len(l)-1): \n a=l[i][0]\n b=l[i][1]\n c=l[i][2]\n d=l[i][3]\n e=l[i][4]\n r = p[a][b]+p[b][a]+2*(p[c][d]+p[d][c])+p[b][c]+p[c][b]+2*(p[d][e]+p[e][d])\n res=max(r,res)\nprint(res)\n ", "lang": "PyPy 3", "bug_code_uid": "419307100f0dd57b417920163fd9bc45", "src_uid": "be6d4df20e9a48d183dd8f34531df246", "apr_id": "51874af31f3455cb1cd75188093de894", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.11796246648793565, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#include \n\n#define uint unsigned int\n#define INF 999999999\n#define LINF 999999999999999999\n#define ll long long\n#define M 100\n#define E 0.0000001\n#define N (1<<18)\n#define pii pair\n#define pll pair\n#define pdd pair\n#define ull unsigned long long\n\nusing namespace std;\n\n\nint main () {\n ll n;\n cin>>n;\n cout<\nusing namespace std;\ntypedef long long ll;\nconst int dx[9]={0,0,-1,1,1,1,-1,-1,0};\nconst int dy[9]={1,-1,0,0,1,-1,1,-1,0};\nchar g[9][9];\nbool f[10][9][9],vis[10][9][9];\nqueue q;\n\nint main()\n{\n for(int i=0;i<8;i++)for(int j=0;j<8;j++)cin>>g[i][j];\n for(int i=0;i<8;i++)for(int j=0;j<8;j++)if(g[i][j]=='S')f[0][i][j]=1;\n for(int t=1;t<=8;t++)for(int i=0;i<8;i++)for(int j=0;j<8;j++)f[t][i][j]=f[t-1][i-1][j];\n q.push(7);q.push(0);q.push(0);vis[0][7][0]=1;\n while(!q.empty())\n {\n int x=q.front();q.pop();\n int y=q.front();q.pop();\n int t=q.front();q.pop();\n if(t==8){\n cout<<\"WIN\"<7||ny>7||f[t+1][nx][ny]||vis[t+1][nx][ny])continue;\n q.push(nx);q.push(ny);q.push(t+1);\n vis[t+1][nx][ny]=1;\n }\n }\n cout<<\"LOSE\"<=0 and r+i1<=7 and c+i2>=0 and c+i2<=7 and (d[r+i1][c+i2]>=deep or (i1==0 and i2==0)):\n\t\t\t\tA=True\t\n\t\t\t\tfor i in range(8):\n\t\t\t\t\tif s[i][c+i2]=='S' and (min(i+deep,7)==r+i1 or min(i+deep-1,7)==r+i1):\n\t\t\t\t\t\tA=False\n\t\t\t\t\t\tbreak\n\t\t\t\t\n\t\t\t\tif A:\n\t\t\t\t\t#print \"A\" , r+i1,c+i2\n\t\t\t\t\tdfs(r+i1,c+i2)\t\t\n\t\t\t\t\tdeep-=1\n\ndfs(7,0)\nres(False)\n", "lang": "Python 2", "bug_code_uid": "bc1194eeb2599ec34b323a5023c173c7", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "apr_id": "6edfc993a8f2c94ddf9f06e49004ad9a", "difficulty": 1500, "tags": ["graphs", "dfs and similar", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.46726786907147627, "equal_cnt": 27, "replace_cnt": 24, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 27, "bug_source_code": "#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\nfrom itertools import combinations\n\nn = int(raw_input())\nrmax = 0\nintervals = []\nfor _ in xrange(n):\n l, r = map(int, raw_input().split())\n rmax = max(rmax, r)\n intervals.append((l, r))\n\n\ndef prob_smaller_equal(ints, val):\n res = 1.0\n for l, r in ints:\n d = min(val + 1 - l, r + 1 - l)\n if d <= 0:\n return 0.0\n res *= float(d) / (r + 1 - l)\n if res == 0.0:\n return 0.0\n return res\n\n\ndef prob_smaller(ints, val):\n res = 1.0\n for l, r in ints:\n d = min(val - l, r + 1 - l)\n if d <= 0:\n return 0.0\n res *= float(d) / (r + 1 - l)\n if res == 0.0:\n return 0.0\n return res\n\n\ndef prob_greater(ints, val):\n res = 1.0\n for l, r in ints:\n d = min(r - val, r + 1 - l)\n if d <= 0:\n return 0.0\n res *= float(d) / (r + 1 - l)\n if res == 0.0:\n return 0.0\n return res\n\n\ndef prob_equal(ints, val):\n res = 1.0\n for l, r in ints:\n if not (l <= val <= r):\n return 0.0\n res *= 1.0 / (r + 1 - l)\n return res\n\n\ndef combos(ints, minn, maxn):\n for ntie in xrange(minn, maxn + 1):\n return combinations(ints, r=ntie)\n\n\nINTINDS = range(len(intervals))\nres = 0\nfor i_int1 in INTINDS:\n for i_ints2_tie in combos(INTINDS, 1, n - 1):\n if i_int1 in i_ints2_tie:\n continue\n i_other = [i for i in INTINDS if i not in i_ints2_tie and i != i_int1]\n\n int1 = intervals[i_int1]\n ints2_tie = [intervals[i] for i in i_ints2_tie]\n other = [intervals[i] for i in i_other]\n\n for price in xrange(1, rmax + 1):\n add = prob_smaller(other, price) * prob_equal(ints2_tie, price) * prob_greater((int1,), price)\n # if add:\n # print int1, \" | \", ints2_tie, \" : \", \"price2\", price, \"*\", add, \"=\", add * price\n res += add * price\n\n# print\n\nfor i_ints1_tie in combos(INTINDS, 2, n):\n i_other = [i for i in INTINDS if i not in i_ints1_tie]\n\n ints1_tie = [intervals[i] for i in i_ints1_tie]\n other = [intervals[i] for i in i_other]\n for price in xrange(1, rmax + 1):\n add = prob_smaller(other, price) * prob_equal(ints1_tie, price)\n # if add:\n # print ints1_tie, \" | \", other, \" : \", \"price2\", price, \"*\", add, \"=\", add * price\n res += add * price\n\nprint res\n", "lang": "Python 2", "bug_code_uid": "1a2f872bd2c7772e8eaf424462ad0ca2", "src_uid": "5258ce738eb268b9750cfef309d265ef", "apr_id": "aaeb0f0f2702f24e903015d36b7956ef", "difficulty": 2000, "tags": ["probabilities", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.045993031358885016, "equal_cnt": 23, "replace_cnt": 18, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 23, "bug_source_code": "#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\nimport sys\nimport math\nfrom fractions import Fraction, gcd\nfrom decimal import Decimal, getcontext\nfrom itertools import product, permutations, combinations\ngetcontext().prec = 100\n\nMOD = 10**9 + 7\n\nn, m = map(int, raw_input().split())\nws = map(int, raw_input().split())\nbs = [int(x) - 1 for x in raw_input().split()]\n\nstack = []\nweights = []\nres = 0\nfor b in bs:\n # print b, stack, \":\", res, \"->\",\n if b in stack:\n ind = stack.index(b)\n weight = sum(weights[ind + 1:])\n del stack[ind]\n del weights[ind]\n else:\n weight = sum(weights)\n stack.append(b)\n weights.append(ws[b])\n res += weight\n # print res, \"(\", stack, weights, \")\"\n\nprint res\n", "lang": "PyPy 2", "bug_code_uid": "fa1d473adbc33e4a579160dc862985a7", "src_uid": "5258ce738eb268b9750cfef309d265ef", "apr_id": "aaeb0f0f2702f24e903015d36b7956ef", "difficulty": 2000, "tags": ["probabilities", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7528089887640449, "equal_cnt": 21, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 20, "bug_source_code": "ins = list(map(int,input().split()))\nn = ins[0]\nk = ins[1]\nins = input()\nfor i in range(0,len(ins)):\n if ins[i] == 'G':\n g = i\n if ins[i] == 'T':\n t = i\nt = True\nif (t-g) % k == 0:\n p = t-g\n if p<0:\n p *= -1\n \n while and ins[p]!='T'!='T':\n p = p - k\n if ins[p] == '#':\n t = False\n else:\n while p!=0 and ins[p]!='T':\n p = p - k\n if ins[p] == '#':\n t = False\nelse:\n t = False\nif t:\n print('YES')\nelse:\n print('NO')", "lang": "Python 3", "bug_code_uid": "63fa69c1ea2fa96336d840d89f552186", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "1a2fcb09c375b02ed77dc5f17e645c5a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9454545454545454, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "s=input()\nlis=s.split(\" \")\ndef hcf(a,b):\n if(a%b==0):\n return b\n else:\n hcf(b,a%b)\nk=hcf(int(lis[2]),int(lis[3]))\na=int(lis[0])//(int(lis[2])/k)\nb=int(lis[1])//(int(lis[3])/k)\nprint(min(a,b))", "lang": "Python 3", "bug_code_uid": "ceec3d20198946c60094060035e25304", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "apr_id": "f4e13ecca4e03ec90fa13c897c05623b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7281795511221946, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "n=int(input())\nL=[int(i) for i in input().split()]\nif L.count(100)=2*(L.count(200)) or (L.count(100)==n and L.count(200)==0 and n%2==0) or (L.count(200)==n and L.count(100)==0 and n%2==0):\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "bd14b78f860edc5316b5cb7de364decc", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "b6e320bd397fa8060c1eeb8dc01c01d2", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.06583072100313479, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n = input()\nn = int(n)\n\narr =[0]*(n+1)\n\nday = 0\nmax =0\n# be ezaye har ye voroodi i ke migire :\n\nfor i in range (0,n):\n number = input()\n number = int(number)\n day+=1\n arr[number] = day\n\n# for item in arr:\n# print(item)\n\nfor i in range(1,n+1):\n if max 0:\n lo = mid+1\n elif midval < 0:\n hi = mid\n else:\n return mid\n return lo\n\ndef scanl(f, base, l):\n for x in l:\n base = f(base) - x\n yield base\n\n\n[n,m] = map(int, input().split())\nmyAdd = lambda a: n if a + m > n else a+m\ndays = list(scanl(myAdd, n, range(1, n+1)))\nprint(binary_search(days) + 1)\n", "lang": "PyPy 3", "bug_code_uid": "1be8d12493488e55a87ad59f2a877f97", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "436a05087100677d2fb09e0ab4e33671", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8648648648648649, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": " a = abs(int(input()))\n b = 0\n while a > 0 or a & 1:\n b += 1\n a -= b\n print(b)", "lang": "PyPy 3", "bug_code_uid": "11fd3fde4daa7b82c6c4657a48949f6a", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "45ed067683fd933a321d03c4a6ac5a5c", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5464788732394367, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "x=int(input());lis=[];sq=0;i=1\nwhile sq=c):\n c+=1\n u+=1\n l[i]= -1\nprint(a)", "lang": "PyPy 3", "bug_code_uid": "3720a81384466f29109e779da9a555e5", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "aa2740e89842d16b8e21067951fa8d56", "difficulty": 1400, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9636963696369637, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\na=list(map(int,input().split()]\nfor i in range(a):\n if(a[i]>0):\n b+=a[i] \n else:\n c+=a[i]\n \nd=b-c\nprint(d)", "lang": "Python 3", "bug_code_uid": "72ff8ad0ffeb37f33c6a15308564cb07", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "1eb55a3c0c5ec90e1909064b93691f5e", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4824120603015075, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "from functools import reduce\nn=int(input())\nl=list(map(int,input()))\nprint(reduce(lambda x,y:abs(x)+abs(y) , l)\n", "lang": "Python 3", "bug_code_uid": "e1c2200237607fee25c3f515426ead16", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "3587cdec22937ee9ec8f1f2ecdbd90cd", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4237567758661325, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 24, "bug_source_code": "\ndef determine(arr, poss, seen):\n\tif seen[arr[0]][arr[1]][arr[2]]:\n\t\treturn poss[arr[0]][arr[1]][arr[2]]\n\telse:\n\t\tseen[arr[0]][arr[1]][arr[2]] = True\n\t\tif arr[0] >= 2:\n\t\t\ta = [arr[0] - 1, arr[1], arr[2]]\n\t\t\tp1 = determine(a, poss, seen)\n\t\t\tfor i in range(3):\n\t\t\t\tif p1[i] == True: \n\t\t\t\t\tposs[arr[0]][arr[1]][arr[2]][i] = True\n\t\tif arr[1] >= 2:\n\t\t\ta = [arr[0], arr[1]-1, arr[2]]\n\t\t\tp1 = determine(a, poss, seen)\n\t\t\tfor i in range(3):\n\t\t\t\tif p1[i] == True: \n\t\t\t\t\tposs[arr[0]][arr[1]][arr[2]][i] = True\n\t\tif arr[2] >= 2:\n\t\t\ta = [arr[0], arr[1], arr[2]-1]\n\t\t\tp1 = determine(a, poss, seen)\n\t\t\tfor i in range(3):\n\t\t\t\tif p1[i] == True: \n\t\t\t\t\tposs[arr[0]][arr[1]][arr[2]][i] = True\n\t\tif arr[0] >= 1 and arr[1] >= 1:\n\t\t\ta = [arr[0] - 1, arr[1]-1, arr[2]+1]\n\t\t\tp1 = determine(a, poss, seen)\n\t\t\tfor i in range(3):\n\t\t\t\tif p1[i] == True: \n\t\t\t\t\tposs[arr[0]][arr[1]][arr[2]][i] = True\n\t\tif arr[0] >= 1 and arr[2] >= 1:\n\t\t\ta = [arr[0] - 1, arr[1]+1, arr[2]-1]\n\t\t\tp1 = determine(a, poss, seen)\n\t\t\tfor i in range(3):\n\t\t\t\tif p1[i] == True: \n\t\t\t\t\tposs[arr[0]][arr[1]][arr[2]][i] = True\n\t\tif arr[1] >= 1 and arr[2] >= 1:\n\t\t\ta = [arr[0] + 1, arr[1] - 1, arr[2] - 1]\n\t\t\tp1 = determine(a, poss, seen)\n\t\t\tfor i in range(3):\n\t\t\t\tif p1[i] == True: \n\t\t\t\t\tposs[arr[0]][arr[1]][arr[2]][i] = True\n\t\treturn poss[arr[0]][arr[1]][arr[2]]\n\na = int(input())\ns = input()\n\narr = [0, 0, 0]\n\nfor i in range(len(s)):\n\tif s[i] == \"B\":\n\t\tarr[0] += 1\n\telif s[i] == \"G\":\n\t\tarr[1] += 1\n\telse:\n\t\tarr[2] += 1\n\nb = arr[0]\ng = arr[1]\nr = arr[2]\n\nseen = [[[False for i in range(r+g+b+1)] for i in range(r+g+b+1)] for i in range(r+g+b+1)]\nseen[0][0][0] = True\nposs = [[[[False, False, False] for i in range(r+g+b+1)] for i in range(r+g+b+1)] for i in range(r+g+b+1)]\nposs[0][0][0] = [False, False, False]\n\nseen[1][0][0] = True\nposs[1][0][0][0] = True\n\nseen[0][1][0] = True\nposs[0][1][0][1] = True\n\nseen[0][0][1] = True\nposs[0][0][1][2] = True\na = determine(arr, poss, seen)\n\nt = \"\"\nif a[0] == True:\n\tt += \"B\"\nif a[1] == True:\n\tt += \"G\"\nif a[2] == True:\n\tt += \"R\"\n\nprint(t)\n\n", "lang": "PyPy 3", "bug_code_uid": "935cff1eac1c15f51ed1bb68655d1cab", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "7f63393b8bb422d392b5365d81260d31", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9664429530201343, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "a, b, c = map(int, input().split(' '))\nmod = 998244353\n\ndef calc (a, b) :\n\tif a > b:\n\t\ta, b = b, a\n\tans = 0\n\ttmp = 1\n\tfor i in range(a + 1):\n\t\tans = (ans + tmp) % mod\n\t\ttmp = tmp * (a - i) * (b - i) * pow(i + 1, mod - 2, mod) % mod\n\treturn ans\n\nans = calc(a, b) * calc(b, c) * calc(a, c) % p\n\nprint(ans)", "lang": "Python 3", "bug_code_uid": "002f415d73f1d9a0d435fc482faeeb56", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "137a5885c890f962fd16271715827b6e", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2929824561403509, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#!/usr/bin/python3\n\nn , m = list( map( int , input().split() ) )\n\nn = min( n , 7 ** 7 )\nm = min( m , 7 ** 7 )\n\ndef f( hour , minutes , l ):\n\tif len( l ) == 0:\n\t\treturn 1\n\tres = 0\n\tfor i in l:\n\t\tlp = [ x for x in l if x != i ]\n\t\th = hour * 10 + i\n\t\tif( h < n ) res += f( h , minutes , lp )\n\t\tmi = minutes * 10 + i\n\t\tif( m < mi ) res += f( hour , mi , lp )\n\treturn res\n\nprint( f( 0 , 0 , range( 7 ) ) )", "lang": "Python 3", "bug_code_uid": "36b7e30c3fa6f7516c8ea334edc546bf", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "c922e0e624fcb454614bf62734c8d8e9", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.28771929824561404, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 19, "bug_source_code": "#include \n\nusing namespace std;\n\nint main() {\n\tint n, a, b;\n\tcin >> n >> a >> b;\n\tint ans = 1;\n\twhile(n / ans + b / ans >= n)\n\treturn 0;\n}", "lang": "Python 3", "bug_code_uid": "e6a1caf9146eb580d4f8e8682ed1faf6", "src_uid": "a254b1e3451c507cf7ce3e2496b3d69e", "apr_id": "7c6f5ff547b9d9b2cfcb482863c16535", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9459459459459459, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\nprint(pow(8,n),10))\n", "lang": "PyPy 3", "bug_code_uid": "1f577644dd31bff8e04b004bc2534908", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "ad4b69b214545d847ce8014bab22a211", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.925531914893617, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "from math import sqrt\n\ndef issquare(apositiveint):\n x = apositiveint // 2\n seen = set([x])\n while x * x != apositiveint:\n x = (x + (apositiveint // x)) // 2\n if x in seen: return False\n seen.add(x)\n return True\n\ndef main():\n\tn = input()\n\t\n\tif(n == 1):\n\t\tprint 1\n\t\n\telse:\n\t\tdiv = []\n\t\n\t\tranges = range(1, int(sqrt(n))+1)\n\t\tranges.sort(reverse = True)\n\t\n\t\tfor i in ranges:\n\t\t\tif(n % i == 0 and (i not in div) and (n/i not in div)):\n\t\t\t\tif(i > 1):\n\t\t\t\t\tdiv.append(i)\n\t\t\t\tif(n/i > 1):\n\t\t\t\t\tdiv.append(n/i)\n\t\tdiv.sort(reverse = True)\n\t\tcondition = 0\t\t\n\t\t#print div\n\t\t#print int(sqrt(div[0]) + 1)\n\t\t\n\t\tfor i in div:\n\t\t\tcondition = 0\n\t\t\treqd_range = range(len(div))\n\t\t\n\t\t\tif(i not in reqd_range):\n\t\t\t\treqd_range.append(i)\n\t\t\t\n\t\t\n\t\t\tfor j in reqd_range:\n\t\t\t\tif(i % div[j] == 0):\n\t\t\t\t\t#print j, issquare(j)\n\t\t\t\t\tif(issquare(div[j])):\n\t\t\t\t\t\tcondition = 1\n\t\t\t\t\t\tbreak\n\n\t\t\tif(condition == 0):\n\t\t\t\tprint i\n\t\t\t\tbreak\t\n\t\nmain()\n", "lang": "Python 2", "bug_code_uid": "a5d8b36eb59e212f8fff60f6e58f8cbb", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "e050ff9426efdef8288002ee5c3e37f2", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9097888675623801, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = int(raw_input())\ncount = [0] * 10\nfor idx in range(1, n+1):\n count[idx%9] += 1\n\nans = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n ans += count[i] * count[j] * count[i*j%9]\n\nfor i in range(1, n+1):\n for j in range(i, n+1, i):\n ans -= 1\n\nprint ans\n", "lang": "Python 2", "bug_code_uid": "7a68afd56d2589e3f46bf51805866c0e", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "5e7b54380a7ad5c227ff42aecf24d917", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.995575221238938, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\ndef main():\n ans = 0\n a = [0] * 10\n n = int(input())\n for i in range (1, 9):\n a[i] = n // 9 + int(n % 9 >= i)\n a[9] = n // 9\n \n for i in range(1, 10):\n for j in range(1, 10):\n k = i * j % 9\n if k == 0:\n k = 9\n ans += a[i] * a[j] * a[k]\n \n for i in range(1, n):\n ans -= n // i\n print(ans)\n \n return\n\nif __name__ == \"__main__\":\n main()", "lang": "PyPy 3", "bug_code_uid": "a245fb13e19add036c1b9543d9750820", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "28c6af4a1ae6dfedd941e3a00a69a13f", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9986962190352021, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def prime(x) :\n if x == 2 : return 1\n if ~ x & 1 : return 0\n i = 3\n while i * i <= x :\n if x % i == 0 : return 0\n i += 1\n return 1\nn = int(input())\ncnt = 0\nfor i in range (2, int(1e9), 1) :\n if not prime(i) : continue\n if i == int(str)(i)[::-1]) : continue\n if not prime(int(str(i)[::-1])) : continue\n cnt += 1\n if cnt == n : exit(print(i))", "lang": "PyPy 3", "bug_code_uid": "0928754a7cdbf45b75b0b54714bbb694", "src_uid": "53879e79cccbacfa6586d40cf3436657", "apr_id": "4cf5945a313b5369a0f1ae76effd2f3f", "difficulty": 1600, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8877551020408163, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "\nt=['']\nfor _ in range(10):\n u = ['4'+s for s in t] + ['7'+s for s in t]\n t += u\nt = map(int,t)\nt.sort()\nl,r=map(int,raw_input().split())\nfirst = True\nfor i in range(2**10):\n if l<=t[i]:\n rr = min(t[i],r)\n res += t[i]*(rr-l+1)\n l = t[i]+1\n if t[i]>=r:\n break\nprint res \n", "lang": "Python 2", "bug_code_uid": "d3ae8b7075ba4344d21d2be988d86f39", "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd", "apr_id": "b2288ca81d96daf5d045c2a8d12dc59c", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.37073170731707317, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "n = eval(input())\n\narea = 0\np1 = []\np2 = []\nps = []\nxl, xu, yl, yu = 0, 1 << 28, 0, 1 << 28\nfor i in range(n):\n in_ = input().split()\n p1.append(tuple(map(int, in_[0:2])))\n p2.append(tuple(map(int, in_[2:4])))\n xl = min(xl, ps[-2][0], ps[-1][0])\n xu = max(xu, ps[-2][0], ps[-1][0])\n yl = min(yl, ps[-2][1], ps[-1][1])\n yu = max(yu, ps[-2][1], ps[-1][1])\n\nok = True\nfor p in p2:\n q = p\n if p[0] < xu:\n q = (q[0] + 0.5, q[1])\n if p[1] < yu:\n q = (q[0], q[1] + 0.5)\n for i in range(n):\n if not (p1[i][0] <= p[0] <= p2[i][0] and p1[i][1] <= p[1] <= p2[i][1]):\n ok = False\nfor p in p1:\n q = p\n if xl < p[0]:\n q = (q[0] - 0.5, q[1])\n if yl < p[1]:\n q = (q[0], q[1] - 0.5)\n for i in range(n):\n if not (p1[i][0] <= p[0] <= p2[i][0] and p1[i][1] <= p[1] <= p2[i][1]):\n ok = False\n\nprint('YES' if ok else 'NO')\n", "lang": "Python 3", "bug_code_uid": "234b967d933b3f9b697da9238b9c01b9", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "e3a73d968c6dc24a484ec1999ea324e5", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9738863287250384, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a1, b1, a2, b2 = map(int, input().split())\ns = (a2 - a1) * (b2 - b1)\nfor i in range(n - 1):\n x1, y1, x2, y2 = map(int, input().split())\n a1, b1, a2, b2 = min(a1, x1), min(b1, y1), max(a2, x2), max(b2, y2)\n s += (x2 - x1) * (y2 - y1)\nprint('YES' if a2 - a1 == b2 - b1 and s == (a2 - a1) * (b2 - b1) else 'NO')", "lang": "Python 3", "bug_code_uid": "9aef17cb15f415c784f336df17ef8d52", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "419f6161945d2a6500d64b33226016db", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9969604863221885, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\ndef f(k):\n s=(n+1)//2;m=n\n while s>0and m:\n l=min(k,m);s-=l;m-=l;m-=m//10\n return s<=0\nl=[0,n]\nwhile l[1]-l[0]>1:\n m=(sum(l)//2;l[f(m)]=m\nprint(l[1])", "lang": "Python 3", "bug_code_uid": "031f3ae36e9535ae0c945e40f1252409", "src_uid": "db1a50da538fa82038f8db6104d2ab93", "apr_id": "bacf12e7900ae4f4143795ad1ab96327", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3789086450030656, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "# ========= /\\ /| |====/|\n# | / \\ | | / |\n# | /____\\ | | / |\n# | / \\ | | / |\n# ========= / \\ ===== |/====| \n# code\n\ndef main():\n from math import factorial as fac\n n,m,k = map(int , input().split())\n \n dp = [[0 for i in range(k + 1)] for i in range(n + 1)]\n\n dp[1][0] = m\n\n for i in range(2,n + 1):\n for j in range(k + 1):\n dp[i][j] = dp[i - 1][j]\n if j > 0:\n dp[i][j] += dp[i - 1][j - 1] * (m - 1)\n print(dp[n][k] % 998244353)\n return\n\nif __name__ == \"__main__\":\n main()", "lang": "Python 3", "bug_code_uid": "61ec1e8b14039e95ce62c77ad59f9db7", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "apr_id": "f577171d7f22fd77a4888c8b58fac89d", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9805555555555555, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def s(a,b,c):\n l = []\n for i in range(1,82):\n v = b*i**a+c\n if v > 1000000000:\n break\n vcopy = v\n val = 0\n while v > 0:\n val += v%10\n v//=10\n if val == i:\n l.append(vcopy)\n print(len(l))\n for i in l:\n print(i,end=' ')\n\na,b,c = map(int, input().spli", "lang": "PyPy 3", "bug_code_uid": "8607e4c13fe06e77a2e1a3720cd3d1e3", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "a1dc61d4d4918ab68826a8e886b91c4c", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9954819277108434, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "from math import *\nfrom Queue import *\nfrom sys import *\nfrom datetime import *\n\n\n\n\n\nnMax, hMax = map(int, raw_input().split())\ntable = [[0 for j in range(nMax+1)] for i in range(nMax+1)]\ntable[0][0] = 1\nfor i in range(1, nMax+1):\n table[i][i] = 2**(i-1)\nfor h in range(1, nMax+1):\n for n in range(h+1, nMax+1):\n for i in range(1,n+1):\n for j in range(h):\n table[n][h] += table[i-1][h-1]*table[n-i][j]\n for j in range(h):\n table[n][h] += table[i-1][j]*table[n-i][h-1]\n table[n][h] -= table[i-1][h-1]*table[n-i][h-1]\nres = 0\nfor h in range(hMax, n+1):\n res += table[n][h]\nprint(res)\n", "lang": "Python 2", "bug_code_uid": "52eae5d5486af86762291e2399c4d508", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "apr_id": "eec5c19718c8e6e1c241c823cd888052", "difficulty": 1900, "tags": ["divide and conquer", "dp", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9692307692307692, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "n = int(input(\"\"))\nif n % 2 == 0:\n print 2\nelse:\n print 1", "lang": "Python 3", "bug_code_uid": "4163a181948d9486123adec88b33739b", "src_uid": "816ec4cd9736f3113333ef05405b8e81", "apr_id": "fe383d9b5bbeb8a87216648a12bf53cc", "difficulty": 1200, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9252525252525252, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "s = raw_input()\nk = raw_input()\n\nsm = len(s) + k\nmx = sm if sm % 2 == 0 else sm - 1\n# cntr = mx / 2\nddone = False\nwhile mx > 0:\n strt = 0\n cntr = mx / 2\n while strt + mx <= sm:\n step = strt + cntr\n for i in range(strt, strt + step):\n j = i + step\n if i < len(s):\n if j < len(s):\n if s[i] == s[j]:\n pass # great\n else: # s[i] != s[j]\n break\n else: # j > len(s)\n pass # we can add here what we want\n ddone = True\n strt += 1\n if ddone:\n print mx\n break\n mx -= 2\n # cntr /= 2", "lang": "Python 2", "bug_code_uid": "a12cbd2c12167c49add3b548a5c10ff5", "src_uid": "bb65667b65ff069a9c0c9e8fe31da8ab", "apr_id": "f03f364272eb43425d315a0370929462", "difficulty": 1500, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9281314168377823, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "N, L, R, X = map(int, raw_input().split())\nC = map(int, raw_input().split())\nAns = 0\n\nfor Cf in range(1, 1 << N):\n\tV = [C[i] for i in range(N) if Cf & (1 << i) > 0]\n\tif max(V) - min(V) >= X and L <= sum(V) and sum(V) <= R:\n\t\tAns += 1\n\nprint Ans", "lang": "Python 3", "bug_code_uid": "af96a36402e0630c1a6f4bc13a0c2f40", "src_uid": "0d43104a0de924cdcf8e4aced5aa825d", "apr_id": "d1ad99695a20d7f68979cd0561bebd2b", "difficulty": 1400, "tags": ["brute force", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8706467661691543, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "import math \nx, y = raw_input().split(\" \")\nx = int(x)\ny = int(y)\n\nk = math.log(y) + math.log(math.log(x))\nl = math.log(x) + math.log(math.log(y))\n\nif (k > l):\n\tprint(\">\")\nif (k < l):\n\tprint(\"<\")\nif (k == l):\n\tprint(\"=\")", "lang": "Python 2", "bug_code_uid": "2315b4f7041b1beb424b6aa64dc33359", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "9b1f8f70af994df626779bc38b98afc9", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8797624938149431, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import math,sys\nimport heapq\nfrom fractions import Fraction\nfrom collections import Counter,defaultdict\ndef li(): return list(map(int,sys.stdin.readline().split()))\ndef ls(): return list(map(int,list(input())))\ndef la(): return list(input())\ndef ii(): return int(input())\ndef dic(x): return defaultdict(lambda: x) \ndef isPrime(n):\n i= 2\n if n == 1:\n return False\n while i <= int(math.sqrt(n)):\n if n%i == 0:\n return False\n i = i + 1\n return True\ndef gcd(a,b):\n if b == 0:\n return a\n return gcd(b,a%b)\ndef binarySearch(arr, x): \n l,r = 0,len(arr)-1\n while l <= r: \n mid = l + (r - l) // 2; \n if arr[mid] == x: \n return True \n elif arr[mid] < x: \n l = mid + 1\n else: \n r = mid - 1\n return False\nminn = float(\"inf\")\nx ,y ,n= li()\nfor i in range(1,n):\n if abs(Fraction(x,y)-Fraction(x,y).limit_denominator(i)) 0:\n box+=1\n comp=0\n if (b>k-1):\n comp=k\n b-=k-1\n else:\n comp=b+1\n b=0\n rem-=v*comp\nprint box\n ", "lang": "PyPy 3", "bug_code_uid": "eb904ed8b80cd06bf419791d58ce1445", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "d629443df9ee6611a2011a0453e03db3", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8817891373801917, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "p,m,x=map(int,input ().split ())\nif abs(p-m)==x:\n print ('0')\nelif abs(p-m)m:\n print ('+')\nelse:\n print ('-'", "lang": "Python 3", "bug_code_uid": "a932c2cba59ead438796a7f1f217f578", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "c215bf9bd2901568b4e2aa9587498fdd", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3879310344827586, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "read = lambda: map(int, input().split())\nn, k = read()\na = list(read())\n", "lang": "Python 3", "bug_code_uid": "e7167bb2164604b8a30071506dfb6ced", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "b06a3ab9ab66434e21aeb518b0ce8d27", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.06982305117168819, "equal_cnt": 24, "replace_cnt": 19, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 25, "bug_source_code": "import math\n\n# CRIVO\nm = 10 ** 6 + 10\neh_primo = [True] * m\neh_primo[0] = False\neh_primo[1] = False\n\nfor i in xrange(int(math.sqrt(m))):\n\n if eh_primo[i]:\n for j in xrange(i * i, m, i):\n eh_primo[j] = False\n\n# ------------\n\nn = int(raw_input())\n\na = int(math.sqrt(n))\nb = int(math.sqrt(n))\n\nif eh_primo[n]:\n print 1,n\n\nelif a * b == n:\n print a, b\n\nelse:\n\n while a > 0 and a * b < n:\n a = a - 1\n\n if a * b != n:\n\n a = int(math.sqrt(n))\n while a * b < n:\n if a * (b+1) > n:\n a = a - 1\n else:\n b = b + 1\n\n print a, b\n", "lang": "Python 2", "bug_code_uid": "3dd8f67b2e069e24dd28df27cabd6cf3", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "074703b43d79d967904e1ea451fb75f7", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.995825093386069, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "# by the authority of GOD author: manhar singh sachdev #\n\nimport os,sys\nfrom io import BytesIO, IOBase\nfrom collections import Counter\n\ndef main():\n mod = 10**9+7\n r,g = map(int,input().split())\n n = 1\n while r+g >= (n*(n+1))//2:\n n += 1\n n -= 1\n tot = n*(n+1)//2\n dp = [0]*(tot+1)\n dp[0] = 1\n for i in range(1,n+1):\n for x in range(tot-i,-1,-1):\n dp[i+x] += dp[x]\n dp[i+x] %= mod\n ans = 0\n for i,val in enumerate(dp):\n if i <= r and tot-i <= g:\n ans += val\n ans %= mod\n print(ans)\n\n#Fast IO Region\nBUFSIZE = 8192\nclass FastIO(IOBase):\n newlines = 0\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\nif __name__ == '__main__':\n main()", "lang": "PyPy 3", "bug_code_uid": "793bfc8a6b300f1c186c19f088e329cb", "src_uid": "34b6286350e3531c1fbda6b0c184addc", "apr_id": "6a9ff612b267dc844bcdfd190d391fbd", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.45977011494252873, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "a = input()\nb = input()\nc = input()\nd = input()\ne = input()\nf = input()\nans = (a+d) * (b + c) + e * f + b * c\nprint ans", "lang": "Python 2", "bug_code_uid": "fdc43ab2d72483a055d6a6bd27fc6168", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "beea7e6d53718d56451f0b0dbd2aacc1", "difficulty": 1600, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.39080459770114945, "equal_cnt": 7, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "from itertools import repeat\nk = {'s':'Sheldon' , 'l' : 'Leonard' , 'p' :'Penny' , 'r' : \"Rajesh\" , 'h' :'Howard'}\nh = \"\"\ni = 1\nst = \"slprh\"\nj = 0\nwhile( i <= 10**9):\n h += st[0]*2**j\n h += st[1]*2**j\n h += st[2]*2**j\n h += st[3]*2**j\n h += st[4]*2**j\n i += 5*(2**j)\n j += 1\n print(i)\ng = int(input())\nprint( k[h[g-1]])\n \n", "lang": "Python 3", "bug_code_uid": "b820d2cb4c891a0122462db4f1b2ddf5", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "29758c62340ee5fbe39aedc8178e7e4f", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6931677018633541, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n , m = map(int , raw_input().split())\nx = int(raw_input())\n\ndef change():\n global n , m\n n -= 2\n m -= 2\n n = max(n , 0)\n m = max(m , 0)\n\ndef calc(n , m):\n ret = 0\n for i in range(0 , n):\n for j in range(0 , m):\n if (i + j) % 2 == 0:\n ret += 1\n return ret\n\nfor i in range(1 , x):\n change()\nans = calc(n , m)\nchange()\nans -= calc(n , m)\nprint(ans)\n", "lang": "Python 2", "bug_code_uid": "6291263e7055758f9408927085667293", "src_uid": "fa1ef5f9bceeb7266cc597ba8f2161cb", "apr_id": "82e563f9b8d272c3f4ba205d9e04bb47", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8878718535469108, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(raw_input())\na = map(int, raw_input().split())\n\ns = 0\nfor i in xrange(n):\n if a[i] == 1:\n s += 1\n elif a[i] == 0 and (i > 0 and i + 1 < n and a[i-1] == 1 and a[i+1] == 1):\n s += 1\n\nprint s\n", "lang": "Python 3", "bug_code_uid": "44931dccf23780a16277bc98a7efc273", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "37857bd96d8cd6bf248dbc6f045b70a5", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.962486602357985, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "X, Students = list(map(int, input().split())), list(map(int, input().split()))\nfor i in range(X[0]):\n Count, Temp, Sum = 0, X[1], sum(Students[:i]) + Students[i]\n if Sum <= X[1]:print(0, end=\" \")continue\n else:\n STemp = sorted(Students[:i], reverse=True)\n for j in range(i):\n if X[1] >= Sum:break\n Count, Sum = Count + 1, Sum - STemp[j]\n print(Count, end=\" \")\n\n# Come together for getting better !!!!\n", "lang": "Python 3", "bug_code_uid": "76d876809c1c91a814cf33efd52712cc", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "apr_id": "2346098460678158e092b2fe199e7017", "difficulty": 1200, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.061597690086621755, "equal_cnt": 12, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include\nusing namespace std;\nint n,m;\nint fail(int limit,int ar[])\n{\n int i;\n int sum=0;\n sort(ar,ar+n);\n for(i=limit;i>=0;i++)\n {\n sum=sum+ar[i];\n if(sum<=n)\n break;\n }\n return i;\n\n}\nint main()\n{\n int sum=0;\n cin>>n>>m;\n int ar[n],ar1[n];\n for(int i=0;i>ar[i];\n ar1[i]=ar[i];\n }\n for(int i=0;i max:\n max = cur\n cur = 1\n else:\n cur += 1\n if cur > max:\n max = cur\n \n return max\n \n \n\nif __name__ == \"__main__\":\n road = sys.argv[1]\n print main(road)\n", "lang": "Python 2", "bug_code_uid": "6696f47b7e5ec7acb790b2e2d3f40702", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "35f69f92b029917c97c1814a113628bf", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9853574504737296, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import math\ndef main(fl=math.floor):\n m = int(raw_input())\n lo, hi = 0, 5.0 * (10 ** 15)\n g = [1, 1] + [i ** 3.0 for i in xrange(2, 180000)]\n def f(n):\n return sum(fl(n / g[i]) for i in xrange(2, int(n ** (1.0 / 3)) + 2))\n while lo + 1 < hi:\n mid = (lo + hi) / 2\n if f(mid) < m:\n lo = mid\n else:\n hi = mid\n gi = [1, 1] + [i ** 3 for i in xrange(2, 180000)]\n def fi(n):\n return sum(n / gi[i] for i in xrange(2, int(n ** (1.0 / 3)) + 2)) \n x = int(round(hi))\n print x if fi(x) == m else -1\nmain()\n", "lang": "Python 2", "bug_code_uid": "01c2d4bf423f4bb28772877ee4b0c69b", "src_uid": "602deaad5c66e264997249457d555129", "apr_id": "b160a8823bf85032f7561f53e5acfb4f", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9878048780487805, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\nbe, en, ans = 8, 10 ** 16, float('inf')\nall = [x * x * x for x in range(2, 170416)]\n\nwhile be <= en:\n cur, md, k = 0, (be + en) >> 1, 0\n\n while all[k] <= md:\n cur += md // all[k]\n k += 1\n\n if cur < n:\n be = md + 1\n else:\n if cur == n:\n ans = min(ans, md)\n en = md - 1\n # print(cur,ans,md)\n\nprint(-1 if ans == float('inf') else ans)\n", "lang": "PyPy 2", "bug_code_uid": "66bb5b7a9077b3eb32c591b0e7aa51fb", "src_uid": "602deaad5c66e264997249457d555129", "apr_id": "eb62da7701a5832e848849589971436a", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9982300884955753, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p,y = map(int,input().split())\nfor x in range(y,p,-1):\n\tif all(x%i for i in range(2,min(int(x**.5),p+1)):\n\t\t#even if one devides it completely then not possible to sit\n\t\t#if nothing devides then it's sitable\n\t\t#factors repeat after reachin midway(sqrt)\n\t\tprint(x)\n\t\texit()\nprint(-1)", "lang": "Python 3", "bug_code_uid": "c55c80b7e09fe5ae26e13423babac0a7", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "de8d46ebd7b423a673af5d2ea6374bd3", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8797250859106529, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n, m = [int(i) for i in input().split()]\na = 1\nk = 0\nwhile (k < n and a <= m):\n a *= 2\n k += 1\n\nif (a > m):\n print(m)\nelse:\n print(m % a)", "lang": "PyPy 3", "bug_code_uid": "ca89c6f602f61cea87a4aebd1312f54e", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "91ee5ce25f4e6c70f5063b89485faac5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.10040160642570281, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nSpyder Editor\n\nEste \u00e9 um arquivo de script tempor\u00e1rio.\n\"\"\"\n\n\"\"\"\nSolution to coin-exchange problem, in which 2 parameters are given:\n - amount of money\n - array of coin values\n\"\"\"\n\ndef solveCombinations(amount, coins):\n comb = [0] * (amount+1)\n comb[0] = 1\n for c in coins:\n for i, val in enumerate(comb):\n if i >= c:\n comb[i] += comb[i - c]\n return comb[-1]\n\ndef solveMinCoins(amount, coins):\n minNum = [amount+1] * (amount+1)\n minNum[0] = 0 # sem moedas para 0 dinheiros\n # print(minNum)\n for i in range(1, amount+1):\n for c in coins:\n if c <= i:\n minNum[i] = min(minNum[i - c] + 1, minNum[i])\n # print(minNum)\n else:\n break\n # print(minNum)\n return minNum[-1]\n\ncoin, amount = map(int, input().split())\n\nprint(solveMinCoins(amount , range( 1, coin+1 ) ))", "lang": "PyPy 3", "bug_code_uid": "c261699b5a2d15aeb5297b4baef38d3c", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "6b6a480401da72ab2a9f4f3b4efeb5cb", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.998193315266486, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "class Square():\n point1 = []\n point2 = []\n number = 0\n\n def GenerateCords(self, a, x):\n self.number = x\n if x == 1:\n self.point1 = [(-a/2), 0]\n elif x%3 == 2:\n self.point1 = [(-a/2),((((x//3)*2)+1)*a)]\n elif x%3 == 0:\n self.point1 = [-a,(((((x//3)-1)*2)+2)*a)]\n else:\n self.point1 = [0,(((((x//3)-1)*2)+2)*a)]\n\n self.point2 = [(self.point1[0]+a),(self.point1[1]+a)]\n\n def CheckIfIn(self, x, y):\n if x < self.point1[0]+1 or x => self.point2[0]:\n return -1\n if y < self.point1[1]+1 or y => self.point2[1]:\n return -1\n else:\n return self.number\n\n\n\na,x,y = map(int, input().split())\n\n\nrow = y//a + 1\n\nif row == 1:\n test = Square()\n test.GenerateCords(a, row)\nelif (row - 1)%2 == 1:\n test = Square()\n test.GenerateCords(a, ((((row-1)//2)*3)+2))\nelse:\n if x <= 0:\n test = Square()\n test.GenerateCords(a, (row//2)*3)\n else:\n test = Square()\n test.GenerateCords(a, ((row//2)*3)+1)\n\nprint(test.CheckIfIn(x,y))\n \n", "lang": "Python 3", "bug_code_uid": "6087c832282e1e5376c1bf56b8db8617", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "b4915a3f3a45c55a5918683237a318f0", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9976470588235294, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\n\nentrada = list(map(int,input().split(' ')))\nl = entrada[0]\nx = entrada[1]\ny = entrada[2]\n\n\nok = True\n\nres = 1\n\nax = True\n\nif y >= l:\n\ty -= l\n\tres = 2\n\t\n\nwhile(y >= l):\n\tif ax:\n\t\tres += 1\n\telse:\n\t\tres += 2\n\tax = not ax \n\t\t \n\ty -= l\n\nif y == 0:\n\tok = False\nif not ax:\n\tif x <= -l or x >= l or x == 0:\n\t\tok = 0\n\tif x > 0:\n\t\tres += 1\nelse:\n\tif x => (l/2) or x <= -(l/2):\n\t\tok = 0\n\n\nif ok:\n\tprint(res)\nelse:\n\tprint(-1)\n\n\n\n\n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "d36322f665d4b51473c8d54e4c9679b4", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "487334990da99cd2bdbde2d70a055344", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6568627450980392, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "if(a>0 and b>0):\n print('0',a+b,a+b,'0')\nelif(a<0 and b>0):\n print(-(abs(a)+b),'0','0',abs(a)+b)\nelif(a>0 and b<0):\n print('0',-(abs(b)+a),abs(b)+a,'0')\nelse:\n print('0',-(abs(b)+abs(a)),-(abs(b)+abs(a)),'0')", "lang": "Python 3", "bug_code_uid": "eb7cc71cb82d9110f2e560eda9aef2d1", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "11622f2ce74c825fffc86f542c1991c6", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9915014164305949, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\nans = 0\nm = 1\nwhile n>0:\n k = n%10\n n = n/10\n if k == 4:\n ans = ans + m * 1\n elif k == 7:\n ans = ans + m * 2\n m = m * 2\nprint ans", "lang": "Python 3", "bug_code_uid": "330588f61ea8e8316e81a7da4d9b1100", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "3b059806729db92cd367ef7f07a769e7", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8611111111111112, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\na = input().split()\nb= a.count(\"100\")\nif b > 0 and b%2 == 0:\n print(\"YES\")\nb= a.count(\"200\")\nelif b%2 == 0 and b>0:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "fa404c2943313dad3c3e28192123d489", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "87b00cba91a2794bf81bc30aacb8da9a", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9954337899543378, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import math\nn=int(input())\nans=(int((n*(n-1)*(n-2)*(n-3)*(n-4))/(120)))\nprint(ans*(n*(n-1)*(n-2)*(n-3)*(n-4))", "lang": "Python 3", "bug_code_uid": "e7d943ecb9773b27d0e6ef7b6b5ac9b4", "src_uid": "92db14325cd8aee06b502c12d2e3dd81", "apr_id": "f1ed191c298ea660c1ffd9d1b94f3623", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.976056338028169, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "ri = lambda: raw_input().strip()\n\n#n = int(ri())\nx, y = map(int, ri().split())\n\n\nif abs(x) <= 1 and abs(y) <= 1:\n if (x == 0 and y == 0) or (x == 1 and y == 0):\n print 0\n\n elif x == 1 and y == 1:\n print 1\n\n elif y == 1:\n print 2\n\n elif x == -1:\n print 3\n\n\n\nelse:\n ans = 0\n if abs(x) > abs(y):\n ans = (abs(x) - 1) * 4\n else:\n ans = (abs(y) - 1) * 4\n\n if x > 0 and abs(y) <= abs(x):\n if x != -(y+1):\n ans += 1\n if (-y == x):\n ans += 3;\n\n elif y > 0 and abs(x) <= abs(y):\n ans += 2\n\n elif x < 0 and ans(x) >= abs(y):\n ans += 3\n\n else:\n ans += 4\n\n print ans", "lang": "Python 2", "bug_code_uid": "da63982a1c7d7ec0c5fe38d617ad3205", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382", "apr_id": "efeb4b2be212567e75394795aa043b25", "difficulty": 1400, "tags": ["geometry", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.924812030075188, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "import math \n\nnbr=int(input())\ns=int(math.sqrt(2*n))\nif n==r*(r+1)/2 or n==(r+1)*(r+2)/2:\n print(\"YES\")\nelse:\n print(\"NO\")\n ", "lang": "Python 3", "bug_code_uid": "791b14f113e3a83d9c4f85d64a957573", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "f6f2b2d54e3fcd33dc898e23788df436", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8148148148148148, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = input().split(' ')\nday = int(n[0])\nident = n[2]\n\nelif ident == \"week\":\n if day > 6:\n print(51)\n else:\n print(52)\nelse:\n if day <30:\n print(12)\n elif day == 30:\n print(11)\n else:\n print(7)", "lang": "PyPy 3", "bug_code_uid": "f96e0387cff4539f6985fea9b07ef721", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "2fae96688fea7f62487da38ca0786090", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2948960302457467, "equal_cnt": 19, "replace_cnt": 10, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "import itertools as it\nimport operator as op\n\nnums = list(map(int, input().split()))\nn = nums[0]\nnums = sorted(set(nums[1:]), reverse=True)\nuniq_count = map(lambda x: range(n // x + 1), nums)\n\nfor t in sorted(it.product(*uniq_count), key=sum, reverse=True):\n if sum(map(op.mul, nums, t)) == n:\n print(sum(t))\n break\n", "lang": "Python 3", "bug_code_uid": "81994ff9e2c735dacc03bdef9b75e97f", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "e26534e597268b32cc98f4e14ff621c0", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.015748031496062992, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#include\nusing namespace std;\n\nint main(int argc, char const *argv[])\n{\n\tstring a, b; cin >> a >> b;\n\tint num1 = 0, num2 = 0;\n\tfor (int i = 0; i < a.size(); i++) num1 += ((int)a[i] - 48) * pow(10, a.size() - i - 1);\n\tfor (int i = 0; i < b.size(); i++) num2 += ((int)b[i] - 48) * pow(10, b.size() - i - 1);\n\tif (num1 > 99) num1++;\n\tif (num2 > 99) num2++;\n\tint sum = num1 + num2;\n\tfor (int i = 0; i < a.size(); i++) if (a[i] == '0') a.erase(a.begin() + i);\n\tfor (int i = 0; i < b.size(); i++) if (b[i] == '0') b.erase(b.begin() + i);\n\tnum1 = 0, num2 = 0;\n\tfor (int i = 0; i < a.size(); i++) num1 += ((int)a[i] - 48) * pow(10, a.size() - i - 1);\n\tfor (int i = 0; i < b.size(); i++) num2 += ((int)b[i] - 48) * pow(10, b.size() - i - 1);\n\tstringstream os;\n\tos << sum;\n\tstring s;\n\tos >> s;\n\tfor (int i = 0; i < s.size(); i++) if (s[i] == '0') s.erase(s.begin() + i);\n\tsum = 0;\n\tfor (int i = 0; i < s.size(); i++) sum += ((int)s[i] - 48) * pow(10, s.size() - i - 1);\n\tif (num1 + num2 == sum) cout << \"YES\" << endl;\n\telse cout << \"NO\" << endl;\n\treturn 0;\n}", "lang": "PyPy 3", "bug_code_uid": "b36e078d79f2d709f078b76db11ce060", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "25ab80360393c35c70783e9715537145", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7258687258687259, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "import collections\nimport math\ndef primefactors(n):\n\td = collections.defaultdict(int) \n\twhile n%2 == 0:\n\t\td[2]+=1\n\t\tn/=2\n\tfor i in range(3, int(n**0.5)+1, 2):\n\t\twhile n%i==0:\n\t\t\td[i]+=1\n\t\t\tn/=i\n\tif n > 2:\n\t\td[n]+=1\n\treturn d\nn = int(input())\nx = primefactors(n)\ny = max(x.values())\nz = x.keys()\nk = 1\nfor i in z:\n\tk*=i\nif int(k) = n:\n\tprint(int(k), 0)\nelse:\n\tprint(int(k), math.ceil(math.log(y, 2))+1)", "lang": "Python 3", "bug_code_uid": "e7b9ff4f1bfbe550425b5b3c20e207ad", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "621c917452ddb8e883a78b61bb0189c5", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.30538922155688625, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 20, "bug_source_code": "n = input()\nn = int(n)\ncount = 0\nfor i in range(1,n+1):\n s = str(i)\n if('2' in s or '3' in s or '4' in s or '5' in s or '6' in s or '7' in s or '8' in s or '9' in s):\n continue\n else:\n count += 1\nprint count\n", "lang": "Python 2", "bug_code_uid": "23a391c85cc1fb344923ad3d28923a07", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "134249aaa005ff19fbc4baddeda88ebc", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8598130841121495, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a,b = raw_input().strip().split()\nprint int(a)+int(b[::-1])", "lang": "Python 3", "bug_code_uid": "ecd57a4a375cbdc0420e3efab6d965f4", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "f8ae7022f55c4e9fa028b576a769d6c4", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.920863309352518, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "P = str(input())\nResp = 'NO'\nk = len(P)\nb = 0\nwhile(b=2 and l[i-2]==3):\n ct+=2\n else:\n ct+=3\n else:\n ct=-1\n else:\n if(l[i-1]==1):\n ct+=4\n else:\n ct=-1\n if(ct==-1):\n print('Infinite')\n break\n if(ct!=-1):\n print('Finite')\n print(ct)\n", "lang": "PyPy 3", "bug_code_uid": "51c40b142e5fd45ba62b6ddeb5c7e20a", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "f45e16093a514b691fc7e1efe1040deb", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6229508196721312, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "a= int(input())\nb=input()\nl=b.split()\nq=b.split()\ns=[]\nk=[]\ndef max(l):\n t=l[0]\n f=t\n for j in range(1,len(l)):\n if l[j]>t:\n f=l[j]\n return f\n \nfor i in range(1,len(l)-1):\n v=l[i]\n del l[i]\n for j in range(len(l)-1):\n p=int(l[j+1])-int(l[j])\n s.append(p)\n w=max(s)\n k.append(w)\n l.append(v)\n l.sort()\n\nh=min(k)\nprint(h", "lang": "Python 3", "bug_code_uid": "5d023f072e8c2203b65dca126699347f", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "c63e4df9b4c8f90f7c69f0d934a0980c", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.13031161473087818, "equal_cnt": 7, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "n = int(input)\nl = map(int, input().split())\n\n_min = 1000 * 2\ndiff = 0\n\nfor i in range(n -1):\n _min = min(_min, l[i] + l[i+1])\n diff = max(l[i-1] - l[i])\n \nprint max(diff, _min)", "lang": "Python 3", "bug_code_uid": "29666bcc6b2afea8ed7c7a53b274d757", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "b08c813290defbfb180c92aa70537514", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8486646884272997, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nk = int(input())\nM = int(input())\nD = int(input())\nans = 0\nfor i in range(D + 1):\n maxX = n // (i * k - k + 1)\n minX = n // (i * k + 1)\n if n % (i * k + 1) == 0 :\n minX += 1\n maxX = min(maxX, M)\n if minX <= maxX:\n ans = max(ans, i * maxX)\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "ad5f405cb3d6c1c990891bdc96e2938e", "src_uid": "ac2e795cd44061db8da13e3947ba791b", "apr_id": "177cc0f202c0e9f0778e33b8644ed044", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3769363166953528, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "def main():\n M=998244353\n n,k,*h=map(int,open(0).read().split())\n m=sum(i!=j for i,j in zip(h,h[1:]+h[:1]))\n f=[0]*(m+1)\n f[0]=b=1\n for i in range(1,m+1):f[i]=b=b*i%M\n inv=[0]*(m+1)\n inv[m]=b=pow(f[m],M-2,M)\n for i in range(m,0,-1):inv[i-1]=b=b*i%M\n comb=lambda n,k:f[n]*inv[n-k]*inv[k]%M\n print((pow(k,m,M)-sum(comb(m,i)*comb(m-i,i)*pow(k-2,m-i-i,M)for i in range(m//2+1)))*pow(k,n-m,M)*inv[2]%M)\nmain()", "lang": "PyPy 3", "bug_code_uid": "8d364d2827d0c99977f5d17145c02fc4", "src_uid": "63c4006a0a6284f9825aaabfc4c28fd1", "apr_id": "443a504086cdbe0c1d53e81ccd027ae7", "difficulty": 2400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9994707594601746, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from bisect import *\nfrom collections import *\nfrom math import gcd,ceil,sqrt,floor,inf\nfrom heapq import *\nfrom itertools import *\nfrom operator import add,mul,sub,xor,truediv,floordiv\nfrom functools import *\n\n#------------------------------------------------------------------------\nimport os\nimport sys\nfrom io import BytesIO, IOBase\n# region fastio\n \nBUFSIZE = 8192\n \nclass FastIO(IOBase):\n newlines = 0\n \n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n \n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n \n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n \n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n \n \nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\n \n \nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\n\n#------------------------------------------------------------------------\ndef RL(): return map(int, sys.stdin.readline().rstrip().split())\ndef RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef N(): return int(input())\n#------------------------------------------------------------------------\n\n\nfarr=[1]\nifa=[]\n\ndef fact(x,mod=0):\n if mod:\n while x>=len(farr):\n farr.append(farr[-1]*len(farr)%mod)\n else:\n while x>=len(farr):\n farr.append(farr[-1]*len(farr))\n return farr[x]\n\ndef ifact(x,mod):\n global ifa\n ifa.append(pow(farr[-1],mod-2,mod))\n for i in range(x,0,-1):\n ifa.append(ifa[-1]*i%mod)\n ifa=ifa[::-1]\n\ndef per(i,j,mod=0):\n if if(mid):\n l=mid+1\n else:\n r=mid\n return l\n\ndef rinc(f,t,l,r):\n while lf(mid):\n r=mid-1\n else:\n l=mid\n return l\n\ndef isprime(n):\n for i in range(2,int(n**0.5)+1):\n if n%i==0:\n return False\n return True\n\ndef binfun(x):\n c=0\n for w in arr:\n c+=ceil(w/x)\n return c\n\ndef lowbit(n):\n return n&-n\n\ndef inverse(a,m):\n a%=m\n if a<=1: return a\n return ((1-inverse(m,a)*m)//a)%m\n\nclass BIT:\n def __init__(self,arr):\n self.arr=arr\n self.n=len(arr)-1\n \n def update(self,x,v):\n while x<=self.n:\n self.arr[x]+=v\n x+=x&-x\n\n def query(self,x):\n ans=0\n while x:\n ans+=self.arr[x]\n x&=x-1\n return ans\n\nclass smt:\n def __init__(self,l,r,arr):\n self.l=l\n self.r=r\n self.value=(1<<31)-1 if l=self.r):\n return self.value\n val=(1<<31)-1\n mid=(self.l+self.r)//2\n if(l<=mid):\n val&=self.left.ask(l,r)\n if(r>mid):\n val&=self.right.ask(l,r)\n return val\n\nclass DSU:#\u5bb9\u91cf+\u8def\u5f84\u538b\u7f29\n def __init__(self,n):\n self.c=[-1]*n\n\n def same(self,x,y):\n return self.find(x)==self.find(y)\n\n def find(self,x):\n if self.c[x]<0:\n return x\n self.c[x]=self.find(self.c[x])\n return self.c[x]\n\n def union(self,u,v):\n u,v=self.find(u),self.find(v)\n if u==v:\n return False\n if self.c[u]=self.ranks[pv]:\n self.parent[pv]=pu\n if self.ranks[pv]==self.ranks[pu]:\n self.ranks[pu]+=1\n else:\n self.parent[pu]=pv\n\ndef Prime(n):\n c=0\n prime=[]\n flag=[0]*(n+1)\n for i in range(2,n+1):\n if not flag[i]:\n prime.append(i)\n c+=1\n for j in range(c):\n if i*prime[j]>n: break\n flag[i*prime[j]]=prime[j]\n if i%prime[j]==0: break\n return prime\n\ndef dij(s,graph):\n d={}\n d[s]=0\n heap=[(0,s)]\n seen=set()\n while heap:\n dis,u=heappop(heap)\n if u in seen:\n continue\n for v in graph[u]:\n if v not in d or d[v]>d[u]+graph[u][v]:\n d[v]=d[u]+graph[u][v]\n heappush(heap,(d[v],v))\n return d\n\ndef GP(it): return [(ch,len(list(g))) for ch,g in groupby(it)]\n\nclass DLN:\n def __init__(self,val):\n self.val=val\n self.pre=None\n self.next=None\n\n\n \n\nt=1\nfor i in range(t):\n mod=998244353\n n,k=RL()\n h=RLL()\n res=GP(h)\n c=0\n for ch,cnt in res:\n c+=cnt-1\n n=len(res)\n if n>1 and res[-1][0]==res[0][0]:\n c+=1\n n-=1\n ans=pow(k,c,mod)\n tmp=pow(k,n,mod)\n fact(n,mod)\n ifact(n,mod)\n p=[1]\n for i in range(n):\n p.append(p[-1]*(k-2)%mod)\n for x in range(n//2+1):\n tmp=(tmp-p[n-2*x]*fact(n,mod)%mod*ifa[x]%mod*ifa[x]%mod*ifa[n-2*x]%mod)%mod\n ans=ans*tmp%mod*pow(2,mod-2,mod)%mod\n print(ans)\n \n", "lang": "PyPy 3", "bug_code_uid": "89addcdf4f25591a002254c1eaf15137", "src_uid": "63c4006a0a6284f9825aaabfc4c28fd1", "apr_id": "fca98d03692c8b4a9f5abce021910056", "difficulty": 2400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9206349206349206, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n,k=int(input()),0;while n:n-=int(max(list(str(n))));k+=1;print(k)", "lang": "Python 3", "bug_code_uid": "d96ff02636f8c73d61ed704e2c343fcb", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "5c9b8b03adb9aceb1bb17f04d10b4dca", "difficulty": 1100, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8547945205479452, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "bug_source_code": "a, b = map(int, input().split())\narra = []\nfor i in range(b - a):\n arra.append(a + 1 + i)\nb = 1\nfor i in range(len(arra)):\n b *= arra[i]\nprint(b % 10)", "lang": "PyPy 3", "bug_code_uid": "c7379749ec33fb8c7f6550ce4bf81dd5", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "e83c44fcf63944dfb2a62b9116937880", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.926829268292683, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "s=input()\nu=0\nl=0\nfor i in s:\n if i.isupper():\n u+=1\n if i.islower()\n l+=1\nif u>l:\n print(s.upper())\nif u x else x)\n", "lang": "Python 3", "bug_code_uid": "4ee8d83d1ef0b05ef9cda802c755e9a5", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "eec78b981e6a4c04a74e645a506c6508", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3524590163934426, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "name = input()\n\nif name[0] in \"w, m, j, e, b, r, s, v, n, k, p, l, u, i, q\":\n print(\"CHAT WITH HER!\")\nelse:\n name[1] in \"w\":\n print(\"IGNORE HIM!\")\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "f2c7f5f01acd68937dbc0a14d8f67455", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "e47d73bb761a0a78d1f75e77967f2c2d", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.23789473684210527, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import sys\n\nMIN = -1000000000\nx, y, z, k = [int(x) for x in sys.stdin.readline().split()]\nx1, y1, z1 = 1, 1, 1\nfor i in range(k):\n a, b, c = MIN, MIN, MIN\n if x1 < x:\n a = (x1+1)*y1*z1\n if y1 < y:\n b = x1*(y1+1)*z1\n if z1 < z:\n c = x1*y1*(z1+1)\n best = max(a, b, c)\n if best == MIN:\n break\n if best == a:\n x1 += 1\n elif best == b:\n y1 += 1\n else:\n z1 += 1\n#print(x1,y1,z1)\nprint(x1*y1*z1)\n", "lang": "Python 2", "bug_code_uid": "a66b4754c3b67d0f8b4af42304ab79df", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "edc77a2478c4818a258418e0a8c9c949", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.42948717948717946, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 11, "fix_ops_cnt": 17, "bug_source_code": "x,y,z=map(int,input().split())\nif (x-(y+z))*((x+z)-y)<0:\n print('?)\nelse:\n if x-(y+z)>0:\n print('+')\n elif (x+z)-y<0:\n print('-')\n else:\n print('0')", "lang": "Python 3", "bug_code_uid": "0e0a5712959e101bdc3773cd90cd4626", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "1faefbc93fc043ed9b9d4293729d390b", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9950248756218906, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\ndef phi(n):\n res = n\n for i in range(2, int(math.sqrt(n)) + 1):\n if(n % i == 0):\n while(n % i == 0):\n n /= i\n res -= res/i\n if(n > 1):\n res -= int(res / n)\n return res\nn, k = map(int, input().split())\nres = n\nk = int((k + 1) / 2)\nwhile(res != 1 and k != 0):\n res = phi(n)\n k -= 1\nprint(\"{}\".format(int(res % (1e9 + 7))))", "lang": "Python 3", "bug_code_uid": "ca7405292a2750abc89c3ea4137ada1a", "src_uid": "0591ade5f9a69afcbecd80402493f975", "apr_id": "7cfdf6822e9029c7a6063248e0b1c5c1", "difficulty": 2100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9397260273972603, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "MOD = 1000000007\ndef phi(n):\n res = n\n for i in range(2,int(n**(0.5)+1)):\n if n % i == 0:\n while n % i == 0:\n n = n//i\n res -= res//i\n if n > 1:\n res -= res//n\n return res\n\nn,k = map(int,input().split())\nk = (k+1)//2\nans = n\nfor _ in range(k):\n ans = phi(ans)\nprint(ans % MOD)\n", "lang": "PyPy 3", "bug_code_uid": "31f68c2ebf3e8dff53e62aa71d1fc468", "src_uid": "0591ade5f9a69afcbecd80402493f975", "apr_id": "c1f8a8af42a64f653f83614029c288f9", "difficulty": 2100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.24, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "\nfrom itertools import product, chain\nfrom collections import Counter\n\n\ndic = {}\ndic[1] = ['4', '7']\ndic[2] = ['44', '47', '74', '77']\n\n\ndef getperm(n):\n\tif n in dic:\n\t\treturn dic[n]\n\tdic[n] = [''.join(e) for e in chain(product(getperm(n-2), getperm(n-1)))]\n\treturn dic[n]\n\n\n\n\ns = str(int(raw_input()))\n\n\n\n\n\n\n\n\nif s in ['7', '4']:\n\tprint(s)\n\nelif len(s) == 1:\n\tprint('-1')\n\n\n\n\n\nelse:\n\n\tans = '-1'\n\tval = 0\n\tfor n in range( 1, s.count('4') + s.count('7')):\n\n\t\tfor c in getperm(n):\n\t\t\tcc = s.count( c )\n\n\t\t\n\t\t\tif val < cc:\n\t\t\t\tans = c\n\t\t\t\tval = cc\n\n\tprint ( ans )\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "PyPy 2", "bug_code_uid": "e8650b661cbc46211e7c47cce14a3317", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "db85a191e241259cf2a552d3e16219cc", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.12429378531073447, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "a = input().strip()\na = a + ''.join(list(reversed(input().strip())))\n\nb = input().strip()\nb = b + ''.join(list(reversed(input().strip())))\n\na = a.replace('X', '')\nb = b.replace('X', '')\nf = False\nfor i in range(4):\n if a == b:\n f = True\n b = b[1:] + b[:1]\nif f:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "453df829b753a3498a84acb1d1ce2b92", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "apr_id": "83c4ffa0bf9461cc7918085765e26e34", "difficulty": 1200, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.22424242424242424, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "friend1=int(input())\nfriend2=int(input())\ncounter1=1\ncounter2=1\ntiredness=0\nwhile friend1!=friend2:\n friend1+=1\n tiredness+=counter1\n counter1+=1\n if friend1==friend2:\n break\n friend2-=1\n tiredness+=counter2\n counter2+=1\n \nprint(tiredness)", "lang": "Python 3", "bug_code_uid": "30cd83d3e4f9cf591e374fd21f559a01", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "dc3a469b269aafa1f6d1e5d56823941d", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7413793103448276, "equal_cnt": 19, "replace_cnt": 7, "delete_cnt": 10, "insert_cnt": 1, "fix_ops_cnt": 18, "bug_source_code": "num = [x for int(x) in input().split()]\n\nn = num[0]\nm = num[1]\na = num[2]\nb = num[2]\n\nwhile True:\n if count > n:\n low = count - m\n high = count\n break\n count += m\n \ndes = b * (n - low)\nbuild = a * (high - n)\n\npay = max([des, build])\nprint(pay)\n", "lang": "Python 3", "bug_code_uid": "f3c76f77afc824f0750a5f18dbe4ffcf", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "ad50ddba6433781a9cb887ecc5433494", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7588652482269503, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 10, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "while(true)\n\tn=input()\n\tm=input()\n\ta=input()\n\tb=input()\n\n\tcost=0\n\n\tif n%m==0:\n\t\tprint(cost)\n\telse:\n\t\tk=(n%m)*b\n\t\tf=(m-(n%m))*a\n\t\tcost=min(k,f)\n\t\tprint(cost)\n", "lang": "Python 3", "bug_code_uid": "30eb8d8549d8f73b6a1e3084ee7924fd", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "a84ae690c4ff8bc3315abadea323909b", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9644970414201184, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\nif n > 21 orn <= 10:\n print(0)\nelse:\n if n >= 11 and n <= 19:\n print(4)\n else:\n if n == 20:\n print(15)", "lang": "Python 3", "bug_code_uid": "46cb07482a229c5805ee4749ff4b6337", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "fd503ced3a63dd3a81fb4164729ccdd3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.88, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n, m = input().split()\nn = int(n)\nm = int(m)\nprint(m % (2**n))", "lang": "PyPy 3", "bug_code_uid": "f3b87e1acd1b955260af87cc5c1a4ffa", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "aafb5a2490e141bacd461db4cb456d51", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9969278033794163, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "from math import ceil,floor\n\nFILE = \"rectangle_puzzle\"\ntry:\n inFile = open(FILE+\".txt\")\nexcept:\n pass\n\ndef read():\n try:\n return inFile.readline().strip()\n except:\n return raw_input().strip()\n\ndef gcd(a,b):\n if a%b == 0:\n return b\n else: \n return gcd(b,a%b)\n \n \nn,m,x,y,a,b = map(int,read().split())\ng = gcd(a,b)\na /= g\nb /= g\n\ns = min(m/a,n/b)\n\nx1 = (2*x-s*a)/2\nx2 = x1 + s*a\nif x1 < 0:\n x2 += -x1\n x1 = 0\nelif x2 > n:\n x1 -= (x2-n)\n x2 = n\n\ny1 = (2*y-s*b)/2\ny2 = y1 + s*b\n#print y1,y2\nif y1 < 0:\n y2 += -y1\n y1 = 0\nelif y2 > m:\n y1 -= (y2-m)\n y2 = m\n \nprint x1,y1,x2,y2\n", "lang": "Python 2", "bug_code_uid": "a762c1aee6f381619c8f850e1475ed68", "src_uid": "8f1211b995f35462ae83b2be27f54585", "apr_id": "01dc4e15cc56bfbe62c4140a6713acd2", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9903381642512077, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def gcd(a,b): return a if (b==0) else gcd(b,a%b)\nn,m,x,y,a,b=map(int,raw_input().split())\nd=gcd(a,b)\nk=min(n*d/a,m*d/b)\np,q=a*k,b*k\nc,d=min(n-p,max(x-(p+1)/2,0)),min(m-q,max(y-(q+1)/2,0))\nprint c,d,c+p,d+q", "lang": "Python 2", "bug_code_uid": "6cfbcc7c127a762af1d002d5b32659e7", "src_uid": "8f1211b995f35462ae83b2be27f54585", "apr_id": "d11a1cb7043b139c59a718f54cea24f3", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2832764505119454, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "n = int(input())\nk = int(input())\na = int(input())\nb = int(input())\ndp = [-1 for i in range(n+1)]\ndp[1]=0\nfor i in range(2,n+1):\n if(i%k==0):\n dp[i]=min(dp[i-1]+a,dp[i//k]+b)\n else:\n dp[i] = dp[i-1]+a\nprint(dp[n])\n#basic dp ------------ GOD save me from TLE\n", "lang": "PyPy 3", "bug_code_uid": "5c0dad26347fe97f38953c530cc6b043", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "7c5941cde226ec2a9067cdfa702851fe", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4869109947643979, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nans = [3, 5, 13]\ndct = \n{\n 3 : 18,\n 5 : 1800,\n 13 : 695720788\n}\nif n in ans:\n pritn(dct[n])\nelse:\n print(0)", "lang": "PyPy 3", "bug_code_uid": "07a78289b79582b9e734d6828828a3e0", "src_uid": "a6a804ce23bc48ec825c17d64ac0bb69", "apr_id": "675667cab243c81e014ebbf48ec33464", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "combinatorics", "bitmasks", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4908616187989556, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\nans = [3, 5, 13]\ndct = \\\n{\n 3 : 18,\n 5 : 1800,\n 13 : 695720788\n}\nif n in ans:\n pritn(dct[n])\nelse:\n print(0)", "lang": "PyPy 3", "bug_code_uid": "04fbf0a28862058c4baca3547761cabc", "src_uid": "a6a804ce23bc48ec825c17d64ac0bb69", "apr_id": "675667cab243c81e014ebbf48ec33464", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "combinatorics", "bitmasks", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.991044776119403, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "w,x=map(int,input().split())\nlst=[]\nfor i in range(0,30):\n if pow(w,i)m*m: break\n t=[x+p for x in ans]\n r=[x-p for x in ans]\n ans.extend(t)\n ans.extend(r)\n \nprint(\"YES\" if m in ans else \"NO\") \n ", "lang": "PyPy 3", "bug_code_uid": "d570159630c0a8db02fa4f7d04da726c", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "871037e6d1ce73a967c5753d6e4ae291", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4977168949771689, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "w, h = map(int, input().split())\nu, d = map(int, input().split())\nu1, d1 = map(int, input().split())\nm = w + h + d + d1\np = u + u1\nif m - p > 0:\n print(m - p)\nelif h == 0:\n print(w)\nelse:\n prinr(0)\n", "lang": "Python 3", "bug_code_uid": "6a907ffc509805fc674aff8421cb3c66", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "893cf800d0b249972a3222bb21c16b9e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9969879518072289, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n _ = input().strip().split(' ')\nn = int(_[0])\np = int(_[1])\nk = int(_[2])\n# print(n, p, k)\ncnt = p - k\nif cnt < 1:\n cnt = 1\nif cnt != 1:\n print('<< ',end='')\nwhile cnt <= n and cnt <= (p + k):\n if cnt == p:\n print('(%d) '%cnt, end='')\n else:\n print(cnt, end=' ')\n cnt += 1\nif cnt-1 != n:\n print('>>')", "lang": "Python 3", "bug_code_uid": "127f124e63102a67913ab9134c182c9d", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "503a958644cf0aa482b3a914f742cae8", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4602510460251046, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "a, b = list(map(int, input().split()))\nl = [1]\n\nif a == 0:\n a = 1\n\nfor i in range(2, b + 1):\n l.append(l[-1] * i)\n\ng = str(int(l[b - 1] / l[a - 1]))\n\nprint(g[-1])", "lang": "Python 3", "bug_code_uid": "d309e46581399ac83739fe0305cf9d18", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "fe28a032dad03e35370e374db52fec1c", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9732394366197183, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "#!/usr/bin/env python2\n\nocc = []\nfor i in range(300):\n occ.append(0)\npair = {}\nk = 0\ni = 0\nwhile i < 300:\n while i < 300 and occ[i] == 1:\n i += 1\n if i == 300:\n break\n occ[i] = 1\n if i+k < 300:\n occ[i+k] = 1\n pair[i] = i+k\n k += 1\n#print pair\n\nn = int(raw_input())\n\nif n == 1:\n a = int(raw_input())\n if a == 0:\n print \"BitAryo\"\n else:\n print \"BitLGM\"\n\nelif n == 2:\n a, b = map(int, raw_input().split())\n if pair[a] == b or pair[b] == a:\n print \"BitAryo\"\n else:\n print \"BitLGM\"\n\nelse:\n a, b, c = map(int, raw_input().split())\n if (a^b^c) == 0:\n print \"BitAryo\"\n else:\n print \"BitLGM\"\n", "lang": "Python 2", "bug_code_uid": "a0c7f75d201d5e0acc27cfcb45501d25", "src_uid": "7a33b4f94082c7ef80d7e87b58497fa7", "apr_id": "4b1be149a69a1e70f8aee2cca4ecc47d", "difficulty": 2100, "tags": ["dp", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4320909665192672, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "dp=[]\nfor i in xrange(333):\n tmp = []\n for j in xrange(333):\n tmp.append(-1)\n dp.append(tmp)\n\ndef win(a,b):\n if(dp[a][b]!=-1):return dp[a][b]\n if(a+b==0): return 0\n can = 0\n if a>0:\n for i in xrange(a):\n if(win(i,b)==0): can=1\n if(b>0):\n for i in xrange(b):\n if(win(a,i)==0): can = 1\n\n if(min(a,b)>=1):\n for i in xrange(min(a,b)):\n if(win(a-i-1,b-i-1)==0): can=1\n dp[a][b]=can\n return dp[a][b]\n\nn = map(int,raw_input().split())[0]\na = map(int,raw_input().split())\ns1=\"BitLGM\"\ns2=\"BitAryo\"\n\nif n==2:\n if win(a[0],a[1])==1:\n print s1\n else: print s2\n exit(0)\n\nt = 0\nif n==1: t = a[0]\nelse:\n t = (a[0]^a[1]^a[2])\n\nif(t>0):\n print s1\nelse:\n print s2\n", "lang": "Python 2", "bug_code_uid": "b85173c50708959828080620c44b9416", "src_uid": "7a33b4f94082c7ef80d7e87b58497fa7", "apr_id": "f9c139ca2fefce5e48e90a3c9242bb83", "difficulty": 2100, "tags": ["dp", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9674418604651163, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "def main():\n n,k = list(map(int, input().split()))\n b = list(map(int, input().split()))\n b.sort(reverse = True)\n for x in b:\n if k % x == 0:\n print (k // num)\n return\nmain()", "lang": "Python 3", "bug_code_uid": "cf20670aa1ffc5a4a080b781262a3179", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "c61ff09cda48da3370bbe79ad590d7f5", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8229166666666666, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "n=input()\ns=input()\ni=1\nwhile s[i-1]=='1':\n\ti+=1\n\tif i==len(s):\n\t\tbreak\nprint(i)", "lang": "Python 3", "bug_code_uid": "a55140101c3e28a3f451dea2bf902a8f", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "d85eb01f6af880e66d5ea2b9180c1570", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9207317073170732, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "n=int(input())\ns=input()\nif s[0]=='0':\n print(1)\nelse:\n i=1\n while i 1:\n current = a\n a.append(c)\n a = a + current[:len(a) - 1]\n n -= 1\n c += 1\nif len(a) < k:\n print(a[k % len(a) - 1])\nelse:\n print(a[k - 1])\n", "lang": "Python 3", "bug_code_uid": "7d3b29df3be2159d64f1aafc2abde2ed", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "098961a406d252d0dcfe911675137f1e", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3392405063291139, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "from copy import deepcopy\nn, k = [int(x) for x in input().split()]\n\nif k & 1:\n print(1)\nelse:\n a = [1]\n pp = 2\n for i in range(n):\n cc = deepcopy(a)\n a.append(pp)\n a = a + cc\n pp += 1\n if k > len(a):\n print(a[len(a) % k - 1])\n else:\n print(a[k - 1])\n", "lang": "Python 3", "bug_code_uid": "9fa45f81d10de1df30741b584b679311", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "098961a406d252d0dcfe911675137f1e", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5259259259259259, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "n,k=map(int,raw_input().split())\na=[1]\ni=1\nwhile ik:\n break\n j+=1\n if j > n:\n break\nprint a[k-1]", "lang": "Python 2", "bug_code_uid": "e05062f6c357aaeb9a5ce7c4ca563d79", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "c11f05b99005f7e2ab9e7f6fc5d044d2", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.43223443223443225, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "n,k=map(int,raw_input().split())\na=[1]\nfor i in xrange(n):\n a=a+[max(a)+1]+a\nprint a[k-1]\n", "lang": "Python 2", "bug_code_uid": "a22691eb7e276f12657accc44f99e0a2", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "ce0adc8ed955630fcec03fa2ab628f4b", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.28720626631853785, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n,k=raw_input().split()\nn=int(n)\nk=int(k)\n\nseq=[1]\n\nfor i in range(2,n+1):\n seq = seq + [i] + seq\n \nprint seq[k-1]\n", "lang": "Python 2", "bug_code_uid": "eccbe1e4d0924488160ec8f7b1811c39", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "27734368231bcd44cc1d8bb368ff4183", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1944954128440367, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import copy\nn,k = map(int,raw_input().split())\nl = [1,2,1]\nm = copy.copy(l)\nsome = 3\nfor i in range(n-2):\n l += [some]\n l += m\n m = copy.copy(l)\n some += 1\nprint l[k-1]\n", "lang": "Python 2", "bug_code_uid": "0e4f9ed23fa861957d3674ceea3e16bd", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "f123c11b014d3ab77f81cffb384119f9", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6012269938650306, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x=raw_input().split()\nn=int(x[0])\nk=int(x[1])\n\n\ndef func(n):\n if n<=1:\n return [1]\n x=func(n-1)\n\n l=[]\n l.extend(x)\n l.append(n)\n l.extend(x)\n return l\n\nprint func(n)[k-1]\n \n", "lang": "Python 2", "bug_code_uid": "33ec452b32ecc36dbd56e395e9a94431", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "db1ff55e45c6b243acda186760c9ca5c", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.46540880503144655, "equal_cnt": 16, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "n,k=raw_input().split()\nn=int(n)\nk=int(k)\nif n>1:\n\tn=n-2\n\ta=\"1 2 1\"\n\ti=3\n\twhile n>0:\n\t\ta=a+\" \"+str(i)+\" \"+a\n\t\ti=i+1 \n\t\tn=n-1\n\tb=a.split()\n\tprint b[k-1]\nelse:\n\tprint \"1\"", "lang": "Python 2", "bug_code_uid": "f7e426758b5d74ca4ef86bf3e064f144", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "d3cee5dadf373555516856cae26d86c1", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7058823529411765, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n, m = map(int,input().split())\na = list(map(int,input().split()))\nb = 0\nturn = 0\nfor i in range(n):\n turn += a[i]\n if turn >= m :\n b += 1\n turn = a[i]\nif a[-1] + a[-2] > m :\n b += 1\nprint(b)\n", "lang": "Python 3", "bug_code_uid": "e78c95f8becb214b98c53062040b15b5", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "19d6e18a9b502b7274aba50b09c08055", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9691275167785235, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\ns = input()\n\ndef parse(pr, tail):\n if tail == '':\n return 1\n s = \"CYM\" if tail[0] == '?' else tail[0]\n count = 0\n for c in s:\n if c != pr:\n count += parse(c, tail[1:])\n if count > 1:\n return count\n return count\ns = s.replace(\"????\", \"???\")\nprint(\"Yes\" if parse('', s)>1 else \"No\")\n \n", "lang": "PyPy 3", "bug_code_uid": "ffc790a76d72f9278b463802fa8cc483", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "9e6928ad8bd74100e086abd2ec8496e6", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.20833333333333334, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = int(raw_input())\n\nans = n + 1\nj = 2\n\nwhile j <= n - 1 :\n ans = ans + j * (n - j - 1)\n\n\nprint ans", "lang": "Python 2", "bug_code_uid": "4aa7418fe11217e22d3f99d248222e82", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "1e5c4b738dd3b5a64aa5e4cf4d4c57e2", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.969029593943565, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "from collections import *\nn = int(input())\ns = input()\nb = [int (i) for i in input().split(' ')]\nn = n\ncnt = defaultdict(int)\nmultiples = []\nbiggest = 'a'\nans = 0\nfor i in range(n//2):\n if(s[i] == s[n-i-1]):\n multiples.append(i)\n cnt[s[i]] += 1\n ans += max(b[i],b[n-i-1])\n else:\n ans += b[i] + b[n-i-1]\n\nfor i in range(26):\n if(cnt[chr(ord('a')+i)] > cnt[biggest]):\n biggest = chr(ord('a')+i)\nmore = max(max(cnt.values())*2-sum(cnt.values()),0)\n# print(more)\ntakes = []\nfor i in range(n//2):\n if(s[i] != biggest and s[n-i-1] != biggest):\n takes.append(min(b[i],b[n-i-1]))\n\ntakes = sorted(takes)[:more]\npen = sum(takes)\n# print(pen)\n# print(takes)\nprint(ans-pen)\n", "lang": "Python 3", "bug_code_uid": "eb175313698e8a5f1ab1b25c41a88bed", "src_uid": "896555ddb6e1c268cd7b3b6b063fce50", "apr_id": "d24cb5501aeda2e10e001f8e4c6e438b", "difficulty": 2500, "tags": ["graphs", "flows", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9871794871794872, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#https://pymotw.com/2/collections/counter.html\n#same code as mmaxio\nfrom collections import Counter\n\nr = lambda: map(int, input().split())\n\ndef main():\n\tn, = r()\n\ts = input()\n\tcost = list(r())\n\n\tans = 0\n\n\tcnt = Counter()\n\n\tfor i in range(n // 2):\n\t\tif s[i] == s[n - 1 - i]:\n\t\t\tans += min(cost[i], cost[n - 1 - i])\n\t\t\tcnt[s[i]] += 1\n\ttotal = sum(cnt.values())\n\tif total > 0:\n\t\tch, occ = cnt.most_common(1)[0]\n\t\tavail = []\n\t\tif occ > total - occ:# if highest occurence is more than the 50% of total then we will look for the letters which does not have pairs and are not equal to the letter with the highest ocuurence\n\t\t\tfor i in range(n // 2):\n\t\t\t\tif s[i] != s[n - 1 - i] and s[i] != ch and s[n - 1 - i] != ch:\n\t\t\t\t\tavail.append(min(cost[i], cost[n - 1 - i]))\n\t\t\tavail=sorted(avail,reverse=True)\n\t\t\tans += sum(avail[:2 * occ - total])\n\n\tprint(sum(cost)-ans)\n\nmain()\n#suppose total is 100 and highest occ is 51...difference between highest occ and remaining can be found using this form 2*occ-total as it is a simplified form of two steps 1.total-occ=remaining and 2.occ-remaining which is this case is 2 if highest occ is <= 50 % of total then it can be satisfied by remaining 50% but if it is greater than 50% then we have to use the letters of of the total\n", "lang": "PyPy 3", "bug_code_uid": "60a89f07d4461b314345add35aa1572d", "src_uid": "896555ddb6e1c268cd7b3b6b063fce50", "apr_id": "6efbccba3bd792b1bbe2d0773dc87de8", "difficulty": 2500, "tags": ["graphs", "flows", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.30578512396694213, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "x, y = [int(x) for x in input().split()]\nn = int(input())\nf = []\nfor i in range (n + 1):\n f.append(0)\nf[1] = x\nf[2] = y\nfor i in range (3, n + 1, 1):\n f[i] = f[i - 1] - f[i - 2]\nprint(f[n] % (10 ** 9 + 7))", "lang": "PyPy 3", "bug_code_uid": "ba8bec56ef64df1962bcb52576cbd7ac", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "723305e81bf7bc5970aea11b4a89da04", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7927272727272727, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "x,y=map(int,input().split())\nn=int(input())\na=[x,y]\nfor i in range(1,n):\n a.append(a[i]-a[i-1])\nprint(a[n-1]%1000000007)", "lang": "PyPy 3", "bug_code_uid": "48aa83cef998aea61633ed4d83e5327a", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "d10f8b47a4f1783a83ff5690ede1c868", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4755244755244755, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "x,y = [int(no) for no in input().split()]\nn = int(input())\nf = [x,y]\n\nfor i in range(n-2):\n\tf.append((f[-1]-f[-2])%1000000007)\n\nif(n==1):\n\tprint(f[0]%1000000007)\nelse:\n\tprint(f[-1]%1000000007)", "lang": "PyPy 3", "bug_code_uid": "7ce2996b88c1ef4cd922f4fd5f967589", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "52fa0ba27221faf767f110831044f90e", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.24726989079563183, "equal_cnt": 23, "replace_cnt": 11, "delete_cnt": 9, "insert_cnt": 3, "fix_ops_cnt": 23, "bug_source_code": "n, m = map(int, input().split())\na1, s1 = list(map(int, input().split())), list(map(int, input().split()))\na2, s2, a, s = [], [], [], []\nfor q in range(0, n*2, 2):\n a2.append([a1[q], a1[q+1]])\nfor q in range(0, m*2, 2):\n s2.append([s1[q], s1[q + 1]])\nfor q in range(n):\n k = set()\n for q1 in range(m):\n if len(set(a2[q]) & set(s2[q1])) == 1:\n k.add(list(set(a2[q]) & set(s2[q1]))[0])\n if k:\n a.append([a2[q][0], a2[q][1], list(k)])\nfor q in range(m):\n k = set()\n for q1 in range(n):\n if len(set(s2[q]) & set(a2[q1])) == 1:\n k.add(list(set(s2[q]) & set(a2[q1]))[0])\n if k:\n s.append([s2[q][0], s2[q][1], list(k)])\nz, p = set(), float('inf')\nfor q in range(len(a)):\n if len(a[q][2]) > 1:\n print(-1)\n p = -1\n break\n z.add(a[q][2][0])\nelse:\n if len(z) > 1:\n p = 1\n z = set()\n for q in range(len(s)):\n if len(s[q][2]) > 1:\n print(-1)\n p = -1\n break\n z.add(a[q][2][0])\n else:\n if len(z) > 1 or p == 1:\n print(0)\n else:\n print(list(z)[0])\n", "lang": "Python 3", "bug_code_uid": "82a7fe09a7f4034354b090c185e9b71e", "src_uid": "cb4de190ae26127df6eeb7a1a1db8a6d", "apr_id": "ed953119bd881e04a8cb06828f8adb99", "difficulty": 1900, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8941176470588236, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "l=['A','E','I','O','U','Y','a','e','i','o','u','y]\ns=input()\nif(s[-1][-1] in l):\n print('YES')\nelse:\n print('NO')", "lang": "Python 3", "bug_code_uid": "b8b0f4c3f1d4b16066de0b700fc7d954", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "935aaae7ce8d0ff1dfadb12e7bae2597", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6652977412731006, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": " \n\na,b = [int(x) for x in raw_input().split()] \nV = [0] * a\nfor i in range(0,b):\n inp = int(raw_input())\n for i in range( inp - 1 , a):\n if V[i] == 0 :\n V[i] = inp\n\nfor i in range (0 , a):\n print V[i],", "lang": "Python 2", "bug_code_uid": "c013ce72936491f01f87276f0aeef040", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "5474dae03dc48eb79dfc462cbc4bb591", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7545045045045045, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import sys\ndef buttons(n, m, array):\n answer = [0] * n\n for index, item in enumerate(array):\n for i in range(item - 1, n):\n if answer[i] == 0:\n answer[i] = item\n for i in range(len(answer)):\n print str(answer[i]),\ndef main():\n n = int(sys.argv[1])\n m = int(sys.argv[2])\n array = []\n for i in range(m):\n i += 3\n array += [int(sys.argv[i])]\n buttons(n, m, array)\nif __name__ == \"__main__\":\n main()\n", "lang": "Python 2", "bug_code_uid": "4c2de4360bad98fc40097895c682bf29", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "529e3b19fefb2ced8562bbb248c668f1", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9685534591194969, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "a,b,x1,y1,x2,y2 = map(int,input().split())\ns = (x1 + y1) // (2 * a) - (x2 + y2) // (2 * a)\ns = max(s,(x1 - y1) // (2 * b) - (x2 - y2) // (2 * b))\nprint(s)", "lang": "PyPy 3", "bug_code_uid": "1f01095f67c0b7c931926c0736417291", "src_uid": "7219d1837c83b5920992aee5a60dc0d9", "apr_id": "1eb4a1c76c80102e87c192128ad7a703", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7260703097807171, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nd = str(n)\na = []\nt = n\nif(n<10):\n print(n)\nelse:\n flag = 0\n while(n>9):\n a.append(9)\n t = n%10\n if(t != 9):\n flag = 1\n n //= 10\n s = n\n #print(s,t,flag)\n a.append(n-1)\n if(a[-1] != 0):\n a1 = 1\n a2 = 1\n if(flag == 0):\n for i in range(1,s+1):\n for j in range(1,10):\n if((i==s and j<=t) or (i a1*a2):\n a1 = i\n a2 = j\n else:\n for i in range(1,s+1):\n for j in range(1,10):\n if((i==s and j a1*a2):\n a1 = i\n a2 = j \n #print(a1,a2)\n a[-1] = a1\n a[-2] = a2\n else:\n a[-1] = 1\n ans = 1\n\n if(a[-3] == 9 and a[-2] == 7 and d[1] >= '8' and d[2] >= '9'):\n a[-2] = 8\n a[-3] = 8\n #print(a)\n for i in a:\n ans *= i\n print(ans)", "lang": "PyPy 3", "bug_code_uid": "86ecfa4de6fe1fa1f1a66d99607f880d", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "5bfe30fae8d8cedd2c3025aab3a657df", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.43086816720257237, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "def stages()\t\n\tn=int(input())\n\tk=int(input())\n\ts=input()\n\tw=0\n\tcount1=0\n\tcount2=0\n\tx=[]\n\tfor i in range(n):\n\t\tx.append(ord(s[i])-96)\n\tx.sort()\n\tj=x[0]\n\tw+=x[0]\n\tfor l in range(n):\n\t\tif x[l]-j>=2 and x[l]<=26:\n\t\t\tj=x[l]\n\t\t\tcount1+=1\n\t\t\tif count1<=k-1:\n\t\t\t\tw+=x[l]\n\t\t\t\tcount2+=1\n\tif count2==k-1:\n\t\tprint(w)\n\telse:\n\t\tprint(-1)\n\n", "lang": "Python 3", "bug_code_uid": "b3f1dae5c39a0545e9c10fe98b52856a", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "75077a4c6b93479aab4142dcd96c3e97", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9765990639625585, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n,k = map(int,input())\ns = input()\n\ns = ''.join(sorted(s))\n\ndef cost(c):\n\treturn ord(c) - ord('a')\n\ncurr = 0\ntotal = cost(s[curr])\ncount = 1\n\nfor i in range(1:n):\n\tif count == k:\n\t\tbreak\n\tif cost(s[i]) - cost(s[curr]) >= 2:\n\t\ttotal += cost(s[i])\n\t\tcount += 1\n\t\tcurr = i\nif count == k:\n\tprint(total)\nelse:\n\tprint(-1)", "lang": "Python 3", "bug_code_uid": "2acf5a876aaf1c91da7c55fd9057234a", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "9c379a9c3c9846e9e087a98b2f7ae372", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.19964028776978418, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n=int(input())\narr=list(map(int,input().split()))\nfreq=[0]*(101)\nfreq2=[0]*(101)\nans=0\nfor i in range(n):\n freq[arr[i]]+=1\n if i>=1:\n freq3=[]\n for k in range(1,101):\n if freq[k]>=1:\n freq3.append(freq[k])\n #print(freq3)\n if freq3.count(max(freq3))>=2:\n ans=max(ans,i+1)\nfor j in range(n):\n freq2[arr[j]]+=1\n freq3=[]\n for k in range(1,101):\n if freq[k]>=1:freq3.append(freq[k]-freq2[k])\n #print(freq3,j+1)\n if max(freq3)>0 and freq3.count(max(freq3))>=2:\n ans=max(ans,n-j-1)\n #print()\n break\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "38097e1bc0b05b31da5f46914bae37de", "src_uid": "a06ebb2734365ec97d07cd1b6b3faeed", "apr_id": "8db4fe286c1d37aa504ec4ff4c97cb8b", "difficulty": 2600, "tags": ["data structures", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8865800865800866, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "from collections import Counter\nn = int(input())\nA = list(map(int, input().split()))\ncnt = Counter(A)\nmaxv = max(cnt.values())\nx = [c for c in cnt if cnt[c] == maxv]\nif len(x) > 1:\n print(n)\nelse:\n x = x[0]\n ans = 0\n for c in cnt:\n if c == x: continue\n B = [1 if a == c else -1 if a == x else 0 for a in A]\n dic = {0: -1}\n cur = 0\n tmp = 0\n for i, b in enumerate(B):\n cur += b\n if cur in dic:\n tmp = max(tmp, i - dic[cur])\n dic.setdefault(cur, i)\n ans = max(ans, tmp)\n print(ans)", "lang": "PyPy 3", "bug_code_uid": "996e1dc5a31d6a139e11ce990ba6fb51", "src_uid": "a06ebb2734365ec97d07cd1b6b3faeed", "apr_id": "a87683f618d7f9e610271c33f044fc24", "difficulty": 2600, "tags": ["data structures", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5571776155717761, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "# n - length of zebroid\ndef cnt_subzebroes(n):\n if n > 0:\n cnt = 1\n else:\n cnt = 0\n dict = {}\n dict[n], dict[n + 1] = 0, 0\n last = n - 1\n while last > 0:\n dict[last] = dict[last + 1] + dict[last + 2] + 1\n cnt = cnt + dict[last] + 1\n last -= 1\n\treturn cnt % 1000000007\t\n\nprint cnt_subzebroes(int(input()))\n", "lang": "Python 2", "bug_code_uid": "adda177c8241fef925141c56550fa890", "src_uid": "5c4bd12df3915186a7b506c2060db125", "apr_id": "ff6ee61d984e7c24b48ff139adb9192d", "difficulty": 1600, "tags": ["dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9471544715447154, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n=input()\n#l=[0,1]*((n/2)+1)\nl=[0,1,0,1]\ndp=[[0,0] for i in range(n)]\ndp[0][l[0]]=1\nfor i in range(1,n):\n j=i%2\n dp[i][0]=dp[i-1][0]\n dp[i][1]=dp[i-1][1]\n dp[i][l[j]]+=dp[i-1][int(not l[j])]+1\nprint sum(dp[-1])%1000000007\n", "lang": "PyPy 2", "bug_code_uid": "b9ab9fdb0c5dba44bd9bd7eb91745d3e", "src_uid": "5c4bd12df3915186a7b506c2060db125", "apr_id": "8845aaa3520f1a1e77a99281bcb9ab39", "difficulty": 1600, "tags": ["dp", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8391959798994975, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\na = [0] * n\nb = 0\na[0] = 1\nif n > 1:\n a[1] = 2\nfor i in range(2, n):\n a[i] = a[i - 2] + a[i - 1] + 1\nif n > 1:\n b = a[n - 2]\nprint((a[n - 1] + b) % (10 ** 9 + 7))\n\n", "lang": "PyPy 3", "bug_code_uid": "68bd99f3601ffdca6a244214c3139340", "src_uid": "5c4bd12df3915186a7b506c2060db125", "apr_id": "9e929b0d6f1b35760f88c54caa7b3743", "difficulty": 1600, "tags": ["dp", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.41262135922330095, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "n = int(input())\ni = 1\nm = 0\nwhile i <= n:\n if n % i == 0:\n j = 0\n while j <= i:\n a = pow(2, j) - 1\n b = pow(2, j - 1)\n if a * b == i:\n if i > m:\n m = i\n j += 1\n i += 1\nprint(m)\n", "lang": "Python 3", "bug_code_uid": "320afc5d870c9883b505721ec5762b08", "src_uid": "339246a1be81aefe19290de0d1aead84", "apr_id": "f4c6392b9fb0235b5aa72baf463b4119", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9253731343283582, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\n\nprint(n*(n+5):6)", "lang": "Python 3", "bug_code_uid": "d33f4310d36c99f007956f544313dae6", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "6e5fec74b68ee756d4a3cfa86b0703d8", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8087431693989071, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "a,b,c,d=map(int,input().split()))\ns=0\np=min(a,c,d)\ns+=p*256\na-=p\nq=min(b,a)\ns+=32*q\nprint(s)", "lang": "PyPy 3", "bug_code_uid": "e654b98fe0bdb538213fb40d00fea70e", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "e45fa73da97650792d235992c2122f52", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8876811594202898, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = int(raw_input())\ncount = 0\nanslist = []\nfor i in range(n):\n s = str(i)\n add = 0\n for l in s:\n add += int(l)\n add+=i\n if int(add) == n:\n anslist.append(i)\n count+=1\nprint count\nfor t in anslist:\n print t\\\n \n", "lang": "Python 2", "bug_code_uid": "adf76313d5df587f92f7cd172e5209a5", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "apr_id": "e3a55fc8e35d716593b2571baa798c76", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8878923766816144, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "i = int(raw_input(''))\nwyn = 0\nwyn_part = 0\ntab = []\nfor x in range(0, i, +1):\n str_x = str(x)\n suma = 0\n for y in range(0, len(str_x),+1):\n suma += int(str_x[y])\n if x + suma == i:\n wyn += 1\n tab.append(x)\nprint wyn\nfor z in range(0, len(tab),+1):\n print tab[z]", "lang": "Python 2", "bug_code_uid": "91468a91131e65e9d2b56d67e3eeed44", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "apr_id": "ffea4be3eddc570f6ce4587bb7115d99", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.13854351687388988, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import math\n\ncandidate = [1,5,10,50]\n\nn = int(input())\n\nres = candidate + []\n\nif n == 1:\n print(len(res))\nelse:\n for i in range(n-1):\n now = []\n for j in candidate:\n for k in range(len(res)):\n now.append(res[k] + j)\n res = list(set(now))\n print(len(res))\n", "lang": "Python 3", "bug_code_uid": "be226ee20595a5da5c076daee09ad2fb", "src_uid": "75ec99318736a8a1b62a8d51efd95355", "apr_id": "b1a52db00bfbab94c63d08eb8a314745", "difficulty": 2000, "tags": ["dp", "combinatorics", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8805346700083542, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "from sys import stdin, stdout\n\n\ndef count(n):\n d = {}\n cnt = 0\n cur = 0\n \n for i in range(n + 1):\n for j in range(n - i + 1):\n for z in range(n - j - i + 1):\n v = i * 1 + j * 5 + z * 10 + (n - i - j - z) * 50\n \n if not v in d:\n d[v] = 1\n cur += 1\n else:\n d[v] += 1\n \n return cur\n\nn = int(stdin.readline())\n\nfor i in range(20, 200):\n n = i\n \n if count(i) != count(20) + 49 * (i - 20):\n print(i)\n\nif n >= 20:\n upp = count(20) + 49 * (n - 20)\nelse:\n upp = count(n)\nprint(upp)", "lang": "PyPy 3", "bug_code_uid": "4eddb4cee1115c65d4036f07df99753b", "src_uid": "75ec99318736a8a1b62a8d51efd95355", "apr_id": "3bd8d9c790607106bd3f19341d650ae6", "difficulty": 2000, "tags": ["dp", "combinatorics", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8403755868544601, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nwhile n>0:\n if n%1000==144:\n n /= 1000\n elif n%100==14:\n n /= 100\n elif n%10==1:\n n /= 10\n else:\n print('NO')\nprint('YES')", "lang": "Python 3", "bug_code_uid": "a6db06639b3a8cc658eaab1ffa45daef", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "049a6b37ff108b0643f90f66ec4b73bd", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9523809523809523, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "b,g,n=int(input()),int(input()),int(input())\nm=min(b,g) \nma=max(b,g)\nif m>= n :\n\tprint (n+1):\nelse if ma>= n:\n\tprint (m+1)\nelse:\n\tprint (ma-m+1)", "lang": "Python 3", "bug_code_uid": "ecca699a93f8077b9c489cc8a23b7183", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "46411d30ec4d900e9c99e6815bf01d6b", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5567765567765568, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "x,y,n=map(int,input().split())\nif (y<=n):\n print(str(x)+\"/\"+str(y))\nelse:\n print(str(x-1)+\"/\"+str1(n-1))", "lang": "PyPy 3", "bug_code_uid": "03ed9d8578c57e7831d101447e174dff", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "a69e42a2116779c2f25285896890b28f", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2989010989010989, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "luckynumbers = ['4', '7']\nfor i in range(1, 18):\n\tK = len(luckynumbers)\n\tfor j in range(0, K):\n\t\tluckynumbers.append(luckynumbers[j]+'4')\n\t\tluckynumbers.append(luckynumbers[j]+'7')\nN = int(input())\nans = 'NO'\nfor i in range(0, len(luckynumbers)):\n\tif N%int(luckynumbers[i]) == 0:\n\t\tans = 'YES'\n\t\tbreak\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "ca44195352040efc0abba03047ed6c89", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "5ef2f323d0899ad0b7477e40cf3d0217", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.21505376344086022, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "k = int(input())\nprint(\"codeforces\" + \"s\" * (k - 1))", "lang": "PyPy 3", "bug_code_uid": "3cb3d114bd7b2b5a363d1529eebe2f4c", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "f639329a88b01fd8ba4a7a51fe67bfe2", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09120521172638436, "equal_cnt": 1, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "k = int(input())\ns = 'codeforce'\ns2 = 's' * k\nprint(s+s2)", "lang": "PyPy 3", "bug_code_uid": "ffccb9f2d7302ad90dcd75c90150bb71", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "93871f570d109397a769870bbc5d6b6c", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7214611872146118, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "t = int(input())\nfor _ in range ( t ):\n n = int(input())\n a = 0\n for i in range (1, n+1):\n a *= i\n print(2*a//n//n)\n ", "lang": "Python 3", "bug_code_uid": "2fbbf3daf76189823982ab720248ac99", "src_uid": "ad0985c56a207f76afa2ecd642f56728", "apr_id": "98cb7e032b5f347080a340c589cd52c1", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.859375, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n, k = tuple(map(int, input().split()))\nreturn n * (k // n + 1)", "lang": "Python 3", "bug_code_uid": "bcdbf087c7a2b8ab7be4d3ce649a1a80", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "c9410f2e0b21cf9b305ca3a125da1ac0", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.21468926553672316, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#include\nusing namespace std;\nint main(){\n int n,k; \n cin>>n>>k;\n cout< N:\n num -= 1\n\npos = num * (num + 1) / 2 + 1\nval = 1\nlim = num + 1\nwhile pos < N:\n pos += 1\n val += 1\n if val > lim:\n val = 1\n lim += 1\nprint val\n", "lang": "PyPy 2", "bug_code_uid": "80230e919fa02f2ee1143d966afc319d", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "fe1008b99dbe7055245a9479fc3efb3d", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4672897196261682, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "n=int(input())\nn=n-1\nar=[1]\nfor i in range(1,n+1):\n j=0\n while(jres and int(cou)<=b:\n res=int(cou)\n else:\n for i in range(len(s)):\n summ(s[0:i]+s[i+1:len(s)],cou+str(s[i]))\nsumm(a,\"\")\nprint(res)", "lang": "Python 3", "bug_code_uid": "d5917f44405b0a6ad572a91f6b9bedd6", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "acaae64c5ea6c5698229ec9921aef665", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9148766905330151, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "s = input()\na = s.split(' ')\nm=[]\nl=[]\nf=[]\nfor i in a:\n m += i\n \n\n\nfor i in m:\n \n if i =='+':\n i=''\n \n l+=i\n\n\ndef buble_sort(list1):\n amount = len(list1)-1\n for i in range(0,amount):\n for x in range(0,amount):\n if list1[x] > list1[x+1]:\n list1[x],list1[x+1] = list1[x+1],list1[x]\n return list1\nnew_list = buble_sort(l).copy()\n\nn=0\nwhile n < len(new_list)-1:\n for i in new_list:\n f+=i\n f+='+'\n if len(f) > len(new_list)-1:\n break\n \n n+=1\ndel f[-1]\nm = ''.join(f) \nprint(m)\n\n \n \n \n", "lang": "Python 3", "bug_code_uid": "bf76093ebf7a7188dc62413acbdc5bdb", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "3b6848ab1b6c4f56402bd254896a7afb", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6893903024483917, "equal_cnt": 30, "replace_cnt": 26, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 30, "bug_source_code": "from itertools import permutations\n\ndef check(date):\n\ty,m,d = date\n\n\tif (m in [1,3,5,7,8,10,12] and d > 31) or \\\n\t\t(m in [2,4,6,9,11] and d > 30) or m>12:\n\t\treturn False\n\telif m == 2 and ((not y%4 and d>29) or (y%4 and d>28)):\n\t\treturn False\n\telse:\n\t\treturn True\n\ndef date_diff(cdate,bdate):\n\tif bdate[2]==29 and bdate[1]==2 and not bdate[0]%4:\n\t\tbdate = bdate[0]+18,3,1\n\telse:\n\t\tbdate[0]+=18\n\n\tif bdate <= cdate:\n\t\treturn True\n\telse:\n\t\treturn False\n\ndef main():\n\tcdate = [int(x) for x in raw_input().split('.')][::-1]\n\tbdate = [int(x) for x in raw_input().split('.')][::-1]\n\n\tpossible = 'NO'\n\tfor date in permutations(bdate):\n\t#\tprint date,\n\t\tdate = list(date)\n\n\t\tif check(date):\n\t#\t\tprint 'passed'\n\t\t\tif date_diff(cdate,date):\n\t\t\t\tpossible = \"YES\"\n\t\t\t\tbreak\n#\t\telse:\n\t#\t\tprint 'failed'\n\t\n\tprint possible\nif __name__ == \"__main__\":\n\tmain()\n", "lang": "Python 2", "bug_code_uid": "9c5f9ef2c5f01ed6d6df2cae4bb6798b", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "4dc6a8c3d09a4328f8a3ca81301c96ce", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.35584843492586493, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a,b,c = raw_input().split()\na=int(a)\nb=int(b)\nce=int(c)\na=a*(10**100000)\nz=a/b\nk=[]\nl=0\nwhile(z>0):\n\n\tk.append(z%10)\n\tz/=10\n\tl+=1\nl-=1\nplus=0\nans=-1\nwhile(plus<80000):\n\tplus+=1\n\tif(k[l]==ce):\n\t\tans=plus\n\t\tbreak;\n\tl-=1\n\t \n\t\nprint(ans)\n\n", "lang": "Python 2", "bug_code_uid": "3f474b28efc782c591eb008614c1197f", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "bd9f53179ad80a8bdff778b6639537a2", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7317073170731707, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n,m,x1,y1,x2,y2 = map(int, input().split())\nn = abs(x1 - x2)\nm = abs(y1 - y2)\nif n > 2 or m > 2:\n print(\"Second\")\nelif n == 2 and m == 2:\n print(\"Second\")\nelse:\n print(\"First\")", "lang": "Python 3", "bug_code_uid": "b9e77d8b142f6523eaff19262fb0e6f2", "src_uid": "41f6f90b7307d2383495441114fa8ea2", "apr_id": "dcde696189d59ebe45d98ab1907a8c05", "difficulty": 2000, "tags": ["combinatorics", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8544176706827309, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import sys\nrange = xrange\ninput = raw_input\n\nMOD = 10**9+7\ndef mult(A,B):\n n = len(A)\n C = [[0]*n for _ in range(n)]\n for x in range(n):\n for y in range(n):\n for z in range(n):\n C[x][y] += A[z][y]*B[x][z]\n C[x][y]%=MOD\n return C\n\ndef vecmult(A,B):\n n = len(A)\n C = [0]*n\n for y in range(n):\n C[y] = sum(A[x][y]*B[x] for x in range(n))%MOD\n return C\n\nn,m = [int(x) for x in input().split()]\n\n\n#def DP(n):\n# if n<=0:\n# return 1 if n==0 else 0\n# else:\n# return DP(n-m) + DP(n-1)\n\n\nmapper = [[0]*m for _ in range(m)]\n\nmapper[0][0] = 1\nmapper[-1][0] = 1\nfor i in range(m-1):\n mapper[i][i+1] = 1\n\ndef power(A,B,m):\n n = len(A)\n if m == 0:\n return B\n while m>1:\n if m%2==1:\n B = vecmult(A,B)\n A = mult(A,A)\n m//=2\n return vecmult(A,B)\n\nvec = [1]*m\nvec = power(mapper,vec,n)\nprint(vec[-1]%MOD)\n", "lang": "PyPy 2", "bug_code_uid": "7e912126276d85dabf5351a78ea50597", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "apr_id": "4c29ebdd1b97bb82c45fbd9381b3a8dd", "difficulty": 2100, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2805755395683453, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "import numpy as np\nn=int(input())\nli=[]\nfor i in range(n):\n a=list(map(int,input().split()))\n li.append(a)\nli=np.array(li)\nfor i in range(n):\n for j in range(n):\n if(i==j):\n count+=1\n if(i+j==n):\n count+=1\nfor j in range(n):\n count+=a[n//2][j]\nfor i in li[:,n//2]:\n count+=i\n \ncount-=3*li[n//2][n//2]", "lang": "PyPy 3", "bug_code_uid": "befd1dcd19e88e059ba10c7b313c9327", "src_uid": "5ebfad36e56d30c58945c5800139b880", "apr_id": "be855e9d78804ef79a4d37d4c8a5e73a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7034482758620689, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x, y, m = map(int, input().split())\nif x < y: x, y = y, x\nif x > 0:\n s = 0\n while x < m:\n x, y = x + y, x\n s += 1\nelif: x < m: print(-1)\nelse: print(0)", "lang": "Python 3", "bug_code_uid": "664d1dc47ce287bb517145ab001083f4", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "106e884a77dc65be0e1805e812d49d47", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1897810218978102, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "def gen(a):\n if a==0 or a==1:\n return [a]\n else:\n k = a//2\n t = gen(k)\n return t + [a%2] + t \n\nn, l ,r = map(int, input().split() )\n\ns = gen(n)\n \ncount = 0\nfor num in s[l-1:r]:\n if num == 1:\n count+=1\nprint(count)\n", "lang": "PyPy 3", "bug_code_uid": "3579c2495d9577908390a63b43222263", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "ac099b04b5e3b31285f62b4713f72d89", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3614457831325301, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "import random, math\nfrom copy import deepcopy as dc\n\n\n# Function to call the actual solution\ndef solution(li, i):\n\t# print(i, li)\n\tif i >= len(li):\n\t\treturn li\n\tif li[i] <= 1:\n\t\treturn solution(li, i+1)\n\tl = li[i]//2\n\tr = li[i] % 2\n\t# Change\n\tout = solution([l], 0)\n\treturn out + [r] + out\n\n# Function to take input\ndef input_test():\n\tn, l, r = map(int, input().strip().split(\" \"))\n\tout = solution([n], 0)\n\tc = 0\n\tfor i in range(l-1, r):\n\t\tif out[i] == 1:\n\t\t\tc += 1\n\tprint(c)\n\n\n\ninput_test()\n# test()", "lang": "PyPy 3", "bug_code_uid": "724ef012d1fd25f80a58a01d3ce78e7d", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "977c5f10a07a640c1ee15ae3a53e6cee", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.10385064177362893, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "def solve(n,l,m):\n if n==1:\n return [1] \n if n==0:\n return [0]\n else:\n d,m=divmod(n,2)\n a=solve(d,l,m)\n return a+[m]+a \nt=1\n# t=int(input())\nwhile(t>0):\n n,l,m = [int(x) for x in input().split()]\n arr=solve(n,l,m)\n l-=1\n sum=0\n while(l 0 else 0\n rightNum = int(strNum[idx + 1:]) if idx + 1 < len(strNum) else 0\n rightDigits = len(strNum) - idx - 1\n \n if i < digit:\n ret += i * (leftNum + 1) * (10 ** rightDigits)\n\n elif i > digit:\n ret += i * (leftNum ) * (10 ** rightDigits)\n \n elif i == digit:\n ret += i * (leftNum ) * (10 ** rightDigits)\n ret += i * (rightNum + 1)\n\n return ret\n\n\ndef work(a):\n mul = 1\n while mul:\n L = 0\n R = mul * a\n while L < R:\n mid = (L + R) / 2\n\n if g(mid) >= mul * a:\n R = mid\n else:\n L = mid + 1\n \n if g(L) == mul * a:\n print 1, L\n break\n\n mul += 1\n \n\nif __name__ == \"__main__\":\n work(read())\n", "lang": "Python 2", "bug_code_uid": "017d43afcca93997423369c8442a7a01", "src_uid": "52b8d97f216ea22693bc16fadcd46dae", "apr_id": "3fc791d2afa98a4447d1cddf5a484898", "difficulty": 2500, "tags": ["constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9550173010380623, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "r = input\nans = n = int(r())\ns = r()\nlen = 1\nwhile len * 2 <= n:\n if s[0:len] == s[len:len*2]:\n ans = min(ans, n - len + 1)\nprint(ans)", "lang": "Python 3", "bug_code_uid": "3171b48886f69bdbf801781552acb864", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "apr_id": "735bb303aa014c7d39378ce87ab1009b", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.14835164835164835, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a1=input()\na2=input()\na3=0\nl1=len(a1)\nl2=len(a2)\nx=max(l1,l2)\nfor i in range(0,x):\n a3[i]=a1[i]+a2.[x-1-i]\n print(a3[i],sep=\"\")\n\n ", "lang": "Python 3", "bug_code_uid": "badb4a189aed198a69c1062ee3327634", "src_uid": "69b219054cad0844fc4f15df463e09c0", "apr_id": "7548af56f588df29a31b48dfa14361e4", "difficulty": 1200, "tags": ["constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.836036036036036, "equal_cnt": 16, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 9, "fix_ops_cnt": 16, "bug_source_code": "prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71\n,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173\n,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281\n,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409\n,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541\n,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659\n,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809\n,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941\n,947,953,967,971,977,983,991,997,1009]\nimport math\n\ndef find_max_prime(val):\n result= 0\n for prime in prime_number:\n if (prime > math.sqrt(val)):\n break\n if val % prime == 0:\n temp=max(prime, find_max_prime(val/prime))\n result=max(result,temp)\n break\n if result==0:\n return int(val)\n else:\n return int(result)\n\nnum = int(input())\nprev = find_max_prime(num)\nval = 10000000\nfor i in range(num - prev +1, num + 1):\n k = find_max_prime(i)\n if k == i:\n continue\n else:\n val= min(val, i - k + 1)\nprint(val)", "lang": "Python 3", "bug_code_uid": "5e2bd11e0039393ff31adee0fc43597b", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "b0017b5cd508217217881bd3985d8b14", "difficulty": 1700, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7728256166161834, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "import math\ndef primes(max_n):\n max_n-=1\n numbers = range(3, max_n+1, 2)\n half = (max_n)//2\n initial = 4\n\n for step in xrange(3, max_n+1, 2):\n for i in xrange(initial, half, step):\n numbers[i-1] = 0\n initial += 2*(step+1)\n if initial > half:\n return [2] + filter(None, numbers)\ndef factors(a):\n j = 0\n p = {}\n while (a > 1):\n b = asd[j]\n if a % b == 0:\n a /= b\n if b not in p:\n p[b] = 1\n else:\n j += 1\n p = p.keys()\n p.sort()\n return p\nasd=primes(10**6+1)\ncheck={}\nfor i in asd:\n check[i]=1\ndef help(arr,num):\n don=[]\n if num not in check:\n for i in arr:\n p=num/i\n #print p,i\n for j in range(num-i+1,num+1):\n if j not in al:\n al[j]=1\n don.append(j)\n return don\n#print help(factors(16),16)\n\n\nn=input()\nans=[]\nal={}\nf=factors(n)\na=help(f,n)\nal={}\nfor i in a:\n af=help(factors(i),i)\n #print af,i\n ans+=af\n\nprint min(ans)", "lang": "PyPy 2", "bug_code_uid": "c94efa97a748e52dfa226d13a730ea65", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "e5816eda87eae7aec2b2eebfb1caea1f", "difficulty": 1700, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7382663847780127, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "import math\ndef primes(max_n):\n max_n-=1\n numbers = range(3, max_n+1, 2)\n half = (max_n)//2\n initial = 4\n\n for step in xrange(3, max_n+1, 2):\n for i in xrange(initial, half, step):\n numbers[i-1] = 0\n initial += 2*(step+1)\n if initial > half:\n return [2] + filter(None, numbers)\ndef factors(a):\n j = 0\n p = {}\n while (a > 1):\n b = asd[j]\n if a % b == 0:\n a /= b\n if b not in p:\n p[b] = 1\n else:\n j += 1\n p = p.keys()\n p.sort()\n return p\nasd=primes(10**6+1)\ncheck={}\nfor i in asd:\n check[i]=1\ndef help(arr,num):\n don=[]\n if num not in check:\n for i in arr:\n p=num/i\n #print p,i\n for j in range(num-i+1,num+1):\n don.append(j)\n return don\ndef help2(arr,num):\n don=[]\n if num not in check:\n for i in arr:\n don.append(num-i+1)\n return don\n\n\n#print help(factors(16),16)\n\n\nn=input()\nans=[]\nf=factors(n)\na=help(f,n)\nfor i in a:\n af=help(factors(i),i)\n #print af,i\n ans+=af\nprint min(ans)", "lang": "PyPy 2", "bug_code_uid": "7b758ca6382f48769dd35c3d17cec4bc", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "e5816eda87eae7aec2b2eebfb1caea1f", "difficulty": 1700, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9097898513582778, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import itertools\n\ndef countZeroes(s):\n ret = 0\n for i in s:\n if i != '0':\n break\n ret += 1\n return ret\n\ndef stupid(n):\n ansMax = 0\n bn1 = n\n bn2 = n\n for n1 in itertools.permutations(n):\n for n2 in itertools.permutations(n):\n val = str(int(''.join(n1)) + int(''.join(n2)))[::-1]\n cnt = countZeroes(val)\n if cnt > ansMax:\n ansMax = cnt\n bn1 = ''.join(n1)\n bn2 = ''.join(n2)\n return (bn1, bn2)\n\ndef solution(n):\n ansMax = n.count('0')\n bestN1 = n.replace('0', '') + ansMax * '0'\n bestN2 = n.replace('0', '') + ansMax * '0'\n\n for i in range(1, 10):\n cnt1 = [n.count(str(j)) for j in range(10)]\n cnt2 = [n.count(str(j)) for j in range(10)]\n\n if cnt1[i] == 0 or cnt2[10 - i] == 0:\n continue\n cnt1[i] -= 1\n cnt2[10 - i] -= 1\n curN1 = str(i)\n curN2 = str(10 - i)\n ansCur = 1\n for j in range(10):\n addend = min(cnt1[j], cnt2[9 - j])\n ansCur += addend\n \n cnt1[j] -= addend\n cnt2[9 - j] -= addend\n\n curN1 += str(j) * addend\n curN2 += str(9 - j) * addend\n\n if cnt1[0] > 0 and cnt2[0] > 0:\n addend = min(cnt1[0], cnt2[0])\n ansCur += addend\n\n cnt1[0] -= addend\n cnt2[0] -= addend\n\n curN1 = '0' * addend + curN1\n curN2 = '0' * addend + curN2\n\n if ansCur > ansMax:\n ansMax = ansCur\n f = lambda x: str(x[0]) * x[1]\n bestN1 = ''.join(map(f, enumerate(cnt1))) + curN1[::-1]\n bestN2 = ''.join(map(f, enumerate(cnt2))) + curN2[::-1]\n\n return (bestN1, bestN2)\n\n\nfor n in range(1, 100500):\n answer = map(int, stupid(str(n)))\n candidate = map(int, solution(str(n)))\n\n if countZeroes(str(sum(answer))[::-1]) != countZeroes(str(sum(candidate))[::-1]):\n print('Wrong on test', n)\n print('Answer is', stupid(str(n)))\n print('Output is', solution(str(n)))\n break\n", "lang": "Python 3", "bug_code_uid": "b6bc550da779a70fcabdc7fd57c7db63", "src_uid": "34b67958a37865e1ca0529bbf528dd9a", "apr_id": "33fd2b68711a7df967027276bf00127c", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9859649122807017, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "h, w = map(int, input().split())\ngo = [[[] for x in range(w)] for y in range(h)]\ns = input()\nt = input()\nc1 = s[0] == '<' and s[w - 1] == '>' and t[0] == 'v' and t[h - 1] == '^'\nc2 = s[0] == '>' and s[w - 1] == '<' and t[0] == '^' and t[h - 1] == 'v'\nprint(\"YES\" if c1 or c2 else \"NO\")", "lang": "Python 3", "bug_code_uid": "62dca4b99648d61f6b7fbe91b9702619", "src_uid": "eab5c84c9658eb32f5614cd2497541cf", "apr_id": "2f2f276d840f36a7b0e12b21b284a2f6", "difficulty": 1400, "tags": ["graphs", "brute force", "dfs and similar", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9541284403669725, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "\ndef smaller( a):\n res = 1\n while res<=a:\n res = res * 2\n return res/2 \n\na=raw_input()\na=a.split()\n\nb = []\n\nfor i in range(len(a)):\n b.append(int(a[i]))\n\n\nif b[0]==b[1]:\n print 0\n\nwhile b[0]>=smaller(b[1]):\n c = smaller(b[1])\n b[0], b[1] = b[0]-c, b[1]-c\n\nprint smaller(b[1])*2-1\n\n\n", "lang": "Python 2", "bug_code_uid": "17812924f967d2f3d2c8057382e6a10e", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "8614f062bca90c0a8e3ba31c3bc5bcfe", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2792207792207792, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n, s = map(int, input().split())\ncoins = [1e9] * (s+1)\ncoins[0] = 0\nfor i in range(1, s+1):\n for j in range(1, n+1):\n if i >= j:\n coins[i] = min(coins[i], coins[i - j] + 1)\n else:\n break\nprint(coins[s])\n", "lang": "Python 3", "bug_code_uid": "eb3282d9c2eca7e811e18c1ce9ad25b1", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "1586ebbc4c11f45b7f7ff0722804733c", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4421052631578947, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = input()\nif int(s) < 0 :\n if int(s[:-1]) > int(s[:-2] + s[-1]) : print(s[:-1]))\n else : print(s[:-2] + s[-1])\nelse : print(s)", "lang": "Python 3", "bug_code_uid": "5d8508525b1d420bca42ecec40f028dd", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "1b817b2e1918402ea279611f3c7891e3", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.12121212121212122, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "s = [[]] * 3\nfor i in range(3):\n s[i] = raw_input()\nf = 0\nfor i in range(3):\n for j in range(3):\n if(s[i][j] != s[3-i][3-j]):\n f = 1\nif(f):\n print \"YES\"\nelse:\n print \"NO\"\n \n", "lang": "Python 2", "bug_code_uid": "5cc733e2f2f14e122f5a09d3a4b676e3", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "739ccc91a7e299270501f87c847f1397", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.13100436681222707, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a=input()\nd=[]\ni=0\nwhile i 9 or c > 9 or d > 9:\n continue\n if c + d == r2 and c + b == d2 and b + d == c2 and len(set[a, b, c, d])==1:\n f = True\n break\nif not f:\n print -1\nelse:\n print a, b\n print c, d\n", "lang": "Python 2", "bug_code_uid": "b535dd9b40c5fe797d7f2167bfd0dd80", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "fe0884984e8d63e103ad7dcaffd54759", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.04101722723543889, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "import math\ncnt=0\nst=\"\"\nfrom itertools import combinations \ndef powerset(string):\n global cnt\n for i in range(0,len(string)+1):\n for element in combinations(string,i):\n if(''.join(element)==\"QAQ\"):\n cnt+=1\ndef powerSet(arr, n) :\n global cnt\n global st\n opsize = math.pow(2, n)\n for counter in range( 1, (int)(opsize)) :\n st=\"\"\n for j in range(0, n) : \n if (counter & (1< 1:\n l.append(i)\n return l\n\ndef typ(b, d):\n if (b ** 7) % d == 0:\n i, bb = 1, b\n while bb % d != 0:\n i, bb = i + 1, bb * b\n return (2, i)\n elif (b - 1) % d == 0:\n return 3\n elif (b + 1) % d == 0:\n return 11\n else:\n p = pf(d)\n if p and all(typ(b, f)[0] != 7 for f in p):\n return 6\n else:\n return 7\n\nt=typ(b,d)\nif isinstance(t, int):\n print \"%d-type\" % t\nelse:\n print \"%d-type\" % t[0]\n print t[1]\n", "lang": "Python 2", "bug_code_uid": "f197a756fde9d6e9ff101931ccec24b3", "src_uid": "809e1c78b0a5a16f7f2115b046a20bde", "apr_id": "81c8210eb6ac824b917e3e7f9b3b3bd7", "difficulty": 2300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.44285714285714284, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "t=input()\nfor i in range(len(t)-1):\n if t[i]==t[i+1]\n del(t[i])\n \nif len(t)%2==0:\n print('CHAT WITH HER')\nelif len(t)%2==1:\n print('IGNORE HIM')", "lang": "PyPy 3", "bug_code_uid": "9d33aca67cf30dbb08e1e20b7c941859", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "3955e6623118feac68fd3992907dd870", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8723404255319149, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\nm=[int(x) for x in input().split()]\nm.sort()\ny=\" \".join(m)\nprint(y)\n", "lang": "Python 3", "bug_code_uid": "4e53c62a946d42f666666da471848e74", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "725a50dbd9d03289d37110c35663e997", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9499304589707928, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# -*- coding: utf-8 -*-\n#\u1555\u250c\u25d5\u15dc\u25d5\u2510\u1557 HELLO HELLO HELLO \u1555\u250c\u25d5\u15dc\u25d5\u2510\u1557\n\nn = int(raw_input())\ns = raw_input()\n\"jolt\"\n\"flar\"\n\"umbr\"\n\"leaf\"\n\"glac\"\n\"sylv\"\nif n == 6:\n print \"espeon\"\nif n == 8:\n print \"vaporeon\"\nif n == 7:\n if s[0] == 'j' or s[1] == 'o' or s[3] == 't':\n print \"jolteon\"\n if s[0] == 'f':\n print \"flareon\"\n if s[0] == 'u' or s[1] == 'm' or s[2] == 'b':\n print \"umbreon\"\n if s[0] == 'l' or s[1] == 'e' or s[3] == 'f':\n print \"leafeon\"\n if s[0] == 'g' or s[3] == 'c':\n print \"glaceon\"\n if s[0] == 's' or s[1] == 'y' or s[3] == 'v':\n print \"sylveon\"\n if s[1] == 'l':\n if s[3] == 'r':\n print \"flareon\"\n", "lang": "Python 2", "bug_code_uid": "8076aa92a5e9d4e691fa522ea92024ca", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "eafe7bf18a4c4c147fb16c597eca0465", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9477477477477477, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "table = [\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \"leafeon\", \"glaceon\", \"sylveon\"]\nn = int(raw_input())\ns = raw_input()\n\nres = \"\"\nfor na in table:\n\tfor i in range(n):\n\t\tif s[i] != '.' and s[i] != na[i]:\n\t\t\tbreak\n\telse:\n\t\tres = na\n\t\tbreak\n\nprint res\n", "lang": "Python 2", "bug_code_uid": "6726149faa52f356c0cdf5d356d86d38", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "c2ebf415fced16cd72897b5e2079fcb0", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5200764818355641, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "nums = [int(r) for r in input().split()]\nval = nums[1]*nums[3]*nums[5]/(nums[0]*nums[2]*nums[4])\nif val > 1:\n print(\"Ron\")\nelse:\n print(\"Hermione\")", "lang": "Python 3", "bug_code_uid": "7f23e9d635cb8a6b07e7c417fb0dceaa", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "bf0992b74e5223f5fe38191f327e84e2", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.994026284348865, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "s = raw_input()\nk = int(raw_input())\nk1 = ''\nfor i in xrange(k):\n k1 += '1'\ns = s + k1\n\ndef sravn(s):\n for i in xrange(len(s)/2):\n if s[i] != s[i+len(s)/2] and s[i+len(s)/2] != '1':\n return 'no'\n print len(s-1)\n return 'yes'\n\nl = len(s)/2*2-1\nwhile l >= 1:\n for i in xrange(len(s)-l+1):\n t = sravn(s[i:i+l+1])\n if t == 'yes':\n l = -1\n break\n l -= 2", "lang": "Python 2", "bug_code_uid": "2a888c671d25f865d54bbf8f50b3372f", "src_uid": "bb65667b65ff069a9c0c9e8fe31da8ab", "apr_id": "8263a4a58c9475e9841f7559723ef964", "difficulty": 1500, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9344398340248963, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#-------------------------------------------------------------------------------\n# Name: Codeforces\n# Author: Gogol2\n\n#-------------------------------------------------------------------------------\n\n\n\ndef main():\n x,y = map(int,input().split())\n max_q = -1\n z = x+y\n while (x > 0):\n max_q = max(max_q,x % 10)\n x = x//10\n while (y > 0):\n max_q = max(max_q,y % 10)\n y = y//10\n max_q = max_q + 1\n z = a + b\n k = 0\n while (z > 0):\n k += 1\n z = z // max_q\n print(k)\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "9589bb4d27b52e12cfa33ae856740769", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "0b6d8115556ee7e5614226d94d91c142", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.892416225749559, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "line = input().strip();\na = line.split(\" \")[0];\nb = line.split(\" \")[1];\ns = a + b;\nm = 0;\nfor c in s :\n d = int(c);\n m = max(m, d);\n\nt = int(a) + int(b)\nret = \"\";\nwhile (t != 0):\n r = t % (m + 1);\n t //= (m + 1);\n ret = ret + str(r);\nprint(len(ret));", "lang": "Python 2", "bug_code_uid": "e7b7a5de70ced2685f6980c776affb41", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "578fd5cb02c0a150bf5cddaa97736fb0", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9976580796252927, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n t = tuple(map(int, input().split('.')))\ndc = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)\ndef f(d, m, y):\n if m not in range(13) or d > dc[m] + (m == 2 and y % 4 == 0):\n return False\n else:\n return t[2] - y > 18 or t[2] - y == 18 and (m, d) <= (t[1], t[0])\na, b, c = map(int, input().split('.'))\nprint('YES' if any((f(a, b, c), f(a, c, b), f(b, a, c), f(b, c, a), f(c, a, b), f(c, b, a))) else 'NO')", "lang": "Python 3", "bug_code_uid": "20383d9b7cda58c22d0f02690ad62b17", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "017396bdca1c9b60a989f867858f9af0", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3323076923076923, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 25 14:38:46 2020\n\n@author: Ritvik Agarwal\n\"\"\"\nn, wps = input(), map(int, raw_input().split())\ni, summ = 0, 0\nwhile summ < n:\n if i == 7:\n i = 1\n else:\n i += 1\n summ += wps[i-1]\nprint i", "lang": "Python 3", "bug_code_uid": "75667182cf03ab5abc1426782e504424", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "5d1c8d10a0cde329e579d2558eaefbdd", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19875776397515527, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "#!/usr/bin/env python\n\nimport sys\nimport logging\nimport traceback\n\nlogging.basicConfig(level = logging.INFO)\n\ns = raw_input()\n\nindice = [[] for i in range(26)]\n\nfor i in range(len(s)) : \n\tindice[ord(s[i])-ord('A')] += [i]\n\nmaxCnt = -1\nfor l in indice : \n\tif len(l) == 0 : \n\t\tcontinue\n\ts = 0\n\tc = 0\n\tcnt = 1\n\twhile True :\n\t\tif c >= len(l) : \n\t\t\tbreak\n\t\tif (l[c] - l[s]) % 2 == 1 : \n\t\t\tcnt += 1\n\t\t\ts = c\n\t\t\tc += 1\n\t\telse : \n\t\t\tc += 1\n\tif cnt > maxCnt : \n\t\tmaxCnt = cnt\n\nprint maxCnt\t\n\n\t\n", "lang": "Python 2", "bug_code_uid": "f489a0f10ea19ef7a8dd39a26fb17f44", "src_uid": "c4c20228624365e39299d0a6e8fe7095", "apr_id": "5bff6dc48f4b5d98be3a95b232fed14c", "difficulty": null, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7086614173228346, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "count=sum1=sum2=0\ncount1=0\ncount2=0\nn=int(input())\na=list(map(int,input().split()))\nb=list(map(int,input().split()))\nfor i in range(n):\n\tif a[i]>b[i]:\n\t\tcount+=1\n\telif a[i] d:\n print('YES')\nelse:\n print('NO\")", "lang": "Python 3", "bug_code_uid": "e8dcadcbe21de0208856b75749de8a13", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "eedcba647522ce0c0213eeaa5c32143a", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.425, "equal_cnt": 16, "replace_cnt": 4, "delete_cnt": 7, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "n = int(input())\ntab = []\nfor i in range(1 , n + 1):\n tab.append(i)\nfor i in range(0 , len(tab) , 2):\n tab[i] = tab[i] * -1\nprint(sum(tab))", "lang": "PyPy 3", "bug_code_uid": "37f415da7703198dc6674f26f405e1c1", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "2e5ddb12c9a8e592fd292e544aa7a084", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9908256880733946, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m=map(int,input().split())\nprint(max(n,m)-1,min(n,m)", "lang": "Python 3", "bug_code_uid": "805a2ce6a95b8e3e3a24a5efa0637af6", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "c4159fea973568aa3108441d88c53ac9", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.30181245074862095, "equal_cnt": 10, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "while(1 > 0):\n num1 = str(input('enter the numbre component of 0 and(or) 1 :'))\n num2 = str(input('enter the numbre component of 0 and(or) 1 :'))\n if len(num1)==len(num2):\n if '2' not in num1 and '3' not in num1 and '4' not in num1 and '5' not in num1 and '6' not in num1 and '7' not in num1 and '8' not in num1 and '9' not in num1:\n if '2' not in num2 and '3' not in num2 and '4' not in num2 or '5' not in num2 and '6' not in num2 and '7' not in num2 and '8' not in num2 and '9' not in num2:\n if len(num1)>=0 and len(num1)<=100:\n if len(num2)>=0 and len(num2)<=100:\n for i in range(len(num1)):\n if num1[i]==num2[i]:\n print('0', end='')\n else: \n print('1', end='')\n print('')\n else:\n print('The num2 must be 0 or less or equal to 100')\n else:\n print('The num1 must be 0 or less or equal to 100') \n else:\n print('num2 must contain only the numbers 0 and or 1')\n else:\n print('num1 must contain only the numbers 0 and or 1') \n else:\n print('Please enter the same length for num1 and num2')", "lang": "Python 3", "bug_code_uid": "751e741f75fc9c4c8c5be9d7f65fe455", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "4f027c2f5546d4e1993c3dca03e93916", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9253731343283582, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a = 0\nfor i in s:\n if i == 'a':\n\t\ta+=1\nhalf = len(s)//2\nif a > half:\n\tprint(a)\nelse:\n\talls = len(s)\n\twhile a <= half:\n\t\talls-=1\n\t\thalf = alls//2\n\tprint(alls)\n", "lang": "PyPy 3", "bug_code_uid": "9105119b595ae45207ef5121e60e9101", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "15e290d04dc5b01e4f3d22dda17621df", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9894736842105263, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = input()\nprint(min(s.count('a')*2-1, len(s))", "lang": "PyPy 3", "bug_code_uid": "f0013db658d49f50067eedcda7d08048", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "bda1b2210de102b34e0a910ecffe9c5c", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9767441860465116, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,m=map(int,input().split())\na=list(map(int,input().split()))\nb=list(map(int,input().split()))\nc=[]\nfor i in range(m):\n for j in range(b[i]):\n c.append(i+1)\nflag=1 \nfor i in range(n-m+1):\n temp=a[i:i+m+1]\n if(sorted(temp)==sorted(c)):\n print(\"YES\")\n flag=0\n break\nif flag:\n print(\"NO\")\n \n \n ", "lang": "Python 3", "bug_code_uid": "78c0898c40e81f3f680c9e8b218bbef4", "src_uid": "59f40d9f35e5fe402112214b42b682b5", "apr_id": "f9b041f8e92192904ffbee554e91545b", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9342403628117913, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import sys\ninput = sys.stdin.readline\n\na,b,n,x = (int(i) for i in input().split())\nm = int(1e9) + 7\nans = (pow(a,n,m) * x) % m\nif a > 1:\n # ans += ((((1/(1-a) - (pow(a,n,10**100)/(1-a))) ) % m) * b) % m\n # ans += ((( (1/(1-a)) + (pow(a,n,a**n + 1)/(1-a)) ) % m) * b) % m\n # ans += ((pow(a,n,m)-1)/(a+1)*b) % m\n ans += ((( (1/(1-a)) - (a**n/(1-a)) ) % m) * b) % m\nelif a==0:\n ans += b\nelif a==1:\n ans += n*b % m\nprint(ans % m)", "lang": "PyPy 2", "bug_code_uid": "01cc4f30e7c4098e47afcbaf802a813b", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "49e1c349b0156c8d7a2649f193e4afa4", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2402698495070057, "equal_cnt": 18, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "def main():\n path = input()\n coordinate = [[0 for i in range(2)] for j in range(len(path)+1)]\n coordinate[0] = [0,0]\n left = 0\n right = 0\n up = 0\n down = 0\n\n for direction in path:\n if direction == 'U':\n up += 1\n elif direction == 'R':\n right += 1\n elif direction == 'D':\n down += 1\n elif direction == 'L':\n left += 1\n\n if (left = 1 and right = 1 and up = 1 and down = 0) or (left = 1 and right = 1 and up = 0 and down = 1) or (left = 1 and right = 0 and up = 1 and down = 1) or (left = 0 and right = 1 and up = 1 and down = 1):\n print('BUG')\n return\n\n for i in range(0,len(path)):\n if i == 0:\n if path[i] == 'U':\n coordinate[i + 1][0] = 0\n coordinate[i + 1][1] = 1\n elif path[i] == 'R':\n coordinate[i + 1][0] = 1\n coordinate[i + 1][1] = 0\n elif path[i] == 'D':\n coordinate[i + 1][0] = 0\n coordinate[i + 1][1] = -1\n elif path[i] == 'L':\n coordinate[i + 1][0] = -1\n coordinate[i + 1][1] = 0\n else:\n if path[i] == 'U':\n coordinate[i + 1][0] = coordinate[i][0]\n coordinate[i + 1][1] += 1 + coordinate[i][1]\n elif path[i] == 'R':\n coordinate[i + 1][1] = coordinate[i][1]\n coordinate[i + 1][0] += 1 + coordinate[i][0]\n elif path[i] == 'D':\n coordinate[i + 1][0] = coordinate[i][0]\n coordinate[i + 1][1] += -1 + coordinate[i][1]\n elif path[i] == 'L':\n coordinate[i + 1][1] = coordinate[i][1]\n coordinate[i + 1][0] += -1 + coordinate[i][0]\n coordinateSet = list(set(map(tuple,coordinate)))\n if len(coordinate) == len(coordinateSet):\n print('OK')\n else:\n print('BUG')\n\nmain()", "lang": "Python 3", "bug_code_uid": "a63ae063d05257a36a79cf97bae264b7", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "ad90f289d15b04d234d136a7906e7274", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9397305601512644, "equal_cnt": 17, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 11, "fix_ops_cnt": 16, "bug_source_code": "def main():\n path = input()\n coordinate = [[0 for i in range(2)] for j in range(len(path)+1)]\n coordinate[0] = [0,0]\n left = 0\n right = 0\n up = 0\n down = 0\n\n for direction in path:\n if direction == 'U':\n up += 1\n elif direction == 'R':\n right += 1\n elif direction == 'D':\n down += 1\n elif direction == 'L':\n left += 1\n allDirections = [left,up,down,right]\n minDirection = min(allDirections)\n if minDirection == 0:\n allDirections.remove(0)\n minDirection = min(allDirections)\n i = minDirection + 1\n repeatingSequences = []\n while i < len(path):\n currentSet = set(path[i-minDirection - 1:i])\n if len(currentSet) == 1:\n repeatingSequences.append(path[i])\n i += minDirection\n else:\n i += 1\n if len(set(repeatingSequences)) == 3:\n print('BUG')\n return\n\n for i in range(2,len(path)):\n if path[i] != path[i-1] and path[i] != path[i-2] and path[i-1] != path[i-2]:\n print('BUG')\n return\n\n for i in range(0,len(path)):\n if i == 0:\n if path[i] == 'U':\n coordinate[i + 1][0] = 0\n coordinate[i + 1][1] = 1\n elif path[i] == 'R':\n coordinate[i + 1][0] = 1\n coordinate[i + 1][1] = 0\n elif path[i] == 'D':\n coordinate[i + 1][0] = 0\n coordinate[i + 1][1] = -1\n elif path[i] == 'L':\n coordinate[i + 1][0] = -1\n coordinate[i + 1][1] = 0\n else:\n if path[i] == 'U':\n coordinate[i + 1][0] = coordinate[i][0]\n coordinate[i + 1][1] += 1 + coordinate[i][1]\n elif path[i] == 'R':\n coordinate[i + 1][1] = coordinate[i][1]\n coordinate[i + 1][0] += 1 + coordinate[i][0]\n elif path[i] == 'D':\n coordinate[i + 1][0] = coordinate[i][0]\n coordinate[i + 1][1] += -1 + coordinate[i][1]\n elif path[i] == 'L':\n coordinate[i + 1][1] = coordinate[i][1]\n coordinate[i + 1][0] += -1 + coordinate[i][0]\n coordinateSet = list(set(map(tuple,coordinate)))\n\n if len(coordinate) == len(coordinateSet):\n print('OK')\n else:\n print('BUG')\n\nmain()", "lang": "Python 3", "bug_code_uid": "1be7c4d0f37ca584f9115b749b15a16f", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "ad90f289d15b04d234d136a7906e7274", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9711229946524064, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def move(s, i):\n\t\tif s[i] == 'U':\n\t\t\treturn 0, 1;\n\t\telif s[i] == 'D':\n\t\t\treturn 0, -1;\n\t\telif s[i] == 'L':\n\t\t\treturn -1, 0;\n\t\telse:\n\t\t\treturn 1, 0;\na, b = map(long, raw_input().split());\ns = raw_input();\nl = len(s);\nx, y = [0]*(l+1), [0]*(l+1)\nf = 0;\nfor i in xrange(1, l+1):\n\tx[i], y[i] = x[i-1], y[i-1];\n\ttmpx, tmpy = move(s, i-1)\n\tx[i] += tmpx;\n\ty[i] += tmpy;\nif a == 0 and b == 0:\n\tprint \"Yes\";\nelse:\n\tfor i in xrange(1, l+1):\n\t\tif x[l] == 0 and y[l] != 0:\n\t\t\tif a == x[i] and (b - y[i]) % y[l] == 0:\n\t\t\t\tf = 1\n\t\t\t\tbreak;\n\t\telif y[l] == 0 and x[l] != 0:\n\t\t\tif b == y[i] and (a - x[i]) % x[l] == 0:\n\t\t\t\tf = 1\n\t\t\t\tbreak;\t\n\t\telif x[l] == 0 and y[l] == 0:\n\t\t\tif a == x[i] and b == y[i]:\n\t\t\t\tf = 1;\n\t\t\t\tbreak;\n\t\telif (a - x[i]) % x[l] == 0 and (b - y[i]) % y[l] == 0:\n\t\t\tif (a - x[i]) / x[l] == (b - y[i]) / y[l] and (b - y[i]) / y[l] >= 0:\n\t\t\t\tf = 1;\n\t\t\t\tbreak;\n\n\tif f:\n\t\tprint \"Yes\";\n\telse:\n\t\tprint \"No\";\n\n\n", "lang": "Python 2", "bug_code_uid": "88b7931e24ba4cd52b0eabcbdb13d262", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "fd485e8f632cd3a8a6d00828572eb479", "difficulty": 1700, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9798657718120806, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "l1=['ten' ,'eleven', 'twelve' ,'thirteen' ,'fourteen','fifteen','sixteen' ,'seventeen','eighteen','nineteen']\nl2=['','','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety']\nl3=['','one','two','three','four','five','six','seven','eight','nine']\nfor i in range(100):\nn = input()\nif n=='0' : print('zero')\nelif 10<=int(n)<=19:\n print(l1[int(n)-10])\nelse:\n if len(n)==1 : print(l3[int(n)])\n \n else :\n if n[1]=='0':print(l2[int(n[0])])\n else : print(l2[int(n[0])] + '-' + l3[int(n[1])])\n \n", "lang": "Python 3", "bug_code_uid": "f30fdb8770d6a87a1e4d68d9247f1b04", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "9f6cfbf5fc2469e6a81938591320ca71", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9986357435197817, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a = [\"\",\"one\",\"two\",\"three\",\"four\",\"five\",\"six\",\"seven\",\"eight\",\"nine\"]\nb = [\"\",\"\",\"twen\",\"thir\",\"for\",\"fif\"]\nc = [\"\",\"-one\",\"-two\",\"-three\",\"-four\",\"-five\",\"-six\",\"-seven\",\"-eight\",\"-nine\"]\nn = int(input())\n\nif n<10:\n print (a[n])\nelif n == 11:\n print (\"eleven\")\nelif n == 12:\n print (\"twelve\")\nelif n == 10:\n print (\"ten\")\nelif n == 14:\n print (\"fourteen\")\nelif n == 18:\n print (\"eighteen\")\n\nelif n//10 == 1:\n if n<16:\n print (str(b[n-10])+\"teen\")\n else:\n print (str(a[n-10])+\"teen\")\nelif n//10<6:\n print (str(b[n//10]+\"ty\"+str(c[n%10])))\nelse:\n if n//10 != 8:\n print (str(a[n//10]+\"ty\"+str(c[n%10])))\n else:\n print (\"eight\"+str(c[n%10])\nif n == 0:\n print (\"zero\")\n", "lang": "Python 3", "bug_code_uid": "b1c64a5b333e6e147b61d26a72b9c56c", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "32224139c120f65b1bff37169abae37d", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.12315270935960591, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "data = [int(info) for info in input().split(' ')]\n\ninfo = set(range(data[0], data[1] + 1)).intersection(set(range(data[2], data[3] + 1)))\n\nif data[4] in info:\n\tprint(len(info) - 1)\nelse:\n\tprint(len(info))\n\t\n", "lang": "Python 3", "bug_code_uid": "9f5f4fbb8ecb532157baaa3f82f03e2a", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "5620ecbe7aa35b5f30e1189b46b442f6", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.44808743169398907, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "\ninp=input().split()\n\nc1=int(inp[0])\nr1=int(inp[1])\nc2=int(inp[2])\nr2=int(inp[3])\n\nprint((r1+r2)*2+8)\n\n\n", "lang": "Python 3", "bug_code_uid": "8780f87e249e98e5b751c71835f4dcd1", "src_uid": "b5d44e0041053c996938aadd1b3865f6", "apr_id": "00f159615083a18adf548dea3c76d2f4", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.693069306930693, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "\"\"\"\ninstagram : essipoortahmasb2018\ntelegram channel : essi_python\n\n\"\"\"\ni = input\nList = [*map(int,i().split())]\n#w1 h1 w2 h2\n#2 2 1 2\n\n#Result = List[1]+List[3]+4\n#2 1 2 1\nh = List[1]*2\nw = List[0]\nResult = ((h + 2)*2)+(w*2)\nprint(Result)\n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "8479e4ffd5796cfbf0a4d8c20ba46698", "src_uid": "b5d44e0041053c996938aadd1b3865f6", "apr_id": "f02306e6166382db5ebef38a192ef64c", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8620689655172413, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "from sys import stdin\nprint(6-len(stdin.readline())", "lang": "Python 3", "bug_code_uid": "f5b413f9dc5d19cefbee231ddeff2b1b", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "b36f082c4f700f38e28e23e1cb588d4a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9994327850255247, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\n\ndef read():\n global gl, gr, bl, br\n\n girl = input.readline()\n gl = int(girl.split(' ')[0])\n gr = int(girl.split(' ')[1])\n\n boy = input.readline()\n bl = int(boy.split(' ')[0])\n br = int(boy.split(' ')[1])\n\n\ndef check_possible(g, b):\n\n if g == b:\n return True\n\n elif g > b:\n\n if b == g - 1:\n return True\n else:\n return False\n\n elif g < b:\n\n if b <= 2*g + 2:\n return True\n else:\n return False\n\ndef main():\n \n poss = check_possible(gl, br)\n if poss:\n output.write('YES')\n return\n\n poss = check_possible(gr, bl)\n if poss:\n output.write( 'YES')\n return\n\n otput.write('NO')\n\n\ndef run():\n\n global input, output\n input = sys.stdin\n output = sys.stdout\n\n read()\n main()\n\n\nif __name__ == '__main__':\n run()\n", "lang": "Python 3", "bug_code_uid": "9cc62098072ee7ee6a1ad8c681c70984", "src_uid": "36b7478e162be6e985613b2dad0974dd", "apr_id": "0390aa119a841bd12ad1d4597c017eb3", "difficulty": 1300, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9968051118210862, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "ar, al = map(int, input().split())\nbr, bl = map(int, input().split())\nprint('YES' if 2 * (ar + 1) >= bl >= ar - 1 or 2 * (al + 1) >= br >= al - 1] else 'NO')", "lang": "Python 3", "bug_code_uid": "c95994e4496f3f65d2b0caf712051a8c", "src_uid": "36b7478e162be6e985613b2dad0974dd", "apr_id": "a760919e6c7281b36c19bd213aac0622", "difficulty": 1300, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.1421875, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "rubik= list(map(int,input().split()))\na=[0]\nfor i in rubik:\n a.append(i)\nif a[1]==a[3]==a[6]==a[8] and a[2]==a[4]==a[22]==a[24] and a[5]==a[7]==a[10]==a[12] and a[13]==a[14]==a[15]==a[16] and a[9]==a[11]==a[21]==a[23]:\n print('YES')\n exit(0)\n if a[1]==a[12]==a[18]==a[8] and a[5]==a[17]==a[11]==a[16] and a[13]==a[15]==a[6]==a[23] and a[3]==a[19]==a[22]==a[24] and a[4]==a[7]==a[20]==a[21]:\n print('YES')\n exit(0)\nprint(\"NO\")", "lang": "Python 3", "bug_code_uid": "184fbc4c2fb020084e64d9502b81fab1", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "c288c5f94fa0ae83d5eec164d1eb76ba", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9577464788732394, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import bisect\na,b,c=map(int,input().split(' '))\ntimes=[]\nfor i in range(10**8):\n times.append(b*(i+1))\npos=bisect.bisect_left(times,(a-b)*c,0,len(times))\nprint(times)\nprint(pos+1)\n\n", "lang": "PyPy 3", "bug_code_uid": "1454c5be8e3d1e24ea9e5ae18df65b74", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "5e222bb7510fcadac7e9ab4de3231be8", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7352941176470589, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "m,n=raw_input().split()\nh=1\ng=1\nm=int(m)\nn=int(n)\nfor i in range(n): \n h=long(h*m)\nfor i in range(m):\n g=long(g*n)\nif h>g:\n print \">\"\nelif h0:\n #print(seen)\n lol=list(seen)\n tt=[]\n for x in temp:\n aa=[]\n for val in dict[x]:\n if val in seen:\n aa+=[val]\n seen.remove(val)\n dict[x]=aa\n tt+=aa\n tree.append(tt)\n temp=tt\n vall+=1\n for x in lol:\n dict[x]=[]\n \n print(tree,dict)\ndef pow(a,b):\n res=1\n while b>0:\n if b&1:\n res*=a\n a*=a\n b>>=1\n return res\ndef powmod(a,b,m):\n res=1\n while b>0:\n if b&1:\n res=((res*a)%m)\n a*=a\n b>>=1\n return res\ndef inv(a,m):\n return powmod(a,m-2,m)\ndef alldivisors(n) : \n list = [] \n arr=[]\n for i in range(1, int(sqrt(n) + 1)) :\n if (n % i == 0) : \n if (n / i == i) : \n arr+=[i]\n else :\n arr+=[i]\n list.append(n//i) \n arr+=list[::-1]\n return arr\ndef primefactorisation(n):\n potentional_p = 3\n itog_list = defaultdict(int)\n if n % 2 == 0:\n itog_list[2] = 0\n while n % 2 == 0:\n n = n // 2\n itog_list[2] += 1\n while n - 1:\n if potentional_p > (n**0.5):\n itog_list[n] += 1\n return itog_list\n while n % potentional_p == 0:\n n = n // potentional_p\n itog_list[potentional_p] += 1\n potentional_p += 2\n return itog_list\n\n\n\ndef main():\n n,m=list(map(int,input().split()))\n val=((1<= 3) : \n\t\tif (left4seat > 0) : left4seat -= 1\n\t\telse : left2seat -= 2\n\telif (leftSol == 2) :\n\t\tif (left4seat > 0) : \n\t\t\tleft4seat -= 1\n\t\t\tleft1seat += 1\n\t\telse : \n\t\t\tleft2seat -= 1\n\telif (leftSol == 1) :\n\t\tif (left1seat > 0) : left1seat -= 1\n\t\telif (left4seat > 0) : \n\t\t\tleft4seat -= 1\n\t\t\tleft2seat += 1\n\t\telse : \n\t\t\tleft2seat -= 1\n\tif (left4seat < 0 or left2seat < 0) : break\n\tindex += 1\n\nif (index == k and left4seat >= 0 and left2seat >= 0) : print(\"YES\")\nelse : print(\"NO\")", "lang": "Python 3", "bug_code_uid": "139f3a2c1741037468140b8fc4c9a606", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "e55a12d71b3d521c72dfefe77859a5a1", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9237087347970305, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env pypy\nfrom __future__ import division, print_function\n\nimport os\nimport sys\nfrom __builtin__ import xrange as range\nfrom collections import deque\nfrom cStringIO import StringIO\nfrom future_builtins import ascii, filter, hex, map, oct, zip\nfrom io import IOBase\n\nimport __pypy__\n\n\ndef process(grid, a, n, m):\n aux = [[0] * 3000 for _ in range(3000)]\n for i in range(n):\n mi = deque()\n for j in range(a):\n while mi and grid[i][j] < mi[-1]:\n mi.pop()\n mi.append(grid[i][j])\n\n aux[0][i] = mi[0]\n for j in range(a, m):\n if mi[0] == grid[i][j - a]:\n mi.popleft()\n while mi and grid[i][j] < mi[-1]:\n mi.pop()\n mi.append(grid[i][j])\n aux[j - a + 1][i] = mi[0]\n\n return aux\n\n\ndef main():\n n, m, a, b = map(int, input().split())\n g, x, y, z = map(int, input().split())\n\n grid = [[0] * 3000 for _ in range(3000)]\n for i in range(n):\n for j in range(m):\n grid[i][j] = g\n g = (g * x + y) % z\n\n aux1 = process(grid, b, n, m)\n aux2 = process(aux1, a, m - b + 1, n)\n\n print(sum(sum(aux2[i][:m - b + 1]) for i in range(n - a + 1)))\n\n\n# region fastio\n\nBUFSIZE = 8192\n\n\nclass FastI(IOBase):\n def __init__(self, file):\n self._fd = file.fileno()\n self._buffer = StringIO()\n self.newlines = 0\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(\"\\n\") + (not b)\n ptr = self._buffer.tell()\n self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)\n self.newlines -= 1\n return self._buffer.readline()\n\n\nclass FastO(IOBase):\n def __init__(self, file):\n self._fd = file.fileno()\n self._buffer = __pypy__.builders.StringBuilder()\n self.write = lambda s: self._buffer.append(s)\n\n def flush(self):\n os.write(self._fd, self._buffer.build())\n self._buffer = __pypy__.builders.StringBuilder()\n\n\ndef print(*args, **kwargs):\n sep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop(\"end\", \"\\n\"))\n if kwargs.pop(\"flush\", False):\n file.flush()\n\n\nsys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\n# endregion\n\nif __name__ == \"__main__\":\n main()\n", "lang": "PyPy 2", "bug_code_uid": "3612891f5f829897ce42fb1be61ccc3a", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "6a1f3a80b85e9549b910d563fbdb6b16", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9997010463378176, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env pypy\nfrom __future__ import division, print_function\n\nimport os\nimport sys\nfrom __builtin__ import xrange as range\nfrom collections import deque\nfrom cStringIO import StringIO\nfrom future_builtins import ascii, filter, hex, map, oct, zip\nfrom io import IOBase\n\nimport __pypy__\n\n\ndef process(grid, a, n, m):\n aux = [[0] * 3000 for _ in range(3000)]\n for i in range(n):\n mi = deque()\n for j in range(a):\n while mi and grid[i][j] < mi[-1]:\n mi.pop()\n mi.append(grid[i][j])\n\n aux[0][i] = mi[0]\n for j in range(a, m):\n if mi[0] == grid[i][j - a]:\n mi.popleft()\n while mi and grid[i][j] < mi[-1]:\n mi.pop()\n mi.append(grid[i][j])\n aux[j - a + 1][i] = mi[0]\n\n return aux\n\n\ndef main():\n n, m, a, b = map(int, input().split())\n g, x, y, z = map(float, input().split())\n\n MOD = int(z)\n MODF = z\n MAGIC = 6755399441055744.0\n SHRT = 65536.0\n\n MODF_INV = 1.0 / MODF\n SHRT_INV = 1.0 / SHRT\n\n fround = lambda x: (x + MAGIC) - MAGIC\n fmod = lambda a: a - MODF * fround(MODF_INV * a)\n fmul = lambda a, b, c=0.0: fmod(fmod(a * SHRT) * fround(SHRT_INV * b) + a * (b - SHRT * fround(b * SHRT_INV)) + c)\n\n grid = [[0.0] * 3000 for _ in range(3000)]\n for i in range(n):\n for j in range(m):\n grid[i][j] = int(g) % MOD\n g = fmul(g, x, y)\n\n aux1 = process(grid, b, n, m)\n aux2 = process(aux1, a, m - b + 1, n)\n\n ans = 0\n for i in range(n - a + 1):\n ans += sum(aux2[i][:m - b + 1])\n\n print(ans)\n\n\n# region fastio\n\nBUFSIZE = 8192\n\n\nclass FastI(IOBase):\n def __init__(self, file):\n self._fd = file.fileno()\n self._buffer = StringIO()\n self.newlines = 0\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(\"\\n\") + (not b)\n ptr = self._buffer.tell()\n self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)\n self.newlines -= 1\n return self._buffer.readline()\n\n\nclass FastO(IOBase):\n def __init__(self, file):\n self._fd = file.fileno()\n self._buffer = __pypy__.builders.StringBuilder()\n self.write = lambda s: self._buffer.append(s)\n\n def flush(self):\n os.write(self._fd, self._buffer.build())\n self._buffer = __pypy__.builders.StringBuilder()\n\n\ndef print(*args, **kwargs):\n sep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop(\"end\", \"\\n\"))\n if kwargs.pop(\"flush\", False):\n file.flush()\n\n\nsys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\n# endregion\n\nif __name__ == \"__main__\":\n main()\n", "lang": "PyPy 2", "bug_code_uid": "5ec03f9fa4d2ff08e70b7eec415dd92d", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "6a1f3a80b85e9549b910d563fbdb6b16", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9371414913957935, "equal_cnt": 24, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 18, "fix_ops_cnt": 23, "bug_source_code": "from __future__ import division, print_function\ndef main():\n from collections import deque \n \n def printMin(arr, n, k): \n res=[]\n Qi = deque() \n for i in range(k): \n while Qi and arr[i] <= arr[Qi[-1]] : \n Qi.pop() \n Qi.append(i); \n \n for i in range(k, n): \n res.append(arr[Qi[0]])\n while Qi and Qi[0] <= i-k: \n Qi.popleft() \n while Qi and arr[i] <= arr[Qi[-1]] : \n Qi.pop() \n Qi.append(i) \n res.append(int(arr[Qi[0]]))\n return res \n n,m,a,b=map(int,input().split())\n g,x,y,z=map(int,input().split())\n \n grid= [0]*(n*m)\n grid[0]=g\n for i in range(1,n*m):\n grid[i]=(grid[i-1]*x+y)%z\n B=[]\n ans=0\n for i in range(n):\n B.append(printMin(grid[i*m:(i+1)*m],m,b))\n grid=[]\n for i in range(len(B[0])):\n temp=[]\n for j in range(n):\n temp.append(B[j][i])\n ans+=sum(printMin(temp,len(temp),a))\n print(ans)\n######## Python 2 and 3 footer by Pajenegod and c1729\n\n# Note because cf runs old PyPy3 version which doesn't have the sped up\n# unicode strings, PyPy3 strings will many times be slower than pypy2.\n# There is a way to get around this by using binary strings in PyPy3\n# but its syntax is different which makes it kind of a mess to use.\n\n# So on cf, use PyPy2 for best string performance.\n\npy2 = round(0.5)\nif py2:\n from future_builtins import ascii, filter, hex, map, oct, zip\n range = xrange\n\nimport os, sys\nfrom io import IOBase, BytesIO\n\nBUFSIZE = 8192\nclass FastIO(BytesIO):\n newlines = 0\n\n def __init__(self, file):\n self._file = file\n self._fd = file.fileno()\n self.writable = \"x\" in file.mode or \"w\" in file.mode\n self.write = super(FastIO, self).write if self.writable else None\n\n def _fill(self):\n s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])\n return s\n\n def read(self):\n while self._fill(): pass\n return super(FastIO,self).read()\n\n def readline(self):\n while self.newlines == 0:\n s = self._fill(); self.newlines = s.count(b\"\\n\") + (not s)\n self.newlines -= 1\n return super(FastIO, self).readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.getvalue())\n self.truncate(0), self.seek(0)\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n if py2:\n self.write = self.buffer.write\n self.read = self.buffer.read\n self.readline = self.buffer.readline\n else:\n self.write = lambda s:self.buffer.write(s.encode('ascii'))\n self.read = lambda:self.buffer.read().decode('ascii')\n self.readline = lambda:self.buffer.readline().decode('ascii')\n\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\n\n# Cout implemented in Python\nimport sys\nclass ostream:\n def __lshift__(self,a):\n sys.stdout.write(str(a))\n return self\ncout = ostream()\nendl = '\\n'\n\n# Read all remaining integers in stdin, type is given by optional argument, this is fast\ndef readnumbers(zero = 0):\n conv = ord if py2 else lambda x:x\n A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()\n try:\n while True:\n if s[i] >= b'0' [0]:\n numb = 10 * numb + conv(s[i]) - 48\n elif s[i] == b'-' [0]: sign = -1\n elif s[i] != b'\\r' [0]:\n A.append(sign*numb)\n numb = zero; sign = 1\n i += 1\n except:pass\n if s and s[-1] >= b'0' [0]:\n A.append(sign*numb)\n return A\n\nif __name__== \"__main__\":\n main()", "lang": "PyPy 2", "bug_code_uid": "b1c3771ec497d4185b11a718fe005f3b", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "b3e54d9f7937aa9cc02212c0e1680d02", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8942148760330578, "equal_cnt": 37, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 21, "fix_ops_cnt": 36, "bug_source_code": "from __future__ import division, print_function\ndef main():\n from collections import deque \n \n def printMin(arr, n, k): \n res=[]\n Qi = deque() \n for i in range(k): \n while Qi and arr[i] <= arr[Qi[-1]] : \n Qi.pop() \n Qi.append(i); \n \n for i in range(k, n): \n res.append(arr[Qi[0]])\n while Qi and Qi[0] <= i-k: \n Qi.popleft() \n while Qi and arr[i] <= arr[Qi[-1]] : \n Qi.pop() \n Qi.append(i) \n res.append(int(arr[Qi[0]]))\n return res \n n,m,a,b=map(int,input().split())\n g,x,y,z=map(int,input().split())\n grid=[0]\n grid[0]=g\n B=[]\n for i in range(1,n*m):\n if i%m==0:\n B.append(printMin(grid,m,b))\n g=grid[-1]\n grid=[]\n grid.append((g*x+y)%z)\n else :\n grid.append((grid[-1]*x+y)%z)\n B.append(printMin(grid,m,b))\n ans=0\n for i in range(len(B[0])):\n temp=[]\n for j in range(n):\n temp.append(B[j][i])\n ans+=sum(printMin(temp,len(temp),a))\n print(ans)\n\n######## Python 2 and 3 footer by Pajenegod and c1729\n\n# Note because cf runs old PyPy3 version which doesn't have the sped up\n# unicode strings, PyPy3 strings will many times be slower than pypy2.\n# There is a way to get around this by using binary strings in PyPy3\n# but its syntax is different which makes it kind of a mess to use.\n\n# So on cf, use PyPy2 for best string performance.\n\npy2 = round(0.5)\nif py2:\n from future_builtins import ascii, filter, hex, map, oct, zip\n range = xrange\n\nimport os, sys\nfrom io import IOBase, BytesIO\n\nBUFSIZE = 8192\nclass FastIO(BytesIO):\n newlines = 0\n\n def __init__(self, file):\n self._file = file\n self._fd = file.fileno()\n self.writable = \"x\" in file.mode or \"w\" in file.mode\n self.write = super(FastIO, self).write if self.writable else None\n\n def _fill(self):\n s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])\n return s\n\n def read(self):\n while self._fill(): pass\n return super(FastIO,self).read()\n\n def readline(self):\n while self.newlines == 0:\n s = self._fill(); self.newlines = s.count(b\"\\n\") + (not s)\n self.newlines -= 1\n return super(FastIO, self).readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.getvalue())\n self.truncate(0), self.seek(0)\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n if py2:\n self.write = self.buffer.write\n self.read = self.buffer.read\n self.readline = self.buffer.readline\n else:\n self.write = lambda s:self.buffer.write(s.encode('ascii'))\n self.read = lambda:self.buffer.read().decode('ascii')\n self.readline = lambda:self.buffer.readline().decode('ascii')\n\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\n\n# Cout implemented in Python\nimport sys\nclass ostream:\n def __lshift__(self,a):\n sys.stdout.write(str(a))\n return self\ncout = ostream()\nendl = '\\n'\n\n# Read all remaining integers in stdin, type is given by optional argument, this is fast\ndef readnumbers(zero = 0):\n conv = ord if py2 else lambda x:x\n A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()\n try:\n while True:\n if s[i] >= b'0' [0]:\n numb = 10 * numb + conv(s[i]) - 48\n elif s[i] == b'-' [0]: sign = -1\n elif s[i] != b'\\r' [0]:\n A.append(sign*numb)\n numb = zero; sign = 1\n i += 1\n except:pass\n if s and s[-1] >= b'0' [0]:\n A.append(sign*numb)\n return A\n\nif __name__== \"__main__\":\n main()", "lang": "PyPy 2", "bug_code_uid": "d5edc48f3c499ed0ff9d8e054a5e6ff4", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "b3e54d9f7937aa9cc02212c0e1680d02", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.43137254901960786, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def a964(n):\n variations = list()\n for i in range(1, int(n/2)+1):\n variation = list()\n a = int(n/i)\n variation.append(list((a,))*i)\n if a * i != n:\n variation.append(n - a*i)\n variations.append(variation)\n return len(variations) + 1\n\n\nif __name__ == '__main__':\n n = int(input())\n print(a964(n))\n", "lang": "Python 3", "bug_code_uid": "7c26df4379a81f9674e873563bc05233", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "3f0d14de389f79b56c1148804e519b31", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.668041237113402, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "\ns =raw_input()\n\n\ndef ct(s):\n lx=[\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"]\n ct=0\n for x in lx:\n if x in s:\n ct+=1\n if ct>=2:\n return \"NO\"\n if ct==0:\n return \"NO\"\n elif ct==1:\n return \"YES\"\n\n\n\n\nprint ct(s)", "lang": "Python 2", "bug_code_uid": "21669509b34e816556c765a437a9a117", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "d05110ac36230acba94710123d950a46", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9930875576036866, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "Copy\nn,k = input().split()\nn = int(n)\nk = int(k)\ntemp = 1\n \ndef lcm(x, y):\n\tif x>y:\n\t\tgreater = x\n\telse:\n\t\tgreater = y\n\twhile True:\n\t\tif((greater%x==0)and(greater%y==0)):\n\t\t\tlcm = greater\n\t\t\tbreak\n\t\tgreater+=1\n\treturn lcm\n \ndef gcd(x,y):\n\tif x0:\n\t\ttemp=temp*10\n\t\tk=k-1\n\tx = gcd(temp,n)\n\ttemp = int((temp * n)/x) \n\tprint (temp)", "lang": "PyPy 3", "bug_code_uid": "6b7e960192d33cd0ef5ba4262a528628", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "8de91a1498f0cc489240a7035a0e42ca", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.330188679245283, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "n = int(input())\nres = [i for i in range(2,n+1,2)]\nres1 = [ i for i in range(1,n+1,2)]\nresult = sum(res) - sum(res1)\n\nprint(result)", "lang": "PyPy 3", "bug_code_uid": "255763066dcb59da4ad4474ef73ea265", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "65114d2bb40a38574efb4bed1e80bc59", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5614035087719298, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n = int(input())\na = [str(i * [1, -1][i % 2]) for i in range(1, n+1)]\nprint(eval('+'.join(a)))\n", "lang": "PyPy 3", "bug_code_uid": "7d79eacb80e6e940a0a8264dd8365ef2", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "641b91482755158893d2cef0abec5f24", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.44545454545454544, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "# -*- coding: utf-8 -*-\nadditions = []\nn = int(input())\nfor i in range(1, n + 1):\n if i % 2 == 0:\n additions.append(i)\n else:\n additions.append(-i)\n if i == n:\n break\nprint(sum(additions))\n \n ", "lang": "PyPy 3", "bug_code_uid": "22cba2e85fd3f7e6ad8f1bf462c55a85", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "7697ef1250eaa17ba4ae1d0d19dfaae5", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9266409266409267, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,m=map(int,input().split())\nans=\"No\"\n if a%m==0:\n ans=\"Yes\"\n break\n else:\n a+=a%m\nprint(ans)", "lang": "Python 3", "bug_code_uid": "5dde1cba2b56bedecb97f60129d55906", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "09b22c8373934df0fa36b0cc48cae854", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5356265356265356, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 9, "fix_ops_cnt": 18, "bug_source_code": "def main():\n\tn=int(input())\n sum=0\n for i in range(2,(n-1)):\n s=n\n while(s>0):\n sum=sum+(s%i)\n s=s/i\n b=n-2\n a=sum\n #For HCF\n if a\" : '1000',\"<\" : '1001',\"+\" : '1010',\"-\" : '1011',\".\" : '1100',\",\" : '1101',\"[\" : '1110',\"]\" : '1111'}\nn=input()\ns=''\nfor i in n:\n s=s+dic[i]\nss=int(s)\nprint(int(ss,2))\n ", "lang": "Python 3", "bug_code_uid": "71688fa2685cbd0cfdb491d59db9aed2", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "e6ed13e26b742000e74ccf1e90c7c6c1", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9120521172638436, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "p = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}\nt = input()\nans = 0\nfor i in t:\n ans = (16 * ans + i) % 1000003\nprint(ans)", "lang": "Python 3", "bug_code_uid": "a45b787e6a657a112fab266c4d11ea58", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "f860212ecf6a6b502c265fa864255862", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9960474308300395, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input()\na=[0]+[*map(int,input().split())]+[1001]\nm=c=0\nfor x,y in zip(a,a[1:])\n if x+1==y:c+=1;m=max(m,c-1)\n else:c=0\nprint(m)", "lang": "Python 3", "bug_code_uid": "e1523b48624a00062867502dcdeb32fe", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "a42baa1bd1cbfa9e55f13ef7e845dc0d", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9885433715220949, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#map(int,raw_input().split())\nimport itertools\nn = int(raw_input())\n\ndef f(x):\n ans = 1\n for i in x: ans *=i\n return ans\n\np = [2,3,5,7]\nans = 0\nfor i in xrange(1,n+1):\n for t in itertools.combinations(p,i):\n if (i%2 == 1): ans += (n/f(t))\n else: ans -= (n/f(t))\n\nprint n - ans\n", "lang": "PyPy 2", "bug_code_uid": "90e3b9b6bf062743f2edb6156afaf291", "src_uid": "e392be5411ffccc1df50e65ec1f5c589", "apr_id": "fc142def6750a4342b96e2d4a3694ec9", "difficulty": 1500, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1266540642722117, "equal_cnt": 21, "replace_cnt": 8, "delete_cnt": 9, "insert_cnt": 4, "fix_ops_cnt": 21, "bug_source_code": "#include \n#define TARUNNO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);\ntypedef long long ll;\n #define INF 1000000000+7\n #define MAX 100000\n #define pb push_back\n #define pf push_front\n #define pob pop_back\n #define pof pop_front\n #define ins insert\n #define mp make_pair\n #define F first\n #define S second\n #define Endl endl\n #define PII pair\n #define pii pair\n #define PIPII pair >\n#define testing() {cout<<\"OK\"<\nstring to_string(T str){stringstream stream;stream << str;return stream.str();}\n\nint main(){\nTARUNNO;\n \n return 0;\n}\n\n\n\n // C O M F O R T A B L Y N U M B //\n", "lang": "Python 3", "bug_code_uid": "b970a73629c4464ec824a5907dd2776b", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "0021b028013d006af293a0bc60787b24", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.19967266775777415, "equal_cnt": 30, "replace_cnt": 18, "delete_cnt": 7, "insert_cnt": 4, "fix_ops_cnt": 29, "bug_source_code": "def main():\n n, p = map(int, input().split())\n l = [p, p] + [ord(c) - 97 for c in input()]\n a = l[-2]\n for i in range(n + 1, 1, -1):\n a, b = l[i - 2], a\n for x in range(l[i] + 1, p):\n if a != x != b:\n l[i] = x\n break\n else:\n continue\n break\n else:\n print(\"NO\")\n return\n a, b = l[i - 1], x\n for i in range(i + 1, n + 2):\n for x in range(p):\n if a != x != b:\n l[i] = x\n a, b = b, x\n break\n print(\"\".join(chr(x + 97) for x in l[2:]))\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "cd550021bcdf46ba40f4168589495582", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "6551eceb8497b3cce35ab6341e9b008b", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9557522123893806, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\nx=0\nwhile n>=1:\n if n%2==1:\n x+=1\n n-=1\n else:\n n//=2;\n }\n print(x)\n", "lang": "Python 3", "bug_code_uid": "8034d122a2fbfdf80bd167310275e1e9", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "ad1dc36d241ff6ecee40e48f0fe03b4f", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.0756578947368421, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "a = int(input()) #no of a's\nb = int(input()) #no of b's\nc = int(input()) #no of ab's\nd = 0\n \ndef longest_str(a, b, c):\n if a == b:\n return (c * 2) + a + b\n elif a < b:\n return (c * 2) + a + (a + 1)\n elif a > b:\n return (c * 2) + b + b + 1\n else:\n return \"error\"\n \nprint(longest_str(a, b, c))", "lang": "Python 3", "bug_code_uid": "796fedb1150d1b9cf997b5cdcb00415e", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "e823f7516618a1feb3963e4229f060cd", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.415929203539823, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "a=int(input())\nb=int(input())\nc=0\nwhile(a!=b):\n if a>b:\n a=a-1\n b=b+1\n else:\n a=a+1\n b=b-1\n c=c+2\nprint(c)\n ", "lang": "Python 3", "bug_code_uid": "1a901aa4f2ce49b3656ebdb7c0a6181d", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "04d97820623d48666fa48f7d585ff4ed", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4233576642335766, "equal_cnt": 22, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 22, "bug_source_code": "a = []\nfor i in range(4):\n c = input()\n a.append((len(c) - 2, c[0]))\na.sort()\ngs = a[0][0] * 2 <= a[1][0]\ngl = a[3][0] >= a[2][0] * 2\nif (gs and gl) or (not gs and not gl):\n print('C')\nelse:\n print(a[0][1] if", "lang": "PyPy 3", "bug_code_uid": "d17e1b209e2ae5df8a5a386510067252", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "42dd447f558aa9aceb0f8d501ef8a5b6", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9881278538812786, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from collections import deque, defaultdict\n\ndef solve(n, m):\n\tq = deque([])\n\tq.append(n)\n\tseen = defaultdict(lambda : False)\n\tseen[n] = True\n\tsteps = 0\n\twhile(not seen[m]):\n\t\tsize = len(q)\n\t\tsteps += 1\n\t\tfor i in range(size):\n\t\t\tval = q.popleft()\n\t\t\tn1 = val * 2\n\t\t\tn2 = val - 1\n\t\t\tif(not seen[n1] and n1 > 0):\n\t\t\t\tq.append(n1)\n\t\t\t\tseen[n1] = True\n\t\t\t\tif(n1 == m):\n\t\t\t\t\tbreak\n\t\t\tif(not seen[n2] and n2 > 0):\n\t\t\t\tq.append(n2)\n\t\t\t\tseen[n2] = True\n\t\t\t\tif(n2 == m):\n\t\t\t\t\tbreak\n\treturn steps\n\nm,n = map(int, raw_input().split())\nprint solve(m, n)", "lang": "PyPy 2", "bug_code_uid": "b58b536bc49d396c910eab07a52b2d9f", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "6a4d2a94e1b3c3ec3e9d7140ab666349", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9369369369369369, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "a,b,c = map(int,input().split())\nprint((a*c + b -1)//(b-c))", "lang": "Python 3", "bug_code_uid": "cd605e1c0daa07e738c1b7f3ebfa9665", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "d8fc9c6d607069d521843da3d64d73e1", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9073170731707317, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "a=input().split()\na=int(a)\nn=a[0]\nm=a[1]\nk=a[2]\nif n<=m and n<=k:\n\tprint(\"Yes\")\nelse:\n\tprint(\"No\")\t\n", "lang": "Python 3", "bug_code_uid": "634372d5bfdb89bcde7a6be4017641d2", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "ba82d10c076f59d2a8154827c1a47e91", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7065789473684211, "equal_cnt": 20, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 8, "fix_ops_cnt": 20, "bug_source_code": "from itertools import chain, combinations\nfrom collections import defaultdict\nimport math\n\ndef powerset(iterable):\n xs = list(iterable)\n return chain.from_iterable(combinations(xs,n) for n in range(len(xs)+1))\n\ndef has(s):\n\th = 1\n\tp = [2,3,5,7,11,13,17,19,23,29]\n\tfor i in s:\n\t\th *= p[i-1]\n\treturn h\n\nh = set()\ntotal = 0\nok = [int(i) for i in \"1000000000000000000\"]\nrequire = set(ok)\n \nfor s in powerset(ok):\n\tif has(s) in h or len(s) == 0:\n\t\tcontinue\n\n\th.add(has(s))\n\n\td = defaultdict(int)\n\tfor c in s:\n\t\td[c] += 1\n\n\tflag = False\n\tfor i in require:\n\t\tif d[i] == 0:\n\t\t\tflag = True\n\t\t\tbreak\n\tif flag: continue\n\n\tprod = 1\n\tfor k in d:\n\t\tprod *= math.factorial(d[k])\n\n\tn = len(s)\n\ttotal += (n-d[0])*math.factorial(n-1)/prod\n\nprint(int(total))", "lang": "Python 3", "bug_code_uid": "cd01a2751776ec24575ec3f9167a5e29", "src_uid": "7f4e533f49b73cc2b96b4c56847295f2", "apr_id": "28bb5c652d7c439c502eb35cbe5da3a1", "difficulty": 1800, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8946459412780656, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = list(map(int, input()))\ndp = [[1] * 10]\nfor i in range(1, len(n)):\n dp.append([0] * 10)\n for j in range(10):\n x = j + n[i]\n dp[i][x // 2] += dp[i - 1][j]\n if x % 2:\n dp[i][x // 2 + 1] += dp[i - 1][j]\nprint(sum(dp[-1]))", "lang": "Python 3", "bug_code_uid": "b031c68e3e13e863f6554de5d9b60bf5", "src_uid": "2dd8bb6e8182278d037aa3a59ca3517b", "apr_id": "87995c087034eed4ee8b5b412ea7762b", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5397489539748954, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#!/usr/bin/python\nimport sys\n\ndef f(x, s, index, length):\n\ta = int(s[index])\n\tif index == length - 1:\n\t\treturn 2 if (a + x) % 2 == 1 else 1\n\tif (a + x) % 2 == 0:\n\t\treturn f( (a+x)/2, s, index+1, length)\n\telse:\n\t\treturn f( (a+x)//2, s, index+1, length) + \\\n\t\t\t f( (a+x)//2+1, s, index+1, length)\n\ndef selfInclude(s):\n\tfor i in range(0, len(s)-1):\n\t\ta = int(s[i])\n\t\tb = int(s[i+1])\n\t\tif abs(a-b) > 1:\n\t\t\treturn False\n\treturn True\n\ns = sys.stdin.readline().strip()\nresult = 0\nfor i in range(10):\n\tresult += f(i, s, 1, len(s))\nprint result-1 if selfInclude(s) else result\n", "lang": "Python 2", "bug_code_uid": "6a7ea4095ccd62deef3b37493932a7ab", "src_uid": "2dd8bb6e8182278d037aa3a59ca3517b", "apr_id": "5558f3f34e7a894a2746986a371b7d2b", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9361069836552749, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import os,sys\n\ndef read():\n sys.stdin = open('input.txt', 'r') \n sys.stdout = open('output.txt', 'w') \ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\n\ndef main():\n\tn=int(input())\n\tli=list(map(int,input().split()))\n\n\tli.sort()\n\tli[0],li[n-1]=li[n-1],li[0]\n\tprint(*li)\n\n\t\n\nif __name__ == \"__main__\":\n read()\n main()\n ", "lang": "Python 3", "bug_code_uid": "2542655a2d01253233f1a69334a23236", "src_uid": "4408eba2c5c0693e6b70bdcbe2dda2f4", "apr_id": "1663ccb6fe868c219752905330c4fea8", "difficulty": 1300, "tags": ["constructive algorithms", "implementation", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8128872366790583, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "if __name__=='__main__':\n inp = input()\n inp = input()\n arr = inp.split(\" \")\n Li = []\n Ls = []\n for a in arr:\n Li.append(int(a))\n\n Li.sort()\n fst = Li.pop(0)\n lst = Li.pop(-1)\n ans = str(lst)\n for x in Li:\n Ls.append(str(x))\n Ls.sort()\n for s in Ls:\n ans+=\" \"+s\n ans+=\" \"+str(f)\n print(ans)\n \n \n \n", "lang": "Python 3", "bug_code_uid": "99433bf43038503ad6982e3f273c08ee", "src_uid": "4408eba2c5c0693e6b70bdcbe2dda2f4", "apr_id": "e51d460cfbee0b48b54aae1498e65596", "difficulty": 1300, "tags": ["constructive algorithms", "implementation", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8312958435207825, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a,b=map(int,input().split())\nif not a:\n if not b:print(0,0)\n else:print('Impossible')\nelse:\n if a>=b:\n t = a\n elif b>a and b=<2*a:\n t = a\n elif b>a and b>2*a:\n t = a + b-2*a\n \n print(max(t,a+b-bool(b))", "lang": "Python 3", "bug_code_uid": "0356bf754ad135e64667d118d2072f68", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "4532fd9485983fa7de7e753aafe9fd21", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.08915304606240713, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "import itertools\nn, k = list(map(int, input().split()))\narr = []\ncr = 1\nfor i in range(n):\n arr.append(cr)\n cr += 1\npr = list(itertools.permutations(arr, n))\nmc = n - k\nac = 0\nfor i in pr:\n c = 0\n for j in range(n):\n if i[j] == j + 1:\n c += 1\n if c >= mc:\n ac += 1\nprint(ac)", "lang": "Python 3", "bug_code_uid": "3df347828858f04118d210e63ddfeae8", "src_uid": "96d839dc2d038f8ae95fc47c217b2e2f", "apr_id": "afd00609a33835fe0f057d433e4c32e0", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9627760252365931, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "els = [\"AC\",\"AG\",\"AL\",\"AM\",\"AR\",\"AS\",\"AT\",\"AU\",\"B\",\"BA\",\"BE\",\"BH\",\"BI\",\"BK\",\"BR\",\"C\",\"CA\",\"CD\",\"CE\",\"CF\",\"CL\",\"CM\",\"CO\",\"CR\",\"CS\",\"CU\",\"DS\",\"DB\",\"DY\",\"ER\",\"ES\",\"EU\",\"F\",\"FE\",\"FM\",\"FR\",\"GA\",\"GD\",\"GE\",\"H\",\"HE\",\"HF\",\"HG\",\"HO\",\"HS\",\"I\",\"IN\",\"IR\",\"K\",\"KR\",\"LA\",\"LI\",\"LR\",\"LU\",\"MD\",\"MG\",\"MN\",\"MO\",\"MT\",\"N\",\"NA\",\"NB\",\"ND\",\"NE\",\"NI\",\"NO\",\"NP\",\"O\",\"OS\",\"P\",\"PA\",\"PB\",\"PD\",\"PM\",\"PO\",\"PR\",\"PT\",\"PU\",\"RA\",\"RB\",\"RE\",\"RF\",\"RG\",\"RH\",\"RN\",\"RU\",\"S\",\"SB\",\"SC\",\"SE\",\"SG\",\"SI\",\"SM\",\"SN\",\"SR\",\"TA\",\"TB\",\"TC\",\"TE\",\"TH\",\"TI\",\"TL\",\"TM\",\"U\",\"V\",\"W\",\"XE\",\"Y\",\"YB\",\"ZN\",\"ZR\"]\ns = input()\n\ndef f(t):\n if t == \"\":\n return True\n for p in els:\n if t.startswith(p) and f(t[len(p):]):\n return True\n return False\n \nif f(s) || s == \"REVOLVER\":\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "9eb1ee8cafc61122061f2a404ef0a6d3", "src_uid": "d0ad35798119f98320967127c43ae88d", "apr_id": "e88b9de022d1e882233991e35ab415aa", "difficulty": null, "tags": ["dp", "brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8256227758007118, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\nif x % 4 == 0:\n print(x//2 - 1, x//2 + 1)\nelse:\n x % 4 == 2:\n print(x//2 - 2, x//2 + 2)", "lang": "Python 3", "bug_code_uid": "0e6b630790795e39d847fc0eab50076f", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "629ee80db75fa9676ad68f4b97200a36", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2100082034454471, "equal_cnt": 17, "replace_cnt": 18, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": "n=['January', 'February', 'March', 'April', 'May', 'June', 'July','August', 'September', 'October', 'November', 'December']\nx=input();ans=0\nif x=='January':\n ans=0\nelif x=='February':\n ans=1\nelif x=='March':\n ans=1\nelif x=='February':\n ans=1\nelif x=='February':\n ans=1\nelif x=='February':\n ans=1\nelif x=='February':\n ans=1\nelif x=='February':\n ans=\ns=int(input())", "lang": "Python 3", "bug_code_uid": "df2621133e5799ddb3b3fa0d6d9381ae", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "01133edcbbe51ee4a45697f15c727a63", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9627228525121556, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/python\n\nfrom collections import deque\nfrom collections import Counter\n\ndef ir():\n return int(raw_input())\n\ndef ia():\n line = raw_input()\n line = line.split()\n return map(int, line)\n\nn, k = ia()\nwhile k > 0 and add > 0:\n ans += add\n add -= 4\n k -= 1\n \nprint ans\n\n", "lang": "Python 2", "bug_code_uid": "8d05fcba3e0118c3a0691b309675f93d", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "apr_id": "11090c416800bf284d33228d45558415", "difficulty": 1200, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.873015873015873, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "from bisect import bisect_left as bl, bisect_right as br, insort\nimport sys\nimport heapq\n#from math import *\nfrom collections import defaultdict as dd, deque\ndef data(): return sys.stdin.readline().strip()\ndef mdata(): return map(int, data().split())\n#def print(x): return sys.stdout.write(str(x)+'\\n')\n#sys.setrecursionlimit(100000)\nmod=int(1e9+7)\n\nn,m=mdata()\ndp=[[2,0,0]]\nfor i in range(1,m):\n dp.append([2*dp[i-1][0]-dp[i-1][2],dp[i-1][1]+dp[i-1][0]-dp[i-1][2],dp[i-1][0]-dp[i-1][2]])\ncnt=dp[-1][1]\nk1=dp[-1][0]-dp[-1][1]\nk2=0\nfor i in range(1,n):\n k1,k2=(2*k1-k2+mod)%mod,(k1-k2+mod)%mod\nprint(cnt+k1)", "lang": "PyPy 3", "bug_code_uid": "01e36ddf1e17c611d5b00ce9768f6ef9", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "2a086d907a52ee3d9896a94d39e29d6c", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7371695178849145, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n,m=map(int,input().split())\nmod=10**9+7\n\nB=[1]\nW=[1]\nBB=[0]\nWW=[0]\n\nfor i in range(1,100010):\n x=W[-1]+WW[-1]\n y=B[-1]+BB[-1]\n z=B[-1]\n w=W[-1]\n\n B.append(x)\n W.append(y)\n BB.append(z)\n WW.append(w)\n\nprint(B[n-1]+W[n-1]+BB[n-1]+WW[n-1]+B[m-1]+W[m-1]+BB[m-1]+WW[m-1]-2)\n\n\n", "lang": "PyPy 3", "bug_code_uid": "067ae72736b479c56b5b15062b564578", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "948c8a25a6f3d9d8efff9c6bd3087e16", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.08722741433021806, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import itertools\n\na = raw_input()\nb = raw_input()\n\na = list(a)\nb = int(b)\n\np_list = list(itertools.permutations(a,len(a)))\n#p_list = [[int(x) for x in y] for y in p_list]\n\nans = 0\na_ans = ''\nfor i in p_list:\n tsum = ''\n for j in range(len(a)):\n tsum += i[j]\n if int(tsum) <= b and int(tsum) > ans:\n ans = int(tsum)\n a_ans = tsum\n\nprint a_ans \n", "lang": "Python 2", "bug_code_uid": "69bb3a1f4cde71fa02a4f12b68b04641", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "391359e6a1bab2378c9b135cee857d2d", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09502515371716043, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "def normalize(seg):\n if seg[0] != seg[2] and seg[1] != seg[3]:\n return None\n\n xs = (seg[0], seg[2])\n ys = (seg[1], seg[3])\n\n return (min(xs), min(ys), max(xs), max(ys))\n\ndef valid(shifted):\n w, h = None, None\n for _, _, x, y in shifted:\n if x != 0 and y != 0:\n if w is not None and (w, h) != (x, y):\n return False\n\n w, h = x, y\n\n if w is None or h is None:\n return False\n\n expected = [(0, 0, 0, h), (0, 0, w, 0), (0, h, w, h), (w, 0, w, h)]\n\n return set(shifted) == set(expected)\n\ndef sub(a, x, y):\n return (a[0] - x, a[1] - y, a[2] - x, a[3] - y)\n\ndef main():\n segs = [normalize(tuple(map(int, input().split()))) for _ in range(4)]\n poss = False\n for seg in segs:\n shifted = [sub(s, seg[0], seg[1]) for s in segs]\n poss |= valid(shifted)\n\n print('YES' if poss else 'NO')\n\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "7d08d45a226a027f86f1a4ca06bdf7b7", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "fdb2e39923dba62ecad1f1b68469d4bd", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9973614775725593, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "print([1,3,15,63,4095,65535,262143,73741816,536396503,140130950,487761805,319908070,106681874,373391776,317758023,191994803,416292236,110940209,599412198,383601260,910358878,532737550,348927936,923450985,470083777,642578561,428308066,485739298,419990027,287292016,202484167,389339971,848994100,273206869,853092282,411696552,876153853,90046024,828945523,697988359][int(input())])", "lang": "PyPy 3", "bug_code_uid": "b03499b6a834898aa0c1a098aa5616c9", "src_uid": "c2cbc35012c6ff7ab0d6899e6015e4e7", "apr_id": "9185db31b5fbebe1e2b4f1d6297974bf", "difficulty": 2100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9867109634551495, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\np=[2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279,2203,2281,3217,4253,4423,9689,9941,11213,19937,21701,23209,44497,86243,110503,132049,216091,756839,859433,1257787,1398269,2976221,3021377,13466917,20996011]\nres=1\nfor i in range(p[n-1]-1):\n res*=2\n res%=1000000007\nprint(res-1)", "lang": "PyPy 3", "bug_code_uid": "9995c899e892970b415407eca3b7e66e", "src_uid": "c2cbc35012c6ff7ab0d6899e6015e4e7", "apr_id": "255dbac25c0b0cc58bfbf6c22e96a7c8", "difficulty": 2100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9964186231595702, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\nfrom functools import lru_cache, cmp_to_key\nfrom heapq import merge, heapify, heappop, heappush\n# from math import *\nfrom collections import defaultdict as dd, deque, Counter as C\nfrom itertools import combinations as comb, permutations as perm\nfrom bisect import bisect_left as bl, bisect_right as br, bisect\nfrom time import perf_counter\nfrom fractions import Fraction\nimport copy\nimport time\n# import numpy as np\nstarttime = time.time()\n# import numpy as np\nmod = int(pow(10, 9) + 7)\nmod2 = 998244353\ndef data(): return sys.stdin.readline().strip()\ndef out(*var, end=\"\\n\"): sys.stdout.write(' '.join(map(str, var))+end)\ndef L(): return list(sp())\ndef sl(): return list(ssp())\ndef sp(): return map(int, data().split())\ndef ssp(): return map(str, data().split())\ndef l1d(n, val=0): return [val for i in range(n)]\ndef l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]\n\ntry:\n # sys.setrecursionlimit(int(pow(10,6)))\n sys.stdin = open(\"input.txt\", \"r\")\n # sys.stdout = open(\"../output.txt\", \"w\")\nexcept:\n pass\n\n\nn=L()[0]\nA=[1]\ni=0\nwhile(A[-1]<=n):\n A.append(A[i]*10+0)\n A.append(A[i]*10+1)\nwhile(A[-1]>n):\n del(A[-1])\nprint(len(A))\n\nendtime = time.time()\n# print(f\"Runtime of the program is {endtime - starttime}\")\n", "lang": "PyPy 3", "bug_code_uid": "40708eb7d0403161ed599061c6b16267", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "f7a150f568bcdffce128455ae4f55dfc", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5263157894736842, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "n=int(input())\nq=int(input())\nz=pow(2,n+q)\nx=z%998244335\nprint(x)", "lang": "Python 2", "bug_code_uid": "394d29e7e3fda1203c1deabb4686c88e", "src_uid": "8b2a9ae21740c89079a6011a30cd6aee", "apr_id": "31a9f139516f4e7ffc06844f260fec4c", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.25287356321839083, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n,k = map(int,raw_input().split())\ni=2\ns=[1]\nwhile(i!=n+2):\n if(i==n+1):\n print s[k-1]\n break\n else:\n s.extend(s)\n s.insert(len(s)/2,i)\n i += 1", "lang": "Python 2", "bug_code_uid": "aad5fb0fc916ff480ff3207bcfc46bc8", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "22ecb31f26e14148ac86d28c17780102", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.88, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "from sys import stdin, gettrace\n\nif gettrace():\n inputi = input\nelse:\n def input():\n return next(stdin)[:-1]\n\n\n def inputi():\n return stdin.buffer.readline()\n\ndef tide(k, t):\n t = t%(2*k)\n if t <= k:\n return t\n else:\n return 2*k - t\n\ndef solve():\n n,k,l = map(int, inputi().split())\n dd = [int(a) for a in inputi().split()]\n if max(dd) > l:\n print(\"No\")\n return\n t = 0\n def can_finish(t,i):\n if i == n:\n return True\n for t1 in range(t+1, t+2*k):\n if dd[i] + tide(k,t1) > l:\n return False\n else:\n if can_finish(t1, i+1):\n return True\n return False\n for i in range(2*k):\n if can_finish(i,0):\n print(\"Yes\")\n return\n else:\n print(\"No\")\n\n\n\n\ndef main():\n t = int(inputi())\n for _ in range(t):\n solve()\n\n\nif __name__ == \"__main__\":\n main()", "lang": "PyPy 3", "bug_code_uid": "eafd18db2a9e7c8a1a59b3f4b310df1d", "src_uid": "4941b0a365f86b2e2cf686cdf5d532f8", "apr_id": "d7edc7bc1ecb866168fd89e2e40df063", "difficulty": 1900, "tags": ["dp", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9350393700787402, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def gcd(a, b):\n return a if b == 0 else gcd(b, a%b)\n\nn, k = (int(x) for x in input().split())\nnk = n*k\na, b = (int(x) for x in input().split())\nflag1 = [1, 1, -1, -1]\nflag2 = [1, -1, 1, -1]\nmin_ans, max_ans = float('inf'), -1\nfor s in range(1, k+1):\n for dir in range(4):\n if (s + flag1[dir]*a + flag2[dir]*b) % k == 0:\n for d in range(n+1):\n stop = (nk)//gcd(nk, d*k+s)\n min_ans = min(min_ans, stop)\n max_ans = max(max_ans, stop)\n\nprint(min_ans, max_ans)\n", "lang": "Python 3", "bug_code_uid": "ce69a604f8dc67ed0577a8617de93713", "src_uid": "5bb4adff1b332f43144047955eefba0c", "apr_id": "005fcd04c3a0b207993f79b36b27908d", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9949238578680203, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b,c=input(),input(),input()\nif(b==b[::-1] and c=a[::-1]):\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "540c8e1db49110df6f5ab4c43da9a60c", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "beba1ff2a459376a7d96f787c5b98aee", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.40080160320641284, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "matrix = [[],[0],[0],[0]]\n\nfor i in range(1,4):\n\tfor j in range(3):\n\t\tmatrix[i].append(int(input())) \n\nif(matrix[1][1] == matrix[3][3] && matrix[1][3] == matrix[3][1] && matrix[1][2] == matrix[3][2] && matrix[2][1] == matrix[2][3]):\n\tprint('YES')\nelse:\n\tprint('NO')\n\n\n", "lang": "PyPy 3", "bug_code_uid": "554557dab5b26fc21d9e3169c1052602", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "b52e57501121ecff4dd56670a7f24c5f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.06315789473684211, "equal_cnt": 10, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "#._.\n#want to maximize xa+y*int((c-z*a)/w)\n\ndef maxi(c, x, y, z, w):\n one = x / z\n two = y / w\n dictx = {}\n def f(a):\n return x*a+y*int((c-z*a)/w)\n for a in range(0, int(c//w)+1):\n dictx[a] = f(a)\n \n return max(dictx, key = lambda x:dictx[x])\nc, x, y, z, w = list(map(int, input().split(' ')))\nbad = maxi(c, x, y, z, w)\nprint(x*bad+y*int((c-z*bad)/w))\n", "lang": "PyPy 3", "bug_code_uid": "775c350d825d6862e02345bd7661bd96", "src_uid": "eb052ca12ca293479992680581452399", "apr_id": "bc2f802bc45906616f061822b1dbee84", "difficulty": 2000, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.96875, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input()\nprint \"YES\" if len(set(input().lower()))==26 else \"NO\"", "lang": "Python 2", "bug_code_uid": "853931bd6aef384e2b797bbcc5f5bcf8", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "7b4a7e6fc24fa4684f78549c008f802b", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3516998827667057, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "a, b = [int(i) for i in input().split()]\no = a - b\nsum = 0\nl = 1\nif o > 0:\n if o ** 0.5 == int(o ** 0.5):\n l = 0\n for i in range(1, int(o ** 0.5) + l):\n if o % i == 0:\n if o // i > b and i > b:\n sum += 2\n if (o // i > b and i <= b) or (o // i <= b and i > b):\n sum += 1\n if i == o // i:\n sum -= 1\nif o == 0:\n print('infinity')\nelse:\n print(sum)", "lang": "Python 3", "bug_code_uid": "a0278d96d09c5f21d1e96592aad03b54", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "2fee84afc1e853357dbce9fc4509523c", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9882747068676717, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import sys\n\ndesired = 'BERLAND'\nmatches = 5\n\ndef check(x, y):\n global result, played, victim\n standing = played.keys()\n for i in range(4):\n points = 0\n team = standing[i]\n got, lost = 0, 0\n for j in range(5):\n if result[j][1] == team:\n result[j][0], result[j][1] = result[j][1], result[j][0]\n result[j][2][0], result[j][2][1] = result[j][2][1], result[j][2][0]\n if result[j][0] != team:\n continue\n diff = result[j][2][0] - result[j][2][1]\n got += result[j][2][0]\n lost += result[j][2][1]\n if diff == 0: points += 1\n if diff > 0: points += 3\n if team == desired:\n points += 3\n got += x\n lost += y\n if team == victim:\n got += y\n lost += x\n standing[i] = (-points, -(got - lost), -got, team)\n standing = sorted(standing)\n return standing[0][3] == desired or standing[1][3] == desired\n\ndef add(s):\n global played\n if played.has_key(s):\n played[s] += 1\n else:\n played[s] = 1\n\nresult = []\nplayed = dict()\nfor _ in range(matches):\n buf = raw_input().split()\n add(buf[0])\n add(buf[1])\n buf[2] = list(map(int, buf[2].split(':')))\n result.append(buf)\nfor pair in played.items():\n if pair[1] == 2 and pair[0] != desired:\n victim = pair[0]\nfor x in range(1, 100):\n for delta in range(x, 0, -1):\n y = x - delta\n if check(x, y):\n print str(x) + ':' + str(y)\n sys.exit(0)\nprint 'IMPOSSIBLE'\n", "lang": "Python 2", "bug_code_uid": "0039f90a7dca8005dd2800c0d843fcab", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "7fd1d0ffa7767df34d8766b1010c14f6", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7334303479296204, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "def find(teams):\n for i in range(len(teams)):\n if teams[i].name == \"BERLAND\": return i\ndef find_other(teams):\n for j in range(len(teams)):\n if teams[j].name != \"BERLAND\" and teams[j].games == 2: return j\n\nclass Team(object):\n def __init__(self,name):\n self.name = name\n self.gfor = 0\n self.gagainst =0\n self.points = 0\n self.games=0\n \n def __lt__(self,other):\n if self.points == other.points:\n if self.gfor-self.gagainst == other.gfor-other.gagainst:\n if self.gfor == other.gfor:\n return self.name < other.name\n else:\n return self.gfor > other.gfor\n else:\n return self.gfor-self.gagainst > other.gfor-other.gagainst\n else:\n return self.points > other.points\n \n def __str__(self):\n return self.name\n \n \n \n#data = open(\"P3.txt\")\nteams = []\nnames = []\nfor _ in range(5):\n t1,t2,goals = raw_input().split()\n if t1 not in names:\n names.append(t1)\n teams.append(Team(t1))\n if t2 not in names:\n names.append(t2)\n teams.append(Team(t2))\n \n i=names.index(t1)\n j=names.index(t2)\n a,b = map(int,goals.split(\":\"))\n teams[i].games += 1\n teams[j].games += 1\n teams[i].gfor += a\n teams[i].gagainst += b\n teams[j].gfor += b\n teams[j].gagainst += a\n if a==b:\n teams[i].points += 1\n teams[j].points += 1\n elif a > b:\n teams[i].points += 3\n else:\n teams[j].points += 3\n \n\n'''teams = []\nt = Team(\"A\")\nt.points = 3\nt.gfor = 5\nt.gagainst = 0\nt.games = 2\nteams.append(t)\n\nt = Team(\"BERLAND\")\nt.points = 0\nt.gfor = 0\nt.gagainst = 4\nt.games = 2\nteams.append(t)\n\nt = Team(\"C\")\nt.points = 3\nt.gfor = 0\nt.gagainst = 0\nt.games = 3\nteams.append(t)\n\nt = Team(\"D\")\nt.points = 9\nt.gfor = 6\nt.gagainst = 0\nt.games = 3\nteams.append(t)'''\n\n\nteams.sort()\n#for t in teams: print t,t.points,t.gfor-t.gagainst\ni = find(teams)\nj = find_other(teams)\n \nif i==0 or i==1:\n print \"1:0\"\nelse:\n minp = teams[1].points\n if teams[i].points+3minp:\n print \"1:0\"\n \n else:\n teams[i].points += 3\n teams[i].gfor += 1\n teams[j].gagainst += 1\n count = 1\n teams.sort()\n i = find(teams)\n j = find_other(teams)\n while i > 1 and count<100:\n teams[i].gfor += 1\n teams[j].gagainst += 1\n count += 1\n teams.sort()\n i = find(teams)\n j = find_other(teams)\n \n if i > 1:\n print \"IMPOSSIBLE\"\n else:\n print \"%i:0\" %(count)\n \n '''if j!=1:\n mingd = teams[1].gfor-teams[1].gagainst\n gd = mingd-(teams[i].gfor-teams[i].gagainst)\n if teams[i].name > teams[1].name:\n gd += 1\n print \"%i:0\" %(gd)\n \n else:\n if i==2:\n mingd = teams[1].gfor-teams[1].gagainst\n gd = mingd-(teams[i].gfor-teams[i].gagainst)\n gd /= 2\n teams\n if teams[i].name > teams[1].name:\n gd += 1\n print \"%i:0\" %(gd)'''\n \n \n ", "lang": "Python 2", "bug_code_uid": "5772e7d565e0cbe217b9d46f2be0c345", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "34f0d4c1dff2eae8fb5ed41fbfc0e6f4", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9821268990169795, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 10, "bug_source_code": "# Codeforces Round #488 by NEAR (Div. 2)\nimport collections\nfrom functools import cmp_to_key\n#key=cmp_to_key(lambda x,y: 1 if x not in y else -1 )\n\nimport sys\ndef getIntList():\n return list(map(int, input().split())) \n\nimport bisect \n \n \ns1 = getIntList()\ns2 = getIntList()\n\ndef x8(x):\n return x*4\n \ns1 = map(x4,s1)\ns1 = list(s1)\ns1 = [ (s1[i],s1[i+1]) for i in range(0,8,2)]\ns2 = map(x4,s2)\ns2 = list(s2)\ns2 = [ (s2[i],s2[i+1]) for i in range(0,8,2)]\n\n\n\ns1x = map(lambda x: x[0], s1)\ns1x = list(s1x)\ns1xmin = min(s1x)\ns1xmax = max(s1x)\n \n\ns1y = map(lambda x: x[1], s1)\ns1y = list(s1y)\ns1ymin = min(s1y)\ns1ymax = max(s1y)\n\ns2xpy = map(lambda x: x[0] + x[1], s2)\ns2xpy = list(s2xpy)\ns2xpymin = min(s2xpy)\ns2xpymax = max(s2xpy)\n\ns2xsy = map(lambda x: x[0] - x[1], s2)\ns2xsy = list(s2xsy)\ns2xsymin = min(s2xsy)\ns2xsymax = max(s2xsy)\n\n\n\nfor x in range(-800, 801):\n for y in range(-800, 801):\n if s1xmin < x = n:\n i += 1\n k = int(m[i: j])\n while m[i] == '0': i += 1\n j = i\n s += k * p\n p *= n\nprint(s)", "lang": "PyPy 3", "bug_code_uid": "4fa279dd26316d77a57329b02c696e31", "src_uid": "be66399c558c96566a6bb0a63d2503e5", "apr_id": "4763a2d099c88148e2cffaf09411cc7c", "difficulty": 2000, "tags": ["dp", "greedy", "math", "constructive algorithms", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4203102961918195, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\nimport time\nimport sys, io\nimport re, math\nstart = time.clock()\nl=list(raw_input())\nwhile 1:\n ans,chk=0,[]\n stp=set(l)\n if len(stp)==len(l):\n cnt=0\n break\n for i in range(len(l)):\n if l[i] not in chk:\n cnt,j=2,i+1\n while l[i]!=l[j]:\n cnt+=1\n j+=1\n ans=max(ans,cnt)\n chk.append(l[i])\n break\nprint ans", "lang": "Python 2", "bug_code_uid": "eeb8f283b0447dc3d3d2884b79b9ccb6", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7", "apr_id": "a2ffdbe9b1842ea3350a1983e9e34b89", "difficulty": 1200, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8354430379746836, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "a = map(int, raw_input().split())\nn = a[0]\nm = a[1]\n\nans = (2**m) - 1\nans = ans**n\nans = ans % 1000000007\nprint(ans)", "lang": "PyPy 2", "bug_code_uid": "6aa9a5fabe8ff077adf9ce8be6fbcade", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "7e37beb5316341fa5d8e13696828d505", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6161616161616161, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "n,m=map(int,raw_input().split())\na=1< 1:\n b *= b\n n /= 2\n b *= a\n return b\n\n\nn1, m1 = map(int, input().split())\na = (1 << m1) - 1\nprint(fastExp(a, n1))", "lang": "PyPy 3", "bug_code_uid": "280b23fc1dfc09ea25b01b0e9e259ccb", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "ce2aeb11fa2944d7e286c643daac983c", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8840579710144928, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n,m = map(int,input().split())\n\nprint((pow((pow(2,m) - 1),n))%1000000007)", "lang": "PyPy 3", "bug_code_uid": "81d7bbc2723998379dd6881895910381", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "de84634b8b98052ecee583cdd5a9b20e", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4784688995215311, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "n,m=map(int,input().split())\nmod=1000000007\nx=(1<= m else 0\ndef perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0\ndef mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)\nmod = 998244353\nINF = float('inf')\n\n# ------------------------------\n\n\ndef main():\n n = N()\n res = 'codeforces'\n res+='s'*(n-1)\n print(res)\n\nif __name__ == \"__main__\":\n main()\n\n", "lang": "PyPy 3", "bug_code_uid": "5eaae85001c311d8a5777b85cd772b91", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "0b75b72bc32dc16c70b500e94a8be9a7", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.995640802092415, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import sys\ndef rs(): return sys.stdin.readline().rstrip()\ndef ri(): return int(sys.stdin.readline())\ndef ria(): return list(map(int, sys.stdin.readline().split()))\ndef ws(s): sys.stdout.write(s); sys.stdout.write('\\n')\ndef wi(n): sys.stdout.write(str(n)); sys.stdout.write('\\n')\ndef wia(a, sep=' '): sys.stdout.write(sep.join([str(x) for x in a])); sys.stdout.write('\\n')\n \n \ndef main():\n n = ri()\n s = rs()\n for d in range(1, n+1):\n if n % d > 0:\n continue\n s = [d::-1] + s[d+1:] \n ws(s)\n \nif __name__ == '__main__':\n main()", "lang": "PyPy 3", "bug_code_uid": "cd0fac73e419aef5f35ec237268d106f", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "apr_id": "0f7da7b40a71f31be90c93628fa03125", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8975903614457831, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import sys\nn, a = map(int, input().split())\nt = [0]\nt += [int(x) for x in input().split()]\ncrim = t[a]\nfor i in range(1,n+1)\n if (a-i<1) and (a+i>n):\n break\n if a-i<1:\n if t[a+i]==1:\n crim += 1\n\t\telif a+i>n:\n\t\t if t[a-i]==1:\n\t\t\t crim += 1\n\t\telif t[a-i]*t[a+i]==1:\n\t\t\tcrim +=2\nprint(crim)", "lang": "Python 3", "bug_code_uid": "543e2b77a019e12d147eaa09caf813b8", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "c14c51f2ac9697eac379c53543db6c6d", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5172413793103449, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "n = int(input())\ncount = 0\nfor i in range(1, n + 1):\n if n // i > 1:\n count += 1\n elif n // i == 1:\n count += 1\n break\n else:\n break\n\nprint(count)\n", "lang": "Python 3", "bug_code_uid": "91bfb6fc05fa6aa854645afe1369350b", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "bcabc1b1e338446ebd40ce32758000e6", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9273182957393483, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "#http://codeforces.com/contest/964/problem/A\n\nN = int(raw_input())\n\nif N == 1:\n\tprint(1)\nelse:\n\tanswer = 2\n\tfor i in xrange(2, N):\n\t\tif N/i >= 2:\n\t\t\tanswer += 1\n\t\telse:\n\t\t\tbreak\n\tprint(answer)\n", "lang": "Python 2", "bug_code_uid": "80e176a5b361808bc40fb517e6099d5d", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "ce52e419654c8311d706f74add102815", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2826086956521739, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a = int(input())\nb = input().split()\na = [int(x) for x in b]\nprint a", "lang": "Python 3", "bug_code_uid": "882410b15e2fc7c0ae5887bab24cfeb4", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "e9d76eb8ef172d12fa6f66f15ed63f7e", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9854368932038835, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a, b = map(int, input().split())\nif a == 0 || b == 0:\n if a + b == 1:\n print (\"YES\")\n else:\n print (\"NO\")\nelse:\n if abs(a-b) <= 2:\n print (\"YES\")\n else:\n print (\"NO\")", "lang": "Python 3", "bug_code_uid": "d695d62ee024e0cc3587065a7ee09d55", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "7369593159463f1290701bbccd09b2ff", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8708333333333333, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "import sys\n# a simple parser for python. use get_number() and get_word() to read\ndef parser():\n while 1:\n data = list(input().split(' '))\n for number in data:\n if len(number) > 0:\n yield(number) \n\ninput_parser = parser()\n\ndef get_word():\n global input_parser\n return next(input_parser)\n\ndef get_number():\n data = get_word()\n try:\n return int(data)\n except ValueError:\n return float(data)\n\ndef done(x,y):\n print(\"%d %d\"%(x,y))\n sys.exit(0)\n\ndef die():\n print(-1)\n sys.exit(0)\n\ndef ext_gcd(a,b):\n if b != 0:\n tmp = ext_gcd(b,a%b)\n return [tmp[1], tmp[0] - (a//b)*tmp[1]]\n return [1,0]\n\ndef gcd(a,b):\n if b == 0:\n return a\n return gcd(b,a%b)\n\nn = get_number()\nm = get_number()\nx = get_number()\ny = get_number()\nvx = get_number()\nvy = get_number()\n\nif vx == 0 :\n if x != 0 and x != n :\n die()\n if x == 0:\n if vy > 0:\n done(0,m)\n else:\n done(0,0)\n if x == n:\n if vy > 0:\n done(n,m)\n else:\n done(n,0)\n\nif vy == 0 :\n if y != 0 and y != m:\n die()\n if y == 0:\n if vx > 0:\n done(n,0)\n else:\n done(0,0)\n if y == m:\n if vx > 0:\n done(n,m)\n else:\n done(0,m)\n\ng = gcd(vy*n,vx*m)\n\nif (vy*x-vx*y)%g != 0:\n die()\n\na = vy*n//g\nb = vx*m//g\nt = (vy*x-vx*y)//g\nres = ext_gcd(a,-b)\nif res[0]*a + res[1]*(-b) == -1:\n res[0] = -res[0]\n res[1] = -res[1]\n\nalpha = res[0]*t\nbeta = res[1]*t\nk = b//gcd(a,b)\nT = (n*alpha-x)//vx\n\nwhile T<0:\n val = 0\n if vx*k > 0:\n val = 1\n else:\n val = -1\n alpha = alpha + val*k\n T = (n*alpha-x)//vx\n\nval = 0\nif vx*k > 0 :\n val = -1\nelse :\n val = 1\n \nhigh = 98765432198765432198765432199\nlow = 0\nans = 0\nwhile high >= low:\n mid = (high+low)//2\n nalpha = alpha + mid*val*k\n nT = (n*nalpha-x)//vx\n if nT >= 0:\n ans = mid\n low = mid+1\n else:\n high = mid-1\n\nalpha = alpha + ans*val*k\nT = (n*alpha-x)//vx\n\n\nX = x + vx*T\nY = y + vy*T\nT = t + vy*T\nif (X//n)%2 == 0 and (Y//m)%2 == 0 :\n done(0,0)\nelif (X//n)%2 == 0:\n done(0,m)\nelif (Y//m)%2 == 0:\n done(n,0)\nelse:\n done(n,m)\n \n \n \n \n \n \n \n", "lang": "Python 3", "bug_code_uid": "b2bf3f1b0eaefeddafad22029237a6f0", "src_uid": "6c4ddc688c5aab1432e7328d27c4d8ee", "apr_id": "a1758854441985ac9622e6121ab9ffde", "difficulty": 2600, "tags": ["geometry", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9967320261437909, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\ndef exgcd(a, b):\n if b == 0: return (a, 1, 0)\n g, y, x = exgcd(b, a%b)\n return (g, x, y-x*(a//b))\n\ndef crt(a1, m1, a2, m2):\n g = exgcd(m1, m2)[0]\n \n e1, e2 = a1%g, a2%g\n if e1 != e2: return None\n\n a1 //= g \n m1 //= g \n a2 //= g\n m2 //= g\n\n (_, m1i, m2i) = exgcd(m1, m2)\n\n ans = a1*m2*m2i + a2*m1*m1i\n \n ans = ans%(m1*m2)\n if ans < 0: ans += m1*m2\n\n return ans*g + e1\n\n\ndef solve(N, M, x, y, vx, vy):\n if vx == 0:\n if x == 0 or x == N: return (x, 0)\n else: return None\n if vy == 0:\n if y == 0 or y == M: return (y, 0)\n else: return None\n \n ans = crt(x, N, y, M)\n #print(ans)\n if ans is None: return ans\n\n xhit, yhit = (ans+N-1) // N, (ans+M-1) // M\n if x == 0: xhit -= 1\n if y == 0: yhit -= 1\n #print(xhit, yhit)\n\n return (N if xhit%2 == 0 else 0, M if yhit%2 == 0 else 0)\n\ndef main():\n N, M, x, y, vx, vy = map(int, input().split())\n\n swapx, swapy = False, False\n\n if vx > 0:\n swapx = True\n x = N-x\n \n if vy > 0:\n swapy = True\n y = M-y\n \n ans = solve(N, M, x, y, vx, vy)\n if ans is None: print(-1)\n else:\n ax, ay = ans\n if swapx: ax = N-ax\n if swapy: ay = M-ay \n print(ax, ay)\n\n\nif __name__ == '__main__':\n main()", "lang": "Python 3", "bug_code_uid": "ae318fa9ed75fe4d8111b446821ce642", "src_uid": "6c4ddc688c5aab1432e7328d27c4d8ee", "apr_id": "1641d1f7b09e6c3302e34e1802adea61", "difficulty": 2600, "tags": ["geometry", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5644768856447688, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "MOD = 1000000007\nn,m,k = map(int,input().split())\nif (n+m)%2 and k==-1:\n print(0)\nelse:\n n,m = n-1,m-1\n print((2**(n*m))%MOD)\n", "lang": "PyPy 3", "bug_code_uid": "f8d7d55a0d11887a12be316e31bea8ad", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "3060530b4ef7710549168c99a022f698", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6666666666666666, "equal_cnt": 25, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 9, "fix_ops_cnt": 25, "bug_source_code": "y,r,b=input().split(' ')\ny=int(y)\nr=int(r)\nb=int(b)\nif (y 1:\n if self.get_height(n.left.left) < self.get_height(n.left.right):\n self._rotate_left(n.left)\n self._rotate_right(n)\n elif balance_factor < -1:\n if self.get_height(n.right.right) < self.get_height(n.right.left):\n self._rotate_right(n.right)\n self._rotate_left(n)\n else:\n n = n.parent\n\n def _remove_one(self, node):\n \"\"\"\n Side effect!!! Changes node. Node should have exactly one child\n \"\"\"\n replacement = node.left or node.right\n if node.parent:\n if AvlTree._is_left(node):\n node.parent.left = replacement\n else:\n node.parent.right = replacement\n replacement.parent = node.parent\n node.parent = None\n else:\n self._tree = replacement\n replacement.parent = None\n node.left = None\n node.right = None\n node.parent = None\n self._rebalance(replacement)\n\n def _remove_leaf(self, node):\n if node.parent:\n if AvlTree._is_left(node):\n node.parent.left = None\n else:\n node.parent.right = None\n self._rebalance(node.parent)\n else:\n self._tree = None\n node.parent = None\n node.left = None\n node.right = None\n\n def remove(self, k):\n node = self._get_node(k)\n if not node:\n return\n if AvlTree._is_leaf(node):\n self._remove_leaf(node)\n return\n if node.left and node.right:\n nxt = AvlTree._get_next(node)\n node.key = nxt.key\n node.value = nxt.value\n if self._is_leaf(nxt):\n self._remove_leaf(nxt)\n else:\n self._remove_one(nxt)\n self._rebalance(node)\n else:\n self._remove_one(node)\n\n def get(self, k):\n node = self._get_node(k)\n return node.value if node else -1\n\n def _get_node(self, k):\n if not self._tree:\n return None\n node = self._tree\n while node:\n if k < node.key:\n node = node.left\n elif node.key < k:\n node = node.right\n else:\n return node\n return None\n\n def get_at(self, pos):\n x = pos + 1\n node = self._tree\n while node:\n if x < node.num_left:\n node = node.left\n elif node.num_left < x:\n x -= node.num_left\n node = node.right\n else:\n return (node.key, node.value)\n raise IndexError(\"Out of ranges\")\n\n @staticmethod\n def _is_left(node):\n return node.parent.left and node.parent.left == node\n\n @staticmethod\n def _is_leaf(node):\n return node.left is None and node.right is None\n\n def _rotate_right(self, node):\n if not node.parent:\n self._tree = node.left\n node.left.parent = None\n elif AvlTree._is_left(node):\n node.parent.left = node.left\n node.left.parent = node.parent\n else:\n node.parent.right = node.left\n node.left.parent = node.parent\n bk = node.left.right\n node.left.right = node\n node.parent = node.left\n node.left = bk\n if bk:\n bk.parent = node\n node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1\n node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)\n node.num_left = 1 + self.get_num_total(node.left)\n\n def _rotate_left(self, node):\n if not node.parent:\n self._tree = node.right\n node.right.parent = None\n elif AvlTree._is_left(node):\n node.parent.left = node.right\n node.right.parent = node.parent\n else:\n node.parent.right = node.right\n node.right.parent = node.parent\n bk = node.right.left\n node.right.left = node\n node.parent = node.right\n node.right = bk\n if bk:\n bk.parent = node\n node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1\n node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)\n node.num_left = 1 + self.get_num_total(node.left)\n\n @staticmethod\n def _get_next(node):\n if not node.right:\n return node.parent\n n = node.right\n while n.left:\n n = n.left\n return n\n\n\n# -----------------------------------------------binary seacrh tree---------------------------------------\nclass SegmentTree1:\n def __init__(self, data, default=0, func=lambda a, b: max(a, b)):\n \"\"\"initialize the segment tree with data\"\"\"\n self._default = default\n self._func = func\n self._len = len(data)\n self._size = _size = 1 << (self._len - 1).bit_length()\n\n self.data = [default] * (2 * _size)\n self.data[_size:_size + self._len] = data\n for i in reversed(range(_size)):\n self.data[i] = func(self.data[i + i], self.data[i + i + 1])\n\n def __delitem__(self, idx):\n self[idx] = self._default\n\n def __getitem__(self, idx):\n return self.data[idx + self._size]\n\n def __setitem__(self, idx, value):\n idx += self._size\n self.data[idx] = value\n idx >>= 1\n while idx:\n self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])\n idx >>= 1\n\n def __len__(self):\n return self._len\n\n def query(self, start, stop):\n if start == stop:\n return self.__getitem__(start)\n stop += 1\n start += self._size\n stop += self._size\n\n res = self._default\n while start < stop:\n if start & 1:\n res = self._func(res, self.data[start])\n start += 1\n if stop & 1:\n stop -= 1\n res = self._func(res, self.data[stop])\n start >>= 1\n stop >>= 1\n return res\n\n def __repr__(self):\n return \"SegmentTree({0})\".format(self.data)\n\n\n# -------------------game starts now----------------------------------------------------import math\nclass SegmentTree:\n def __init__(self, data, default=0, func=lambda a, b: a + b):\n \"\"\"initialize the segment tree with data\"\"\"\n self._default = default\n self._func = func\n self._len = len(data)\n self._size = _size = 1 << (self._len - 1).bit_length()\n\n self.data = [default] * (2 * _size)\n self.data[_size:_size + self._len] = data\n for i in reversed(range(_size)):\n self.data[i] = func(self.data[i + i], self.data[i + i + 1])\n\n def __delitem__(self, idx):\n self[idx] = self._default\n\n def __getitem__(self, idx):\n return self.data[idx + self._size]\n\n def __setitem__(self, idx, value):\n idx += self._size\n self.data[idx] = value\n idx >>= 1\n while idx:\n self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])\n idx >>= 1\n\n def __len__(self):\n return self._len\n\n def query(self, start, stop):\n if start == stop:\n return self.__getitem__(start)\n stop += 1\n start += self._size\n stop += self._size\n\n res = self._default\n while start < stop:\n if start & 1:\n res = self._func(res, self.data[start])\n start += 1\n if stop & 1:\n stop -= 1\n res = self._func(res, self.data[stop])\n start >>= 1\n stop >>= 1\n return res\n\n def __repr__(self):\n return \"SegmentTree({0})\".format(self.data)\n\n\n# -------------------------------iye ha chutiya zindegi-------------------------------------\nclass Factorial:\n def __init__(self, MOD):\n self.MOD = MOD\n self.factorials = [1, 1]\n self.invModulos = [0, 1]\n self.invFactorial_ = [1, 1]\n\n def calc(self, n):\n if n <= -1:\n print(\"Invalid argument to calculate n!\")\n print(\"n must be non-negative value. But the argument was \" + str(n))\n exit()\n if n < len(self.factorials):\n return self.factorials[n]\n nextArr = [0] * (n + 1 - len(self.factorials))\n initialI = len(self.factorials)\n prev = self.factorials[-1]\n m = self.MOD\n for i in range(initialI, n + 1):\n prev = nextArr[i - initialI] = prev * i % m\n self.factorials += nextArr\n return self.factorials[n]\n\n def inv(self, n):\n if n <= -1:\n print(\"Invalid argument to calculate n^(-1)\")\n print(\"n must be non-negative value. But the argument was \" + str(n))\n exit()\n p = self.MOD\n pi = n % p\n if pi < len(self.invModulos):\n return self.invModulos[pi]\n nextArr = [0] * (n + 1 - len(self.invModulos))\n initialI = len(self.invModulos)\n for i in range(initialI, min(p, n + 1)):\n next = -self.invModulos[p % i] * (p // i) % p\n self.invModulos.append(next)\n return self.invModulos[pi]\n\n def invFactorial(self, n):\n if n <= -1:\n print(\"Invalid argument to calculate (n^(-1))!\")\n print(\"n must be non-negative value. But the argument was \" + str(n))\n exit()\n if n < len(self.invFactorial_):\n return self.invFactorial_[n]\n self.inv(n) # To make sure already calculated n^-1\n nextArr = [0] * (n + 1 - len(self.invFactorial_))\n initialI = len(self.invFactorial_)\n prev = self.invFactorial_[-1]\n p = self.MOD\n for i in range(initialI, n + 1):\n prev = nextArr[i - initialI] = (prev * self.invModulos[i % p]) % p\n self.invFactorial_ += nextArr\n return self.invFactorial_[n]\n\n\nclass Combination:\n def __init__(self, MOD):\n self.MOD = MOD\n self.factorial = Factorial(MOD)\n\n def ncr(self, n, k):\n if k < 0 or n < k:\n return 0\n k = min(k, n - k)\n f = self.factorial\n return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD\n\n\n# --------------------------------------iye ha combinations ka zindegi---------------------------------\ndef powm(a, n, m):\n if a == 1 or n == 0:\n return 1\n if n % 2 == 0:\n s = powm(a, n // 2, m)\n return s * s % m\n else:\n return a * powm(a, n - 1, m) % m\n\n\n# --------------------------------------iye ha power ka zindegi---------------------------------\ndef sort_list(list1, list2):\n zipped_pairs = zip(list2, list1)\n\n z = [x for _, x in sorted(zipped_pairs)]\n\n return z\n\n\n# --------------------------------------------------product----------------------------------------\ndef product(l):\n por = 1\n for i in range(len(l)):\n por *= l[i]\n return por\n\n\n# --------------------------------------------------binary----------------------------------------\ndef binarySearchCount(arr, n, key):\n left = 0\n right = n - 1\n\n count = 0\n\n while (left <= right):\n mid = int((right + left) / 2)\n\n # Check if middle element is\n # less than or equal to key\n if (arr[mid] < key):\n count = mid + 1\n left = mid + 1\n\n # If key is smaller, ignore right half\n else:\n right = mid - 1\n\n return count\n\n\n# --------------------------------------------------binary----------------------------------------\ndef countdig(n):\n c = 0\n while (n > 0):\n n //= 10\n c += 1\n return c\ndef binary(x, length):\n y = bin(x)[2:]\n return y if len(y) >= length else \"0\" * (length - len(y)) + y\n\ndef countGreater(arr, n, k):\n l = 0\n r = n - 1\n\n # Stores the index of the left most element\n # from the array which is greater than k\n leftGreater = n\n\n # Finds number of elements greater than k\n while (l <= r):\n m = int(l + (r - l) / 2)\n if (arr[m] >= k):\n leftGreater = m\n r = m - 1\n\n # If mid element is less than\n # or equal to k update l\n else:\n l = m + 1\n\n # Return the count of elements\n # greater than k\n return (n - leftGreater)\n\n\n# --------------------------------------------------binary------------------------------------\nn,k=map(int,input().split())\nl=[]\nse=set()\nfor i in range(k):\n a,b,c=map(int,input().split())\n l.append((a,b,c,i))\n se.add(b)\nl.sort()\nstack=[]\nt=0\nans=[0]*n\nfor i in range(n):\n if t 1:\n factors.add(n)\nresult = 1\nfor x in factors:\n result *= x\nprint(result)", "lang": "Python 3", "bug_code_uid": "fcbb4c86a6172756417cc73bb02322ef", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "8dfe3bd0e589f11668bfb05d3884f668", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7707006369426752, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "a = int(input())\nif a==2||a==3||a==5||a==46||a==4||a==12||a==31||a==30||a==35||a==43||a==52||a==64||a==86:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "0f3ab68e276ac943943f74a1574d4885", "src_uid": "821529a4644b74483bcdf80fc318d1f8", "apr_id": "43fbc99be0e9609478c731e01df6c300", "difficulty": null, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9923076923076923, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = map(int, raw_input().split());\nprint max(i + (a[0]-i)/3 + (a[1]-i)/3 + (a[2]-i)/3 for i in range(max(0, min(a)-2, min(a)+1)));", "lang": "Python 2", "bug_code_uid": "20c4c1524a71cd5ea9c8aac0f4b9c3bf", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "b3142a1fd39132ce5fbabf502754d438", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7601547388781431, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "from itertools import permutations\n\nn, k = list(map(int, input().split(\" \")))\n\npermutacoes = []\n\nfor i in range(n):\n x = list(input())\n permuts = [''.join(x) for x in list(permutations(x))]\n permuts = list(map(int, permuts)) \n permutacoes.append(permuts)\n\nmenor_dif = 100000\n\nfor i in range(len(permutacoes[0])):\n menor = 100000\n maior = 0\n for j in range(n):\n aux = permutacoes[j][i]\n if aux > maior: maior = aux\n if aux < menor: menor = aux\n dif = maior - menor\n if dif < menor_dif: menor_dif = dif\n\nprint(menor_dif)\n\n", "lang": "Python 3", "bug_code_uid": "6fcef0732261453a2a41e630567eef68", "src_uid": "08f85cd4ffbd135f0b630235209273a4", "apr_id": "1dc45cf856eee48e80ef0d4f42790ae6", "difficulty": 1400, "tags": ["brute force", "combinatorics", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9700374531835206, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from __future__ import print_function, division\nfrom sys import stdin, stdout\nfrom fractions import gcd\n# from math import *\nfrom collections import *\nfrom operator import mul\nfrom functools import reduce\nfrom copy import copy\n\nrstr = lambda: stdin.readline().strip()\nrstrs = lambda: [str(x) for x in stdin.readline().split()]\nrint = lambda: int(stdin.readline())\nrints = lambda: [int(x) for x in stdin.readline().split()]\nrstr_2d = lambda n: [rstr() for _ in range(n)]\nrint_2d = lambda n: [rint() for _ in range(n)]\nrints_2d = lambda n: [rints() for _ in range(n)]\npr = lambda args, sep: stdout.write(sep.join(map(str, args)) + '\\n')\nout = []\n\nn = int(input())\na = rint_2d(n)\nmi = min(a)\n\nif mi in a[:2]:\n print(mi * (n - 1))\nelse:\n print(min(a[0], a[1]) + (n - 2) * mi)\n", "lang": "PyPy 2", "bug_code_uid": "4fad6cc21f3482eba933e2a0e330f3c8", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "821e9fd8faf7e6c5b67bedce61dbd88c", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.555205047318612, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "n, k = map(int, input().strip().split())\nansw = 0\nflag = False\nif k == 0 or n == k:\n print(0, 0)\nelse:\n for i in range(1, n, 3):\n k -= 1\n if i + 1 <= n - 1:\n answ += 2\n elif i == n - 1:\n answ += 1\n if k == 0:\n break\n if i == n - 3:\n flag = True\n if k == 0:\n print(1, answ)\n elif flag:\n print(1, answ - k + 1)\n else:\n print(1, answ - k)", "lang": "Python 3", "bug_code_uid": "4c4de54ebdfc2687902e8f20ba5a1a29", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "82e5616fbfbf284df6c6189f2eb7356c", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9234828496042217, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n=int(input())\nch=input()\nl=[\"a\",\"e\",\"u\",\"i\",\"o\",\"y\"]\ni=0\nwhile(i 0:\n if (b >= x):\n factor = min(int((b - x)/x)+1,dif)\n dif = dif-factor\n b = b - x*factor\n else:\n factor = int( (x-b-1)/(w-x) )+1\n b = factor*(w-x)+b\n count = count+factor\n\nprint(count+(c-a))\n", "lang": "Python 3", "bug_code_uid": "9952c82c8cfa92df5aac4ebd6e5a4308", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "04675aefd8feaf3ffcacf3cccc4dd598", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9201970443349754, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "import sys\n\n#sys.stdin = open(\"input.txt\")\n\na, b, w, x, c = [long(x) for x in raw_input().split()]\n\n\nt = c - a\nhash = {}\n\nif t <= 0:\n print 0\nelse:\n cur_t = 0\n\n while 0 < t:\n #print cur_t\n if b >= x:\n if x <= 0:\n print t\n sys.exit()\n else:\n\n cur_t += b/x\n t -= b/x\n b -= (b/x)*x\n else:\n if (w-x) <= 0:\n print cur_t + (t-cur_t)/2\n sys.exit()\n else:\n delt = max((x-b)/(w-x),1)\n b += (w-x)*delt\n #t += delt\n cur_t += delt\n #if t >0:\n # if b in hash:\n # del_t = t - hash[b][1]\n # del_step = cur_t - hash[b][0]\n # times = t / -del_t\n # cur_t += del_step*times\n # t += del_t * times\n # else:\n # hash[b] = [cur_t, t]\n\n print cur_t + t", "lang": "Python 2", "bug_code_uid": "a7b139a5a9ac857a693bca205bec19a0", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "3d514b15e3f37bc37186649795a663d4", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2876949740034662, "equal_cnt": 22, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 11, "fix_ops_cnt": 23, "bug_source_code": "def search(a,n,k):\n l=0\n h=n\n while l<=h:\n mid=(l+h)//2\n if n-mid==a[mid]-k:\n return n-mid\n elif n-mid>a[mid]-k:\n l=mid+1\n else:\n h=mid-1\n return 0\nif __name__ == \"__main__\":\n n,k=map(int,input().split())\n a=[]\n sum=0\n for i in range(n+1):\n sum=sum+i\n a.append(sum)\n c=search(a,n,k)\n print(c)", "lang": "Python 3", "bug_code_uid": "789972b5c8ed0c7d27bfe8764094ca03", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "2aabdbe990c60796a2d42ab01419bf32", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8389798248953179, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 20, "bug_source_code": "def checkr(i,j):\n flag=0\n cnt=0\n \n try:\n for temp in xrange(i,i+5):\n if mat[temp][j]==\"X\":\n cnt+=1\n elif mat[temp][j]==\".\" and flag==0:\n flag=1\n cnt+=1\n else:\n break\n if cnt==5:\n return True\n elif cnt==4 and mat[i-1][j]==\".\" and flag==0:\n return True\n except:\n if cnt==4 and mat[i-1][j]==\".\" and flag==0:\n return True\n return False\n\ndef checkc(i,j):\n flag=0\n cnt=0\n \n try:\n for temp in xrange(j,j+5):\n if mat[i][temp]==\"X\":\n cnt+=1\n elif mat[i][temp]==\".\" and flag==0:\n flag=1\n cnt+=1\n else:\n break\n if cnt==5:\n return True\n elif cnt==4 and mat[i][j-1]==\".\" and flag==0:\n return True\n except:\n if cnt==4 and mat[i][j-1]==\".\" and flag==0:\n return True\n return False\n\ndef checkd(i,j):\n flag=0\n cnt=0\n \n try:\n for temp in xrange(5):\n if mat[i+temp][j+temp]==\"X\":\n # print i+temp,j+temp\n cnt+=1\n elif mat[i+temp][j+temp]==\".\" and flag==0:\n # print i+temp,j+temp\n flag=1\n cnt+=1\n else:\n break\n if cnt==5:\n return True\n elif cnt==4 and mat[i-1][j-1]==\".\" and flag==0:\n return True\n except:\n if cnt==4 and mat[i-1][j-1]==\".\" and flag==0:\n return True\n \n return False\n\n\ndef checkdr(i,j):\n flag=0\n cnt=0\n \n try:\n for temp in xrange(5):\n if mat[i+temp][j-temp]==\"X\":\n # print i+temp,j+temp\n cnt+=1\n elif mat[i+temp][j-temp]==\".\" and flag==0:\n # print i+temp,j+temp\n flag=1\n cnt+=1\n else:\n break\n if cnt==5:\n return True\n elif cnt==4 and mat[i-1][j+1]==\".\" and flag==0:\n return True\n except:\n if cnt==4 and mat[i-1][j+1]==\".\" and flag==0:\n return True\n \n return False\n\n \nmat=[]\nfor i in xrange(10):\n temp = raw_input()\n mat.append(temp)\n\nposs=False\n\nfor i in xrange(10):\n for j in xrange(10):\n if mat[i][j]=='X':\n poss = checkr(i,j) or checkc(i,j) or checkd(i,j) or checkdr(i,j)\n if poss:\n print 'YES'\n exit()\nprint 'NO'\n", "lang": "PyPy 2", "bug_code_uid": "480a0ffe06effa463b60a82cbeb9d2a2", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "apr_id": "615ae7f3f83022ea7cb7c14e83b09eaf", "difficulty": 1600, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7955314827352742, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "grid = []\nfor i in range(10):\n grid.append(list(raw_input()))\nf = 0\nfor i in range(10):\n for j in range(10):\n if grid[i][j]=='.':\n grid[i][j] = 'X'\n for k in range(10):\n cnt = 0\n for l in range(10):\n if grid[k][l:l+5].count('X')==5:\n f = 1\n if grid[l][k]=='X':\n cnt += 1\n else:\n cnt = 0\n if cnt==5:\n f = 1\n for k in range(10):\n cnt = 0\n for l in range(10-k):\n if cnt[k-l][l]=='X':\n cnt += 1\n else:\n cnt = 0\n if cnt==5:\n f = 1\n for k in range(10):\n cnt = 0\n for l in range(10-k):\n if cnt[k+l][l]=='X':\n cnt += 1\n else:\n cnt = 0\n if cnt==5:\n f = 1\n grid[i][j] = 'X'\nif f:\n print \"YES\"\nelse:\n print \"NO\"", "lang": "PyPy 2", "bug_code_uid": "744329321d7fd922581939a27aa3dfbc", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "apr_id": "26d0182b738993040511cc2e206abdd5", "difficulty": 1600, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9711198062232159, "equal_cnt": 17, "replace_cnt": 17, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 17, "bug_source_code": "def rotate90(dim, arr):\n new = []\n for col in xrange(dim):\n new_row = ''\n for row in xrange(dim-1, -1, -1):\n new_row += arr[row][col]\n new.append(new_row)\n return new \n \ndef vertical_flip(dim, arr):\n new = []\n for row in xrange(dim):\n new.append(arr[row][::-1])\n return new\n\ndef horizontal_flip(dim, arr):\n new = []\n for row in xrange(dim-1, -1, -1):\n new.append(arr[row])\n return new\n\ndef check(dim, arr1, arr2):\n for row in xrange(dim):\n if arr1[row] != arr2[row]:\n return False\n return True\n \nn = input()\nmap1 = []\nfor ni in xrange(n):\n map1.append(raw_input().strip())\nmap2 = []\nfor nii in xrange(n):\n map2.append(raw_input().strip())\nok = False\nif check(n, map1, map2) == True:\n ok = True\n print True\nmap1_v = vertical_flip(n, map1)\nif ok == False and check(n, map1_v, map2) == True:\n ok = True\n print True\nmap1_h = horizontal_flip(n, map1)\nif ok == False and check(n, map1_h, map2) == True:\n ok = True\n print True\nmap1_vh = horizontal_flip(n, map1_v)\nif ok == False and check(n, map1_vh, map2) == True:\n ok = True\n print True\nmap1_90 = rotate90(n, map1)\nif ok == False and check(n, map1_90, map2) == True:\n ok = True\n print True\nmap1_90_v = vertical_flip(n, map1_90)\nif ok == False and check(n, map1_90_v, map2) == True:\n ok = True\n print True\nmap1_90_h = horizontal_flip(n, map1_90)\nif ok == False and check(n, map1_90_h, map2) == True:\n ok = True\n print True\nmap1_90_vh = horizontal_flip(n, map1_90_v)\nif ok == False and check(n, map1_90_vh, map2) == True:\n ok = True\n print True\nmap1_180 = rotate90(n, map1_90)\nif ok == False and check(n, map1_180, map2) == True:\n ok = True\n print True\nmap1_180_v = vertical_flip(n, map1_180)\nif ok == False and check(n, map1_180_v, map2) == True:\n ok = True\n print True\nmap1_180_h = horizontal_flip(n, map1_180)\nif ok == False and check(n, map1_180_h, map2) == True:\n ok = True\n print True\nmap1_180_vh = horizontal_flip(n, map1_180_v)\nif ok == False and check(n, map1_180_vh, map2) == True:\n ok = True\n print True \nmap1_270 = rotate90(n, map1_180)\nif ok == False and check(n, map1_270, map2) == True:\n ok = True\n print True\nmap1_270_v = vertical_flip(n, map1_270)\nif ok == False and check(n, map1_270_v, map2) == True:\n ok = True\n print True\nmap1_270_h = horizontal_flip(n, map1_270)\nif ok == False and check(n, map1_270_h, map2) == True:\n ok = True\n print True\nmap1_270_vh = horizontal_flip(n, map1_270_v)\nif ok == False and check(n, map1_270_vh, map2) == True:\n ok = True\n print True \nif ok == False:\n print False ", "lang": "Python 2", "bug_code_uid": "ec8194ce505d7b46e634302456798d0d", "src_uid": "2e793c9f476d03e8ba7df262db1c06e4", "apr_id": "4e19e6fd7aae88fd13f8b65659b95c32", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9956999522216914, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def rotate(a,d):\n\t# 90 180 270\n\tif d==0:\n\t\treturn a\n\tret = [[0 for x in range(n)] for y in range(n)] \n\n\tfor i in range(n):\n\t\tfor j in range(n):\n\t\t\tret[n-1-j][i]=a[i][j]\n\td -= 90\n\treturn rotate(ret,d)\n\n\ndef flip(a,v):\n\tret = [[0 for x in range(n)] for y in range(n)] \n\tif v:\n\t\tfor i in range(n):\n\t\t\tfor j in range(n):\n\t\t\t\tret[n-i-1][j] = a[i][j]\n\telse:\n\t\tfor i in range(n):\n\t\t\tfor j in range(n):\n\t\t\t\tret[i][n-j-1] = a[i][j]\n\treturn ret\n\nn=int(raw_input())\na=[]\nb=[]\n\n# print range(0,n)\n\nfor i in range(0,n):\n\ta.append(raw_input())\nfor i in range(0,n):\n\tb.append(raw_input())\nay = [[0 for x in range(n)] for y in range(n)]\nfor i in range(n):\n\tfor j in range(n):\n\t\tay[i][j] = a[i][j]\na = ay\n\n\nby = [[0 for x in range(n)] for y in range(n)]\n\nfor i in range(n):\n\tfor j in range(n):\n\t\tby[i][j] = b[i][j]\nb = by\n\n# print 'a=',a,'b=',b\n\nphase = [rotate(a,360),rotate(a,90),rotate(a,180),rotate(a,270)]\np = []\nfor item in phase:\n\tp.append(item)\n\tp.append(flip(item,1))\n\tp.append(flip(item,0))\n\nif b in p:\n\tprint 'TRUE'\nelse:\n\tprint 'NO'\n\n# print a[1][2]\n\n\n", "lang": "Python 2", "bug_code_uid": "ea37e646220f49967fe583a3cb673281", "src_uid": "2e793c9f476d03e8ba7df262db1c06e4", "apr_id": "97e47cfdd03cb428c6e39bab484dbadf", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.46621621621621623, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "l, r, x, y, k = map(int, input().split())\n\nanswer = 'NO'\n\nfor b in range(x, y + 1, 1):\n if (b*k <= r and b*k >= l):\n answer = 'YES'\n\nprint(answer)", "lang": "Python 3", "bug_code_uid": "900f52ba960a795de53cb8336da9fce8", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "a7d369701956b60be188711b898eef7b", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7850467289719626, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\nif n < 4:\n print(1, n - 1)\nelif n % 2 = 0:\n print(n // 2 - 1, n // 2 + 1)\nelse:\n print(n // 2, n // 2 + 1)", "lang": "Python 3", "bug_code_uid": "628572962c8dbe45b520f2054aa703da", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "4c57dae9407f87a0033921099345cf8c", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5752212389380531, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\nif n%2 !=0:\n print(\"NO\")\nelse:\n tiquete=input()\n cuatros = tiquete.count(\"4\")\n sietes = tiquete.count(\"7\")\n if cuatros+sietes==n:\n mitad1 = tiquete[:int(len(tiquete)/2)]\n mitad2 = tiquete[int(len(tiquete)/2):(len(tiquete))]\n print(mitad1,mitad2)\n cuatros1 = mitad1.count(\"4\")\n sietes1 = mitad1.count(\"7\")\n cuatros2 = mitad2.count(\"4\")\n sietes2= mitad2.count(\"7\")\n if cuatros1==cuatros2 and \n sietes1==sietes2:\n print(\"SI\")\n else:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "e37b0180b215231af2656614e582d498", "src_uid": "435b6d48f99d90caab828049a2c9e2a7", "apr_id": "3e15ac982b8e385f9801e78954de05f4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.945273631840796, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "k = int(input())\na = list(map(int, input().split()))\n\ntemp = sorted(a, reverse=True)\nheight = i = 0\nwhile height < k and i < n:\n height += temp[i]\n i += 1\n\nif i = n:\n print(-1)\nelse:\n print(i)", "lang": "Python 3", "bug_code_uid": "6a650b9a4faf82c903bffffb9c4c0264", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "60443217973e9ada3ac6ffa5157d4390", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2857142857142857, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "l=[]\nj=1\nwhile len(l)<1000000001:\n for i in range(j):\n l.append(j)\n j+=1\nprint l[input()-1]\n", "lang": "PyPy 2", "bug_code_uid": "3414c35bee08f2d856182c1ade024b94", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "8b1d39fa9c00b65a9b077f0aa310de13", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3618421052631579, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\nres = 0\n\nif n < 5:\n res = 1\nelse:\n floor = 1\n maxCardForRooms = 2\n while maxCardForRooms < n:\n if (n - 2*floor)%3 == 0:\n res += 1\n floor += 1\n maxCardForRooms = 0\n for i in range(floor):\n maxCardForRooms += 2+3*i\n if maxCardForRooms == n :\n res += 1\n\nprint(res)\n", "lang": "Python 3", "bug_code_uid": "8df44347423eb07883b49e57e6252d22", "src_uid": "ab4f9cb3bb0df6389a4128e9ff1207de", "apr_id": "690b8a42fefaa7dd6ce8844eb65b71e5", "difficulty": 1700, "tags": ["math", "brute force", "greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.059900166389351084, "equal_cnt": 33, "replace_cnt": 15, "delete_cnt": 15, "insert_cnt": 4, "fix_ops_cnt": 34, "bug_source_code": "#pragma comment(linker,\"/STACK:100000000,100000000\")\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n\n/* Constants begin */\nconst long long inf = 1e18+7;\nconst long long mod = 1e9+7;\nconst double eps = 1e-9;\nconst double PI = 2*acos(0.0);\nconst double E = 2.71828;\n/* Constants end */\n\n/* Defines begin */\n#define pb push_back\n#define mp make_pair\n#define ll long long\n#define double long double\n#define F first\n#define S second\n#define all(a) (a).begin(), (a).end()\n#define forn(i,n) for (ll (i)=0;(i)<(ll)(n);(i)++)\n/* Defines end */\n\nll x[100005];\nll y[100005];\n\nint main(void) {\n #ifndef ONLINE_JUDGE\n freopen(\"input.txt\",\"rt\",stdin);\n freopen(\"output.txt\",\"wt\",stdout);\n #endif\n ll n;\n cin >> n;\n forn(i,n){\n cin >> x[i] >> y[i];\n }\n ll ans = 0;\n sort(x,x+n);\n sort(y,y+n);\n ll sx = 0;\n ll last = 0, L = 0;\n for(ll i=1;i a[5]:\n print(a[5] - a[4])\nelse:\n print(min(a[:len(a)-2])-a[4])\n", "lang": "PyPy 3", "bug_code_uid": "2bd7f4c7dfeef4e309311e66982fff3a", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "bc2339bf8553111707616cb98784be05", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9320388349514563, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a, b = map(int, input().split())\nprint((a + b) % 1024)", "lang": "Python 3", "bug_code_uid": "edc14e9a3df52644493d4dd09aed9e54", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "ebbd731d3905282a6bfb232d0c53e316", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.986335403726708, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def main():\n from sys import stdin, stdout\n dayNum={\"saturday\" : 0, \"sunday\" : 1, \"monday\" : 2, \"tuesday\" : 3, \"wednesday\" : 4, \"thursday\" : 5, \"friday\" : 6}\n day1, day2=tuple(stdin.read().split())\n day1=dayNum[day1]\n day2=dayNum[day2]\n stdout.write(\"YES\\n\" if (day1+28)%7==day2 or or (day1+30)%7 == day2 or (day1+31)%7 == day2 else \"NO\\n\")\n \nif __name__=='__main__':\n main()", "lang": "Python 3", "bug_code_uid": "8e87840a5a5778dd9422160482f975f8", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "58b6284b629e325c56c2304788191279", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3602962962962963, "equal_cnt": 29, "replace_cnt": 19, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 29, "bug_source_code": "import sys\nb = 'sabcdefgh'\na1,a2,a3,a4 = map(str,input().split())\nx1 = b.index(a1[0])-1\ny1 = int(a1[1]) -1\nx2 = b.index(a2[0])-1\ny2 = int(a2[1]) -1\nx3 = b.index(a3[0])-1\ny3 = int(a3[1]) -1\nx4 = b.index(a4[0])-1\ny4 = int(a4[1]) -1\nc = []\nfor i in range(8):\n c.append([0]*8)\nfor i in range(8):\n if c[x1][i] != 1:\n c[x1][i] = 1\n else:\n break\nfor i in range(8):\n if c[x2][i] != 1:\n c[x2][i] = 1\n else:\n break\nfor i in range(8):\n if c[i][y1] != 1:\n c[i][y1] = 1\n else:\n break \nfor i in range(8):\n if c[i][y2] != 1:\n c[i][y2] = 1\n else:\n break\nc[x1][y1] = 0\nc[x2][y2] = 0 \nfor i in range(-1,2):\n for j in range(-1,2):\n if x3 + i> -1 and x3+ i < 8 and y3+j > -1 and y3+j < 8:\n c[x3 + i][y3 + j] = 1\n\nfor i in range(-1,2):\n for j in range(-1,2):\n if x4 + i> -1 and x4+ i < 8 and y4+j > -1 and y4+j <8 :\n if c[x4 + i][y4 + j] == 0:\n print(\"OTHER\")\n sys.exit()\nprint(\"CHECKMATE\")\n \n", "lang": "Python 3", "bug_code_uid": "39230d34c3e78b307b5b3653585ca63b", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "476d7470e1fad6820ae6a6462fb8fc95", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.751622418879056, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "r1, r2, wk, bk = map (lambda x: [int (ord (x[0]) - ord ('a') + 1) - 1, int (x[1]) - 1], raw_input ().split ())\nfield = [[0 for j in xrange (8)] for i in xrange (8)] \nmoves = ((0, 0), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1))\nvalid = lambda x, y: 0 <= x[0] + y[0] < 8 and 0 <= x[1] + y[1] < 8 \nf = lambda r, i, tf: ((i - wk[tf]) * (r[tf] - wk[tf]) > 0 and wk[tf ^ 1] == r[tf ^ 1] or wk[tf ^ 1] != r[tf ^ 1]) and r[tf] != i\nfor i in xrange (8):\n field[r1[0]][i], field[i][r1[1]], field[r2[0]][i], field[i][r2[1]] = f (r1, i, 0), f (r1, i, 1), f (r2, i, 0), f (r2, i, 1)\nfor mv in moves:\n if valid (wk, mv):\n field[wk[0] + mv[0]][wk[1] + mv[1]] = 1\nprint 'CHECKMATE' if all ([field[mv[0] + bk[0]][mv[1] + bk[1]] for mv in moves if valid(bk, mv)]) else 'OTHER'\n \n\n \n", "lang": "Python 2", "bug_code_uid": "a759ced2dfe7454d26d27b1c1cce4a65", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "c6582abaf8cc87630de49a5b64e90164", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4645161290322581, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n, m = map(int, input().split())\nost = [0] * m\nfor i in range(1, n + 1):\n d = i % m\n ost[d ** 2 % m] += 1\ns = ost[0] * (ost[0] - 1) // 2 + ost[0]\nfor i in range(1, m // 2):\n s += ost[i] * ost[m - i] * 2\nprint(s)\n", "lang": "PyPy 3", "bug_code_uid": "14572f6ad642ca96b3fe584a481da22a", "src_uid": "2ec9e7cddc634d7830575e14363a4657", "apr_id": "6b7e3d4071fb3eaf3c25f1c9811b4336", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1565217391304348, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "k=int(input())\ns='c'*k\ns+='odeforces'\nprint(s)\n", "lang": "PyPy 3", "bug_code_uid": "f59bb64b3a40d70f80a0a7be9db35b5c", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "d6706f7e1365a3f7a3aa7ee771d705b0", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.541978387364921, "equal_cnt": 19, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "import sys\nimport math as mt\ninput=sys.stdin.buffer.readline \n#t=int(input())\nt=1\nfor __ in range(t):\n #a,b,n=map(int,input().split())\n k=int(input())\n s='codeforces'\n cnt=1\n s1='s'\n k-=1\n while cnt*2=0: \n #print(s1) \n if k-cnt>0: \n s1+=s1[:k-cnt]\n #print(s1)\n if k>=1:\n s+=s1\n print(s)\n \n #n=int(input())\n #l=list(map(int,input().split()))\n \n ", "lang": "PyPy 3", "bug_code_uid": "404b42c6440d377e4407ce6884e63b87", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "197b0aad7d9035af6d866bc231d6dcdc", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3159722222222222, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "import sys\ninput=sys.stdin.readline\nk=int(input())\nif k<=100000000:\n print(\"codeforces\",end=\"\")\n k-=1\n for i in range(0,k):\n print('s',end=\"\")\n print()\nelse:\n k-=1\n st=['s']*100000000\n s=\"\".join(a for a in st)\n n=k%100000000\n ct=k//100000000\n for i in range(0,ct):\n print(s,end=\"\")\n for i in range(0,n):\n print('s',end=\"\")\n print() ", "lang": "PyPy 3", "bug_code_uid": "fe9306aa63457fcfd8cd590c7eff0441", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "194c12c4fbc526644173fb3c52b84aae", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2902208201892745, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "k = int(input())\ns = 'codeforces'\nif k == 1:\n\tprint(s)\nelse:\n\tprint(s + (k-1)*'s')", "lang": "PyPy 3", "bug_code_uid": "be17e10f5e98cde3a34de1dcb8a609d0", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "48cfabba65a36537c88d7f944ea80fa4", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6688610928242265, "equal_cnt": 11, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 12, "bug_source_code": "def gcd(xx,yy):\n x, y = sorted([xx,yy])\n while y != 0:\n r = x%y\n x = y \n y = r\n return x\n\ndef xgcd(aa, bb):\n \"\"\"return (g, x, y) such that a*x + b*y = g = gcd(a, b)\"\"\"\n x0, x1, y0, y1 = 0, 1, 1, 0\n while a != 0:\n q, bb, aa = bb // aa, aa, bb % aa\n y0, y1 = y1, y0 - q * y1\n x0, x1 = x1, x0 - q * x1\n return bb, x0, y0\n\na, b, c = [int(x) for x in input().split()]\nd,s,t = xgcd(a,b)\n\nif c%d == 0 and s>=0 and t>=0:\n print(\"Yes\")\nelse:\n print(\"No\")", "lang": "PyPy 3", "bug_code_uid": "72846b184e7ad519be6e0b9e425b50fa", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "451725dab6f42983fa6a55f69e505334", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9917355371900827, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\nn+=1\nn=list(str(n))\n\nif len(n)==1:\n print(n[0]-1)\n exit()\nmi=9**(len(n)-1)\nfor i in range(1,len(n)+1):\n if n[i-1]!=0:\n new=1\n for l in range(i-1):\n new*=int(n[l])\n new*=int(n[i-1])-1\n new*=9**(len(n)-i)\n mi=max(mi,new)\nprint(mi)\n\n", "lang": "Python 3", "bug_code_uid": "d0419a56e2736c7be63b5b7278288844", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "3ade26f31d631a6af7b624479416352d", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8269018743109151, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "def checkprime(n):\n flag=False\n div=2\n while divm:\n break\n prime=checkprime(i)\n if prime==0:\n if i==m:\n print(\"YES\")\n count=1", "lang": "Python 3", "bug_code_uid": "5109bad75be8f8275ff94db1464b926a", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "546909b340868c4f09392a149fe085ba", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9954545454545455, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\na1,a2,a3=list(map(int,input().rstrip().split())\nb1,b2,b3=list(map(int,input().rstrip().split())\nans=[0,0]\nans[1]=min(a1,b2)+min(a2,b3)+min(a3,b1)\nans[0]=max(0,b1-(a1+a2),b2-(a2+a3),b3-(a1+a3))\nprint(*ans)", "lang": "Python 3", "bug_code_uid": "446c25f3035d91933985f418bf48bc48", "src_uid": "e6dc3bc64fc66b6127e2b32cacc06402", "apr_id": "6feef9d674403d45113bf3afd4db5147", "difficulty": 1800, "tags": ["flows", "greedy", "math", "brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9900990099009901, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "m,n=map(int,input().split())\nv=m*n\nb=0\nc=0\nwhile(v>=b):\n b=b*2\n if b<=v:\n c=c+1\nprint(c)", "lang": "Python 3", "bug_code_uid": "71c1dfe081cc77db2040ba85c61116fc", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "a4a740fd0d98c3a4be33d81369b2c6d4", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4236111111111111, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "x1,y1,x2,y2 = map(int,input().split())\n\nret = 0\nfor y in range(y1,y2+1):\n\tif y%2 == 0:\n\t\tret += (x2 - x1)//2\n\t\tif x1%2 == 0:\n\t\t\tret += 1\n\telse:\n\t\tret += (x2 - x1)//2\n\t\tif x1%2 == 1:\n\t\t\tret += 1\nprint(ret)", "lang": "Python 3", "bug_code_uid": "8633a217f2ad94e217519985d724b0b7", "src_uid": "00cffd273df24d1676acbbfd9a39630d", "apr_id": "9540d20632340ee451eb25d5c000bbd5", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9651741293532339, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import numpy\nn,x,y = map(int, raw_input().split())\nans = x\nwhile ans*100 < y*n: ans += 1\nprint ans-x", "lang": "Python 2", "bug_code_uid": "4f69ca118a6ae2aa49f5c6338ae4fddc", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "9a32145a8a75881d35a0a5357d7d7bbc", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7830626450116009, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import sys\nrange = xrange\ninput = raw_input\n\nMOD = 998244353 \n\nimport __pypy__\nmodmul = __pypy__.intop.int_mulmod\nmo = lambda a,b: modmul(a,b,MOD)\npo = lambda a,b: pow(a,b,MOD)\n\nbig = 10**6 + 10\nmodinv = [1]*big\nfor i in range(2,big):\n modinv[i] = mo(-(MOD//i), modinv[MOD%i])\n\nfac = [1]\nfor i in range(1,big):\n fac.append(mo(fac[-1], i))\n\ninvfac = [1]\nfor i in range(1,big):\n invfac.append(mo(invfac[-1], modinv[i]))\n\ndef choose(n,k):\n return mo(mo(fac[n], invfac[k]), invfac[n-k])\n\ndef par(x):\n return -1 if x & 1 else 1\n\nn = int(input())\n\nans = 0\nfor i in range(1, n + 1):\n base = -po(3, n - i)\n tmp = po(base + 1, n) - po(base, n)\n ans += par(i + 1 + n) * mo(choose(n, i), tmp)\n\nextra = 0\nfor i in range(1, n + 1):\n extra += par(i + 1) * mo(choose(n, i), po(3, n * (n - i) + i))\nprint (3 * ans + 2 * extra) % MOD\n", "lang": "PyPy 2", "bug_code_uid": "f8e8a7ffcead933c0e4b1fbaf30401b8", "src_uid": "6e4b0ee2e1406041a961582ead299a3a", "apr_id": "b82b47186dbef2cea4bdef73a2f2d604", "difficulty": 2500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9927310488058152, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\n\n\ndef solve(cheese):\n ans = 0\n while cheese != k:\n for d in [2, 3, 5]:\n if cheese % d == 0:\n if (cheese // d) % k == 0:\n cheese //= d\n ans += 1\n break\n else:\n if a != k:\n print(-1)\n exit()\n return ans\n\n\na, b = map(int, input().split())\nif a == b:\n print(0)\nelse:\n k = math.gcd(a, b)\n print(solve(a) + solve(b))\n", "lang": "PyPy 3", "bug_code_uid": "b362f1dcdc4b4f3f53621210d2f71a6f", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "3e87401d8fa95099119f2387010dc9dd", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9304029304029304, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a,b = sorted(map(int,raw_input().split()))\nt1 = a*(b/2)+(a/2+a%2)*(b%2)\nif a<3:\n t1 = max(t1,a*(2*(b/4)+min(b%4,2)))\nprint t1\n", "lang": "Python 2", "bug_code_uid": "1e1e44bcba2b30cd479e9b75f54518d1", "src_uid": "e858e7f22d91aaadd7a48a174d7b2dc9", "apr_id": "0e535448062d9cad379f8eb83ed40550", "difficulty": 1800, "tags": ["greedy", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.975609756097561, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "a1,a2,k1,k2,n=(int(input()) for i in range(5))\nif k1>k2:\n\ta1,k1,a2,k2=a2,k2,a1,k1\nprint(max(0,n-(a1*(k1-1)+a2*(k2-1)),end=\" \")\nif n<=a1*k1:\n\tprint(n//k1)\nelse:\n\tprint(a1+(n-(a1*k1))//k2)", "lang": "Python 3", "bug_code_uid": "af8aaa85ccf3c1f29cab1449a0d3dd95", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "5772c29eca37ff35e8ed833e5711c74a", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.96987087517934, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def f(x):\n if x==0: return (3,1)\n else: return ((x-1)//3,(x-1)%3)\nt=[-1]*5\nt2=[-1,1,1,1,-1]\nd=[t,t2,t2,t2,[-1,-1,1,-1,-1],t]\nn=int(input())\noffset=[[1,0],[0,1],[-1,0],[0,-1]]\ncoord=[f(int(i)) for i in input()]\nfor dx,dy in offset:\n if all(d[x+dx][y+dy]==1 for x,y in coord):\n print(\"NO\")\n break\nelse: \n print(\"YES\")\n \n\n", "lang": "Python 3", "bug_code_uid": "6974b709103a4575c2468079bc862eb8", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "f519122dd4a00e8113fd8c8bf90ac9e2", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9928057553956835, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "print([1, 2, 6, 20, 70, 252, 924, 3432, 12870, 48620][int(input())-1]", "lang": "Python 3", "bug_code_uid": "72167473fb25a2463ba7f79face08458", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "40d71424e5bc8a635d159bd580d9a60d", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9337410805300713, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "n,s,k = map(int, input().split())\nr = list(map(int, input().split()))\nr.append(0)\ncol = input()\nmat = []\nfor i in range(n+1):\n adj = {}\n for j in range(n):\n if i == n:\n adj[j] = abs((s-1)-j)\n else:\n if col[i] != col[j] and r[i] < r[j]:\n adj[j] = abs(i-j)\n mat.append(adj)\n# print(*mat, sep='\\n')\n\nmem = [{} for i in range(n+1)]\n# print(mem)\n\ndef get(s, k):\n # print(mem)\n if mem[s].get(k):\n return mem[s].get(k)\n if r[s] >= k:\n mem[s][k] = 0\n else:\n mi = None\n for nei in mat[s]:\n ncost = get(nei, k-r[s])\n if ncost is None:\n continue\n curr = ncost + mat[s][nei]\n if mi is None or curr < mi:\n mi = curr\n if mi is not None:\n mem[s][k] = mi\n return mem[s].get(k)\n\n# print(mem)\n\nans = get(n,k)\nif ans is not None:\n print(ans)\nelse:\n print(-1)\n", "lang": "PyPy 3", "bug_code_uid": "0c2a4ce963877f827ffec3ac13c850df", "src_uid": "a95e54a7e38cc0d61b39e4a01a6f8d3f", "apr_id": "21ff10eb4b233ac0441fe49843a401b8", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9039370078740158, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "n, s, k = list(map(int, input().split()))\namounts = list(map(int, input().split()))\ncolors = list(input())\n\ndp = [[-1 in range(k + 1)] in range(n)]\n\ndef getAns(nth, left):\n if left <= 0:\n return 0\n if dp[nth][left] >= 0:\n return dp[nth][left]\n \n ret = 999999999\n for i in range(n):\n if amounts[i] <= amounts[nth]:\n continue\n ret = min(ret, abs(nth - i) + getAns(i, left - amounts[i])\n \n dp[nth][left] = ret\n return ret\n\nans = 999999999\nfor i in range(n):\n ans = min(ans, getAns(i, k - data[i]) + abs(s - 1 - i))\nprint(ans)\n ", "lang": "PyPy 3", "bug_code_uid": "ff023b8a3aa322b1baadf4620b8cb90d", "src_uid": "a95e54a7e38cc0d61b39e4a01a6f8d3f", "apr_id": "f396ba39e498aef9b8b9189dd5bd8d57", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9945054945054945, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a,b = map(int,input().split())\nc,d = map(int,input().split())\nres = -1\nfor i in range(,10000):\n if (b+a*i-d) % c == 0 and b+a*i-d > 0:\n res = b+a*i\n break\nprint(res)", "lang": "PyPy 3", "bug_code_uid": "a84b48407e402a972f60209fbb62796c", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "apr_id": "46b44876c955285610620d8e827be0bc", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.924924924924925, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\n\nx = int(raw_input())\n\nif x <= 2:\n print 0\nelif x <= 5:\n print 1\nelif x <= 10:\n print 2\nelif x <= 15:\n print 3\nelse:\n print int(math.ceil(x * 1.0 / 5))\n", "lang": "PyPy 2", "bug_code_uid": "765458f192575113bc11e54cc05a8fb7", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "cd7d88e157ca7565878cb4872a275ad9", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.30412371134020616, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "x,y=map(int,input().split())\nn=int(input())\nm=1000000007\nf=[0]*200000000\nf[1]=x\nf[2]=y\nfor i in range(3,n+1):\n f[i]=(f[i-1]-f[i-2])%m\nprint(f[n]%m)\n", "lang": "Python 3", "bug_code_uid": "b75589ca99d6e6c27223d48c0806a5c0", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "37e3b5290cde62879228ca908629755b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6106106106106106, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "x=[]\nsum=0\ncounter = 1;\nfor i in range(8):\n x.append(input())\nfor i in range(8):\n for j in range(8):\n if j==8 and counter==1:\n sum+=1\n if x[j][i]='B':\n counter==1;\n else:\n i+=1\n j=8\nfor i in range(8):\n for j in range(8):\n if j==8 and counter==1:\n sum+=1\n if x[i][j]='B':\n counter==1;\n else:\n i+=1\n j=8\nprint(sum)", "lang": "Python 3", "bug_code_uid": "37e7e03ee343c2375f0dcd70426fd85a", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "c5748ccfe6d995326f11fef402942d44", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.16314199395770393, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n = int(input())\ns = input()\n\nn_8 = 0\nq = 0\nfor x in s:\n if x=='8':\n n_8+=1\n else:\n q+=1\nif n_8==0:\n print(0)\nelse:\n b = False\n while not b:\n if n_8==q//10:\n print(n_8)\n exit()\n else:\n n_8-=1\n q+=1", "lang": "Python 3", "bug_code_uid": "2d80926617a65359de16350dbae350c0", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "b7503ad6a63f3f8534e8fef82974f9c4", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5826086956521739, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n, t = map(int,input().split())\na = []\nfor i in range(0,n+1):\n for j in range(0,n+1-i) :\n for k in range(0,n+1-i-j):\n for s in range(0,n+1-i-j-k):\n a.append([i,j,k,s])\n\ny = list(filter(lambda x: sum(x)==4,a))\nc = []\nfor q in y :\n\n if q[0]*5+q[1]*4+q[2]*3+q[3]*2 == t :\n \n c.append(q)\n\nc.sort(key = lambda x : x[3])\n\nprint(c[0][-1])", "lang": "Python 3", "bug_code_uid": "e6714cf878e0779793960c7723b01bd1", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "c41bb8b83d5e7deeaa5f74363ff336ff", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9820554649265906, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import math\n\ndef same_row(new, rook):\n return new[0] == rook[0] or new[1] == rook[1];\n\ndef knight_hop(new, piece):\n return (math.fabs(new[1]-piece[1]) + math.fabs(new[0]-piece[0]) == 3) and !same_row(new, piece);\n\nSQ = 8\nyay = 0\nattacked = []\nfor i in range(2):\n s = input()\n attacked.append((ord(s[0])-ord('a'), s[1] - 1)) #0=rook 1=knight\n\nfor i in range(SQ):\n for j in range(SQ):\n curr = (i,j)\n if (!(same_row(curr, attacked[0]) or knight_hop(curr, attacked[1]) or knight_hop(curr, attacked[0]) or curr == attacked[1])):\n yay += 1\n \n \n\nprint(yay)\n", "lang": "Python 3", "bug_code_uid": "7439498bccfded06ed2df651c61698ef", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "785a694335bb8abea7a6adf29980ce5f", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9908069458631257, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a, b = input(), input()\na, b = ('abcdefgh'.find(a[0]), int(a[1]) - 1), ('abcdefgh'.find(b[0]), int(b[1]) - 1)\nt = [[0] * 8 for i in range(8)]\nt[a[0]] = [1] * 8\nfor i in range(8):\n t[i][a[1]] = 1\nfor i, j in [(1, 2), (1, -2), (2, 1), (2, -1), (-1, 2), (-1, -2), (-2, 1), (-2, -1)]:\n x, y = b[0] + i, b[1] + j\n if -1 < x < 8 and -1 < y < 8:\n t[yx]yx] = 1\n x, y = a[0] + i, a[1] + j\n if -1 < x < 8 and -1 < y < 8:\n t[x][y] = 1\nprint(sum(i.count(0) for i in t) - 1)", "lang": "Python 3", "bug_code_uid": "9019f93634065fbfda87fcfbc166218c", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "8d38bf6700b663a27eb2c6d70adc98f1", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7956989247311828, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "n=input()\nnumber=int(n)\narr=[]\ni=2\nuno=1\nif(number==1):\n print(number)\nwhile number != 1 :\n arr.append(number)\n while i<=number:\n if (number%i ==0):\n number=number/i\n arr.append(int(number))\n i=i+1\nprint(*arr)", "lang": "PyPy 3", "bug_code_uid": "81d3e70ab612bd32972402c22b347c27", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "068acfaad668627e0c4acda29905467d", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.08799048751486326, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "import sys\ninput=sys.stdin.readline\nmod = 998244353\nsys.setrecursionlimit(pow(10, 8))\n\ndef power(x, y):\n if y == 0: return 1\n elif y == 1\t : return x % mod\n elif y % 2 == 0 : return power(x, y//2)**2 % mod\n else: return power(x, (y-1)//2)**2 * x % mod\n \n\ndef modinv(a):\n b, u, v = mod, 1, 0\n while b:\n t = a//b\n a, u = a-t*b, u-t*v\n a, b, u, v = b, a, v, u\n u %= mod\n return u\n\ndef cmb(n, r):\n if ( r<0 or r>n ):\n return 0\n r = min(r, n-r)\n return g1[n] * g2[r] * g2[n-r] % mod\n\nNNN = 2*10**5\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\n\nfor i in range( 2, NNN + 1 ):\n g1.append( ( g1[-1] * i ) % mod )\n inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )\n g2.append( (g2[-1] * inverse[-1]) % mod )\n\nN, K = map(int, input().split())\nif K > N:\n print(0)\nelse:\n M=N-K\n R = 0\n for i in range(1, M+1):\n R += (-1 if (M-i)%2 else 1) * cmb(M, i) * power(i, N) % mod\n R = R*cmb(N, M)%mod\n if K != 0:\n R = R*2%mod\n print(R)\n", "lang": "Python 3", "bug_code_uid": "11af814f5b8622f61c00969d6c397c5e", "src_uid": "6c1a9aaa7bdd7de97220b8c6d35740cc", "apr_id": "df60d4b757516d3bd59cb1847231cad5", "difficulty": 2300, "tags": ["fft", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19030837004405288, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "import sys\ninput = sys.stdin.buffer.readline\ndef print(val):\n sys.stdout.write(str(val) + '\\n')\n\ndef choose(n,k,mod = None):\n if k > n:\n return 0\n k = min(n-k,k)\n total = 1\n for i in range(n-k+1, n+1):\n total*= i \n for i in range(2,k+1):\n total//= i\n return total % 998244353\ndef factorial(n):\n total = 1\n for i in range(2, n+1):\n total*= i\n total %=998244353\n return total\ndef place_rooks(n,k):\n if k == 0:\n return factorial(n)\n filled = n - k\n placements_per_filled = 0\n for i in range(filled):\n mult = 1\n for _ in range(n):\n mult *= (filled-i)\n mult %= 998244353\n placements_per_filled += ((-1)**i)*choose(filled,i)*mult\n placements_per_filled %= 998244353\n total = (2*choose(n,filled)*placements_per_filled ) % 998244353\n if k == 0:\n total//= 2\n return total\n \nn, k = map(int,input().split())\nprint(place_rooks(n,k))\n", "lang": "PyPy 3", "bug_code_uid": "97db59d2975c38aca53ff068049ed9b8", "src_uid": "6c1a9aaa7bdd7de97220b8c6d35740cc", "apr_id": "3f9635ca72d6ed3f97c1e668ecb817b9", "difficulty": 2300, "tags": ["fft", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2560660815694373, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 17, "bug_source_code": "\n\n\nlist1 = list(input())\nlist2 = list(input())\n\n\ni=0\ncount=0\nf1=0\nup_u=0\nd_u=0\nif len(list1)==1:\n print(0)\n exit()\nwhile i\nusing namespace std;\nint n, m, k;\nint main(int argc, char const *argv[])\n{\n\tcin >> n >> m >> k;\n\tif \n\tcout << m << '\\n';\n\treturn 0;\n}", "lang": "PyPy 3", "bug_code_uid": "2b97763861599397cdab2a1f40a53606", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "bc1a72764c697fe231f6f5cc54b9cf5a", "difficulty": 1600, "tags": ["graphs", "dfs and similar", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1572052401746725, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "from math import sqrt\n\ndef tax(n):\n if n == 4:\n return 2\n if n < 4:\n return 1\n prime_lst = [i for i in range(2, n+1)]\n pointer = 0\n while pointer != n-1:\n if prime_lst[pointer] == 0:\n pass\n else:\n multiple = prime_lst[pointer]\n temp = pointer\n while pointer <= n:\n pointer += multiple\n try:\n prime_lst[pointer] = 0\n except IndexError:\n pass\n pointer = temp\n pointer += 1\n primes = []\n for i in prime_lst:\n if i != 0:\n primes.append(i)\n count = 0\n lp = 0\n while n > 0:\n try:\n if n - primes[-1-lp] >= 0 and n-primes[-1-lp] != 1:\n n -= primes[-1-lp]\n count += 1\n else:\n lp += 1\n except IndexError:\n lp = 0\n return count\n\n\nn = int(input())\nprint(tax(n))\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "e2776114d36b1bc1a60f09285ccf7a36", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "c9595d77ed6612aa05ca2034dfec8c9c", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8396946564885496, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "n = input()\naux = n-2\nsum = (h*h+1)/2\nprint(4*(n-1+sum)+1)", "lang": "Python 3", "bug_code_uid": "d405b822cb8ee65cf99aab0297896c49", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "775dc2cd30b10746bbd17b6a1593c2d3", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7579617834394905, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n = int(input())\nif n == 1:\n\tprint(499122177)\n\texit()\nif n == 2:\n\tprint(748683265)\n\texit()\ndp = [0]*(n+1)\ndp[0], dp[1], dp[2] = 1, 1, 1\ndp[3] = 2\nmodulo = 998244353\ncount1, count2 = dp[1] + dp[3], dp[0] + dp[2]\nfor i in range(4, n+1):\n\tif i%2 == 0:\n\t\tdp[i] = count1\n\t\tcount2 += dp[i]\n\t\tcount2 %= modulo\n\telse:\n\t\tdp[i] = count2\n\t\tcount1 += dp[i]\n\t\tcount1 %= modulo\ny = 1\nfor i in range(n):\n\ty *= 2\n\ty %= modulo\ntime = 1\nyre = 0\nwhile True:\n\tal = modulo*time+1\n\tif al%y == 0:\n\t\tyre = al//y\n\t\tbreak\n\ttime += 1\nres = (dp[n]*yre)%modulo\nprint(res)", "lang": "PyPy 3", "bug_code_uid": "0a847d657fa59c50893184da6b9e02d2", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "d15826ffe7edcdcf98b6309bb8029a71", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7921760391198044, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "m=998244353 \n\ndp=[1,1,1]\n\nd1=1\nd2=2\nn=200001\nfor i in range(3,n+1):\n\tif i%2==0:\n\t\tdp.append(d1)\n\t\td2+=dp[-1]\n\telse:\n\t\tdp.append(d2)\n\t\td1+=dp[-1]\nn=int(input())\nd=pow(2,n,m)\nprint((dp[n]*pow(d,m-2,m))%m)", "lang": "PyPy 3", "bug_code_uid": "5eccfe358f783ca387b6015efe2c5866", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "23f079895a25951b869e929c55edefa0", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9234088457389428, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/env python3\n\nimport itertools\n\nPRIME = int(998244353)\n\ndef ri(string):\n return list(map(int, string.split(' ')))\n\ndef power(a, b):\n if b == 0: return 1\n i = 2\n a_power = [a]\n while i <= b:\n a_power.append(a_power[-1]*a_power[-1] % PRIME)\n i *= 2\n\n bin_b = list(map(int, bin(b)[:1:-1]))\n # print(a_power, bin_b)\n a_power = itertools.compress(a_power, bin_b)\n # print(a_power)\n res = 1\n for p in a_power:\n # print(res, p)\n res = res * p % PRIME\n return res\n\n\nn = int(input())\n\nsums = []\nsums.append(1)\nsums.append(1)\nfor i in range(2, n+1):\n sums.append(sum(sums[-1::-2]) % PRIME)\n # print(f'{i}: {sums[i]}')\n\n# print(sums)\nx = sums[n]\n# print(x)\ny_inv = power(2, n*(PRIME-2))\n\nprint(x*y_inv % PRIME)\n\n\n# sums = []\n# sums.append(1)\n# sums.append(1)\n# # print(f'{i}: {sums[i]}')\n# for i in range(2, n+1):\n# sums.append(sum(sums[-1::-2]) % PRIME)\n\n", "lang": "PyPy 3", "bug_code_uid": "72819f5eac03756ff7053f151ca970aa", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "12d4d8752b0c9ab55f9e8b093bfd6605", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23834196891191708, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def Digits(x):\n M = SumOfDigits(1)\n m = 1\n for i in range(2, x + 1):\n temp = SumOfDigits(i)\n if temp >= M and i > m:\n M = temp\n m = i\n return m\ndef SumOfDigits(n):\n return n % 10 + SumOfDigits(n//10) if n != 0 else 0 \nprint(Digits(int(input())))\n", "lang": "Python 3", "bug_code_uid": "ec6b313b6a1bae0c67603747973d0c10", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "6b5f998aef82c43706468aa47f6782e9", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9780439121756487, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "flag = True\nfor i in range(8):\n ls = input()\n temp = ls[0]\n w = sum([1 for s in range(2, len(ls), 2) if(ls[s]==temp)])\n w_sum = sum([1 for s in ls if(s=='W')])\n if(w != 3 || w_sum != 4):\n flag = False\n break\nprint(\"YES\" if flag else \"NO\")", "lang": "PyPy 3", "bug_code_uid": "e5f18370cf844bc6106bb4cb0e24e61a", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "90460f08223f1d9f8492b36117b9dc0f", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9094693028095734, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "p = [\"first\", \"second\"]\n\na = raw_input()\nb = raw_input()\nc = raw_input()\n\nnx = (a+b+c).count('X')\nno = (a+b+c).count('0')\nd = nx - no\n\n\nopts = [a, b, c, a[0]+b[1]+c[2], a[2]+b[1]+c[0]] + list(map(\"\".join, zip(a, b, c))) #\u5217\u4e3e\u6240\u6709\u53ef\u80fd\u7684\u83b7\u80dc\u65b9\u5f0f\nw = (\"XXX\" in opts) + 2*(\"000\" in opts) - 1 #\u7528\u4e00\u4e2a\u6570\u5b57\u8868\u793a\u83b7\u80dc\u8005\n\nif (d not in [0, 1]) or (w > 1) or d == w: #\u5b57\u6570\u6700\u591a\u5dee1+\u6700\u591a\u540c\u65f6\u5b58\u5728\u4e00\u4e2a\u83b7\u80dc\u6a21\u5f0f+\u5148\u624b\u83b7\u80dc\u5b50\u6570\u591a\u4e00\uff08w = 0 ,d =1\uff09\uff0c\u540e\u624b\u83b7\u80dc\u5b50\u6570\u76f8\u7b49(w =1 d= 0)\n print \"illegal\"\nelif w >= 0:\n print \"the %s player won\" % p[w]\nelif nx + no == 9:\n print \"draw\"\nelse:\n print p[d]", "lang": "Python 2", "bug_code_uid": "2f21784afbe14f571d6cd2d3fa7521de", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "f00fe6cf66b25b90af06ea1a5cc11b61", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9652384801940178, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "line1 = input()\nline2 = input()\n\nn = len(line1)\n\nres = 0\nind = 0\n\nwhile ind < n - 1:\n count = 0\n if line1[ind] == '0':\n count += 1\n\n if line1[ind+1] == '0':\n count += 1\n\n if line2[ind] == '0':\n count += 1\n\n if line2[ind+1] == '0':\n count += 1\n\n if (count == 3):\n res += 1\n ind += 2\n elif count == 4:\n res += 1\n if ind + 2 <= n - 1:\n if line1[ind + 2] == '0' and line2[ind + 2] == '0':\n res += 1\n ind += 3\n else:\n ind += 2\n else:\n ind += 1\n\nprint(res)\n", "lang": "Python 3", "bug_code_uid": "ff1edb01237241f108257b49dcd81349", "src_uid": "e6b3e787919e96fc893a034eae233fc6", "apr_id": "d8a2b217a3b4cdd2ac9cc6785342df8c", "difficulty": 1500, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9878787878787879, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "from math import factorial as fa\nn = int(input())\nf = [1]\nm = 10**9 + 7\nmx = 10**6+5\nfor i in range(1,mx+1):\n f.append(f[-1]*i)\nr = f[n]-pow(2,n-1,m)\nprint(r%m)", "lang": "PyPy 3", "bug_code_uid": "f750e13dd763c4b7c6d24c69e5202ed8", "src_uid": "3dc1ee09016a25421ae371fa8005fce1", "apr_id": "cbe4f1e76098e0fee886249017375b06", "difficulty": 1500, "tags": ["graphs", "dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9445100354191264, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\np=list(map(int,input().split()))\nka=list(map(int,input().split()))\nso=list(set(p))\npo=list(set(ka))\ntod=[]\nlol=[]\nsam=[]\nlil=[]\nloll=0\ntt=[]\nlkl=[]\nfor item in so:\n tod.append(item)\nfor item in po:\n if item not in tod:\n tod.append(item)\nfor item in tod:\n lol.append(ka.count(item)+p.count(item))\nfor item in lol:\n if item%2==0:\n pass\n else:\n loll=1\n break\nif loll=1:\n print(-1)\nelse:\n for item in tod:\n sam.append(p.count(item))\n lol.append(ka.count(item))\n for x in range(n):\n if sam[x]=lol[x]:\n pass\n elif sam[x]>lol[x]:\n tt.append(((sam[x]+lol[x])//2)-lol[x])\n else:\n lkl.append(((sam[x]+lol[x])//2)-sam[x])\n if sum(tt)!=sum(lkl):\n print(-1)\n else:\n print(sum(tt)//2)\n \n \n ", "lang": "PyPy 3", "bug_code_uid": "e522cf06687d4ecbd1397ab98c2f4667", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3", "apr_id": "21ffdc6dab4a403391b9954631ac09ad", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9095744680851063, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n,m,k=[int(s) for s in input().split()]\nn,m=max(n,m),min(n,m)\nif n+m-2m):\n\t\t\tif(m!=1):\n\t\t\t\tm-=1\n\t\telse:\n\t\t\tif(m!=n):\n\t\t\t\tm+=1\n\t\t#move cont\n\t\tif(direction==\"to head\"):\n\t\t\tk-=1\n\t\t\tif k==1:\n\t\t\t\tdirection=\"to tail\"\n\t\telse:\n\t\t\tk+=1\n\t\t\tif k==n:\n\t\t\t\tdirection=\"to head\"\n\t\tif(k==m):\n\t\t\tprint \"Controller \"+str(i+1)\n\t\t\texit(0);\n\tif moves[i]=='1':\n\t\tif(i==len(moves)-1):\n\t\t\tprint \"Stowaway\"\n\t\t\texit(0);\n\t\t#move cont\n\t\tif(direction==\"to head\"):\n\t\t\tk-=1\n\t\t\tif k==1:\n\t\t\t\tdirection=\"to tail\"\n\t\telse:\n\t\t\tk+=1\n\t\t\tif k==n:\n\t\t\t\tdirection=\"to head\"\n\t\tif(direction==\"to head\"):\n\t\t\tm=n\n\t\telse:\n\t\t\tm=1\n\t\t\n", "lang": "Python 2", "bug_code_uid": "b0b94f43fe04632b42f8a3754b4cafc4", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "524141a4c99992ee1559f17189bf0455", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9693396226415094, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// luogu-judger-enable-o2\nread=input()\nread=read.split(\" \")\na=[0]*4\nn=int(read[0])\nm=int(read[1])\na[1]=m\na[2]=m\na[3]=m\ndef mysort():\n\tfor i in range(1,4):\n\t\tfor j in range(i,4):\n\t\t\tif a[i]>a[j]:\n\t\t\t\ta[i],a[j]=a[j],a[i]\n\treturn\ndef getans():\n\tt=0\n\tif n==m:\n\t\treturn 0\n\twhile 0==0:\n\t\tmysort();\n\t\tt=t+1;\n\t\tif a[2]+a[3]-1<=n :\n\t\t\ta[1]=a[2]+a[3]-1\n\t\telse:\n\t\t\ta[1]=n\n\t\tif a[1]==n and a[2]==n and a[3]==n:\n\t\t\treturn t\n\treturn 0;\nprint(getans())", "lang": "Python 3", "bug_code_uid": "0519a4f34b1e5ccb7c70905963178a49", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "3b59ccdd56feb685fb2b528e670e6462", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.008635578583765112, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "# area of equilater triangle s**2 * sqrt(3) / 4\nfrom math import sqrt\n\nanswers = {}\n\ndef solve(s1, s2, s3, y, ite):\n if s1 == y and s2 == y and s3 == y:\n return ite\n if (s1, s2, s3, y) in answers.keys():\n return answers[(s1, s2, s3, y)]\n big = max(max(s1, s2), s3)\n small = min(min(s1, s2), s3)\n other = s1+s2+s3-big-small\n rest = other-small\n new = max(rest+1, y)\n bigg = max(big-1, y)\n ite_min = 300000\n if new == y and bigg == y:\n return solve(small, other, new, y, ite+1)\n for i in range(new, bigg):\n ite_min = min(ite_min, solve(small, other, i, y, 0))\n answers[(s1, s2, s3, y)] = ite_min + ite + 1\n return ite_min + ite + 1\n\nx, y = [int(i) for i in input().split()]\nprint(solve(x, x, x, y, 0))\n\n\n\n", "lang": "Python 3", "bug_code_uid": "e35895671f8527551169f35be1de45f9", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "f9ff38df1e84eecd0ddba02780ec1c69", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9419568822553898, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = map(int, input().split())\nm -= 1\n\nperm = [0] * n\n\nk = 2 ** (n - 2)\n\ncleft = 0\ncright = n - 1\n\nfor i in range(1, n + 1):\n if m & k:\n perm[cright] = i\n cright -= 1\n else:\n perm[cleft] = i\n cleft += 1\n k //= 2\n\nprint(\" \".join(map(str, perm)))\n", "lang": "Python 3", "bug_code_uid": "2e0f418a8dc0e45273b31b49df3e0287", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "45db9d9b46c6fdd2593c049cf88d6ffd", "difficulty": 1400, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8426666666666667, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "n,k=map(int,raw_input().split())\na=[]\nfor i in range(1,int(n**0.5)+1):\n if n%i==0:\n a.append(i)\n if i!=n//i:\n a.append(n//i)\na.sort()\nprint(-1 if len(a)n-k and i+1<=n:\n a.append(s)\n else:\n s-=1\n a.append(s)\nprint(a[t-1])", "lang": "PyPy 3", "bug_code_uid": "269162a6c8d8d72153a2293ca55354a1", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "92cc7e8c0effc2f0268d51c45945a4be", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19325153374233128, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = input()\nans = 6\nbuf = 0\ncnt = 6\nfor i in range(1000000):\n s = str(i).rjust(6,\"0\")\n if( sum(map(int,list(s[0:3]))) != sum(map(int,list(s[3:]))) ):\n continue\n cnt = 0\n for i in range(len(n)):\n if n[i] != s[i]:\n cnt+=1\n ans = min(ans,cnt)\n \nprint (ans)\n", "lang": "Python 3", "bug_code_uid": "bbbaaea9d8c53d6f1f9fe0229d9ef502", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "c2d3ad1eda940b0f4075fe5cbba51dec", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9998152185964004, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "a=input().split()\nb=[True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, True, False, True, False, False, False, False, False, False, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True,True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, True, False, False, False, True, False, True, False, True, False, True, True, False, True, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, True, False, True, True, True, False, True, True, True, False, False, True, False, True, True, True, True, False, True, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, True, False, True, False, True, False, False, False, False, False, True, True, True,True, False, False, False, False, True, False, True, False, False, False, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, True, True, True, True, True, True, False, True, False, True, True, True, True, True, False, False, False, False, True, True, True, True, False, True, False, True, False, True, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, True, True, False, False, True, False, False, False, False, False, True, False, False, False, True, False, False, False, True, False, True, True, False, True, False, False, True, True, True, False, True, True, False, True,False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, True, True, False, True, True, False, True, True, True, True, True, True, False, True, False, True, True, True, False, False, False, False, True, True, False, False, True, False, False, True, False, False, True, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True,True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, True, False, False, True, False, False, True, False, False, False, True, False, False, False, True, False, False, False, True, True, True, True, False, False, True, True, False, True, True, False, True, True, True, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, False, True, True, True, True, True, False, True, True, True, False, True, False, False, True, True, False, False, True, False,False, True, False, True, True, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, True, False, False, False, False, False, False, False, True, True, False, False, False, False, True, True, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True,True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True,True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, False, False, True, True, True, True, True, False, False, False, False, False, False, False, False, False, True, True, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, True, True, True, True, True,True, True, True, True, True, False, False, False, False, True, True, True, True, True, False, False, False, False, False, True, True, True, False, False, True, False, True, True, True, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, True, False, False, True, True, False, True, False, False, True, True, True, True, True,True, True, False, False, True, True, True, False, False, False, False, False, False, False, True, True, True, True, True, False, True, True, True, False, False, False, True, True, False, False, False, True, True, False, False, False, False, False, False, False, False, False, False, False, True, False, True, True, False, True, True, True, False, False, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, True, True, False, False, False, False, False, False, False, False, False, True, True, True, True, True, False, True, True, False, True, True, False, False, True, False, False, True, True, True, False, False, False, False, False, False, False, False, False, True, False, False, True, False, False, False, False, False, True, True, False, True, True, True, True, False, False, False, False, False, False, False, False, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, True, False, False, False, True, True, True, True, True, False, False, False, True, True, False, False, False, False, False, False, False, True, True, True, False, True, True, False, True, True, True, True, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, True, True, False, False, False, False, False, False, False, False, False, True, True, True, True, True, False, True, True, True, False, False, False, True, False, False, False, True, True, True, False, False, False, False, False, False, False, False, True, False, True, False, False, False, False, False, True, False, True, True, True, False, True, True, False, True, False, False, False, False,False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, True, False, True, True, False, True, True, False, True, True, True, False, True, True, False, False, False, False, False, False, True, True, False, True,True, False, True, True, True, True, False, False, True, False, False, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, True, True, False, True, False, False,True, False, False, False, True, False, False, False, True, False, False, False, False, True, False, True, False, False, False, True, False, False, False, False, True, True, False, False, False, True, True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False,False, False, True, False, False, False, False, True, True, True, True, False, True, True, False, True, False, True, True, True, True, False, True, False, True, True, False, True, False, False, False, False, True, True, True, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, False, True, True, False, True, True, False, False, False, True, False, False, False, True, True, True, False, True, False, True, False, False, True, False, False, True, False,True, True, False, True, True, True, False, True, True, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, True, False, False, False, False, True, False, False, True, False, False, False, True, True, True, False, True, False, False, False, True, True, True, True, True, False, False, False, False, True, False, True, False, False, False, False, False, False, True,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, False, False, True, True, False, True, True, False, True, True, True, False, False, False, True, False, True, True, False, False, False, True, False, False, False, False, True, True, False, True, False, False, False, True, True, True, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, False, False, True, False, False, False, True, False, False, True, False, False, False, True, False, False, True, True, True, True, True, False, True, True, False, False, True, False,False, True, True, False, True, True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, True, False, True, True, True, True, False, True, False, True, True, True, True, False, True, False, True, True, False, True, False, True, False, False, True, False, True, True, True, False, False, True, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, False, False, False, False, True, False, True, False, True, False, True, False, True, False, False, False, False, True, False, False, True, False, True, True, False, True, False, False, False, True, True, False, False, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, True, True, False, True, True, True, False, False, False, True, True, True, False, False, False, False, True, True, True, False, True, True, False, False, True, True, True, True, False, True, True, False, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, False, False, True, True, True, False, True, False, False, True, False, False, True, False, False, True, False, False, True, True, False, True, False, False, False, True, False, True, True, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, True, True, True, False, True, False, False, False, False, False, False, True, True, True, True, True, False, False, False, False, False, False, False, True, True, True, False, True, True, True, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, False,True, True, True, True, False, False, False, False, False, True, False, True, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, False, False, False, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, False, False, False, False,False, False, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, False, False, False, False, False, False, False, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, True, True, True, True, True, True, False, False, False, False, False, False, False, True, True, True, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, True, False, True, True, True, True, False, False, False, False, False, False, True, True, True, True, True, True, False, False, False, False, False, False, False, True, False, True, False, True, False, True, True, False, True, False, True, True, True, False, False, True, False, True, False, False, True, True, False, True, False, True, True, False, True, False, False, True, True, True, False, False, True, True, True, True, True,False, True, False, False, False, False, False, False, False, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, True, True, True, False, False, True, True, True, True, True, False, True, True, True, True, True, True, True, False, False, True, True, True, False, False, True, True, True, True, True, True, False, True, False, True, True, False, False, False, True, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, True, False, True, True, False, False, False, False, True, False, False, False, False, True, False, False, False, True, True, False, False, False, True, True, True, True, False, False, False, True, False, False, False, False, False, True, False, True, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, True, False, True, True, False, True, True, False, True, True, True, False, True, False, False, False, False, True, False, False, False, True, False, False, True, False, True, True, True, True, True, False, True, True, True, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, True, True, True, True, False, False, True, False, False, True, False, True, True, True, True, False, True, True, True, False, True, False, True, True, True, True, False, False, False, True, False, True, True, True, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, True, False, False, True, True, True, False, False, False, False, False, True, False, False, True, False, True, False, True, True, True, False, True, False, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, True, True, False, False, False, True, True, False, True, False, True, True, True, False, False, False, True, True, True, False, True, False, False, False, True, True, False, True, True, True, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, True, True, True, False, False, False, False, True, True, True, False, False, False, True, False, False, True, False, False, False, False, True, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, True, False, False, True, True, True, True, False, True, False, True, True,True, True, True, True, False, True, True, True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, True, False, True, False, False, False, False, True, False, False, True, False, False, True, False, True, False, False, True, True, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True,True, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, False, False, False, False, True, True, True, True, False, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, True, True,True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, False, False, False, False,False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False,False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]\nprint('OUT' if b[a[0]*64+a[1]] else 'IN')", "lang": "Python 3", "bug_code_uid": "1ed5b865c7a8e24dab5a2be115cf274f", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "apr_id": "9272770dd65d8489d5846ba6d153abf4", "difficulty": null, "tags": ["geometry", "dfs and similar", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6123260437375746, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def solve():\n n, m, k = map(int, input().split())\n if k==1 or k>n:\n print(pow(m, n, 1e9+7))\n elif k==n:\n print(pow(m, (n+1)//2, 1e9+7))\n elif k%2==1:\n print((m*m)%1e9+7)\n elif k%2==0:\n print(m)\nsolve()", "lang": "Python 3", "bug_code_uid": "059786e9977f80cd2699023f95a3d1ba", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "1df96bbf7bcac50d4b5420ab9dc3defa", "difficulty": 1600, "tags": ["graphs", "math", "combinatorics", "dsu"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7111111111111111, "equal_cnt": 16, "replace_cnt": 3, "delete_cnt": 7, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "n = int(input())\n\ndef f(n): \n return sum([i*(-1 if i % 2 != 0 else 1) for i in range(1, n+1)]) \n\n\nprint(f(n))", "lang": "PyPy 3", "bug_code_uid": "2b46e2ed0e076bcdeefc968d17ff9cc1", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "738d71f46d100cc04b110d85feed274d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9306625577812019, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n=int(input())\nst = map(str, input())\nif n == 1:\n print(st)\nelse:\n\n if st[0]=='0':\n prezero=1\n else:\n prezero=0\n\n zeroc=0\n for x in st:\n if x == '0':\n zeroc += 1\n \n zeroc=zeroc-prezero\n \n answ='1'\n for i in range(0,zeroc):\n answ+='0'\n \n \n print(answ)\n\n", "lang": "Python 3", "bug_code_uid": "bab1fe59055aea74a4f04637e9d8a884", "src_uid": "ac244791f8b648d672ed3de32ce0074d", "apr_id": "9f556ee7e3a43543677a858873492234", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9724770642201835, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s=raw_input()\nn=len(s)\nf=[0]*n\ng=[0]*n\n'''\nAB->BA\nNo Other AB\n'''\n# 0=A\nf[0]=1\nfor i in xrange(0,n-1):\n if (s[i]=='A') and (s[i+1]=='A'):\n f[i+1]+=g[i]\n f[i+1]+=f[i]\n if (s[i]=='A') and (s[i+1]=='B'):\n f[i+1]+=f[i]\n f[i+1]+=g[i]\n g[i+1]+=g[i]\n if (s[i]=='B') and (s[i+1]=='A'):\n g[i+1]+=f[i]\n f[i+1]+=g[i]\n if (s[i]=='B') and (s[i+1]=='B'):\n f[i+1]+=g[i]\n g[i+1]+=g[i]\nans=0\nif s[n-1]=='B':\n ans+=g[n-1]\nelse:\n ans=f[n-1]+g[n-1]\nf=[0]*n\ng=[0]*n\n# 0=B\ng[0]=1\nfor i in xrange(0,n-1):\n if (s[i]=='A') and (s[i+1]=='A'):\n f[i+1]+=g[i]\n f[i+1]+=f[i]\n if (s[i]=='A') and (s[i+1]=='B'):\n f[i+1]+=f[i]\n f[i+1]+=g[i]\n g[i+1]+=g[i]\n if (s[i]=='B') and (s[i+1]=='A'):\n g[i+1]+=f[i]\n f[i+1]+=g[i]\n if (s[i]=='B') and (s[i+1]=='B'):\n f[i+1]+=g[i]\n g[i+1]+=g[i]\nif s[0]=='A':\n ans+=f[n-1]\nelse:\n ans+=g[n-1]\nprint ans", "lang": "Python 2", "bug_code_uid": "56006efc1ed20c177ddf723c15cfaeb2", "src_uid": "ad27d991516054ea473b384bb2563b38", "apr_id": "e2011585a5197e252079d1e11070c03f", "difficulty": 2100, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9448275862068966, "equal_cnt": 13, "replace_cnt": 0, "delete_cnt": 12, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "x = int(input())\nk = int(input())\nA = int(input())\nB = int(input())\nif (x < k):\n print(A*(x-1))\n else:\n if (k == 1):\n print (A*(x-1))\n else :\n ans = 0\n while (x != 1):\n if (x % k == 0):\n ans += min ((x - (x//k)) * A, B)\n x = x // k\n else :\n if (x < k):\n ans += ((x % k)-1) * A;\n x -= ((x % k) - 1)\n else:\n ans += (x % k) * A;\n x -= (x%k)\n print(ans)\n", "lang": "Python 3", "bug_code_uid": "df0a7f95d227cf4cfad13a5d339a0bf1", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "35ed19b916da799c31824a8fa34215e6", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.48739495798319327, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "Y,B=map(int, raw_input().split())\ny,g,b=map(int, raw_input().split())\nwhile y:\n Y-=2\n y-=1\n\nwhile g:\n Y-=1\n B-=1\n g-=1\nwhile b:\n B-=3\n b-=1\n\nprint abs(Y+B)\n", "lang": "Python 2", "bug_code_uid": "85d457a5c9f91e0b598bb3432f71e919", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "b1b4b5ea4d768a4562eb6d0035a80bda", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9130434782608695, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "R = lambda:map(int, input().split())\nn, m, a, b = R()\nt = list(R())\nprint(\"Incorrect\" if n - m == 1 and min(t) != a and max(t) != b else \"Correct\")", "lang": "Python 3", "bug_code_uid": "33900ff48888dc9e62b803a34a82a8b3", "src_uid": "99f9cdc85010bd89434f39b78f15b65e", "apr_id": "9f731cb3a3b677012984452d72764cde", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.27995255041518385, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "n=int(input())\nch=input()\ns=0\ni=0\nif ch.count(ch[0])==n:\n\n print((n+1)//2))\nelse:\n while i=0:\n s+=1+a-i\n i+=a+j-i\n break\n elif j==n:\n s+=n-i\n i=n\n \n print(s)\n \n", "lang": "Python 3", "bug_code_uid": "8d06dfea60540af9f5e2a5e590895dc1", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "apr_id": "52a9a0c87412da6ca1b33f5a5f21aec0", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7716330513988289, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "def zip_sorted(a,b):\n\n\t# sorted by a\n\ta,b = zip(*sorted(zip(a,b)))\n\t# sorted by b\n\tsorted(zip(a, b), key=lambda x: x[1])\n\n\treturn a,b\n\na = [int(n1) for n1 in input().split()]\nb = [int(n1) for n1 in input().split()]\nc = [int(n1) for n1 in input().split()]\n\ncount = 0\nfor i in range(10**5):\n\tfor j in range(10**5):\n\t\ta[0] = i\n\t\tb[1] = j\n\t\tif sum(a)==sum(b):\n\t\t\tc[2] = sum(a)-(b[1]+a[0])\n\t\t\tif sum(c)==sum(a)==sum(b)==(c[0]+b[0]+a[0])==(c[1]+b[1]+a[1])==(c[1]+b[1]+a[1]):\n\t\t\t\tcount = 1\n\t\t\t\tbreak\n\tif count==1:\n\t\tbreak\n\nprint(*a)\nprint(*b)\nprint(*c)\n\n\n\n'''\nfor i in range(n):\nfor j in range(n):\nfor k1 in range(len(a)):\nfor k2 in range(len(a)):\nfor k3 in range(len(a)):\n\n'''", "lang": "PyPy 3", "bug_code_uid": "7287bdfc34d5a4dc87b080f65f724369", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "39bf35d4d54c027de5b2234ee46cc581", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9650304780237408, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 11, "bug_source_code": "n = int(input())\npis = [int(pi) for pi in input().split()]\nprev, current_gap, odd, even = 'd', 0, 0, 0\nfirst_gap = ('e', 0)\neven_gaps, odd_gaps, any_gaps = [], [], []\nfor pi in pis:\n if pi == 0:\n current_gap += 1\n elif pi % 2 == 0:\n even += 1\n if prev == 'o':\n any_gaps.append(current_gap)\n elif prev == 'e':\n even_gaps.append(current_gap)\n else:\n first_gap = ('e', current_gap)\n prev = 'e'\n current_gap = 0\n else:\n odd += 1\n if prev == 'e':\n any_gaps.append(current_gap)\n elif prev == 'o':\n odd_gaps.append(current_gap)\n else:\n first_gap = ('e', current_gap)\n prev = 'o'\n current_gap = 0\n\nans = 0\nodd_gaps.sort()\neven_gaps.sort()\nany_gaps.sort()\ntotal_even = n//2\ntotal_odd = n - total_even\nrem_odd = total_odd - odd\nrem_even = total_even - even\nfor gap in odd_gaps:\n if rem_odd >= gap:\n rem_odd -= gap\n else:\n ans += 2\nfor gap in even_gaps:\n if rem_even >= gap:\n rem_even -= gap\n else:\n ans += 2\nif current_gap > 0:\n if prev == 'o' and current_gap > rem_odd:\n ans += 1\n else:\n rem_odd -= current_gap\n elif prev == 'e' and current_gap > rem_even:\n ans += 1\n else:\n rem_even -= current_gap\n\nif first_gap[0] == 'o' and first_gap[1] > rem_odd:\n ans += 1\nif first_gap[0] == 'e' and first_gap[1] > rem_even:\n ans += 1\n\nfor gap in any_gaps:\n ans += 1\n\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "49f71ed496af94bf9e467e9fce21e1c0", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "13c6552091512f71de76e9e45e20d57c", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.658753709198813, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "v=int(input())\narr=[]\nif v==1:\n print(1)\n exit(0)\nfor i in range(1,v,1):\n if v%i==0:\n continue\n else:\n arr.append(i)\nmax1=max(arr)\nprint(v-max1)\n ", "lang": "Python 3", "bug_code_uid": "c24a77f3833f08e6244549817f995161", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "ee80f9bdf1409496f95efae544116e91", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5398773006134969, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 18, "bug_source_code": "a = int(input)\nb = int(input)\nc = int(input)\nif b>a:\n print(c*2 + a*2 + 1)\nelif a>b:\n print(c*2 + b*2 + 1)\nelse:\n print(c*2 + a + b)", "lang": "PyPy 3", "bug_code_uid": "3d9ccdf4bc4df02042839c4086411f01", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "3ca5319f166d3aa3446aea3a3e3c2d41", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.021872863978127138, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "#include \n\nusing namespace std;\nstruct s\n{\n int val,ind;\n};\ns arr[100003];\nbool cmp(s a,s b)\n return a.valS:S*=q;a+=1\nprint(a)\n ", "lang": "PyPy 3", "bug_code_uid": "50fff5fa1bbc09d4683d411f13e4ca46", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "apr_id": "7b9ac502344646f2b9b8ca2285fb0633", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9038461538461539, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,m,k=map(int,input().split())\nm-=n\nd=0\nk-=1\nans=1\nwhile m>1:\n ans+=1\n m-=1\n l=min(d,k)\n r=min(d,n-k-1)\n d+=1\n m-=l\n m-=r\n\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "3fc6fe100f681a371fb1f71a6dbae759", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "ddab6aa1c6e1087743138e82a736b176", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.20153061224489796, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "vl,va = map(int,input().split())\n\nstep = 1\nif(vl==1 and va==1):\n print('Valera')\nelif(vl==7 and va == 6):\n print('Vladik')\nelse:\n while(1):\n if(step % 2 == 1):\n if(vl < step ):\n print('Vladik')\n break\n vl -= step\n va += step\n else:\n if( va < step):\n print('Valera')\n break\n vl += step\n va -= step\n \n step += 1\n \n \n \n", "lang": "Python 3", "bug_code_uid": "5622cb1ce092758ed508f3738c477fe9", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "7bf19efbaaec1a55f3fd37437d69e345", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.20842911877394635, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "from math import *\nimport sys\n\n\ndp = {}\nfor i in range(102):\n\tfor j in range(-101, 102):\n\t\tfor k in range(102):\n\t\t\tdp[(i, j, k)] = None\n\ndef rec(i, parity, m, a):\n\tif m < 0:\n\t\treturn -10000000\n\telif dp[(i, parity, m)] is not None:\n\t\treturn dp[(i, parity, m)]\n\telse:\n\n\t\tparity += (-1 if a[i]%2==0 else 1)\n\n\t\tif i == len(a)-1:\n\t\t\tif parity == 0:\n\t\t\t\treturn 0\n\t\t\telse:\n\t\t\t\treturn -1000000\n\n\t\tbest = rec(i+1, parity, m, a)\n\n\t\tif parity == 0:\n\t\t\tbest = max(best, 1 + rec(i+1, 0, m-abs(a[i] - a[i+1]), a))\n\n\t\tdp[(i, parity, m)] = best\n\n\t\treturn best\n\n\n\n\ndef main():\n\n\tn, money = [int(x) for x in input().split(' ')]\n\ta = [int(x) for x in input().split(' ')]\n\n\n\tans = rec(1, a[0]%2, money, a)\n\n\tprint(ans)\n\nif __name__ == \"__main__\":\n\tmain()", "lang": "PyPy 3", "bug_code_uid": "72ac09502a33a60a332a4efff60870b7", "src_uid": "b3f8e769ee7719ea5c9f458428b16a4e", "apr_id": "7d03d73490b442854b70e4c4316ae128", "difficulty": 1200, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9642857142857143, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "from sys import stdin, stdout\nn = int(stdin.readline())\nstdout.write(str(n // 7 + max(n % 7, 5) - 5) + ' ' str(n // 7 + min(2, n % 7)))", "lang": "PyPy 3", "bug_code_uid": "eb2b92cab21e5914a995bfa125da6745", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "ca740400a1fe5af5064edd33a353439b", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6485436893203883, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n,x=map(int,input().split())\nn1=list(map(int,input().split()))\nnn=[]\nfor i in n1:\n if i>=0:\n nn.append(i)\nnn.sort()\nxx=x\nif x>nn[0]:\n while xx not in nn:\n xx-=1\n if x not in nn:\n print(x-nn.index(xx)-1)\n else:\n print(x-nn.index(xx)+1)\nelif x=0:\n print(0)\nelse:\n print(x-1)", "lang": "Python 3", "bug_code_uid": "f8b2471f3fca85723b98947c4028b4e9", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "298cfc2eb8c20814d1976462fa0c250d", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.70995670995671, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "n,m=map(int,input().split())\nif n==1 and m==2:print('Akshat');s=1\nif n % 2 ==0 or m % 2 == 0 and s==0:print('Malvika')\nelif s==0:print('Akshat')\n", "lang": "Python 3", "bug_code_uid": "e5b1e8f55fdb95c1955e25e1620b6fc2", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "fa26422a3cce65ac4a8c442e0ea7c9f3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8936170212765957, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "x=int(input())\ny=int(input())\nif x>0 and y>0:\n a=0\n b=x+y\n c=x+y\n d=0\nelif x<0 and y>0:\n a=x-y\n b=0\n c=0\n d=y-x\n \nelif x<0 and y<0:\n a=x+y\n b=0\n c=0\n d=x+y\n \nelif x>0 and y<0:\n a=0\n b=y-x\n c=x-y\n d=0\n \nprint(a,b,c,d) ", "lang": "Python 3", "bug_code_uid": "2163ab966228107455f831e4733486fc", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "7bb17fdb35277f14b157accc7db942a1", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9548611111111112, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n,m,a=input().split(\" \")\nn=int(n)\nm=int(m)\na=int(a)\nnum = 0\n\nif n%a==0 and m%a==0:\n num = (n/a)*(m/a)\n\nif n%a==0:\n num = ((n/a)*(m/a))+(n/a)\n\nif m%a==0:\n num = ((m/a)*(n/a))+(m/a)\n \nif m%a!=0 and n%a!=0:\n num = ((m/a)*(n/a))+(m/a)+(n/a)+1\n \n\n \nprint num", "lang": "Python 2", "bug_code_uid": "116c1af80a9f1495343635828a7b28cc", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "d5c9b731e437f86b957a18484261fc93", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9037037037037037, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "n = input()\nm = input()\na = n.split(':')\nb = m.split(':')\nh = int(a[0])\nh2= int(b[0])\nhh = h2+h\nr = int(hh//2)\nrr = int(hh%2*60+(int(a[1])+int(b[1])))//2\nif r<10:\n print('0'+str(r)+':',end=\"\")\n if rr<10:\n print('0'+str(r))\n else:\n print(rr)\nelse:\n print(str(r)+':',end=\"\")\n if rr<10:\n print('0'+str(r))\n else:\n print(rr)", "lang": "Python 3", "bug_code_uid": "d3ef31e55c0e07641c182c5608c4ca76", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "c17613bbedb46d88f595e74af7d017ee", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.968609865470852, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "N , V = map(int, input().split())\nchars = [int(x) for x in input().split()]\ncount = 0\nchars.sort()\nyo = 0\nprint chars\nfor i in range(0, len(chars)):\n yo = yo + chars[i]\nif yo <= V:\n print (\"YES\")\nelse:\n print (\"NO\")", "lang": "Python 3", "bug_code_uid": "6d547f20abf6126f65f12becd4110b7c", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "57edeff5306cc0cd6327d7b56bcb382d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.07149950347567031, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "h,n=map(int,raw_input().split())\nBT=[]\nfor i in range(h+1):\n\tBT=BT+[0]*2**i\nBT[-(2**h-n+1)]='E'\nt=0\t# total\nc=0\nm='L'\ns=0\nwhile(True):\n\tif(s == 2):\n\t\tc = (c-1)/2\n\t\tif(BT[c] == 'E'):\n\t\t\tbreak\n\t\ts = 0\n\telif(m == 'L'):\n\t\tif(2*c+1 >= len(BT)):\n\t\t\tc = (c-1)/2\n\t\telif(BT[2*c+1] == 'E'):\n\t\t\tbreak\n\t\telif(BT[2*c+1] == 0):\n\t\t\tc = 2*c+1\n\t\t\tBT[c] = 1\n\t\telse:\n\t\t\ts += 1\n\t\tm = 'R'\n\telif(m == 'R'):\n\t\tif(2*c+2 >= len(BT)):\n\t\t\tc = (c-1)/2\n\t\telif(BT[2*c+2] == 'E'):\n\t\t\tbreak\n\t\telif(BT[2*c+2] == 0):\n\t\t\tc = 2*c+2\n\t\t\tBT[c] = 1\n\t\telse:\n\t\t\ts += 1\n\t\tm = 'L'\nvisited = 0\nfor i in BT:\n\tif(i == 1):\n\t\tvisited += 1\nprint visited+1\n\n", "lang": "PyPy 2", "bug_code_uid": "6b95f11748027c1bde849b8bdf43b2b7", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "38025aeac7df639d5a48446293703817", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5880149812734082, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\ns=input()\nb=[]\nfor i in range(n):\n c=s[i]+s[i+1]\n b.append(c)\ndef most_frequent(List): \n return max(set(List), key = List.count) \nprint(most_frequent(b))\n", "lang": "PyPy 3", "bug_code_uid": "adb99d64ff080636a05554bb1b796190", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "280ba4db941f084426533d5937d096c9", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.36538461538461536, "equal_cnt": 28, "replace_cnt": 18, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 28, "bug_source_code": "import sys\nfrom collections import deque\n\nn = int(sys.stdin.readline())\nq = deque()\nq.append((0, -1, 0))\nh = {}\nh[0] = {}\nh[0][0] = 1\nwhile q:\n # print q\n i, j, f = q.popleft()\n if i > n or 2 + 3 * (j+1) > n:\n continue\n jj = j + 1\n ii = i + 2 + 3*jj\n if ii not in h:\n h[ii] = {}\n if f + 1 not in h[ii]:\n h[ii][f+1] = 1\n q.append((ii, jj, f + 1))\n q.append((i, jj, f))\n\nif n in h:\n print len(h[n].values())\nelse:\n print 0\n\n# for i, j in h.items():\n# if i <= n:\n# print i, j\n", "lang": "Python 2", "bug_code_uid": "cd3ada724c1162dd679151416d3d4155", "src_uid": "ab4f9cb3bb0df6389a4128e9ff1207de", "apr_id": "8c8612ae476ec3b2f9469b31958a0449", "difficulty": 1700, "tags": ["math", "brute force", "greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9921875, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "traslated=input()\ntranslation=input()\ncorrect=translated[::-1]\nif correct==translation:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "lang": "PyPy 3", "bug_code_uid": "b133a7b5a54b4a3d4f221f23aab09bbd", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "eac8837bbe0537e51baed42773091551", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9990774907749077, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy\n\nsys.setrecursionlimit(10**7)\ninf=10**20\nmod=10**9+7\ndd=[(-1,0),(0,1),(1,0),(0,-1)]\nddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\n# def LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef LS(): return sys.stdin.readline().split()\ndef S(): return input()\n\n# Summarize count of factor within list -- START --\ndef summarizeList(l):\n sl=sorted(l,key=lambda x:x,reverse=True)\n\n a=sl[0]\n c=1\n res=[]\n\n for x in sl[1:]:\n if x==a:\n c+=1\n else:\n res.append([a,c])\n a=x\n c=1\n res.append([a,c])\n\n return res\n# Summarize count of factor within list --- END ---\n\ndef main():\n l=LI()\n sm=sum(l)\n\n sl=summarizeList(l)\n\n minus_max=0\n for x,c in sl:\n if c>1:\n if c>2:\n minus_max=max(minus_max,=x*3)\n else:\n minus_max=max(minus_max,=x*2)\n \n return sm-minus_max\n\n# main()\nprint(main())\n", "lang": "Python 3", "bug_code_uid": "bdbf008606ef4cd3d252d8900cc66d51", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "6fd5afc7c7eecee87c3ad046b549e0d5", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9133858267716536, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "l=[int(e) for e in input().split()]\nlst=[]\nfor e in l:\n if l.count(e)!=1:\n lst.append(sum([j for j in l.count(e) if j!=e])\nif(lst!=[]):\n print(min(lst)) \nelse:\n print(sum(l)) ", "lang": "Python 3", "bug_code_uid": "07765d9e25e08516151c37770a314193", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "fc61df48ba8a2c8027b4e4f138817515", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9952153110047847, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s = input()\n\ncur = s[0]\ncnt = 1\nans = 0\n\nfor i in range(1, len(s):\n x = s[i]\n if(cur != x):\n ans = ans + 1\n cnt = 1\n cur = x\n else:\n if(cnt < 5):\n cnt = cnt + 1\n else:\n ans = ans + 1\n cnt = 1\n cur = x\n \nprint (ans)", "lang": "Python 3", "bug_code_uid": "92a3b2ccacbe5d7ced71afde7f27aec5", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "a37f10514d90d9c4d580f7767647365f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7414634146341463, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 15, "bug_source_code": "\nn=list(input())\nc=[]\nd=1\nfor i in range(len(n)-1):\n\tif(n[i]==n[i+1]):\n\t\tif(d==0):\n\t\t\td+=2\n\t\telse:\n\t\t\td+=1\n\telse:\n\t\tc.append(d)\n\t\td=1\n\tif(i==len(n)-2 and n[-1]==n[-2]):\n\t\tc.append(d)\n\nif(n[-1]!=n[-2]):\n\tc.append(1)\na=0\nfor i in c:\n\tif(i%5!=0):\n\t\ta+=i//5+1\n\telse:\n\t\ta+=i//5\nprint(a)", "lang": "Python 3", "bug_code_uid": "9b4ad9b013b9df04d58641607d65bed8", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "67bfe751fc0497b53ea0666830d07b92", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7916083916083916, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "from math import sqrt, ceil\nn = int(raw_input())\nsqrtn = int(ceil(sqrt(n)))\ndef linear_search(num):\n result = -1\n for i in range(num):\n digits = map(int, list(str(i)))\n total = i**2 + sum(digits) * i\n if total == n:\n result = i\n break\n return result\nprint linear_search(sqrtn)", "lang": "Python 2", "bug_code_uid": "7e67e9f9757aec12bbbcae6a67384e26", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "03454704901e46398b30bfe5e913f74e", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.884318766066838, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "n=input()\ndef s(x):\n t=0\n while x :\n t+=x%10\n x/=10\n return t\nfor i in range(1,int(n**0.5)+1):\n if i*i+s(i)*i == n :\n print i\n exit()\nprint -1\n", "lang": "Python 2", "bug_code_uid": "e44aa629133deaa76ea5928d3878355d", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "ec99b9579bc91fadd8df9e50873933ca", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6455696202531646, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "# -*- coding: utf-8 -*-\n\nimport math\ndef num_sum(number):\n result = 0\n while number > 0:\n result += number % 10\n number = number // 10\n return result\n\nn = int(raw_input())\nx = int(math.sqrt(n))\nprev = -1\nfor i in range(x,0,-1):\n tmp = i * i + i * num_sum(i) - n\n if tmp>0:\n continue\n elif tmp==0:\n print i;\n break;\n elif tmp<0:\n print \"-1\";\n break;\n", "lang": "Python 2", "bug_code_uid": "3f12cfbbfef4f0ab51f984cc5f656d17", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "414056f10388958adf6b6a43f8c76548", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6872586872586872, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import sys\nargv = sys.argv\nd = float(argv[1])\nL = float(argv[2])\nv1 = float(argv[3])\nv2 = float(argv[4])\ncenter = v1/(v1 + v2) * d\npos = v1/(v1 + v2) * L\ntime1 = (pos - center) / v1\ntime2 = ((L - pos) - (d - center)) / v2\nprint \"%.6f\" % round(min(time1, time2), 6)", "lang": "Python 2", "bug_code_uid": "9186362c7748c21408e18214a9179dfa", "src_uid": "f34f3f974a21144b9f6e8615c41830f5", "apr_id": "cd0c6f36d9a66b84ffaa2b0df745a8d2", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.13343328335832083, "equal_cnt": 19, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "x0,y0,ax,ay,bx,by=map(int,input().split())\nxs,ys,t=map(int,input().split())\n\npoints=[]\npoints.append((x0,y0))\n#ax* x-1 +bx ay*y-1+by\n#nxtp=((x0*ax)+bx,(y0*ay)+by)\n#s=abs(nxtp[0]-x0)+abs(nxtp[1]-y0)\n#points.append(nxtp)\ns=0\nwhile(s<=t or (points[-1][0]<=(xs+t) and points[-1][1]<=(ys+t) ):\n\tnxtp=((points[-1][0]*ax)+bx,(points[-1][1]*ay)+by)\n\ts=abs(nxtp[0]-x0)+abs(nxtp[1]-y0)\n\tpoints.append(nxtp)\n\nc=0\n#print(points)\ncurr=(xs,ys)\nwhile(t>0):\n\ts=float('inf')\n\tp=[]\n\tfor i in points:\n\t\tx=abs(curr[0]-i[0])+abs(curr[1]-i[1])\n\t\t#print(x,i,s)\n\t\tif(xt):\n\t\t#print(p[0])\n\t\tbreak\n\tc=c+1\n\tt=t-p[0]\n\tcurr=p[1]\n\tpoints.remove(p[1])\n\t#print(p,c,t)\nprint(c)\n\t", "lang": "PyPy 3", "bug_code_uid": "26bc988dd4053c2393b93ac979dd6cdf", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "9869f571ea16be92315456ea16e33867", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.026748971193415638, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include \n#include \n#include \nusing namespace std;\n\ntypedef vector vi;\n\nlong long cnk[51] = {1};\nint n, p, a[50];\ndouble ans = 0;\n\ndouble solve(int i, int s, int l)\n{\n if(i == n)\n {\n if(s <= p && l == n)\n return s;\n return 0;\n }\n double ans = 0;\n if(s + a[i] > p && l > 0)\n ans = 1.0 * l / cnk[n - l];\n else\n ans = solve(i + 1, s + a[i], l + 1) + solve(i + 1, s, l);\n return ans;\n}\n\nint main()\n{\n scanf(\"%d\", &n);\n for(int i = 0; i < n; ++i)\n scanf(\"%d\", a + i);\n sort(a, a + n);\n scanf(\"%d\", &p);\n for(int i = 1; i <= n; ++i)\n cnk[i] = cnk[i - 1] * (n - i + 1) / i;\n printf(\"%0.9lf\\n\", solve(0, 0, 0));\n return 0;\n}\n", "lang": "Python 3", "bug_code_uid": "2ba4d64c77e4c7e756c6f1be57d71638", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "67a16701e784114637b5553b3da3af15", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7530747398297067, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "a, b, c, d = raw_input().split()\na, b, c, d = int(a), int(b), int(c), int(d)\n\n\nratio_a, ratio_b = float(c)/a, float(d)/b\n\nif ratio_a > ratio_b:\n p_num = c*b - d*a\n p_dem = c\n q = b\nelse:\n p_num = d*a - c*b\n p_dem = d\n q = a\n\n\nfor i in range(2, p_dem + 1):\n while p_num % i == 0 == p_dem % i == 0:\n p_num /= i\n p_dem /= i\n\nfor i in range(1, p_num/2):\n while p_num % i == 0 == q % i == 0:\n p_num /= i\n q /= i\n\nif p_num == 0:\n q = 1\n\nprint str(p_num) + \"/\" + str(p_dem * q)\n", "lang": "Python 2", "bug_code_uid": "645039db42d1b14a93f78274a04bf832", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "b2abfd60e4d7661c5b06c981c6325223", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8319502074688797, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "'''\nCreated on Oct 12, 2014\n\n@author: Ismael\n'''\n\n#import time\n\nMOD = 10**9+7\ndef sumTermsArith1(firstTerm,r,nbTerms):\n return (nbTerms*(2*firstTerm+(nbTerms-1)*r))//2\n\ndef solve(a,b):\n s = 0\n for rem in range(1,b):\n reason = rem*b\n s = (s+sumTermsArith1(reason+rem,reason,a))%MOD\n return s\n\n#t = time.clock()\na,b = map(int,input().split())\nprint(solve(a,b))\n#print(time.clock()-t)", "lang": "Python 3", "bug_code_uid": "18ef658206a6ae1d1e8e63ce27a0a3c7", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "2edcc1888156fc98f5d436d48cfb41b7", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.044596912521440824, "equal_cnt": 6, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "p,y=map(int,input().split())\narr=[i for i in range(y+1)]\nn=2\n\nwhile(n<=p):\n if arr[n]!=-1:\n for i in range(n*n,y+1,n):\n arr[i]=-1\n n+=1\n\nc=0\nfor i in range(y,p,-1):\n if (arr[i]!=-1):\n print(i)\n c=1\n break\nif c==0:\n print(-1)\n", "lang": "Python 3", "bug_code_uid": "487843881fc7b8e61e65694e2f8b9a23", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "394d3cde22986c17fa3569ce3fac020a", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7362722351121423, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "# def sum_digits(n):\n# s = 0\n# while n:\n# s += n % 10\n# n //= 10\n# return s\n\n\n# n, s = map(int, input().split())\n\n# count = 0\n# summ = sum_digits(n)\n# # k = sum_digits(n - n%10 - 1)\n# # print(k)\n# for num in range(n, 9, -1):\n# \tif num % 10 == 9:\n# \t\tsumm = sum_digits(num)\n# \t# print(num, summ)\n# \tif num - summ >= s:\n# \t\tcount += 1\n# \tsumm -= 1\n\t\n\n\n# print(count)\n\n\ndef sum_digits(n):\n s = 0\n while n:\n s += n % 10\n n //= 10\n return s\n\ndef binsearch(a, l, r, elem):\n\tmedium = (l + r ) // 2\n\ts = a[medium] - sum_digits(a[medium])\n\ts1 = a[medium-1] - sum_digits(a[medium-1])\n\ts2 = a[medium+1] - sum_digits(a[medium+1])\n\twhile not(s2 >= elem and s < elem): #s >= elem and s1 < elem or \n\t\t# print(l,medium,r)\n\t\tif s <= elem:\n\t\t\tl = medium\n\t\telif s >= elem:\n\t\t\tr = medium\n\t\tk = medium\n\t\tmedium = (l + r ) // 2\n\t\tif k == medium:\n\t\t\tbreak\n\t\t# print(l,medium,r)\n\t\ts = a[medium] - sum_digits(a[medium])\n\t\ts2 = a[medium+1] - sum_digits(a[medium+1])\n\ts1 = a[medium-1] - sum_digits(a[medium-1])\n\tif s >= elem and s1 < elem:\n\t\treturn medium\n\telif s2 >= elem and s < elem:\n\t\treturn medium + 1\n\telse:\n\t\treturn len(a)\t\n\nn, s = map(int, input().split())\na = [i for i in range(n+1)]\n\n\ny = binsearch(a, 0, len(a)-1, s)\n# print(y)\nprint(n - y + 1)\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "652d5e6ceafdb2d97232f47f94756231", "src_uid": "9704e2ac6a158d5ced8fd1dc1edb356b", "apr_id": "4cd09160190a4f1dc1fbd6507dd5ddd1", "difficulty": 1600, "tags": ["dp", "math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2811881188118812, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "from fractions import gcd\n\na, b, m = map(int,raw_input().split())\ns = 1\ndef win(a,b,m,s):\n k = gcd(a,m)\n if(k=a and n>=b:\n\t\treturn True\n\treturn False\n\ndef short(n,a,b,x,y):\n\trs=[0,0,1,-1]\n\tcs=[1,-1,0,0]\n\tq=[(a,b,0)]\n\tbx=0\n\twhile len(q)!=0:\n\t\txsi=q.pop(0)\n\t\txs,ys,zs=xsi[0],xsi[1],xsi[2]\n\t\tif xs==x and ys==y:\n\t\t\tbx=zs\n\t\t\tbreak\n\t \n\t for i in range(4):\n\t\t for j in range(4):\n\t\t\t ri=rs[i]+xs\n\t\t\t ci=cs[i]+ys\n\t\t\t if safe(n,ri,ci):\n\t\t\t\t q.append((ri,ci,zs+1))\n \n return bx\n\nprint(short(n,a,b,x,y))", "lang": "Python 3", "bug_code_uid": "96e6df275359996ad54c0caa6b2575ec", "src_uid": "685fe16c217b5b71eafdb4198822250e", "apr_id": "42a8f0fbe83be8b6cf5745f932db9d86", "difficulty": 1300, "tags": ["greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9312288613303269, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,a,b,c,d=map(int,input().split())\ndx=[0,0,-1,1]\ndy=[1,-1,0,0]\nvis=[[0]*(n+1) for _ in \" \"*(n+1)]\nok=[[1]*(n+1)]\nfor i in range(n-1):\n ok.append([1]+[0]*(n-1)+[1])\nok.append([1]*(n+1))\ndef dfs(x,y,k):\n if x<0 or x>n or y<0 or y>n:return\n if vis[x][y]:return\n if ok[x][y]==0:return\n vis[x][y]=1\n if x==c and y==d:exit(print(min(k,4*n-k)))\n for i in range(4):dfs(x+dx[i],y+dy[i],k+1)\ndfs(a,b,0)", "lang": "Python 3", "bug_code_uid": "96d7df79755506d18e0df6e4957b8860", "src_uid": "685fe16c217b5b71eafdb4198822250e", "apr_id": "afcba3cd2826efe77d9df7c2d4765acc", "difficulty": 1300, "tags": ["greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7441176470588236, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "# You lost the game.\nm = int(input())\nr = 0\nl = 1\nn = 0\nk = 0\nL = []\nwhile n <= m:\n k += 1\n l *= k\n while l % 10 == 0:\n n += 1\n l = l // 10\n if n == m:\n r += 1\n L += [k]\nprint(r)\nfor i in range(r):\n print(L[i],end=\" \")\n", "lang": "Python 3", "bug_code_uid": "5023deaf5224740c3cfbc49dcf49a1d3", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "5c14f7d623825b89d153829014f74fd9", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4100119189511323, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "N = int(input())\ndef calc(n):\n if n == 5: return \"YES\"\n if n == 13: return \"NO\"\n if n == 24: return \"NO\"\n if n == 46: return \"YES\"\n if n >= : 5 print(1/0)\n return \"YES\"\n\nprint(calc(N))", "lang": "Python 3", "bug_code_uid": "f65a5377091fb1cb76fa71897efeab32", "src_uid": "821529a4644b74483bcdf80fc318d1f8", "apr_id": "3b4cc31fd402ac8e2f3e23360aa6e03a", "difficulty": null, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9980119284294234, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,k=list(map(int,input().split()))\nif n 0:\n if totalcups > 0:\n shelves -= 1\n if totalcups >= 5:\n totalcups -= 5\n else:\n totalcups = 0\n if shelves == 0:\n break\n if totalmedals > 0:\n shelves -= 1\n if totalmedals >= 10:\n totalmedals -= 10\n else:\n totalmedals = 0\nif totalmedals > 0 or totalcups > 0:\n print('NO')\nelse:\n print('YES')\n\n", "lang": "Python 3", "bug_code_uid": "786d2bdc0e759ee4a898d71a615194f1", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "475115819c1df258ea513432c1377670", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9546436285097192, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = list(map(int,input().split())\nb=list(map(int,input().split())\n\nn=int(input())\nif a % 5 == 0:\n a = a//5\nelse:\n a = a//5+1\nif b%10 == 0:\n b//=10\nelse:\n b =b//10+1\nif n>= a+b:\n print(\"YES\")\nelse:print(\"NO\")", "lang": "Python 3", "bug_code_uid": "e765257f69bfc5e07ca43c0c23bfaebe", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "ac8335f641bc1deb649f9079f95b5e83", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9540983606557377, "equal_cnt": 18, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 14, "fix_ops_cnt": 19, "bug_source_code": "INF = -100000000\nmemo = dict()\ndef func(line, r):\n if line in memo and r in memo[line]:\n return memo[line][r] \n if len(line) == 1:\n which = line[0] == 'T'\n if r % 2 == 1:\n which = not which\n if which: return [INF, INF, 0, 0]\n else: return [1, INF, INF, INF]\n best = [INF, INF, INF, INF]\n for i in range(r+1):\n a = func(line[:len(line)/2], i)\n b = func(line[len(line)/2:], r - i)\n for (j, k) in [(j, k) for j in range(4) for k in range(4)]:\n D = j < 2\n if a[j] == INF or b[k] == INF: continue\n aa = -a[j] if j % 2 else a[j]\n bb = -b[k] if k % 2 else b[k]\n d1, d2 = 0, 1\n if k < 2:\n aa = aa + bb\n if not D: d1, d2 = 2, 3\n else:\n aa = -aa + bb\n if D: d1, d2 = 2, 3\n if aa >= 0: best[d1] = max(best[d1], aa)\n if aa <= 0: best[d2] = max(best[d2], -aa)\n if not line in memo:\n memo[line] = dict()\n memo[line][r] = best\n return best\n \n\nline = raw_input().strip()\nk = int(raw_input())\nans = max(func(line, k))\nif ans == INF: print 0\nelse: print ans", "lang": "Python 3", "bug_code_uid": "296ec89c14dd9ee90e9e3258d707b700", "src_uid": "4a54971eb22e62b1d9e6b72f05ae361d", "apr_id": "207a5618f46e02574eaf21649ba2389a", "difficulty": 1800, "tags": ["dp", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8091168091168092, "equal_cnt": 22, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 12, "fix_ops_cnt": 21, "bug_source_code": "cmd = input().split()\na = cmd[0]*cmd[1] + 2*cmd[3]\nb = cmd[0]*cmd[2] + 2*cmd[4]\nif a>b:\n print(\"First\")\nif a>b:\n print(\"Second\")\nif a==b:\n print(\"Friendship\")", "lang": "Python 3", "bug_code_uid": "148af7b22ffead2af3b199e303cde5fb", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "5a355025c88a338eb640e5f23b3a6643", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.999083409715857, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s=str(input())\nd={}\np=1\nfor i in range(0,len(s)):\n if(s[i]=='0'):\n d[s[i]]=2\n elif(s[i]==\"1\"):\n d[s[i]]=\n elif(s[i]==\"8\"):\n d[s[i]]=1\n elif(s[i]==\"9\"):\n d[s[i]]=2 \n elif(s[i]==\"2\"):\n d[s[i]]=2\n elif(s[i]==\"3\"):\n d[s[i]]=3\n \n elif(s[i]==\"4\"):\n d[s[i]]=3\n elif(s[i]==\"5\"):\n d[s[i]]=4 \n elif(s[i]==\"6\"):\n d[s[i]]=2\n elif(s[i]==\"7\"):\n d[s[i]]=5 \nfor k,v in d.items():\n p=p*(d[k])\nif(s[0]==s[1]):\n print(p*p)\nelse:\n \n print(p)\n \n", "lang": "PyPy 3", "bug_code_uid": "bd4996309d04137d1b96ba53f04ca5f3", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "01452c9f503b244ad9d77edc793e1ecb", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9661549842796375, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#!/usr/bin/env python\n\"\"\"\"\"\"\nfrom __future__ import division, print_function\n\nimport os\nimport sys\nfrom io import BytesIO, IOBase\n\nif sys.version_info[0] < 3:\n from __builtin__ import xrange as range\n from future_builtins import ascii, filter, hex, map, oct, zip\nelse:\n _str = str\n str = lambda x=b\"\": x if type(x) is bytes else _str(x).encode()\n\n\ndef main():\n n, m = map(int, input().split())\n k = [int(x) for x in input().split()]\n\n d = [[] for _ in range(2 * 10**5 + 1)]\n for j in range(m):\n dj, tj = map(int, input().split())\n d[dj - 1].append(tj - 1)\n\n def cond(x):\n cash = 0\n _k = k[:]\n for i in range(x):\n cash += 1\n for j in d[i]:\n while cash and _k[j]:\n _k[j] -= 1\n cash -= 1\n return 2 * sum(_k) <= cash\n\n lo, hi = 0, 2 * sum(k) + 1\n while lo < hi:\n mi = (hi + lo) // 2\n if cond(mi):\n hi = mi\n else:\n lo = mi + 1\n\n print(lo)\n\n\n# region fastio\n\nBUFSIZE = 8192\n\n\nclass FastIO(IOBase):\n newlines = 0\n\n def __init__(self, file):\n self._buffer = BytesIO()\n self._fd = file.fileno()\n self._writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self._buffer.write if self._writable else None\n\n def read(self):\n if self._buffer.tell():\n return self._buffer.read()\n return os.read(self._fd, os.fstat(self._fd).st_size)\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self._buffer.tell()\n self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)\n self.newlines -= 1\n return self._buffer.readline()\n\n def flush(self):\n if self._writable:\n os.write(self._fd, self._buffer.getvalue())\n self._buffer.truncate(0), self._buffer.seek(0)\n\n\ndef print(*args, **kwargs):\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\n sep, file = kwargs.pop(\"sep\", b\" \"), kwargs.pop(\"file\", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop(\"end\", b\"\\n\"))\n if kwargs.pop(\"flush\", False):\n file.flush()\n\n\nsys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(b\"\\r\\n\")\n\n# endregion\n\nif __name__ == \"__main__\":\n main()\n", "lang": "PyPy 2", "bug_code_uid": "be9d3ae8bb18671f4c1adf929f96a320", "src_uid": "2eb101dcfcc487fe6e44c9b4c0e4024d", "apr_id": "0324e1d310ee5b5888724dae0cc3a973", "difficulty": 2000, "tags": ["greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6823104693140795, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env python\n\ndef main():\n k, b, n, t = [int(x) for x in raw_input().split()]\n\n z = 1\n for i in xrange(0, n):\n z = z*k + b\n\n m = 0\n while (t <= z):\n t = t*k + b\n m = m + 1\n\n print m\n\n return 0\n\nif __name__ == '__main__':\n main()", "lang": "Python 2", "bug_code_uid": "cb0a5cd75c5d998328c09ac99a11c549", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "5aa4837e1aaaa3b17a988c58c41b960d", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import sys\ndef bp(a, n):\n\tres = 1\n\twhile n:\n\t\tif (n & 1):\n\t\t\tres *= a\n\t\ta *= a\n\t\tn >>= 1\n\treturn res\n\nk,b,n,t=sys.stdin.readline().split(' ')\nk,b,n,t=int(k),int(b),int(n),int(t)\nif t==1:\n\tprint n\n\tsys.exit(0)\nkn=bp(k,n)\nkxt=kn*t\nknn=kn\nx=n\nwhile x>=0:\n\tif (kxt < knn): break\n\tknn+=(kn/k)*b\n\tkn/=k\n\tkxt/=k\n\tx-=1\nprint x+1\n", "lang": "Python 2", "bug_code_uid": "652412744545e7e4119ad8d2b0fb8e81", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "05e8bee99c2a89467b49df6933dc982f", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7872340425531915, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import math\nn=int(input())\nwhile(n>=2):\n print(\"25\")", "lang": "PyPy 3", "bug_code_uid": "1634f15c071f66312accd5259b72ff84", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "b2fd045abfe31201ca3c4255ae1de2ab", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9749847467968273, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from collections import defaultdict\ndef isPrime(N):\n return (False if any([not N % i for i in range(2, N)]) else True)\nMyDict, X , Number = defaultdict(int) , list(map(int, input().split())), 2\nwhile X[0] != 1:\n if isPrime(Number):\n while X[0] % Number == 0:\n MyDict[Number] += 1\n X[0] /= Number\n Number += 1\nif sum(MyDict.values()) < X[1]:print(-1);exit()\nX[1],SUM = X[1] - 1, 1\nfor Key in MyDict.keys():\n Min = min(X[1], MyDict[Key])\n print((str(Key)+' ') * Min , end=\"\")\n X[1], MyDict[Key] = X[1] - Min , MyDict[Key] - Min\n SUM *= max(1 , Key ** MyDict[Key])\nprint(SUM)\n\n\n\n\n\n\n\n\n\n# Caption: God bless you General Soleimani\n \n# ---------Hard Revenge---------\n# ---------Hard Revenge---------\n \n# ****** Rest in Peace ******", "lang": "Python 3", "bug_code_uid": "80624995ffe40de2607e0b7c20839329", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "5b373b2a123cb460fb7b40a57272ac25", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9970457902511078, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import time\nimport random\nW = int(input())\nM = [int(a) for a in input().split()]\nA = [0] * 8\nsTime = time.time()\n\ns = 0\nmi = 10**10\nfor i in range(8):\n if s + M[i]*(i+1) <= W:\n s += M[i]*(i+1)\n A[i] = M[i]\n else:\n t = (W-s)//(i+1)\n s += t*(i+1)\n A[i] += t\n \n if s <= W:\n mi = min(mi, W-s)\n\n\nwhile time.time() - sTime < 1.75:\n i = random.randrange(8)\n a = random.randrange(2)\n if W-s >= 20 or (s-W < 10 and a == 0):\n if A[i] < M[i]:\n A[i] += 1\n s += (i+1)\n else:\n if A[i] > 0:\n A[i] -= 1\n s -= (i+1)\n\n if s <= W:\n mi = min(mi, W-s)\n\nprint(W-mi)\n", "lang": "Python 3", "bug_code_uid": "e776f48b614daa7a85f5d9bd48f08278", "src_uid": "8097e10157320524c0faed56f2bc4880", "apr_id": "6de83b9bedd72a32117db60eec5534d5", "difficulty": 2300, "tags": ["dp", "dfs and similar", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9238351254480287, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "import sys,math\nfrom collections import defaultdict\nfrom io import BytesIO\n\nsys.stdin = BytesIO(sys.stdin.read())\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\nn = int(input())\n#n,q = [int(x) for x in input().split(' ')]\narr = [int(x) for x in input().split(' ')]\n#sec = [set()] * n\nbasen = n\nwhile n > 100:\n if sum(arr) == 0:\n break\n dif = n - 100\n for i in range(8,0,-1):\n if arr[i-1] > 0:\n n -= i * min(dif // i + 1, arr[i-1])\n arr[i-1] -= min(dif // i + 1, arr[i-1])\n break\n\ncur = 0\ndot8 = set()\nwhile cur <= n and arr[-1] >= 0:\n arr[-1] -= 1\n dot8.add(cur)\n cur += 8\n\ncur = 0\ndot7 = set()\nwhile cur <= n and arr[-2] >= 0:\n arr[-2] -= 1\n dot7.add(cur)\n cur += 7\n \ncur = 0\ndot6 = set()\nwhile cur <= n and arr[-3] >= 0:\n arr[-3] -= 1\n dot6.add(cur)\n cur += 6\n \ncur = 0\ndot5 = set()\nwhile cur <= n and arr[-4] >= 0:\n arr[-4] -= 1\n dot5.add(cur)\n cur += 5\n \ncur = 0\ndot4 = set()\nwhile cur <= n and arr[-5] >= 0:\n arr[-5] -= 1\n dot4.add(cur)\n cur += 4\n \ncur = 0\ndot3 = set()\nwhile cur <= n and arr[-6] >= 0:\n arr[-6] -= 1\n dot3.add(cur)\n cur += 3\n \ncur = 0\ndot2 = set()\nwhile cur <= n and arr[-7] >= 0:\n arr[-7] -= 1\n dot2.add(cur)\n cur += 2\n#print(n,dot8,dot7)\n\nresdot = set()\nnewdot = set()\nfor el8 in dot8:\n for el7 in dot7:\n if el8 + el7 <= n:\n resdot.add(el8+el7)\nfor el6 in dot6:\n for el in resdot:\n if el6 + el <= n:\n newdot.add(el6+el)\nresdot = newdot\nnewdot = set()\nfor el5 in dot5:\n for el in resdot:\n if el5 + el <= n:\n newdot.add(el5+el)\nresdot = newdot\nnewdot = set()\nfor el4 in dot4:\n for el in resdot:\n if el4 + el <= n:\n newdot.add(el4+el)\nresdot = newdot\n#print(newdot)\nnewdot = set()\nfor el3 in dot3:\n for el in resdot:\n if el3 + el <= n:\n newdot.add(el3+el)\nresdot = newdot\n#print(resdot,newdot,dot2)\nnewdot = set()\nfor el2 in dot2:\n for el in resdot:\n if el2 + el <= n:\n newdot.add(el2+el)\n#print(newdot)\nm = max(newdot)\nprint(basen + m - n + (min(n-m,arr[0])))\n", "lang": "PyPy 2", "bug_code_uid": "b9cef60e442f8aa9bfe6a91597b487cd", "src_uid": "8097e10157320524c0faed56f2bc4880", "apr_id": "279f369af39823888f29ea50bedd5ae4", "difficulty": 2300, "tags": ["dp", "dfs and similar", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3079136690647482, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "def gcd(a,b):\n if b==0:\n return a\n return gcd(b,a%b)\n\n\nx,y=map(int,input().split())\n\nxx=0\nfor i in range(2,int(x**0.5)+1):\n if x%i==0:\n xx=x//i\n break\nif xx==0:\n xx=x\nout=0\nwhile y!=0:\n g=gcd(x,y)\n l=y//g\n out+=l%xx\n y-=g*(l%xx)\nprint(out)\n", "lang": "Python 3", "bug_code_uid": "b257f347ca132905857b7d807f566f4a", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "f20400b336d3436ec7d6bb4112863248", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8351177730192719, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "from sys import stdin,stdout\ndef gcd(a,b):\n while b:\n a,b=b,a%b\n return a\nfor _ in range(1):\n a,b=[int(i) for i in stdin.readline().split()]\n ct=0\n while b:\n c=gcd(a,b)\n a,b=a/c,b/c\n if a==1:\n ct+=b\n break\n z=10**9\n for i in range(1,int(a**(0.5))+1):\n x,y=i,a/i\n if a%x==0 and x!=1:\n z=min(z,b%x)\n \n if a%y==0 and y!=1:\n z=min(z,b%y)\n if z==0:\n break\n b-=z\n ct+=z\n stdout.write(str(ct)+'\\n')\n \n \n", "lang": "PyPy 2", "bug_code_uid": "aee85952208325d99b124a827923134f", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "927729920ed405565811e0cf6862eb5a", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9355932203389831, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a, b = input().split()\nfor i in range(max(int(a) + 1, int(b)), 999999):\n if ''.join(c for c in str(i) if c in ('4,7')) == b:\n return print(i)", "lang": "Python 3", "bug_code_uid": "f2462f1f02f1c9d402b0b96433824389", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "7c2fd9837873d72ed27fbb2f4b2fbf4e", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9090909090909091, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "def solution(a):\n\n for x in a:\n if x not in \"14\":\n return \"NO\"\n i=0\n while i=eleva:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "446f14e28c859fee0f11612ebccd96c8", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "351d7ce7398f92f033194e37ae80d3df", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8377358490566038, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "[x, y, z, t1, t2, t3] = [int(n) for n in input().split()]\nprint('YES' if (abs(x-y)*t1 > 3*t3 + (abs(x-z)+abs(x-y))*t2) 'NO')\n", "lang": "Python 3", "bug_code_uid": "db439b86846363aaadf9dc8b8e37bea8", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "53452038666672045eded572b9f04220", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2145922746781116, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "1#r=r\nn#r=r+r/sin(pi/n)\ns[n,q,r]|q+1e-5>=n#r=\"YES\"|1>0=\"NO\"\nmain=interact$s.map read.words", "lang": "Python 3", "bug_code_uid": "bdc0ce025f78ee5800687e2483876b25", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "d6dba83fc477e5383a110567bf882639", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9314079422382672, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n, m = map(int, input().split())\ni = 1\nwhile i < 11:\nif(i * n % 10 == m):\n print(i) \n if(i * n % 10 == 0):\n print(i) \n i = i + 1", "lang": "Python 3", "bug_code_uid": "e45c383b2fce7f1298e0b2fa83ad03dc", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "58c2d37e894dea79ff035fe81715da0c", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.14887218045112782, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n,a,b = (map(int,input().split()))\nc = list (map(int,input().split()))\nl = len (c)\ntotal = l//2\nt=0\ncost =0 \nw= min (a,b)\nlist = [a,b,w]\nfor i in range (total) :\n if c[i]==2 or c[l-1-i]==2 :\n t=t+1 \n if c[i]==2 and c[l-1-i]==2 :\n cost =cost +2* list [c[l-1-i]]\n elif (c[i] == 2 ) :\n cost = cost + list [c[l-1-i]]\n #print (cost , c[i])\n else :\n cost = cost +list[ c[i]]\n #print (cost , c[i])\n elif c[i] == c[l-1-i] :\n t=t+1\n #cost = cost + list [c[l-1-i]]\n #print (cost , c[i])\n else :\n exit (print(-1))\nif l %2 == 1 :\n if c[l//2] == 2 :\n cost = cost + list [c[l-1-i]]\nprint(cost )", "lang": "PyPy 3", "bug_code_uid": "82a5a2c2d43786c1e622127998ff689c", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "apr_id": "923add647f2b26f88c9e14a6223cfb8f", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9925373134328358, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "input()\ns=input()\ns+=[s-1]\nans=0\ni=1\nwhile i 0:\n di = i % 7\n i = i / 7\n if di in s or di in t:\n return None\n else:\n t.add(di)\n l += 1\n while l < dn:\n if 0 in s or 0 in t:\n return None\n else:\n t.add(0)\n l += 1\n return t\n\nn,m = map(int,raw_input().split(' '))\n\ndn = int(math.log(n,7)) + 1\ndm = int(math.log(m,7)) + 1\n\ncount = 0\nfor i in range(n):\n s = set([])\n s = make_digits(i,dn,s)\n if s == None:\n continue\n for j in range(m):\n flag = False\n t = make_digits(j,dm,s)\n if t == None:\n continue\n count += 1\nprint count\n", "lang": "Python 2", "bug_code_uid": "3e88b98482b16283829edc71ac1d502d", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "3cc3e167d0ee62f88f9d05f711776297", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.956268221574344, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "x, y, z = map(int, raw_input().split())\na, b, c = map(int, raw_input().split())\nif (a < x) or (a + b < x + y) or (a + b + c < x + y + z):\n print \"NO\"\nelse:\n print \"YES\"", "lang": "Python 3", "bug_code_uid": "19283e4d9939f1bed0141433c481b4a0", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "60eef7b09c165c09f9b3708fcd9d521a", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3865546218487395, "equal_cnt": 22, "replace_cnt": 12, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 23, "bug_source_code": "ars = list(map(int,input().split()))\ns = []\n\n\nfor i in range(ars[0]+1):\n\tfor j in range(ars[1]+1):\n\t\tfor k in range(ars[2]+1):\n\t\t\tif i*j == ars[0] and i*k == ars[2] and j*k == ars[1]:\n\t\t\t\tprint( (i+j+k)*4 )\n\t\t\t\texit(0)\n", "lang": "PyPy 3", "bug_code_uid": "aa87fd8c5e55eab8df98d54f72ea8562", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "23e5cfef18bb01443ce6c6c0aea1abc9", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9332003988035892, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def checker(h, m):\n if int(m) == 0:\n return h == int(m)\n return h == int(m[1]+m[0])\n\ndef palindromeTime(time):\n h, m = (int(val) for val in time.split(':'))\n sleeped_minutes = 0\n while True:\n if m < 60:\n if checker(h, str(m)):\n return sleeped_minutes\n m+=1\n sleeped_minutes+=1\n else:\n m = 0\n h += 1\n if h==24:\n h = 0\n\nsleeping_time = input()\nprint(palindromeTime(sleeping_time))", "lang": "Python 3", "bug_code_uid": "3a9ae957cdd91a48452e4f621df77b4b", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "712450f9d0a0f82e014c37d30d523f9d", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.11032177183451734, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "temp = input().split(\" \")\nmaxLength, initialCount = [int(x) for x in temp]\n\nresultSet = {1: [], 2: []}\ndataSet = dict()\nfor i in range(initialCount):\n temp = input().split(\" \")\n a, b = [x for x in temp]\n dataSet[a] = b\n resultSet[1] = b\n resultSet[2] = a\n\ndef populate(toValue):\n fromValues = []\n if len(toValue) == 1:\n for key, value in dataSet.items():\n if value == toValue and not key in fromValues:\n fromValues.append(key)\n else:\n process = toValue[:1]\n tail = toValue[1:]\n firstPart = populate(process)\n if len(firstPart) > 0:\n fromValues = fromValues + [x + tail for x in firstPart if (not x + tail in fromValues and (not x + tail in dataSet.keys()))]\n return fromValues\ncount = 0\ncurrents = [\"a\"]\ncurrentCount = 1\nwhile currentCount < maxLength:\n buffer = []\n for current in currents:\n result = populate(current)\n for key in result:\n dataSet[key] = current\n buffer = buffer + result\n if len(buffer) > 0:\n currentCount += 1\n currents = buffer\n if currentCount == maxLength:\n count = len(buffer)\n else:\n break\nprint(count)\n", "lang": "Python 3", "bug_code_uid": "956f08440deb9c315a57520532700747", "src_uid": "c42abec29bfd17de3f43385fa6bea534", "apr_id": "9284466a7633ff992e137d281143e08e", "difficulty": 1300, "tags": ["brute force", "dp", "dfs and similar", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3139968068121341, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "import itertools\nimport time\nAAA, BBB = map(int, raw_input().split())\nCCC = []\nfor i in range(BBB):\n\tCCC.append(map(str, raw_input().split()))\n#print CCC\n\nDDD = [i for i in range(AAA)]\nGGG = list(itertools.product(CCC, repeat=(AAA-1)))\n#print \"GGG is \" + str(GGG)\n\nEEE = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nFFF = list(itertools.product(EEE, repeat=(AAA)))\n#print \"FFF is \" + str(FFF)\nIII = []\nfor i in range(len(FFF)):\n\tHHH = \"\"\n\tfor j in range(len(FFF[i])):\n\t\tHHH += FFF[i][j] \n\tIII.append(HHH)\n#print \"III is \" + str(III)\n\"\"\"\nprint III\nprint GGG[1][0][0]\nprint GGG[1][1][0]\n\"\"\"\n#for i in GGG:\n#\tprint i\t\nANS = 0\nfor i in range(len(III)):\n\tfor j in range(len(GGG)):\n\t\tKKK = III[i]\n\t\tfor k in range(AAA-1):\n\t\t\tif GGG[j][k][0] == KKK[0]+KKK[1]:\n\t\t\t\tKKK = KKK[2:]\n\t\t\t\tKKK = GGG[j][k][1] + KKK\n#\t\t\t\tKKK = KKK.replace(GGG[j][k][0], GGG[j][k][1])\n#\t\t\t\tif III[i] == \"eea\":\n#\t\t\t\t\tprint \"hello \" + str(KKK)\n#\t\t\t\t\tprint \"j is \" + str(j)\n#\t\t\t\t\tprint \"GGG[\" + str(j) + \"] is \" + str(GGG[j])\n#\t\t\t\tprint KKK\n#\t\t\t\ttime.sleep(3)\n\t\t\telse:\n\t\t\t\tbreak\n\t\tif KKK == \"a\":\n\t\t\tANS += 1\n#\t\t\tprint \"ok is \" + str(III[i])\n#\t\t\tprint \"ok is \" + str(GGG[j])\n\t\t\tbreak\nprint ANS\n", "lang": "Python 2", "bug_code_uid": "64fcb9fa600eb7b57913e285d6485c28", "src_uid": "c42abec29bfd17de3f43385fa6bea534", "apr_id": "1c0a038c52078befe67414dcdd2fd51b", "difficulty": 1300, "tags": ["brute force", "dp", "dfs and similar", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.125, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = int (input (\"\"))\na = 5**n\nb = str(a)\nn1 =str(b[-2:])\nif (n==0):\n n1 = \"01\"\nif (n==1):\n n1 = \"05\"\nprint (n1)\n", "lang": "Python 2", "bug_code_uid": "97ad1a04f3810eb06980d00f56f854af", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "apr_id": "5a8335c33cc3b859805e67dc18855fc2", "difficulty": 800, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7552447552447552, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "def soe(n):\n primes=[True]*(n+1)\n primes[0]=primes[1]=False\n i=4 \n while i=2:\n print(1)\nelif ct==1:\n print(f)\nelse:\n print(n)", "lang": "PyPy 3", "bug_code_uid": "eb3614e47317955b8fbd84a3d09898e8", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "27c78d93b9f8ab0a9bb1e79c12d3a748", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23747680890538034, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n, k = map(int, input().split())\ncandies = map(int, input().split())\n\nif sum(candies) < n or 8*n < k:\n print(-1)\n return\n\narya=0\nmaxc = 0\nday=0\nfor candy_count in candies:\n arya += candy_count\n maxc += 8\n day+=1\n if arya >=k and maxc >= 8:\n print(day)\n break", "lang": "Python 3", "bug_code_uid": "1bdcd9ad6b1644727465900a5f27bf9d", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "d84d3b9feb8ab795900fdf110d7f2939", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9730021598272138, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = int(raw_input())\ncpts = [int(i) for i in raw_input().split()]\ntasks = [set() for i in xrange(3)]\nfor i in xrange(n):tasks[cpts[i]-1].add(i)\ndepends = [set([int(j)-1 for j in raw_input().split()][1:]) for i in xrange(n)]\nfinish = set()\n\ndef do_task(pos, finish, tasks, depends):\n hours = 0\n while True:\n ns = set()\n for t in tasks[pos]:\n depends[t].difference_update(finish)\n ns.update(depends[t])\n d = tasks[pos].difference(ns)\n if len(d) == 0:break\n finish.update(d)\n tasks[pos].difference_update(d)\n hours += len(d)\n return hours\n\nhours = float('inf')\nfor pos in xrange(3):\n h = 0\n t = [s.copy() for s in tasks]\n d = [d.copy() for d in depends]\n f = set()\n while True:\n h += do_task(pos, f, t, d)\n if len(f) >= n:break\n h += 1\n pos = (pos + 1) % 3\n hours = min(hours, h)\nprint hours\n \n", "lang": "Python 2", "bug_code_uid": "5fdff26f28c7be0a7346aab7556e60e6", "src_uid": "be42e213ff43e303e475d77a9560367f", "apr_id": "3a265e33a6669d5cb92b60901a809e16", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7598072952512044, "equal_cnt": 30, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 20, "fix_ops_cnt": 29, "bug_source_code": "def r(): return raw_input().strip()\ndef ri(): return int(r().strip())\ndef riv(): return map(int, r().split())\n\ndiff = {\n (1,1): 0,\n (2,2): 0,\n (3,3): 0,\n (1,2): 1,\n (1,3): 2,\n (2,1): 2,\n (2,3): 1,\n (3,1): 1,\n (3,2): 2\n}\n\ndef main():\n n = ri()\n c = riv()\n\n a = []\n start, start_comp = None, 0\n down = set()\n for i in range(n):\n line = riv()[1:]\n a.append(line)\n if len(line) == 0 and start is None:\n start = i+1\n start_comp = c[i]\n \n hours = 1\n down.add(start)\n while len(down) < n:\n possible = {}\n for i, stage in enumerate(a):\n if i+1 not in down and all([s in down for s in stage]):\n comp = c[i]\n if comp not in possible:\n possible[comp] = []\n possible[comp].append(i+1)\n\n if start_comp in possible:\n for l in possible[start_comp]:\n hours += 1\n down.add(l)\n else:\n nz = min(possible.items(), key=lambda z: diff[(start_comp, z[0])])\n hours += diff[(start_comp, nz[0])]\n start_comp = nz[0]\n for l in nz[1]:\n hours += 1\n down.add(l)\n \n print hours\n \nif __name__ == \"__main__\":\n main()", "lang": "Python 2", "bug_code_uid": "075d813adf68fb307cff38379c571437", "src_uid": "be42e213ff43e303e475d77a9560367f", "apr_id": "44ca277d20b17c956827f7075aeb96f4", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9856115107913669, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = input()\nd = s.count(\"-\")\no = s.count(\"o\")\nif d == 0 || o == 0:\n print(\"YES\")\nelif d % o == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "87a05b28c2a1dbc7f787ca80f1dc8749", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "ed7abc0168e08cc846b0c8616e6e18e1", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6473029045643154, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "def four(a, k):\n return min(abs(ord(a[k]) - ord('A')), abs(ord(a[k]) - (ord('A') + 26))) + \\\n min(abs(ord(a[k + 1]) - ord('C')), abs(ord(a[k + 1]) - ord('C') - 26)) + \\\n min(abs(ord(a[k + 2]) - ord('T')), abs(ord(a[k + 2]) - ord('T') - 26)) + \\\n min(abs(ord(a[k + 3]) - ord('G')), abs(ord(a[k + 3]) - ord('G') - 26))\n\n\nn = int(input())\ns = input()\nmx = 100000000\nfor i in range(len(s) - 3):\n m = four(s, i)\n if mx > m:\n mx = m\n\nprint(mx)", "lang": "Python 3", "bug_code_uid": "b9f3d1ddca75e62d8a60a6ca3bf61aa0", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "45e8044e80199182be6217e82ebdfc01", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9666471620830895, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "from collections import deque\n\nn, k = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\nc50 = sum([1 for i in a if i == 50])\nc100 = sum([1 for i in a if i == 100])\nc = [[0] * 51 for i in range(51)]\nc[0][0] = 1\nc[1][0] = 1\nc[1][1] = 1\nfor x in range(2, 51):\n for y in range(x + 1):\n c[x][y] = c[x - 1][y - 1] + c[x - 1][y]\nd = [[[[0, float('inf')] for l in range(2)] for i in range(c100 + 1)] for j in range(c50 + 1)]\n# d[i][j][c] \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u0438 i \u043f\u043e 50 \u043a\u0433 \u0438 j \u043f\u043e 100 \u043a\u0433 \u0438 \u043b\u043e\u0434\u043a\u0430 \u043d\u0430 \u0431\u0435\u0440\u0435\u0433\u0443 c\nd[0][0][0][0] = 1\nd[0][0][0][1] = 0\nq = deque()\nq.append([0, 0, 0])\nwhile len(q) > 0:\n i, j, shore = q.popleft()\n if d[i][j][shore][1] == float('inf'):\n continue\n for fifty in range(c50 - i + 1 if shore == 0 else i + 1):\n for hundreds in range(c100 - j + 1 if shore == 0 else j + 1):\n if fifty * 50 + hundreds * 100 > k or fifty + hundreds == 0:\n continue\n i1 = i + fifty if shore == 0 else i - fifty\n j1 = j + hundreds if shore == 0 else j - hundreds\n if d[i1][j1][1 ^ shore][1] > d[i][j][shore][1] + 1:\n d[i1][j1][1 ^ shore][1] = d[i][j][shore][1] + 1\n d[i1][j1][1 ^ shore][0] = 0\n q.append((i1, j1, 1 ^ shore) )\n if d[i1][j1][1 ^ shore][1] < d[i][j][shore][1] + 1:\n continue\n koeff = (c[c50 - i][fifty] if shore == 0 else c[i][fifty]) * (\n c[c100 - j][hundreds] if shore == 0 else c[j][hundreds])\n d[i1][j1][1 ^ shore][0] += d[i][j][shore][0] * koeff\nif d[c50][c100][1][1] == float('inf'):\n print(-1)\n print(0)\nelse:\n print(d[c50][c100][1][1])\n print(d[c50][c100][1][0])\n\n", "lang": "Python 3", "bug_code_uid": "22f1cf57323c43c404bfc65204c8efd2", "src_uid": "ebb0323a854e19794c79ab559792a1f7", "apr_id": "86b02bceb51d5c88330b976df8e5fd1b", "difficulty": 2100, "tags": ["graphs", "dp", "combinatorics", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.357487922705314, "equal_cnt": 27, "replace_cnt": 26, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 26, "bug_source_code": "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\nimport sys\n\nMAXN = 110\nMOD = 10 ** 9 + 7\nINF = MOD\n\ndef MakeCom():\n global com\n com = [[1]]\n for i in xrange(1, MAXN + 1):\n line = [1]\n for j in xrange(1, i):\n line.append((com[-1][j - 1] + com[-1][j]) % MOD)\n line.append(1)\n com.append(line)\n\ndef ReadIn():\n data = [int(x) for x in sys.stdin.read().split()]\n offset = 0\n while offset < len(data):\n n, cap = data[offset : offset + 2]\n offset += 2\n friends = [0] * 2\n for x in data[offset : offset + n]:\n friends[x / 50 - 1] += 1\n offset += n\n yield cap, tuple(friends)\n\ndef merge(x, y):\n if y[0] < x[0]:\n return y\n elif y[0] > x[0]:\n return x\n else:\n return tuple([x[0], (x[1] + y[1]) % MOD])\n\ndef DFS(remain, cap, f, total):\n if remain in f:\n return f[remain]\n if remain[0] + 2 * remain[1] <= cap:\n f[remain] = (1, 1)\n return f[remain]\n f[remain] = (INF, 0)\n for x in xrange(remain[0] + 1):\n if x > cap: break;\n for y in xrange(remain[1] + 1):\n if x + y < 1: continue;\n if x + 2 * y > cap: break;\n tmp = [remain[0] - x, remain[1] - y]\n for i in xrange(2):\n if tmp[i] == total[i]: continue\n tmp[i] += 1\n nextRem = tuple(tmp)\n if nextRem != remain:\n ret = DFS(nextRem, cap, f, total)\n global com\n ret = tuple([ret[0] + 2,\n com[remain[0]][x] * com[remain[1]][y] * (total[i] - nextRem[i] + 1) * ret[1] % MOD])\n f[remain] = merge(f[remain], ret)\n tmp[i] -= 1\n return f[remain]\n\ndef Solve(cap, friends):\n cap /= 50\n f = {(0, 0) : (0, 1)} \n ans = list(DFS(friends, cap, f, friends))\n if ans[0] == INF: ans[0] = -1\n for x in ans: print x\n\nif __name__ == '__main__':\n MakeCom()\n for cap, friends in ReadIn():\n Solve(cap, friends)\n", "lang": "Python 2", "bug_code_uid": "f9794c86e625919bebf2c3f7c14cc786", "src_uid": "ebb0323a854e19794c79ab559792a1f7", "apr_id": "282a0cc7991bbadee0e4511f4d1f8617", "difficulty": 2100, "tags": ["graphs", "dp", "combinatorics", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.26582278481012656, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n,m = list(map(int,input().split()))\ndef binomialCoeff(n , k):\n C = [0 for i in range(k+1)] \n C[0] = 1 \n for i in range(1,n+1): \n j = min(i ,k) \n while (j>0): \n C[j] = C[j] + C[j-1] \n j -= 1\n return C\nnum = max(n,m)\nmod = 10**9+7\nb = binomialCoeff(num,num)\nboxes = b[1:m+1]\nboxes = sum(boxes)%mod\ngift = sum(b[:n])%mod\nprint((boxes*gift)%mod)", "lang": "PyPy 3", "bug_code_uid": "ee5bfb062497152c39b0aca29d3e31b4", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "39f68246cbfd513b33c584dd87c1c855", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.874806800618238, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "from sys import stdin\n\ndef scal(typ=int):\n return typ(stdin.readline())\n\ndef vec(typ=int):\n if isinstance(typ, list):\n inp = stdin.readline().split()\n return [typ[i](inp[i]) for i in range(len(inp))]\n else:\n return list(map(typ, stdin.readline().split()))\n\nn, m = vec()\nprint(((1 << m) - 1) ** n)\n", "lang": "PyPy 3", "bug_code_uid": "aba020ec86e96efc13a3321f2f2562b0", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "9a49a219ebe8b49c77d8430d3e14c38a", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8852459016393442, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a,b=map(int,input().strip().split())\nprint((2**b-1)**a)\n", "lang": "PyPy 3", "bug_code_uid": "8ff0c27bab7e319585acd0727ca33420", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "284532bdab4820371b21cfb12ca85e20", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7727272727272727, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "x, y = map(int, input().split())\np=1000000007\nd = pow(2, x)-1\ne = pow(2, y)-1\nd=d*e\nd=d%p\nprint(d)", "lang": "PyPy 3", "bug_code_uid": "11bf3d328c9bf665445cabd2b13a82de", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "df36906d802ef4483a2836ab361c6f32", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4383116883116883, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import os, sys\n\n# zeilen = [l.strip() for l in sys.stdin.readlines()]\n\n\nn, m = map(int, sys.stdin.readline().strip().split())\nprint(((1<= 0\n a_b = a+b - y\n if a_b >= 0:\n a_b_c = a_b + c - z\n if a_b_c >= 0:\n print(\"YES\")\n exit()\nprint(\"NO\")\n\n", "lang": "PyPy 3", "bug_code_uid": "1384c082ac254203baa0ac3e6aeb6d3e", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "6f61d46c97d0d362dde5203f7faf93ee", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2076624097723487, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "n = int(input())\n\ndice1 = [int(i) for i in input().split()]\ndice2 = [int(i) for i in input().split()]\ndice3 = [int(i) for i in input().split()]\n\nh = [0] * 100000\n\nfor i in dice1:\n h[i]+=1\n for j in dice2:\n h[j]+=1\n for k in dice3:\n h[k]+=1\n #pairs\n num = (i*10) + j\n h[num]+=1\n num = (j*10) + i\n h[num]+=1\n num = (i*10) + k\n h[num]+=1\n num = (k*10) + i\n h[num]+=1\n num = (k*10) + j\n h[num]+=1\n num = (j*10) + k\n h[num]+=1\n #triplets\n num = (i*100) + (j*10) + k\n h[num]+=1\n num = (i*100) + (k*10) + j\n h[num]+=1\n num = (k*100) + (i*10) + j\n h[num]+=1\n num = (k*100) + (j*10) + i\n h[num]+=1\n num = (j*100) + (i*10) + k\n h[num]+=1\n num = (j*100) + (k*10) + i\n h[num]+=1\n\nh = h[1:]\n\nprint(len(h[:h.index(0)]))\n", "lang": "Python 3", "bug_code_uid": "60c466895e32e72c6653069d82781ee0", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "a779b0e16b7392698759381c20c18dcf", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2920517560073937, "equal_cnt": 21, "replace_cnt": 8, "delete_cnt": 11, "insert_cnt": 2, "fix_ops_cnt": 21, "bug_source_code": "s = input()\nif len(s)>2:\n s_right = s[0:len(s)//2]\n s_left = (s[len(s) - len(s)//2::])[::-1]\n if s_right == s_left and len(s)%2==0:\n print(\"NO\")\n else:\n for i in range(len(s_right)):\n if s_right[0:i] + s_right[i+1::] == s_left[0:i] + s_left[i+1::]:\n print(\"YES\")\n breakwd\n else:\n print(\"NO\")\nelse:\n print(\"YES\")\n\n", "lang": "Python 3", "bug_code_uid": "0d251ded1aed7b76d2fa6dbc41e9bcd5", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "635ed9c7ef2bca9bd527b50fe896831a", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8345323741007195, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "xp, yp, xv, yv = map(int, raw_input().split())\n\nif xp<=xv and yp<=yv:\n print \"Polycarp\"\nelse:\n print \"Vasiliy\"", "lang": "PyPy 2", "bug_code_uid": "37d7b0f50588c068f9a779fee8e42c1c", "src_uid": "2637d57f7809ff8f922549c617709074", "apr_id": "326f8f9d0b47b26b0b79cad8e89aadbc", "difficulty": 1700, "tags": ["math", "greedy", "games", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8847795163584637, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from sys import stdin\n\nx1, y1, x2, y2 = map(int, stdin.readline().split())\nflag = 1\nwhile (x1, y1) != (0, 0) and (x2, y2) != (0, 0):\n if flag:\n if x1 >= x2 and (x1 - 1, y1) != (x2, y2) and x1 > 0:\n x1 -= 1\n elif x1 <= x2 and (x1, y1 - 1) != (x2, y2) and y1 > 0:\n y1 -= 1\n\n else:\n if x2 and y2 and (x2 - 1, y2 - 1) != (x1, y1):\n x2 -= 1\n y2 -= 1\n elif x2 and (x2 - 1, y2) != (x1, y1):\n x2 -= 1\n elif y2 and (x2, y2 - 1) != (x1, y1):\n y2 -= 1\n\n flag ^= 1\n # print(x1,y1,x2,y2,flag)\n\nprint(['Polycarp', 'Vasiliy'][flag])\n", "lang": "PyPy 2", "bug_code_uid": "2d186a52d0d153b6e17326c89ecf1d8b", "src_uid": "2637d57f7809ff8f922549c617709074", "apr_id": "889db88bea5d81d264c002588d4b6482", "difficulty": 1700, "tags": ["math", "greedy", "games", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07836990595611286, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "def int2base(num, base):\n\tc = \"0123456789ABCDEF\"\n\tif num ok\n # either s[i] or s[j] is '?' -> copy\n # both '?' -> pop missing letter\n if s[i] != s[j]:\n if s[i] == '?':\n s[i] = s[j]\n elif s[j] == '?':\n s[j] = s[i]\n else:\n return 'IMPOSSIBLE'\n elif s[i] == '?':\n # pop\n if len(letters) == 0:\n s[i] = s[j] = 'a'\n else:\n s[i] = s[j] = letters.pop(0)\n i += 1\n j -= 1\n \n if len(letters)>0:\n return 'IMPOSSIBLE'\n \n return ''.join(s)\n\nk = int(raw_input())\ns = raw_input()\nprint k, s\nprint title(s, k)\n", "lang": "Python 2", "bug_code_uid": "b7d5d46dab0c2eb67c79cecd220a3341", "src_uid": "9d1dd9d722e5fe46823224334b3b208a", "apr_id": "350aa13340a2ecc13a2ecda24f7ffe08", "difficulty": 1600, "tags": ["expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9743589743589743, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "y=input();a=may(y);print(y.count(a)*a)\n", "lang": "Python 3", "bug_code_uid": "5332cec4cfa039b1814f30e4ab53d818", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "d8e70df75eb806e2fd716987c68d6c25", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9677926158680282, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "f __name__==\"__main__\":\n\tn,k = map(int,input().split())\n\tprime = [2]\n\n\t\n\tfor i in range(3,n):\n\t\t#check if i is prime\n\t\ti_is_prime = True\n\t\tfor j in range(2,int(i**0.5)+1):\n\t\t\tif i%j==0:\n\t\t\t\ti_is_prime = False\n\t\t\t\tbreak\n\t\tif i_is_prime:\n\t\t\tprime.append(i)\n\t\t#check if i can be express as sum of two prime\n\t#print(prime)\n\tcount = 0\n\tfor i in range(5,n):\n\t\tfor j in range(len(prime)):\n\t\t\tif prime[j]=k):\n\t\tprint(\"YES\")\n\telse:\n\t\tprint(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "d8349a917b4c424e5cd7cea74c71e2db", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "821b6254baa2fe0e430f0804da532676", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9860248447204969, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def pucci(n):\n if n < 9:\n return [2, 3, 5, 7, 11, 13]\n n *= 2\n l = [1] * n\n for i in range(2, int(n ** 0.5) + 1):\n if l[i - 1] == 1:\n for j in range(i ** 2, n + 1, i):\n if j % i == 0:\n l[j - 1] = 0\n l[0] = 0\n l1 = []\n for i in range(n):\n if l[i] == 1:\n l1.append(i + 1)\n return l1\n\ndef mih(l, n):\n s = 0\n i = 0\n while l[i] <= 27:\n if l[i] + l[i + 1] + 1 in l[i + 2: ]:\n s += 1\n i += 1\n return s\n\nn, k = map(int, input().split())\nl = pucci(n)\nif mih(l, n) >= k:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "9823856b9f61fd045362b6ce331dc22f", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "40c91b70c8980608fd9bb1041ae88597", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3238512035010941, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a,b,c,d = map(int,input().split())\n\nans = 0\nfor x in range(a,b+1):\n for y in range(b,c+1):\n z = x + y - 1\n if z < c:continue\n ans += min(d,z) - c + 1\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "9bee5ede4c377ff13a8ba71c92b2e68b", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "c2f1fe98a6524c5be89724643e0a6f59", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3593314763231198, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "A,B,C,D = map(int,input().split())\narr = []\nfor i in range(A,B+1):\n for j in range(B,C+1):\n arr.append(i+j)\narr.sort(reverse=True)\nSum = 0\nfor i in range(C,D+1):\n ans = -1\n l = 0\n r = len(arr)-1\n while(l<=r):\n mid = (l+r)//2\n if (arr[mid]>i):\n ans = mid\n l = mid+1\n else:\n r = mid-1\n # print(ans)\n if (ans!=-1):\n Sum += ans+1\nprint(Sum)", "lang": "PyPy 3", "bug_code_uid": "6b87e944e28c74c91ddccb73f53b17df", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "273758a2db20225e4bb3adf1b5f18a4d", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3781942078364566, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "a,b,c,d=map(int,input().split())\nl=[]\nfor i in range(a,b+1):\n for j in range(b,c+1):\n for k in range(c,d+1):\n l.append((i+j,k))\nc=0\nfor i in range(len(l)):\n if(l[i][0]>l[i][1]):\n c+=1\nprint(c)", "lang": "PyPy 3", "bug_code_uid": "d73f9e1b2a037941ab1eaf32d84231a2", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "3296d5733b443d6134f499ebc5119439", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.23622047244094488, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n,a,b,p,q = map(int,raw_input().split(' '))\nif p min_moves_for_b:\n print('B')\n ", "lang": "Python 3", "bug_code_uid": "8fe0a9afeccffe733db27c4731f7817e", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "2fbb1ad4e54b7a4d44760c1f0181d939", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7563405797101449, "equal_cnt": 21, "replace_cnt": 19, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 21, "bug_source_code": "\"\"\"\n This template is made by Satwik_Tiwari.\n python programmers can use this template :)) .\n\"\"\"\n\n#===============================================================================================\n#importing some useful libraries.\n\nimport sys\nimport bisect\nimport heapq\nfrom math import *\nfrom collections import Counter as counter # Counter(list) return a dict with {key: count}\nfrom itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]\nfrom itertools import permutations as permutate\nfrom bisect import bisect_left as bl #\nfrom bisect import bisect_right as br\nfrom bisect import bisect\n\n#===============================================================================================\n#some shortcuts\n\nmod = pow(10, 9) + 7\ndef inp(): return sys.stdin.readline().strip() #for fast input\ndef out(var): sys.stdout.write(str(var)) #for fast output, always take string\ndef lis(): return list(map(int, inp().split()))\ndef stringlis(): return list(map(str, inp().split()))\ndef sep(): return map(int, inp().split())\ndef strsep(): return map(str, inp().split())\ndef graph(vertex): return [[] for i in range(0,vertex+1)]\ndef zerolist(n): return [0]*n\ndef nextline(): out(\"\\n\") #as stdout.write always print sring.\ndef testcase(t):\n for p in range(t):\n solve()\ndef printlist(a) :\n for p in range(0,len(a)):\n out(str(a[p]) + ' ')\ndef lcm(a,b): return (a*b)//gcd(a,b)\n\n\n#===============================================================================================\n# code here ;))\ndef sieve(a): #O(n loglogn) nearly linear\n #all odd mark 1\n for i in range(3,((10**6)+1),2):\n a[i] = 1\n #marking multiples of i form i*i 0. they are nt prime\n for i in range(3,((10**6)+1),2):\n for j in range(i*i,((10**6)+1),i):\n a[j] = 0\n a[2] = 1 #special left case\n return (a)\n\n\na = [0]*((10**8)+1)\na = sieve(a)\n\ndef func(d):\n ans = 1\n if(d%2 == 0):\n x = 1\n while(d%(2**x) == 0):\n x+=1\n ans *= x\n for i in range(3,d+1,2):\n if(a[i] == 0 or d%i == 1):\n continue\n elif(d%i == 0):\n x = 1\n while(d%(i**x)==0):\n x+=1\n ans *=x\n return ans\n\ndef solve():\n a,b,c = sep()\n ans = 0\n for i in range(1,a+1):\n for j in range(1,b+1):\n for k in range(1,c+1):\n ans += (func(i*j*k))%1073741824\n print(ans%1073741824)\n\ntestcase(1)\n\n", "lang": "PyPy 3", "bug_code_uid": "f2214853a2e5bf90eaec98a49bb2ac92", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "256020c064941575ab9598cf6d29592a", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8969578017664377, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a, b, c = map(int, input().split())\n\nuniquenums = {}\nret = 0\n\n\ndef dfunc(n):\n score = 0\n for i in range(1,n+1):\n if n%i == 0:\n score += 1\n #print(n, score)\n return score\n\nfor i in range(1,a+1):\n for j in range(1,b+1):\n for k in range(1,c+1):\n mult = i * j * k\n if mult not in uniquenums:\n uniquenums[mult] = dfunc(mult)\n ret += uniquenums[mult]\n#print(uniquenums)\nprint(ret%1073741824)\n", "lang": "PyPy 3", "bug_code_uid": "254aedcb0bc33e943ca2f99527e01090", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "bbb745295f6451442658243b10de68fd", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.23107569721115537, "equal_cnt": 10, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "m='codeforce'\nm=m.lower()\ninp=int(input())\nm=m+inp*'s'\nprint(m)", "lang": "Python 3", "bug_code_uid": "73b5b26d3c2d060966e77a442521c26a", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "661f25c627ca224aff9e7e9e6602066e", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.36065573770491804, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "k=int(input())\ns='codeforces'\ns2='s'*(k-1) \nprint(s+s2)", "lang": "Python 3", "bug_code_uid": "f0ddfa90045186c74e26b7ba3616175a", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "18eb69619261e007714e7472b55018d4", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.11929824561403508, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "k=int(input())\nprint('codeforce'+k*'s')", "lang": "Python 3", "bug_code_uid": "82108ad06cef0f1676269bdac5625c6c", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "73cad6f84efeece6da113b3d94ed21ed", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.32671081677704195, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "def solve(k):\n return 'codeforces' + 's' * (k - 1)\n\n\nK = int(input())\nprint(solve(K))\n", "lang": "Python 3", "bug_code_uid": "902fb049197a27d1af91d16f65df9c42", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "6ab718a989a24e0c58db16256f713496", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8283378746594006, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "n = int(input())\ns = [int(i) for i in input().split()]\na = sum(s)\nt = max(s)\nc = 0\n\n\nwhile c\nusing namespace std;\nint main(void) {\n long double a;\n cin >> a;\n if (a >= -128 && a <= 127)\n cout << \"byte\";\n else if (a >= -32768 && a <= 32767)\n cout << \"short\";\n else if (a >= -2147483648 && a <= 2147483647)\n cout << \"int\";\n else if (a >= -9223372036854775808 && a <= 9223372036854775807)\n cout << \"long\";\n else\n cout << \"BigInteger\";\n}", "lang": "Python 3", "bug_code_uid": "9f5a88b981f5ac15c2fc669a9d688da4", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "21ca3b63329cef9b838886c62651aea7", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7029702970297029, "equal_cnt": 29, "replace_cnt": 17, "delete_cnt": 4, "insert_cnt": 9, "fix_ops_cnt": 30, "bug_source_code": "def run():\n n = long(raw_input())\n if n <= 127: return \"byte\"\n if n <= 32767: return \"short\"\n if n <= 2147483647: return \"int\"\n if n <= 9223372036854775807: return \"long\"\n return \"BigInteger\"\n\nprint run()", "lang": "Python 3", "bug_code_uid": "2a2e3caa78116dbdfa0abb3c0515b867", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "4783dddfe66f48641c4692b41476cdff", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.40875912408759124, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "n = int(input())\nli = []\nlio = []\nlie = []\nfor i in range(1,n+1):\n li.append(i)\nfor i in li:\n if i%2 != 0:\n lio.append(-i)\n else:\n lie.append(i)\nprint(sum(lio)+sum(lie))\n", "lang": "PyPy 3", "bug_code_uid": "e32d90405d87854682be7397844b53ad", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "c1af98d4061794da3d100303c7ea8b23", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.41509433962264153, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n = int(input())\ndisp = []\nfor i in range(1,n+1):\n disp.append(i)\nsum = 0\nfor i in disp:\n if i == 1 or i%2!=0:\n sum += -(i)\n else:\n sum += i\nprint(sum)\n ", "lang": "PyPy 3", "bug_code_uid": "5da0c4d6be61189eb47e9e2268845443", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "ecc96c67821c8481e125a6923a19cb9a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.37267080745341613, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n = int(input()) +1\na = sum(list(range(0,n,2)))\nb = sum(list(range(1,n,2)))\nprint(a-b)", "lang": "PyPy 3", "bug_code_uid": "4a7cbd4035d2630022becb20fc5df268", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "9be4c5ff14954fc47da429a439cc80d8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.40875912408759124, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "n = int(input(\"\"))\nans = 0\n\neven = [i for i in range(1,n+1) if i % 2 == 0]\nodd = [i for i in range(1,n+1) if i % 2 != 0]\n\nfor num in even:\n ans += num\nfor num in odd:\n ans -= num\n\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "17c0abfed2f9a4921ed3cd9e93f1bbea", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "78bd7a7829a7fd5631952eebb9fe8463", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5533980582524272, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "n = int(input())\nl=[]\nfor i in range(1,n+1):\n if i%2!=0:\n l.append(-i)\n else:\n l.append(i)\nprint(sum(l))\n", "lang": "PyPy 3", "bug_code_uid": "c835b203350c0d31a9b070df571a2375", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "92f4f14bb6d026c996bd32ecd945dd9d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8089500860585198, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#http://codeforces.com/problemset/problem/831/A\ndef main(lst):\n\tif(lst[0]>lst[1]):\n\t\treturn \"NO\"\n\t#0-increasing, 1-staying, 2-decreasing\n\tstatus=0\n\tfor i in range(len(lst)-1):\n\t\tif(status==0):\n\t\t\tif(lst[i]==lst[i+1]):\n\t\t\t\tstatus+=1\n\t\t\tif(lst[i]>lst[i+1]): #assuming it MUST go constant\n\t\t\t\tstatus+=2\n\t\tif(status==1):\n\t\t\tif(lst[i]>lst[i+1]):\n\t\t\t\tstatus+=1\n\t\t\tif(lst[i]lst[i+1]):\n\t\t\t\tpass\n\t\t\telse:\n\t\t\t\treturn \"NO\"\n\treturn \"YES\"\n\n\ninput()\nlst=input().split()\nlst=[eval(i) for i in lst]\nprint(main(lst))", "lang": "Python 3", "bug_code_uid": "9cc4e0700e31c06a34c7457d588df608", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "e2ad6c9e9efa8fe0e4418a34be150ea0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4643510054844607, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 8, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "import math\nn,k=map(int,input().split())\nif(n%2==0):\n if(k>2):\n print('NO')\n else:\n print('YES')\nelse:\n c=0\n for i in range(3,int(math.sqrt(n))+1,2):\n if(n%i==0):\n if(k 0 and y > 0) or (y < 0 and x < 0)):\n if result == b:\n result = w\n else:\n result = b\n \n if c == fc:\n result = b\n return result\n\ndef main(argv=None):\n if argv is None:\n argv = sys.argv\n if len(sys.argv) != 3:\n return -1\n \n print( gcl(int(argv[1]), int(argv[2])) ),\n return 0\n \nif __name__ == \"__main__\":\n sys.exit(main())\n", "lang": "Python 2", "bug_code_uid": "8a2eaea2ac41dc2ba595b7f4494262ef", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "ccdd2065bfaab0732ae152d879214340", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.009302325581395349, "equal_cnt": 1, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "B.py", "lang": "Python 3", "bug_code_uid": "66169947dd4bc9155598164180ee2415", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "apr_id": "2032bfe615418d5ba316d7a2481023d1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4636542239685658, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "or i in range(int(input())):\n n, k, d = map(int, input().split())\n a = list(map(int, input().split()))\n mn = 1000000000000\n for i in range(n - d + 1):\n b = set(a[i : i + d])\n if len(b) < mn:\n mn = len(b)\n print(mn)", "lang": "Python 3", "bug_code_uid": "21b86a4a2b0b60a9e48891fb64306e6e", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "apr_id": "5204426def53ffaed21f2ca436f5fbc8", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9965870307167235, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def getpos(digit):\n digit = int(digit)\n if digit == 0:\n return (3,1)\n digit -= 1\n return (digit // 3, digit % 3)\n\ndef main():\n ndig = int(input())\n number = input().strip()\n assert ndig == len(number)\n rlo = clo = 4\n rhi = chi = 0\n for digit in number:\n row, col = getpos(digit)\n rlo = min(row, rlo)\n rhi = max(row, rhi)\n clo = min(col, clo)\n chi = max(col, chi)\n rdiff = rhi-rho\n if rdiff == 3:\n print('YES')\n elif rdiff < 2:\n print('NO')\n elif chi - clo < 2:\n print('NO')\n elif '0' in number:\n print('NO')\n else if '7' in number or '9' in number:\n print('YES')\n else:\n print('NO')\n \nmain() ", "lang": "Python 3", "bug_code_uid": "58095846b530e329158ec42609dc2254", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "6e1eb8b9c87c8e0fb3939bc2eac6a65e", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6179159049360147, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "h,m,s,x,y=map(int,input().split())\nh=h+m/60+s/3600\nm=m/5\ns=s/5\nl=[h,m,s,x,y]\nl.sort()\nz=(l.index(x)-l.index(y))\nif(z==1 or z==4):\n\tprint(\"YES\")\nelse:\n\tprint(\"NO\")\n\n\n h,m,s,x,y=map(int,input().split())\n h=h+m/60+s/60\n m=m/5\n s=s/5\n l=[h,m,s,x,y]\n l.sort()\n z=(l.index(x)-l.index(y))\n if(z==1 or z==4):\n \tprint(\"YES\")\n else:\n \tprint(\"NO\")\n \t", "lang": "PyPy 3", "bug_code_uid": "48988069aea08d1a2903ee749ebbd090", "src_uid": "912c8f557a976bdedda728ba9f916c95", "apr_id": "e4621609a9b939b964600cfcab85d027", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.1984126984126984, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "ls -l | python -c \"import sys;[sys.stdout.write(' '.join([line.split(' ')[-1]])) for line in sys.stdin]\"", "lang": "PyPy 3", "bug_code_uid": "9d3ef4f4baaffe67d54dbe7f6c0e7968", "src_uid": "ef657588b4f2fe8b2ff5f8edc0ab8afd", "apr_id": "48d1a8808f0a98a69d63cab49054d6d8", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9976525821596244, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env python\n\nfrom sys import stdin\n\ndef main():\n x, y, z = map(int, stdin.readline().split())\n x1, y1, z1 = map(int, stdin.readline().split())\n A = map(int, stdin.readline().split())\n res = 0\n if y < 0: res += A[0]\n if y > y1: res += A[1]\n if z < 0: res += A[2]\n if z > z1: res += A[3]\n if x < 0: res += A[4]\n if x > z1: res += A[5]\n print res\n return 0\n\nif __name__ == '__main__': main()\n", "lang": "Python 2", "bug_code_uid": "4b0a5b06a4055a44afacf81ed98a95b9", "src_uid": "c7889a8f64c57cf7be4df870f68f749e", "apr_id": "b4a84a3e157f1e370742f14c203c2d5a", "difficulty": 1600, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9920277296360486, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "def subtract(p1, p2):\n return [a-b for a, b in zip(p1, p2)]\n\ndef add(p1, p2):\n return [a+b for a, b in zip(p1, p2)]\n\ndef within(p, mid):\n withi = True\n for x in xrange(3):\n if not(p[x]/2.0 <= mid[x] and p[x] >= 0): \n withi = False\n break\n return withi\n\ndef intersect(p1, p2, p3, N):\n denominator = sum([a*b for a, b in zip(N, subtract(p2, p1))])\n if denominator == 0:\n # print denominator\n return True\n numerator = sum([a*b for a, b in zip(N, subtract(p3, p1))])\n u = numerator*1.0/denominator\n #print u\n p = add(p1, map(lambda(x): x*u, subtract(p2, p1)))\n if u > 0 and u < 1 and within(p, p3):\n return True\n return False\n\ndef start():\n p = map(int, raw_input().split())\n x, y, z = map(int, raw_input().split())\n faceValue = map(int, raw_input().split())\n N = [[0,1,0],[0,1,0],[0,0,1],[0,0,1],[1,0,0],[1,0,0]]\n P = [[x/2.0, 0, z/2.0],[x/2.0, y, z/2.0],[x/2.0, y/2.0, 0],[x/2.0, y/2.0, z],[0, y/2.0, z/2.0],[x, y/2.0, z/2.0]]\n sumFaces = 0\n for x in xrange(6):\n poss = True\n #print 'face %s' % (x)\n for y in xrange(6):\n if x != y:\n intersct = intersect(p, P[x], P[y], N[y])\n # print 'point %s, intersects with plane %s, %s' %(x+1, y+1, intersct)\n poss = poss and not intersct\n if poss:\n sumFaces += faceValue[x]\n print sumFaces\n\nstart()\n", "lang": "Python 2", "bug_code_uid": "4aef7a40987c8602b2eee67f4605c5cd", "src_uid": "c7889a8f64c57cf7be4df870f68f749e", "apr_id": "84ef04f5a22f700edfedba82d0d2ff00", "difficulty": 1600, "tags": ["geometry", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9956204379562044, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import sys\n#input = sys.stdin.buffer.readline\n\nINF = 100000000\nn1 , n2 , K1 , K2 = [int(i) for i in input().split()]\ndp = [ [[ [0 for k2 in range(K2 +1)] for k1 in range(K1 + 1)] for j in range(n2+1) ] for i in range(n1+1) ]\ndef rep(i,j,k1,k2,K1,K2):\n if k1 > K1 or k2 > K2:return 0\n if i == 0 and j == 0 :return 1\n if i == -1 or j == -1:return 0\n if dp[i][j][k1][k2] != 0:return dp[i][j][k1][k2]\n\n # Select elephant\n ansE = rep( i - 1 , j , k1 + 1 , 0 , K1 , K2 ) % INF\n\n # Select dog\n ansD = rep( i , j - 1 , 0 , k2 + 1 , K1 , K2) % INF\n\n ans = (ansE + ansD) % INF\n dp[i][j][k1][k2] = ans\n return ans\n\nprint(rep(n1,n2,0,0,K1,K2))", "lang": "PyPy 3", "bug_code_uid": "64be9ef839d10c4689c51dda239afc1e", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "5b721700743d132b1d0b5ef42e45fc0b", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8888888888888888, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "s = input()\nin1 = s.split(' ')\n\nR = int(in1[0])\nB = int(in1[1])\n\nprint(R==B)", "lang": "Python 3", "bug_code_uid": "b934771e5c9747c8b922243853726f3e", "src_uid": "65f81f621c228c09915adcb05256c634", "apr_id": "96f641a6b75a8b5bdbbb111c334e8840", "difficulty": 1600, "tags": ["geometry", "math", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4229390681003584, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "n=int(input())\nwhile(n>0):\n an=map(int,input().split())\n n=n-1\ncount=0\nfor(i in range(n)):\n for(j in range(n)):\n if(ai[0]==aj[1]):\n count+=1\nprint(count) \n ", "lang": "Python 3", "bug_code_uid": "faf6557e6bea1bed9e24186595016e57", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "0d8430c37479fbc98e225a81cd510c86", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9493087557603687, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import time\nh,m = input().split(\":\")\nmins = int(input())\nh=int(h)\nm=int(m)\nh += int((mins+m)/60)\nh= h%24\nm = (mins+m)%60\nif h<10: print(\"0\"+h,end=\":\")\nelse: print(h,end=\":\")\nif m<10: print(\"0\"+m)\nelse: print(m)", "lang": "Python 3", "bug_code_uid": "ab3e9019f2b9cfc9cbb7b0871ad563ba", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "apr_id": "f2e0a9ae3f3b2694cb42c00aaba4671f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9973190348525469, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": " n=int(input())\nl=[]\nk=0\nfor i in range(n):\n l.append(list(map(int,input().split())))\nfor i in range(n):\n for j in range(n):\n if l[i][0]==l[j][1]:\n k+=1\nprint((k))", "lang": "Python 3", "bug_code_uid": "d3c723e9fa3a58d06e8aca1a3780ee9a", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "f092d6d68f5166654cd35240aa537788", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.24573378839590443, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "arr = list(map(int, input().split()))\nt1 = 0\nt2 = 0\ndef main():\n\tglobal t1\n\tglobal t2\n\tglobal arr\n\ti = 0\n\tarr = sorted(arr)\n\ttmp = arr\n\twhile i < len(tmp):\n\t\tt1 += tmp[i]\n\t\ttmp.pop(i)\n\t\tt1 += tmp[i]\n\t\ttmp.pop(i)\n\t\tj = 0\n\t\twhile j < tmp:\n\t\t\tt1 += tmp[j]\n\t\t\ttmp.pop(j)\n\t\t\tfor c in tmp:\n\t\t\t\tt2 += c\n\t\t\tj+=1\n\t\ti+=1\t\n\n\n\twhile i < len(arr):\n\t\tt1 += arr[i]\n\tif t1 == t2:\n\t\tprint(\"YES\")\n\telse:\n\t\tprint(\"NO\")\nif __name__ == \"__main__\":\n\tmain()", "lang": "Python 3", "bug_code_uid": "f5c0bd0fcc8a29014c284059d3ed26e1", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "fc5717494570a58ff8bc71a336b5df56", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.384, "equal_cnt": 25, "replace_cnt": 14, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 25, "bug_source_code": "a=int(input())\nb=int(input())\nc=int(input())\na=a//1\nb=b//2\nc=c//4\ns=0\nif a= len(j[2:])*2) and r1 : \n y *= 1\n r2 = False\n elif (len(i[2:]) <= len(j[2:])/2) and r2: \n r1 = False \n y *= 1\n else :\n y *= 0 \n break\n \n \n res.append(y)\n\nif res.count(0) == 4 :\n print('C')\nelif res.count(1) > 1 :\n print('C')\n\nelse:", "lang": "Python 3", "bug_code_uid": "18133a2e5964ba6b46b468ac09b96c37", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "16f54b4be3fc34c2e167a64be39b0112", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9954648526077098, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import math\n\n\ndef lucky_gen():\n current = ['4']\n while True:\n yield int(''.join(current))\n for i in range(len(current)-1, -1, -1):\n if current[i] == '4':\n current[i] = '7'\n break\n else:\n current[i] = '4'\n if i == 0:\n current.insert(0, '4')\n\n\ndef sub_str(num):\n n_str = str(num)\n for i in range(1, len(n_str)+1):\n for j in range(len(n_str) - i + 1):\n yield n_str[j:j+i]\n\n\nnum = int(input())\nstr_num = str(num)\nwhile num % 10 == 0:\n num //= 10\n\nresult = {}\n\nfor sub in sub_str(num):\n if sub in result.keys():\n continue\n success = False\n for i in sub:\n if not i in ['4', '7']:\n success = False\n break\n else:\n success = True\n if not success:\n continue\n\n i = 0\n sub_str_amount = 0\n while i < len(str_num):\n try:\n i = str_num.index(sub, i) + 1\n sub_str_amount += 1\n except ValueError:\n break\n result[sub] = sub_str_amount\n\nanswer = (0, '777')\nfor key in result.keys():\n if answer[0] < result[key] or (answer[0] == result[key] and answer[1] > key):\n answer = (result[key], key)\nif answer[0] == 0:\n print(-1)\nelse:\n print(answer[1])\n", "lang": "Python 3", "bug_code_uid": "75af54307e1fe0433eb887e3b3a418a2", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "d2e971303d62935c7493c6c3ad7d9e47", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5740740740740741, "equal_cnt": 23, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 22, "bug_source_code": "s=input()\nl=''\nn=len(s)\nn-=1\nm=0\nif n==0:\n print(s)\nelse:\n while len(l)!=len(s):\n l=s[n]+l\n n-=1\n l=s[m]+l\n m+=1\n \n print(l)", "lang": "Python 3", "bug_code_uid": "cd15a5275ca10473fbde28affa56c1e9", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "073526ed7685487ec8cd4b2bf89fcef5", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2521440823327616, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "for i in range(4):\n\tst = input()\n\tlista[i] = st.split(\" \")\n\nprint(lista)\ndef ff(n):\n\tif n ==0 :\n\t\treturn 3\n\tif n%2==0:\n\t\treturn n+1\n\telse:\n\t\treturn n-1\n\ndef rec(lista):\n\tfor i in range(len(lista)):\n\t\tfor j in range(len(lista[i])):\n\t\t\tif lista[i][3] == lista[i][j] == 1:\n\t\t\t print(\"YES\")\n break\n\t\t\tif lista[i][j] == lista[ff(j)][3] == '1' :\n\t\t\t\tprint(\"YES\")\n\t\t\t\tbreak\n\n\nrec(lista)\n", "lang": "Python 3", "bug_code_uid": "e1f1e66fedaec6dd259cc77ef820bb84", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "apr_id": "331ae826e55139dde8ad238573b6ff62", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9660928534167971, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "from collections import deque\n\nw, d = map(int, raw_input().split())\n\ndef is_princess(x, y):\n return (w + d - x - y) % 3 == 0\n\ndp = [[0.0 for j in range(d + 1)] for i in range(w + 1)]\ndp[w][d] = 1.0\n\nQ = deque([(w, d)])\nP = 0.0\n\nwhile Q:\n x, y = Q.popleft()\n \n if is_princess(x, y):\n if dp[x][y] < 1e-10:\n if x < w and y < d:\n dp[x][y] += dp[x+1][y+1] * (y + 1) / (x + 1 + y + 1) * (x + 1) / (x + 1 + y)\n if y + 1 < d:\n dp[x][y] += dp[x][y+2] * (y + 2) / (x + y + 2) * (y + 1) / (x + y + 1)\n \n if y > 0: \n Q.append((x, y - 1))\n \n else:\n if dp[x][y] < 1e-10:\n if y < d:\n dp[x][y] += dp[x][y + 1] * (y + 1) / (x + y + 1)\n if y > 0:\n Q.append((x - 1, y - 1))\n if y > 1:\n Q.append((x, y - 2))\n \n # print x, y, dp[x][y]\n\nfor x in range(1, w + 1):\n for y in range(d + 1):\n if is_princess(x, y):\n P += dp[x][y] * x / (x + y)\n\n# print dp \nprint P\n\n", "lang": "PyPy 2", "bug_code_uid": "c4834614ce33c8d6c5eb706642547265", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "bac3c04cc8d13b8b8f87a44a754617fa", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5324384787472036, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n, a, b, c = map(int, input().split())\ncount = 0\nfor ci in range(c + 1):\n x = n - 2 * ci\n if x < 0:\n break\n for bi in range(b + 1):\n y = x - bi\n if y < 0:\n break\n if 2 * y <= a:\n count += 1\n\nprint(count)\n", "lang": "Python 3", "bug_code_uid": "e7d3bd3d6fe611aa020592d67ef4a23f", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "77d09f4630f2ea30e0b77b06942cb49f", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.30985915492957744, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n, a, b, c = map(int, input().split())\nprint(sum(n - i // 2 - 2 * j in range(0, b + 1) for i in range(0, a + 1, 2) for j in range(c + 1)))", "lang": "Python 3", "bug_code_uid": "c847c17eac1b6c5c12ae53da54061725", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "668b35f075c8510bacd6bf8860402d4c", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7798882681564245, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "def really_big(k, s):\n return k - sum([int(x) for x in str(k)]) >= s\n\n\ndef find_big(n, k):\n if not really_big(n, k):\n return 0\n\n min = n\n while True:\n if really_big(min, k):\n if not really_big(min - 1, k):\n break\n min = min/2\n else:\n min += (n - min)/2\n\n return n - min + 1\n\nip = raw_input().split(' ')\nprint find_big(int(ip[0]), int(ip[1]))", "lang": "Python 2", "bug_code_uid": "985a53e8d3354ce281b4f937846ca69b", "src_uid": "9704e2ac6a158d5ced8fd1dc1edb356b", "apr_id": "36ad9c2fcae35f8d8cc88de8bb2b9079", "difficulty": 1600, "tags": ["dp", "math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7420417124039517, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "from itertools import permutations\nn, L = list(map(lambda x: int(x), input().split()))\nk = list(map(lambda x: int(x), input().split()))\ns = list(map(lambda x: int(x), input().split()))\nj = 1\nfor i in range(L):\n for x in range(len(s)):\n s[x] += 1\n if s[x] == L:\n s[x] = 0\n if any(tuple(k) == y for y in list(permutations(s))):\n print('YES')\n j = 0\n break\nif j == 1:\n print('NO')", "lang": "Python 3", "bug_code_uid": "65c2e6a4147075ccc851b847ce65b74b", "src_uid": "3d931684ca11fe6141c6461e85d91d63", "apr_id": "7f92ff268c3364823f98166fc139901f", "difficulty": 1300, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.768361581920904, "equal_cnt": 30, "replace_cnt": 17, "delete_cnt": 12, "insert_cnt": 1, "fix_ops_cnt": 30, "bug_source_code": "input1=(list(map(int,input().split()))) \nK=(list(map(int,input().split()))) \nS=(list(map(int,input().split()))) \nn=input1[0] \nl=input1[1] \nKlist=[] \nfor i in range(1,len(K)): \nKlist.append(K[i]-K[i-1]) \nmax=0 \nfor i in range(0,len(Klist)): \nmax+=Klist[i] \nKlist.append(l-max) \nSlist=[] \nfor i in range(1,len(S)): \nSlist.append(S[i]-S[i-1]) \nmax=0 \nfor i in range(0,len(Slist)): \nmax+=Slist[i] \nSlist.append(l-max) \ncount=0 \nT=False \nvar=0 \nwhile count\nPermission to use, modify, and distribute this software is given under the\nterms of the MIT License.\n\n\"\"\"\nfrom __future__ import division, print_function\n\nimport cmath\nimport itertools\nimport math\nimport operator as op\n# import random\nimport sys\nfrom atexit import register\nfrom bisect import bisect_left, bisect_right\n# from collections import Counter, MutableSequence, defaultdict, deque\n# from copy import deepcopy\n# from decimal import Decimal\n# from difflib import SequenceMatcher\n# from fractions import Fraction\n# from heapq import heappop, heappush\n\nif sys.version_info[0] < 3:\n # from cPickle import dumps\n from io import BytesIO as stream\n # from Queue import PriorityQueue, Queue\nelse:\n # from functools import reduce\n from io import StringIO as stream\n # from pickle import dumps\n # from queue import PriorityQueue, Queue\n\n\nif sys.version_info[0] < 3:\n class dict(dict):\n \"\"\"dict() -> new empty dictionary\"\"\"\n def items(self):\n \"\"\"D.items() -> a set-like object providing a view on D's items\"\"\"\n return dict.iteritems(self)\n\n def keys(self):\n \"\"\"D.keys() -> a set-like object providing a view on D's keys\"\"\"\n return dict.iterkeys(self)\n\n def values(self):\n \"\"\"D.values() -> an object providing a view on D's values\"\"\"\n return dict.itervalues(self)\n\n input = raw_input\n range = xrange\n\n filter = itertools.ifilter\n map = itertools.imap\n zip = itertools.izip\n\n\ndef sync_with_stdio(sync=True):\n \"\"\"Set whether the standard Python streams are allowed to buffer their I/O.\n\n Args:\n sync (bool, optional): The new synchronization setting.\n\n \"\"\"\n global input, flush\n\n if sync:\n flush = sys.stdout.flush\n else:\n sys.stdin = stream(sys.stdin.read())\n input = lambda: sys.stdin.readline().rstrip('\\r\\n')\n\n sys.stdout = stream()\n register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))\n\n\ndef gcd(x, y):\n \"\"\"greatest common divisor of x and y\"\"\"\n while y:\n x, y = y, x % y\n return x\n\n\ndef ntt(a, invert=False):\n j = 0\n for i in range(1, len(a)):\n bit = len(a) >> 1\n while j & bit:\n j ^= bit\n bit >>= 1\n j ^= bit\n\n if i < j:\n a[i], a[j] = a[j], a[i]\n\n length, cnt = 2, 1\n while length <= len(a):\n wlen = pow(3, 998244353 - 1 - (998244353 - 1 >> cnt) if invert else 998244353 - 1 >> cnt, 998244353)\n\n for i in range(0, len(a), length):\n w = 1\n for j in range(i, i + length // 2):\n u = a[j]\n v = (a[j + length//2] * w) % 998244353\n\n a[j] = u + v if u + v < 998244353 else u + v - 998244353\n a[j + length//2] = u - v if u - v >= 0 else u - v + 998244353\n\n w = (w * wlen) % 998244353\n\n cnt += 1\n length <<= 1\n\n if invert:\n n_1 = pow(len(a), 998244351, 998244353)\n for i in range(len(a)):\n a[i] = (a[i] * n_1) % 998244353\n\n\ndef main():\n n, _ = map(int, input().split(' '))\n\n d = [0] * 1048576\n for i in map(int, input().split(' ')):\n d[i] = 1\n\n ntt(d)\n d = list(map(lambda x: pow(x, n//2, 998244353), d))\n ntt(d, True)\n\n print(sum(i*i for i in d) % 998244353)\n\n\nif __name__ == '__main__':\n sync_with_stdio(False)\n main()\n", "lang": "PyPy 2", "bug_code_uid": "67aabc9d9b37adb2ceb79419a88b6b6c", "src_uid": "279f1f7d250a4be6406c6c7bfc818bbf", "apr_id": "271acd664d792a24d830158c8af4a556", "difficulty": 2400, "tags": ["divide and conquer", "dp", "fft"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.02912621359223301, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "MOD = 998244353\n\nn, k = map(int, input().split())\nf = [0] * (5 * n + 5)\nfor d in map(int, input().split()):\n f[d] = 1\n\ndef ntt_transform(a, P, G, inv=False):\n n, k = 1, 0\n while n < len(a):\n k += 1\n n *= 2\n a += [0] * (n - len(a))\n \n n2 = n // 2\n w = [1] * n2\n w[1] = pow(G, (P - 1) // n, P)\n if inv: w[1] = pow(w[1], P - 2, P)\n for i in range(2, n2):\n w[i] = w[i - 1] * w[1] % P\n\n rev = [0] * n\n for i in range(n):\n rev[i] = rev[i >> 1] >> 1\n if i & 1: rev[i] |= n2\n if i < rev[i]: a[i], a[rev[i]] = a[rev[i]], a[i]\n\n l = 2\n while l <= n:\n half, diff = l // 2, n // l\n for i in range(0, n, l):\n pw = 0\n for j in range(i, i + half):\n v = a[j + half] * w[pw] % P;\n a[j + half] = a[j] - v if a[j] - v >= 0 else a[j] - v + P\n a[j] = a[j] + v if a[j] + v < P else a[j] + v - P\n pw += diff\n l *= 2\n\n if inv:\n inv_n = pow(n, P - 2, P)\n for i in range(n): a[i] = a[i] * inv_n % P;\n\n\nntt_transform(f, MOD, 3)\nf = [pow(x, n // 2, MOD) for x in f]\nntt_transform(f, MOD, 3, inv=True)\n\nans = sum(x * x % MOD for x in f) % MOD\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "f383b9b8b56a4ecc3afd643772bdf6aa", "src_uid": "279f1f7d250a4be6406c6c7bfc818bbf", "apr_id": "b0e7e94e712793c356422d3b53f0f8ec", "difficulty": 2400, "tags": ["divide and conquer", "dp", "fft"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9848484848484849, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\nA = []\nsum = 0\nfor i in range(n):\n x = int(input())\n sum += x\n A.append(sum/i)\n\nprint('%.6f\\n' % max(A))", "lang": "PyPy 3", "bug_code_uid": "0fbaf7edefd912f80006ce37dfdb6d50", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "d90b798c0ca4ad0da2b6ea641280cd61", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7727272727272727, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "\n\nn = int(input())\nl = []\nfor i in range(1 , n + 1):\n l.append(i)\n \nif sum(l) % 2 == 0:\n print(0)\nelse:\n print(1)", "lang": "PyPy 3", "bug_code_uid": "86f70f9cd0b59d48b9e63b9e211f9deb", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "4acd056beb21e0ae5b87f62d791391c4", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7963386727688787, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n=input()\na=[[0,0]for i in range(n)]\ns=[0 for i in range(n)]\nfor i in range(n):\n a[i]=map(int,raw_input().split())\n if((a[i][0]%2)!=(a[i][1]%2)):\n s[i]=1\nb=zip(*a)\nb[0]=list(b[0])\nb[1]=list(b[1])\nif (sum(b[0])+sum(b[1]))%2==1:\n print -1\n exit()\nt=0\nwhile sum(b[0])%2==1 or sum(b[1])%2==1:\n for i in range(len(s)):\n if s[i]==1:\n t=t+1\n b[0][i],b[1][i]=b[1][i],b[0][i]\n break\nprint t", "lang": "Python 2", "bug_code_uid": "b9a2d657cee6d217f195d6321f237295", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "cac319e100634c012a07ebb6e67fc824", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2864864864864865, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "numcases = int(input())\nstart = \"1\"\nroot = \"1\"\ncount = 0\n\nfor i in range(numcases):\n lim = int(input())\n\n while int(start) != lim:\n if (len(start) < 4):\n start += root\n \n else:\n root = str(int(root) + 1)\n start = root\n count += len(start)\n if (lim == 1):\n print(1)\n else:\n print(count+1)\n\n \n", "lang": "Python 3", "bug_code_uid": "09d2bc421abce72967d4f1cf95f135e4", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "db5cfb4cc6251a5c768c216b69357fea", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9823874755381604, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def fact(n):\n\tp = 1\n\tif(n == 0): \n\t\treturn 1\n\tfor i in range(1,n+1):\n\t\tp = p*n\n\treturn p\nn = int(raw_input())\nf = fact(n+1)\na = map(int, raw_input().split())\na.pop(0)\nb = map(int, raw_input().split())\nb.pop(0)\nfor i in range(f):\n\tif(a[0]>b[0]):\n\t\ta.append(b[0])\n\t\ta.append(a[0])\n\t\ta.pop(0)\n\t\tb.pop(0)\n\telif(b[0]>a[0]):\n\t\tb.append(a[0])\n\t\tb.append(b[0])\n\t\ta.pop(0)\n\t\tb.pop(0)\n\telse:\n\t\tprint \"-1\"\n\t\texit()\n\tif(len(a)==0):\n\t\tprint str(i+1)+\" \"+\"2\"\n\t\texit()\n\telif(len(b)==0):\n\t\tprint str(i+1)+\" \"+\"1\"\n\t\texit()\nprint \"-1\"\n", "lang": "Python 2", "bug_code_uid": "97fd25a9cf803a3c6355183b7d495b2d", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "afa23d75dcabadfd302f00a603dfbaae", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5038434661076171, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "\n\ng = [0]*111111\nt = [0]*111111\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef ksm(a, b, p=int(1e9+7)):\n a = a % p\n ans = 1\n while b > 0:\n if b & 1:\n ans = ans * a % p\n b = b >> 1\n a = a*a % p\n return ans\n\n\nm = int(input())\np = int(1e9+7)\ntmp = ksm(m, p-2)\nfor j in range(m, 0, -1):\n c1 = 0\n tyouce = tmp\n gyouce = 0\n if j == 1:\n c1 = 0\n else:\n c1 = m//j * tmp % p\n\n for k in range(2, m//j + 1):\n t0 = m//j//k\n t1 = 0\n for l in range(1, k):\n if gcd(l, k) == 1:\n t1 += 1\n ck = t0*t1 % p\n for l in range(1, (m//j) % k + 1):\n if gcd(l, k) == 1:\n ck += 1\n ck = ck*tmp%p\n tyouce = (tyouce + ck * t[k*j]) % p\n gyouce = (gyouce + ck * (t[k*j] + g[k*j])) % p\n t[j] = tyouce * ksm(1-c1+p, p-2) % p\n gyouce = (gyouce + tmp + c1 * t[j]) % p\n g[j] = gyouce * ksm(1-c1+p, p-2) % p\n\n# print(t[2])\n# print(g[2])\n# print(t[1])\nprint(g[1])\n", "lang": "PyPy 3", "bug_code_uid": "08ed82de1b7607b793f2d4dc16f2ebf0", "src_uid": "ff810b16b6f41d57c1c8241ad960cba0", "apr_id": "2eace31d444a04951d417502b46a75ba", "difficulty": 2300, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9913769123783032, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from fractions import Fraction\n\ng = [0]*111111\nt = [0]*111111\nprime = [0]*111111\npm = [0]*111111\nfor i in range(len(prime)):\n prime[i] = {}\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef ksm(a, b, p=int(1e9+7)):\n a = a % p\n ans = 1\n while b > 0:\n if b & 1:\n ans = ans * a % p\n b = b >> 1\n a = a*a % p\n return ans\n\n\nm = int(input())\np = int(1e9+7)\ntmp = ksm(m, p-2)\nfor j in range(m, 0, -1):\n c1 = 0\n tyouce = tmp\n gyouce = 0\n if j == 1:\n c1 = 0\n else:\n c1 = m//j * tmp % p\n\n for k in range(2, m//j + 1):\n\n def get_ck(m, n):\n ans = 0\n\n def get_fac():\n for i in range(2, 100011):\n if pm[i] == 0:\n prime[i][i] = 1\n for j in range(2, 100001//i+1):\n pm[i*j] = 1\n prime[i*j][i] = 1\n\n if prime[m] == {}:\n get_fac()\n prime_list = list(prime[m].keys())\n for i in range(1, 1 << len(prime_list)):\n t = i\n rongchixishu = -1\n lcm = 1\n index = len(prime_list)-1\n while t>0:\n if t&1:\n lcm = lcm*prime_list[index]\n rongchixishu *= -1\n t >>= 1\n ans += n//lcm*rongchixishu\n return ans\n\n ck = (m//j - get_ck(k, m//j)+p) % p\n ck = ck*tmp % p\n tyouce = (tyouce + ck * t[k*j]) % p\n gyouce = (gyouce + ck * (t[k*j] + g[k*j])) % p\n t[j] = tyouce * ksm(1-c1+p, p-2) % p\n gyouce = (gyouce + tmp + c1 * t[j]) % p\n g[j] = gyouce * ksm(1-c1+p, p-2) % p\n\nprint(g[1])\n", "lang": "PyPy 3", "bug_code_uid": "b55a521e32699cea4aefbfe6de9d4641", "src_uid": "ff810b16b6f41d57c1c8241ad960cba0", "apr_id": "2eace31d444a04951d417502b46a75ba", "difficulty": 2300, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5791767554479419, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "# -*- coding:utf-8 -*-\n\n\"\"\"\n\ncreated by shuangquan.huang at 1/17/20\n\n\"\"\"\n\nimport collections\nimport time\nimport os\nimport sys\nimport bisect\nimport heapq\nfrom typing import List\n\n\ndef solve(N, A, B, K):\n MOD = 1000000007\n \n dp = [0 for _ in range(N+1)]\n dp[A] = 1\n for k in range(1, K+1):\n delta = []\n for x in range(1, N+1):\n d = abs(x-B)\n if d <= 1:\n continue\n l, r = max(x-d+1, 1), min(x+d, N+1)\n if l < x:\n delta.append((l, dp[x]))\n delta.append((x, -dp[x]))\n if x < r:\n delta.append((x+1, dp[x]))\n delta.append((r, -dp[x]))\n \n delta.sort()\n \n ndp = [0 for _ in range(N+1)]\n v = 0\n for x, d in delta:\n v += d\n v %= MOD\n if x <= N:\n ndp[x] = v\n \n dp = ndp\n \n return sum(dp) % MOD\n\n\nN, A, B, K = map(int, input().split())\nprint(solve(N, A, B, K))", "lang": "PyPy 3", "bug_code_uid": "fc98b0e4447eaebcecd11d9edbe22792", "src_uid": "142b06ed43b3473513995de995e19fc3", "apr_id": "0f3f5baed5590980f68a48aa72c64e12", "difficulty": 1900, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9918478260869565, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def solve(n, st, k):\n MOD = int(1e9 + 7)\n dp = [0] * (n + 1)\n prefix_sum = [0] * (n + 1)\n dp[st] = 1\n for times in range(k):\n prefix_sum[0] = 0\n for i in range(1, n + 1):\n prefix_sum[i] = prefix_sum[i - 1] + dp[i]\n if prefix_sum[i] >= MOD: prefix_sum[i] -= MOD\n for i in range(1, n + 1):\n t = prefix_sum[n] - prefix_sum[i] + prefix_sum[i - 1] - prefix_sum[i >> 1]\n while t < 0: dp[i] += MOD\n while t >= MOD: dp[i] -= MOD\n dp[i] = t\n return sum(dp) % MOD\n \n\ndef main():\n n, a, b, k = [int(i) for i in input().split()]\n if a > b:\n print(solve(n - b, a - b, k))\n else:\n print(solve(b - 1, b - a, k))\n \nmain()\n", "lang": "PyPy 3", "bug_code_uid": "d431123cf0a103f42bddae7e1799b60f", "src_uid": "142b06ed43b3473513995de995e19fc3", "apr_id": "e54e22d8fa7adbb69e2bd84c8013f88c", "difficulty": 1900, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9569691300280636, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import sys\n\ndef main():\n def modst(a, s):\n ret = 1\n while s:\n if s % 2:\n ret = ret * a % mod\n a = a * a % mod\n s //= 2\n return ret \n def Cnk(n, k):\n return (k <= n and n >= 0) * ((f[n] * modst((f[k] * f[n - k]) % mod, mod - 2)) % mod)\n #n, v, u = map(int, sys.stdin.readline().split())\n #n, k = map(int, sys.stdin.readline().split())\n n = int(sys.stdin.readline().strip())\n #a, b = map(int, sys.stdin.readline().split())\n #q = list(map(int, sys.stdin.readline().split()))\n #q = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)\n f = [1, 1]\n m = 200007\n for i in range(2, m):\n f.append(f[-1] * i)\n mod = 998244353\n a = 0\n for i in range(2 - n % 2, n + 1, 2):\n a = (a + Cnk(max(((n - i) // 2) + i - 1, 0), i - 1)) % mod\n print((a * modst(modst(2, n), mod - 2)) % mod)\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n#for i in range(int(sys.stdin.readline().strip())):\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "ee8b1a29d73a2c056c46624c679c0a49", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "a6b5f4c87edb91dee983f861286dd3bf", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2100456621004566, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "import sys\nn=int(input())\na=[1]*n\nb=list(range(1,n+1))\nif n>1:\n while True:\n for i in range(1,n):\n a[i]=a[i-1]+b[i]\n if a[1]==n:\n print(a[n-1])\n sys.exit()\n for j in range(1,n):\n b[j]=b[j-1]+a[j]\n if b[1]==n:\n print(b[n-1])\n sys.exit()\nelse:\n print(1)", "lang": "Python 3", "bug_code_uid": "2e37e088e1cbe5fadf3b4ff5c6803b8b", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "ef4b9b740fbcdd231148ed1a7fbf57f9", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.954954954954955, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "r,g,b=map(int,raw_input().split())\nt=0\nwhile r>0 or g>0 or b>0:\n if t%3==0:\n r-=2\n elif t%3==1:\n g-=2\n else:\n b-=2\nt += 30\nprint t\n", "lang": "Python 2", "bug_code_uid": "49902715b74308c27403e5f1cad8b794", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "3dc03991aadcc4e8118e66d5663c4df4", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.30357142857142855, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 19, "bug_source_code": "n = int(input())\nl = [2, 3]\ni = 0\nwhile (i+2) < (n-1):\n l += [(i+2)*2]*(i + 2)\n l += [(i+2)*2 + 1]*(i + 2)\n i += 1\nprint(l[n-1])", "lang": "PyPy 3", "bug_code_uid": "e7e7f361bc34fe326daf7f675068c88c", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "21af57fa3bd359e3a30853d436e1f987", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9942857142857143, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def solve(year):\n while(True):\n year = str(int(year)+1)\n if(len(set(year))==4):\n return year\n\nif __name__ == \"__main__\":\n print solve(input())\n", "lang": "Python 3", "bug_code_uid": "4f5de5b96eaa62ad15633a25acd682a7", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "54c3cc15fe8fb286ee8d0ab61bc8658a", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8235294117647058, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "res = a\nrem = 0\nwhile a > 0:\n a += rem\n s = a // b\n res += s\n rem = a % b\n a = s\nprint res", "lang": "Python 2", "bug_code_uid": "69d2ce490797ce003aae7780a6a5232d", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "12544f3a87e8e5b4b6e30c0df81685ec", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.07415730337078652, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "def gen(i, counts, res1, res2):\n global count\n if i == n:\n if res1 == res2 == 0 and (counts < count or count == -1):\n count = counts\n else:\n gen(i + 1, counts, (res1 + A[i][0]) % 2, (res2 + A[i][1]) % 2)\n gen(i + 1, counts + 1, (res1 + A[i][1]) % 2, (res2 + A[i][0]) % 2)\n\n\nn = int(input())\ncount = -1\nA = []\nfor i in range(n):\n A.append(list(map(int, input().split())))\ngen(0, 0, 0, 0)\nprint(count)\n", "lang": "Python 3", "bug_code_uid": "4ca89b31b272c893f660875310744715", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "7f92a32e7230de82992894f10c04f342", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9370277078085643, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "t = input()\n for i in range(len(t)):\n\tif int(t[-i]) < 5:\n\t\tprint(\"O-|\"+\"O\"*int(t[-i])+\"-\"+\"O\"*(4-int(t[-i])))\n\telif int(t[-i]) <= 9:\n\t\tprint(\"-O|\"+\"O\"*(int(t[-i])-5)+\"-\"+\"O\"*(9-int(t[-i])))\n\t", "lang": "Python 3", "bug_code_uid": "cba10a81c653f4b8df547befa95f4b37", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "894e4220db2193cd245cebad324281d4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9587628865979382, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "n = input()\nfor i in reversed(n) :\n k = int(i)\n if k < 5 :\n print('O-|' + 'OOOO'[:k] + '-' + 'OOOO'[:4-k])\n else : \n k -= 5\n print('-O|' + 'OOOO'[:k] + '-' + 'OOOO'[:4-k])\n", "lang": "Python 3", "bug_code_uid": "afb8db9ff8075e7aaf948ca032bdf96c", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "390946498066662f1ce668dab060d884", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4618991793669402, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 31 20:11:35 2018\n \n@author: Himanshu Gwalani\n \n\"\"\"\nn,a,x,b,y = map(int,input().split())\nl = [a]\nif a == n:\n a = 1\nelse:\n a+=1\nwhile a!=x:\n l.append(a)\n a+=1\n if a == n+1:\n a = 1\nl.append(x)\nll = [y]\nwhile b<=y:\n ll.append(b)\n b-=1\n if b==0:\n b = n\nflag = False\n#print(l)\n#print(ll)\nfor i in range(n):\n if i+1 in l and i+1 in ll:\n flag = True\n break\nif flag:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "c3b6bb4616bed8f2f2ed851ba16f77c9", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "f982ffdfafa338e4e88b5f9eb2ba0365", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8888888888888888, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a = list(map(int, raw_input().split(\" \")))\n\ns = 0\n\nfor i in range(len(a)):\n s+= a[i]\n\nif s % len(a) == 0:\n print s/len(a)\nelse:\n print \"-1\"", "lang": "Python 2", "bug_code_uid": "0f736252fd5d49c55c31300d348c3a09", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "65882561e9575194ca8a36f7829eeda4", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9953051643192489, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "inp = raw_input().strip().split()\n\ntotal = 0\nfor i in range(0,len(inp)):\n a = int(inp[i])\n total += a\n\n\nm = total % 5\nx = total / 5\nif total == 0:\n print \"-1\"\nif m == 0:\n print x\nelse:\n print \"-1\"\n", "lang": "Python 2", "bug_code_uid": "090f1422c73a45b30bf00c2a2226f7d5", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "2b794e30b11fe67ca2d2f2f8586b4417", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6018440905280805, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "\ndef func(fr,to):\n if fr==to:\n return 0\n temp=fr.bit_length()-to.bit_length()\n if temp<=0:\n return -1\n return temp\nn,k=map(int,input().split())\ngans=-1\narr=sorted(list(map(int,input().split())))\nfor i in range(max(arr)+1):\n cs=0\n tk=0\n for j in arr:\n if tk>=k:\n break\n temp=func(j,i)\n if temp<0:\n continue\n cs=cs+temp\n tk=tk+1\n if gans==-1:\n gans=cs\n else:\n if tk>=k:\n gans=min(gans,cs)\n #print(i,cs,tk,gans)\nprint(gans)", "lang": "Python 3", "bug_code_uid": "86480dc30cf61fb608e2c99ed1748fe8", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "2993ce934d717e3947beae03074ba7bd", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.17181208053691274, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "n=input()\nfor i in range(n):\n k=input()\n l=7\n s=3\n if k=l:\n if k%s==0:\n print \"YES\"\n\n elif k%l==0:\n print \"YES\"\n elif k%l!=0:\n y=k%l\n if y%s==0:\n print \"YES\"\n elif k%s!=0:\n i=1\n while True:\n if (s*i)+l==k or (l*i)+s==k:\n print \"YES\"\n break\n i=i+1\n else:\n print \"NO\"\n \n \n", "lang": "Python 2", "bug_code_uid": "247d44a9ee5de2e418d0f932a9070d33", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "2e6761e0f001aeb51bf1d39bb89b87f1", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9871244635193133, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import sys\n\na = int(input())\n\np = 0\nif a==0:\n print(8)\n sys.exit()\n\nwhile True:\n a+=1\n p+=1\n j=a\n while j!=0:\n if j%10==8:\n print(p)\n sys.exit()\n else:\n j=j//10\n ", "lang": "Python 3", "bug_code_uid": "9dcf9099643319fe58be11b5b55615ea", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "bd3199bd56db39b482ce093a21df4d5c", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7479224376731302, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "from math import factorial as F\nn, w, b = map(lambda x: int(x), raw_input().split())\nprint reduce(lambda x,i:x+(i-1)*F(w-1)/F(i-1)/F(w-i)*F(b-1)/F(n-i-1)/F(b+i-n),xrange(max(2,n-b),min(n,w+1)),0)*F(w)*F(b) % (10**9+9)\n", "lang": "Python 2", "bug_code_uid": "aeea722a2b255e6ce0f4f3bbf804e1cd", "src_uid": "63e93a161bbff623323e66c98d5e20ac", "apr_id": "a4aaf0258260d483c9315b2c7a432c52", "difficulty": 2100, "tags": ["combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9925373134328358, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\na = list(map((int, input().split()))\nb = sorted(a)\nres = 0\nfor i in range(n/2):\n res += b[i*2+1]-b[i*2]\nprint(res)", "lang": "Python 3", "bug_code_uid": "c44d8e9de83336976c9d7ae5f8699028", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "3f51cf63e30d86371e373be137ff8992", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9536423841059603, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n, s = input(), input()\n\nprint('1' * s.count('1') % 2 + '0' * s.count('0'))", "lang": "Python 3", "bug_code_uid": "9eff8734d5f944b3670fb1c3c0a374c6", "src_uid": "ac244791f8b648d672ed3de32ce0074d", "apr_id": "ecb09e4c20cd2d3be69950c6d72cb78f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4782608695652174, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n,m = map(int,input().split())\narr = list(map(int,input().split()))\narr.sort(reverse=True)\n\nfor k in range(0,n):\n total = 0\n grps = (k+n-1)//n\n for i in range(n):\n total += max(0, arr[i] - i%grps)\n if total>=m:\n print(k)\nprint(-1)", "lang": "PyPy 3", "bug_code_uid": "353d2d20446252dd9168451e71fb8611", "src_uid": "acb8a57c8cfdb849a55fa65aff86628d", "apr_id": "12b3a4d02c70a299610308ef1f469f20", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9880341880341881, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#After seeing the editorials :'(\nn,m=map(int,input().split())\na=list(map(int,input().split()))\na=sorted(a,reverse=True)\nfor i in range(1,n+1):\n s=0\n for j in range(n):\n s+=max(0,a[j]-(j//i))\n if s>=m:\n print(i)\n flag=1\n break\nif flag==0:\n print(-1)\n", "lang": "PyPy 3", "bug_code_uid": "0e2debd8fc62fa32a8c6deb59d27ccdf", "src_uid": "acb8a57c8cfdb849a55fa65aff86628d", "apr_id": "b56ede01f6b00460cf05e53f3798bdee", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.020876826722338204, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "#include\n#include\nusing namespace std;\nint main()\n{\n\tstring a,b;\n\tint h1=0,h2=0,m1=0,m2=0,a1,a2;\n\tbool flag=false;\n\tcin>>a>>b;\n\tfor(int i=0;imaks)\n maks = sum\n sum=0\n if str[i].isUpper():\n sum+=1;\n\nif (sum>maks)\n maks = sum\nprint(maks)", "lang": "Python 3", "bug_code_uid": "72f92b8a1d305946b213fa1ffbd13ea0", "src_uid": "d3929a9acf1633475ab16f5dfbead13c", "apr_id": "fa09852e50ff8ccbe0d2d3431330b7e9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.12293853073463268, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a, b = map(int, input().split())\na, b = bin(a)[2:], bin(b)[2:]\n\nmax_len = max(len(a), len(b))\n\nfor _ in range(max_len - len(a)):\n a = '0' + a\n\nfor _ in range(max_len - len(b)):\n b = '0' + b\n\noutput = ''\nreminder = 0\n\nfor i in range(max_len - 1, -1, -1):\n if a[i] == '0' and b[i] == '1' or a[i] == '1' and b[i] == '0':\n output = str(1 ^ reminder) + output\n elif a[i] == '0' and b[i] == '0':\n output = str(0 ^ reminder) + output\n elif a[i] == '1' and b[i] == '1':\n output = str(0 ^ reminder) + output\n reminder = 1\n\nif reminder:\n output = '1' + output\n\nprint(int(output, 2))", "lang": "Python 3", "bug_code_uid": "16cfed272bda0d0f0b7a10c2f822aa13", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "apr_id": "e3dc5b9960ae4bd4092549dae7d45822", "difficulty": 1500, "tags": ["brute force", "constructive algorithms", "implementation", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9230769230769231, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "import sys\ninput=sys.stdin.readline\nn,m = map(int,input().split())\nprint((2**m-1)**n)", "lang": "PyPy 3", "bug_code_uid": "2ad134c45b1d20d32c1d12c6eeb84bd8", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "7e429677a6e2d1d9912fe50f4262f66f", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4892086330935252, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n,m=map(int,input().split())\nprint((2**m-1)**n)", "lang": "PyPy 3", "bug_code_uid": "8cc72793dd6759360fb5a21c51232628", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "143e6d7eb5b007eba1deed210270d2cf", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9047619047619048, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "x,y=map(int,input().split())\nprint((((2**y)-1)**x)%1000000007)\n", "lang": "PyPy 3", "bug_code_uid": "f7c0cbf468f817f33ee6dfad9f9e4fe1", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "d4a5a1ac1a3ecb4b7da140990bebb6fc", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8188976377952756, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "n,m=map(int,input().split())\nprint(((2 ** m - 1) ** n) % (10**9 + 7))", "lang": "PyPy 3", "bug_code_uid": "f7466da2319be5709c28081386dff989", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "0471b6caa40633d2ec8121dfcfe3b587", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9444444444444444, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a, b = list(map(int, input().split()))\nmod = 10**9 + 7\nprint(pow(pow(2, b)-1, a)%mod)\n\n", "lang": "PyPy 3", "bug_code_uid": "b6cc8cba7450d120ca926ac0624e3d72", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "5a8e055e7c8bf980f6c29199b4ffd73f", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n, m = map(int, input().split())\ns = (2 ** m - 1) ** n\n\nprint(s)\n", "lang": "PyPy 3", "bug_code_uid": "58dd2fbb8c4b0c753d57f72d073e3ae3", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "a23a34e63f3a0657ad3ef94b4acec2d0", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.82, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,m = map(int,input().split())\nmd = 1000000007\nans = ((2**m - 1)**n)%md\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "509f23b9443e10ff25cde65718a6e498", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "35e5c25266c81596f3ec40798f65db0c", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3708838821490468, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import sys\ninputfn = sys.stdin.readline\n\nnm = inputfn().split(\" \")\nn = int(nm[0])\nm = int(nm[1])\n\nprint((((1 << n) - 1) * ((1 << m) - 1)) % (10**9 + 7))", "lang": "PyPy 3", "bug_code_uid": "b63fa56b310eab290bba315ecc1d7665", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "69efbece3c16b29314ccad759d115e90", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.29347826086956524, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n, m = map(int, input().split())\nprint((((2 ** m) - 1) ** n ) % 1000000007)", "lang": "PyPy 3", "bug_code_uid": "8ae15bbf8162c324a57f3c38e95c6939", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "105898420a45fe77dfc89f3d556e35ef", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8307692307692308, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,m = map(int,input().split())\nprint((int)(((2**m-1)**n)%(1e9+7)))", "lang": "PyPy 3", "bug_code_uid": "77eee62643d6dd0b4979395c9dc97cdf", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "bec42ee00b2d1d544f7663ce4030ef22", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9298245614035088, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m=map(int,input().split())\nprint(pow(pow(2,m)-1,n))", "lang": "PyPy 3", "bug_code_uid": "d628c2faf64db08e0b2ea39e573ef22f", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "d6f7afc4ca3ed4c73da58563e930e118", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8617886178861789, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n,m=map(int, input().split())\nprint(((2**m-(1))**n)%(10**9+7))", "lang": "PyPy 3", "bug_code_uid": "47b7f511eccc414cb59c71ce06e6d4c7", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "6d036762d9213b87f9f1d84e6ce0801a", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9305555555555556, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n, m=[x for x in map(int, input().split())]\nprint((2**m-1)**n%(10**9+7))", "lang": "PyPy 3", "bug_code_uid": "3a65efc7597593242b685700c4660fc4", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "555ddf8ea03444b709ff40d435901189", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8452380952380952, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "n, m = [int(i) for i in input().split(' ')]\nprint(((2**m - 1)**n)%(10**9 + 7))", "lang": "PyPy 3", "bug_code_uid": "670bb2d8778219c932cf9a63110c7e67", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "292aa1117cea1db98cceb70f07f506ea", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6203703703703703, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "n,m=map(int,input().split())\n\nans=(2**m-1)\nfor _ in range(1,n):\n ans*=(2**m-1)%(10**9+7)\n\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "20f20f17c6a70d81071596afe4dd1bb5", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "179c15e731432f594ca898dc5c871fd2", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.44126074498567336, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n, m = [int(x) for x in input().split()]\nprint(((2 ** m - 1) ** n) % (10 ** 9 + 7))", "lang": "PyPy 3", "bug_code_uid": "93c9978d15f108ed61feac799bfd2aad", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "a0320b2ce18c5b204806642bfe317c30", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.991869918699187, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,m,X,Y,x,y=map(int,input().split())\na=[abs(X-x),abs(Y-y)]\na.sort()\nprint(\"First\" if a[0]<5 and a[0]+a[1]<7 else \"Second\")\n", "lang": "Python 3", "bug_code_uid": "f190d9993c0f10432afbc3be5348a20b", "src_uid": "41f6f90b7307d2383495441114fa8ea2", "apr_id": "57a09fcbbd4722f12665d0b3878a9687", "difficulty": 2000, "tags": ["combinatorics", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9777777777777777, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from decimal import *\nimport sys\ngetcontext().prec=100\nn,m=input().split()\nn=eval(n)\nm=eval(m)\nif n*m<=2:\n if n==2 and m==1:\n print(0.5)\n else:\n print(1)\n sys.exit()\nn=Decimal(n)\nm=Decimal(m)\na=m*n\nb=n-1\nb=b*b\nans=(a-1+b)/(n*(a-1))\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "31ffa930a2a66979b69c8b6774639276", "src_uid": "0b9ce20c36e53d4702869660cbb53317", "apr_id": "c4a529091661d11a521a673aca760191", "difficulty": 2100, "tags": ["probabilities", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.31537102473498235, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "a=[[1,1,1],[1,1,1],[1,1,1]]\nb=[]\n;b.append(list(map(int,input().split())))\n;b.append(list(map(int,input().split())))\n;b.append(list(map(int,input().split())))\nfor i in range(3):\n for j in range(3):\n if b[i][j]%2==1:\n for k in range(3):\n if a[k][j] and k!=i:a[k][j]=0\n else:a[k][j]=1\n for k in range(3):\n if a[i][k]:a[i][k]=0\n else:a[i][k]=1\nfor i in range(3):print(*a[i])", "lang": "PyPy 3", "bug_code_uid": "16af3019502a591e96ea6f993c7e6074", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "2e30c6be97386c51b912474f3fcd30cd", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5613207547169812, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n,k=[int(i) for i in input().split()]\narr=list(map(int,input().split()))\nx=0\ny=1\ne=0\nwhile x<=y+1:\n if arr[x]<=k:\n e=e+1\n x=x+1\n if arr[-y]<=k:\n e=e+1\n y=y+1\nprint(e)\n \n", "lang": "Python 3", "bug_code_uid": "2c3dc50d42c074f0502592ec95ad89a3", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "856803679bbfc47deb1baa8f0ea827af", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7455078373900854, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "def inp(dtype=str, strip=True):\n s = input()\n res = [dtype(p) for p in s.split()]\n res = res[0] if len(res) == 1 and strip else res\n return res\n\n\ndef problem1():\n\n def test(cur, steps):\n if 0 < cur <= n and cur not in a:\n return steps\n else:\n return -1\n\n t = inp(int)\n for _ in range(t):\n n, s, k = inp(int)\n a = inp(int, strip=False)\n a = set(a)\n\n res = -1\n steps = 0\n while res < 0:\n res = test(s + steps, steps)\n if res < 0:\n res = test(s - steps, steps)\n steps += 1\n\n print(res)\n\n\ndef problem2():\n n = inp(int)\n res = 0\n for i in range(1, n + 1):\n res += 1 / i\n print(res)\n\n\ndef problem3():\n n, q = inp(int)\n conflicts = [[[0, 0, 0] for _ in range(n)] for _ in range(2)]\n state = [[0 for _ in range(n)] for _ in range(2)]\n nconflicts = 0\n for _ in range(q):\n r, c = inp(int)\n r = r - 1\n c = c - 1\n\n if state[r][c] == 0:\n state[r][c] = 1\n q = 1 - r\n if c - 1 >= 0 and state[q][c - 1] == 1:\n nconflicts += 1\n conflicts[r][c][-1 + 1] = 1\n conflicts[q][c - 1][1 + 1] = 1\n if state[q][c] == 1:\n nconflicts += 1\n conflicts[r][c][0 + 1] = 1\n conflicts[q][c][0 + 1] = 1\n if c + 1 < n and state[q][c + 1] == 1:\n nconflicts += 1\n conflicts[r][c][1 + 1] = 1\n conflicts[q][c + 1][-1 + 1] = 1\n else:\n state[r][c] = 0\n q = 1 - r\n if c - 1 >= 0 and state[q][c - 1] == 1:\n nconflicts -= 1\n conflicts[r][c][-1 + 1] = 0\n conflicts[q][c - 1][1 + 1] = 0\n if state[q][c] == 1:\n nconflicts -= 1\n conflicts[r][c][0 + 1] = 0\n conflicts[q][c][0 + 1] = 0\n if c + 1 < n and state[q][c + 1] == 1:\n nconflicts -= 1\n conflicts[r][c][1 + 1] = 0\n conflicts[q][c + 1][-1 + 1] = 0\n\n if nconflicts == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\ndef problem4():\n\n def dist(xi, yi, xj, yj):\n return abs(xi - xj) + abs(yi - yj)\n\n def dist2(xi, yi, xj, yj):\n return 2 * max(abs(xi - xj), abs(yi - yj))\n\n x0, y0, ax, ay, bx, by = inp(int)\n xs, ys, t = inp(int)\n\n i = 0\n a = [(x0, y0)]\n xmin, ymin = x0, y0\n while i < 60:\n xmin = ax * xmin + bx\n ymin = ay * ymin + by\n a.append((xmin, ymin))\n\n i = 0\n xmin, ymin = x0, y0\n while dist2(xs, ys, xmin, ymin) > t and i < 60:\n xmin = ax * xmin + bx\n ymin = ay * ymin + by\n i += 1\n imin = i\n\n xmax, ymax = xmin, ymin\n while dist2(xs, ys, xmax, ymax) <= t and i < 60:\n xmax = ax * xmax + bx\n ymax = ay * ymax + by\n i += 1\n imax = i - 1\n\n res = 0\n for istart in range(imin, imax + 1):\n dist_start = dist(xs, ys, *a[istart])\n if dist_start > t:\n continue\n\n # some down and all up\n for imed in range(imin, istart + 1):\n dist_med = dist(*a[istart], *a[imed])\n if dist_start + dist_med > t:\n continue\n\n i = imed + 1\n while dist_start + dist_med + dist(*a[imed], *a[i]) <= t:\n i += 1\n\n i = max(imed, i - 1)\n res = max(res, i - imed + 1)\n\n # some up and all down\n for imed in range(istart, imax + 1):\n dist_med = dist(*a[istart], *a[imed])\n if dist_start + dist_med > t:\n continue\n\n i = imed - 1\n while dist_start + dist_med + dist(*a[imed], *a[i]) <= t:\n i -= 1\n\n i = min(imed, i + 1)\n res = max(res, imed - i + 1)\n\n print(res)\n\n\ndef problem5():\n pass\n\n\nif __name__ == '__main__':\n # problem1()\n # problem2()\n # problem3()\n problem4()\n # problem5()\n", "lang": "Python 3", "bug_code_uid": "d31d8a992a9b0c6180db36bbbf20cece", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "b0e6a36188afa9cb50278ce53c6f732f", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8589147286821706, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "n=input()\nstrs=input()\nif len(strs)<3:\n print(strs)\nk='ogo'\nif len(strs)>=3:\n while True:\n while k in strs:\n k+='go'\n k=k[:-2]\n strs=strs.replace(k,'***')\n if k=='ogo':\n print(strs)\n break\n else:\n k=='ogo'", "lang": "Python 3", "bug_code_uid": "87a19da301fe391ebbb13a234a29943f", "src_uid": "619665bed79ecf77b083251fe6fe7eb3", "apr_id": "5b5fdf5d795929ee527c00df58b689f7", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.42900763358778626, "equal_cnt": 20, "replace_cnt": 5, "delete_cnt": 14, "insert_cnt": 1, "fix_ops_cnt": 20, "bug_source_code": "n=input() \nstrs=input() \nc=0 \nif len(strs)<3: \n print(strs) \n c=1 \nk='ogo' \nz=0 \nif c!=1: \n while True: \n while k in strs: \n k+='go' \n z=1 \n if z==1: \n k=k[:-2] \n z=0 \n strs=strs.replace(k,'***') \n if k=='ogo': \n print(strs) \n break \n else: \n k=='ogo' ", "lang": "Python 3", "bug_code_uid": "1ff167f9ed5f2723c8a4eec8321b0580", "src_uid": "619665bed79ecf77b083251fe6fe7eb3", "apr_id": "5b5fdf5d795929ee527c00df58b689f7", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9963636363636363, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=list(map(int,input().split()))\ndayinm=[31,\t28,\t31,\t30,\t31,\t30,\t31,\t31,\t30,\t31,\t30,\t31]\nansw=(dayinm[a[0]-1]-(8-a[1])+6//7+1\nprint(answ)", "lang": "Python 3", "bug_code_uid": "44c9f905fa12eaae69705ceb54e0a80d", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "a9325d8362158f40fe0e60904f28eddc", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9996362313568571, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l, r = list( map( int, input().split() ) )\n\ndef cnt( x ) :\n ret = 0\n for i in range( 1, x+1 ):\n s = str(i)\n if s[0] == s[-1]:\n ret += 1\n #print(s)\n return ( ret )\n\ndef cnt2( x ):\n\n ret = 0\n s = str(x)\n L = len(s)\n\n if L >= 2 and x == 10**(L-1):\n return ( cnt2( 10**(L-1)-1 ) )\n\n if L <= 1:\n return ( x )\n elif L <= 2:\n while x//10 != x%10:\n x -= 1\n return ( 9 + x//10 )\n else:\n ret = int( \"1\" + \"0\"*(L-3) + \"8\" )\n num = list( str(x) )\n #print( num )\n if num[0] != num[-1]:\n if int(num[0]) > int( num[-1] ):\n how = int(num[-1]) + 10-int(num[0])\n else:\n how = int(num[-1]) - int(num[0])\n x -= how\n num = str(x)\n d = x % 10\n #print( 'num',num )\n #print( 'd', d )\n #print( 'num', num, 'ret before', ret )\n ret += ( int(d-1) ) * int( \"9\" * (L-2) ) + int( num[1:-1] ) + int(d)\n\n return ( ret )\n\n#print( cnt(1024), cnt2(1024) )\n#print( cnt(47), cnt2(47) )\n#print( cnt(9), cnt2(9) )\n#print( cnt(58), cnt2(58) )\n#print( cnt(999), cnt2(999) )\n#print( cnt(8987), cnt2(8987) )\n#print()\n#print( cnt(99999), cnt2(99999) )\n#print( cnt(99899), cnt2(99899) )\n#print( cnt(1000), cnt2(1000) )\n#print( cnt2(1) )\n#exit(0)\n \nprint( cnt2(r) - cnt(l-1) )", "lang": "PyPy 3", "bug_code_uid": "b334651cd3d5771f6ffe03b2ef3b25ce", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "e43b36bef98cea8a76d261131be1d99c", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9973333333333333, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,num=input(),0\nfor i in range(len(n)):\n if n[i]==\"4\":\n num+=1\n elif n[i]==\"7\":\n num+=1\n else:\n num+=0\nprint([\"NO\",\"YES\"][\"4\" in str(num) or \"7\" in str(num)]", "lang": "PyPy 3", "bug_code_uid": "bb63f3bbbefe88c93c2584f1fd2c46b3", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "1e71c4f7a5732d44149242602b9fd9b6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8911917098445595, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "a=input().split()\nif a[0]<=a[1] and a[0]<=a[2]:\n prinnt('Yes')\nelse:\n print('No')", "lang": "Python 3", "bug_code_uid": "7bae9990936e171e4ed1fc68b910e82e", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "07df7ef5f7c08c30984e6ede3277a91d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8643649815043156, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "def Solve(x,B):\n if(len(B)>X):\n return False\n if(x==len(L)):\n return True\n if(Form(L[x],B)):\n A=list(B)\n for e in range(len(B)):\n r=A[e]\n A[e]=L[x]\n if(Solve(x+1,tuple(A))):\n return True\n A[e]=r\n A+=[L[x]]\n if(Solve(x+1,tuple(A))):\n return True\n return False\n\ndef Form(x,B):\n for i in range(len(B)):\n for j in range(i,len(B)):\n if(B[i]+B[j]==x):\n return True\n return False\n \nn=int(input())\nL=list(map(int,input().split()))\ndone=False\nfor X in range(1,n+1):\n if(Solve(1,(L[0],))):\n print(X)\n done=True\n break\nif(not done):\n print(-1)\n", "lang": "Python 3", "bug_code_uid": "d27bb43d78958db0b12fa86e51619f28", "src_uid": "359f5d1264ce16c5c5293fd59db95628", "apr_id": "6e10300834463dc7b879a7e531e1b4fd", "difficulty": 2200, "tags": ["dp", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7922912205567452, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "__author__ = \"runekri3\"\n\nshop_1, shop_2, between_shops = list(map(int, input().split()))\n\nopt_1 = 2 * shop_1 + 2 * shop_2\nopt_2 = shop_1 + shop_2 + between_shops\n\nprint(min(opt_1, opt_2))\n", "lang": "Python 3", "bug_code_uid": "d45905f55b15ac310ca4614141e25e69", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "d1361f0496ff749d19fcaea65f902dbc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9420654911838791, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def ok( s, r ):\n res = s // 50 % 475\n for i in range( 25 ):\n res = ( res * 96 + 42 ) % 475\n if 26 + res == r:\n return True\n return False\n\nP, X, Y = map( int, input().split() )\n\nif any( ok( i, P ) for i in range( X, Y - 1, -50 ) ):\n exit( print( 0 ) )\nelse:\n ans = 1\n X += 100\n while True:\n if ok( X, P ) or ok( X - 50, P ):\n exit( print( ans ) )\n X += 100\n ans += 1\n\n", "lang": "PyPy 3", "bug_code_uid": "859c50ba8afc3e1700a1fa5b0fa7424a", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "apr_id": "e28c094a30e697ad307acfb59c28b3c0", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.11702127659574468, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "#include \nusing namespace std;\n\n#define boost ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)\n\nint main(){\n boost;\n int n;\n cin >> n;\n vector v(n);\n for(int i = 0; i < n; i++)\n cin >> v[i];\n sort(v.begin(), v.end());\n\n int t, ans = 0;\n cin >> t;\n\n for(int i = 0; i < n; i++){\n int k = 0;\n for(int j = i + 1; j < n; j++){\n if(v[j] - v[i] <= t) k++;\n }\n ans = max(ans, k + 1);\n }\n cout << ans << \"\\n\";\n return 0;\n}", "lang": "Python 3", "bug_code_uid": "77066a4135de29fd519ee9a6bfcb529c", "src_uid": "086d07bd6f9031df09bd6a6e8fe8f25c", "apr_id": "9c4875a3f95dddb3b21fa0909274f59c", "difficulty": 1400, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9555273189326556, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\nm = list(map(int, input().split()))\nprint(m)\nt = int(input())\nm.sort()\nif n == 1 || len(m) == 1:\n print(1)\nelif m[-1]-m[0] <= t:\n print(n)\nelse:\n mx = 1\n for i in range(n-1):\n ma = 1\n fr = m[i]\n for j in range(i+1, n):\n if m[j]-fr <= t:\n ma += 1\n else:\n break\n mx = max(ma, mx)\nprint(mx)", "lang": "Python 3", "bug_code_uid": "6b9f1e21559af5e32da4ad37da0178e5", "src_uid": "086d07bd6f9031df09bd6a6e8fe8f25c", "apr_id": "ebfa1d7d7faa0e8fdc9d76e36c41cc2e", "difficulty": 1400, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09857612267250822, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "import collections\nimport sys\ndef recur(_list):\n idx = -1\n next_list = []\n for i,x in enumerate(_list):\n if x > 1:\n idx = i\n q = _list[idx] // 2\n r = _list[idx] % 2\n next_list += [q,r,q]\n else:\n next_list += [x]\n if idx == -1:\n return _list\n else:\n return recur(next_list)\n\nsys.setrecursionlimit(100000)\nn,s,e = list(map(int,input().split(' ')))\n_list = [n]\nprint(collections.Counter(recur(_list[:])[s-1:e])[1])", "lang": "Python 3", "bug_code_uid": "e936553435ef8b88bbd3d039df3d206b", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "d934fb79b03510f9b0341d81bf7a1884", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.44324324324324327, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n, l, r = map(int, input().split())\ns = ''\na = []\nk = n\nwhile k > 1:\n a.append(str(k % 2))\n k = k // 2\ncur = 1\nk = str(k)\ns = k + a[-cur] + k\ncur += 1\nwhile cur < len(a):\n s = s + a[-cur] + s\n cur += 1\ns = s + a[0] + s\nans = 0\nfor i in range(l - 1, r):\n ans += int(s[i])\nprint(ans)", "lang": "Python 3", "bug_code_uid": "622f1edb26496dacb7229897264d9862", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "93bc16a84e33582f1797b4323c5ab34b", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5152057245080501, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "\ndef construct_array(n): \n if n == 1 or n == 0:\n return [n]\n half_n = construct_array(n/2)\n \n return half_n + [n%2] + half_n\n \n \ndef count_ones(array, i, j):\n count = 0\n while(i<=j):\n count = count + array[i-1]\n i = i + 1\n return count\n\nimport sys\n\nfor line in sys.stdin:\n x = line.split(' ')\n print count_ones(construct_array(int(x[0])), int(x[1]), int(x[2]))", "lang": "Python 2", "bug_code_uid": "8205ed04ce9e0ef917176a561cddf096", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "b1f1e740b5899cb527a54f1d0492e751", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3126787416587226, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "import sys as s\n\nfor v in s.stdin:\n if not v.isnumeric():\n s.exit(1)\n v=list(v.strip())\n pl1=pl2=0\n p=0\n ln=len(v)\n while p=7:\n print(\"YES\")\n s.exit()\n pl2=0 \n while p=7:\n print(\"YES\")\n s.exit() \n break\nprint(\"NO\")\ns.exit()", "lang": "Python 3", "bug_code_uid": "9d96cdb2aac62d4990e6c3d74d0042d6", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "3d9f22319485a73d31bd729defd93070", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9698275862068966, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import math\nt=1\nl=[1,1]\nfor i in range(2,200000):\n l.append(l[i-1]+l[i-2])\nwhile t:\n t-=1\n n=int(input())\n x=l[n-1]\n y=pow(2,n)\n print(x*pow(y,998244351,998244353)%998244353)\n ", "lang": "Python 3", "bug_code_uid": "d9f708511e574b104b0ef766b52dbd95", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "0e9e485e9192b0462452ef82f7c1ed24", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.837410071942446, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def modinv(a,m):\n b=m\n u=1\n v=0\n while b:\n t=a//b\n a-=t*b\n a,b=b,a\n u-=t*v\n u,v=v,u\n u%=m\n return u\nn=int(input())\nMOD=998244353\ndpsum=[0]*(n+1)\ndp=1\nfor i in range(n):\n dpsum[i+1]=dp+dpsum[i]\n dp=dpsum[i]\nans=dpsum[n]\nfor _ in range(n):ans*=modinv(2,MOD)\nans%=MOD\nprint(ans)", "lang": "Python 3", "bug_code_uid": "0e1c7235d2ba3c5a96c20efe19da690d", "src_uid": "cec37432956bb0a1ce62a0188fe2d805", "apr_id": "96d37cc22ee7d85e603aa43fdd75bf05", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9758179231863442, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "def win(x, y, z):\n if y != z:\n return False\n if x == 'rock':\n return y == 'scissors'\n if x == 'scissors'\n return y == 'paper'\n return y == 'rock'\n\na = []\nb = 'MFS'\nfor i in range(3):\n a.append(input())\n\nfor i in range(3):\n if win(a[i], a[(i+1) % 3], a[(i+2) % 3]):\n print(b[i])\nelse:\n print('?')", "lang": "PyPy 3", "bug_code_uid": "ae89ad6bc5c817a88b3cf70b0180f85b", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "bf54ea29975ce2c5d1ae9f325c07c163", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4686064318529862, "equal_cnt": 26, "replace_cnt": 16, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 26, "bug_source_code": "import sys\ninput = sys.stdin.readline\n\nn,k=map(int,input().split())\nmod=10**9+7\n\nFACT=[1]\nfor i in range(1,2*10**5+1):\n FACT.append(FACT[-1]*i%mod)\n\nFACT_INV=[pow(FACT[-1],mod-2,mod)]\nfor i in range(2*10**5,0,-1):\n FACT_INV.append(FACT_INV[-1]*i%mod)\n\nFACT_INV.reverse()\n\ndef Combi(a,b):\n if 0<=b<=a:\n return FACT[a]*FACT_INV[b]*FACT_INV[a-b]%mod\n else:\n return 0\n\nDP=[0]*(n+1)\nDP[0]=1\n\nfor yoko in range(n):\n NDP=[0]*(n+1)\n for i in range(n+1):\n for j in range(max(1,i),n+1):\n PLUS=pow(k,i,mod)*Combi(n-i,j-i)*pow(k-1,n-j,mod)\n if i==j:\n PLUS-=pow(k-1,n,mod)\n\n #print(i,j,PLUS)\n NDP[j]=NDP[j]+DP[i]*PLUS\n\n NDP[j]%=mod\n\n DP=NDP\n #print(DP)\n\nprint(DP[-1])\n \n \n \n \n", "lang": "PyPy 3", "bug_code_uid": "b992c4d860fd528121410bdb484d9f22", "src_uid": "f67173c973c6f83e88bc0ddb0b9bfa93", "apr_id": "728824f2c71384470b60b46444433f85", "difficulty": 2300, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9865921787709497, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "MOD = int(1e9+7)\n\ndef mult(l, r):\n\treturn (l*r)%MOD\n\ndef fast_exp(b, e):\n\tif e == 0:\n\t\treturn 1\n\tif e%2 == 1:\n\t\treturn mult(b, fast_exp(b, e-1))\n\telse:\n\t\tb2 = fast_exp(b, e//2)\n\t\treturn mult(b2, b2)\n\n[n, k] = [int(s) for s in input().split(\" \")]\nprint(n, k)\nfact = (n+1)*[1]\nfor i in range(1, n+1):\n\tfact[i] = mult(i, fact[i-1])\n\n\nifact = (n+1)*[1]\nifact[n] = fast_exp(fact[n], MOD-2)\nfor i in reversed(range(1, n)):\n\tifact[i] = mult(i+1, ifact[i+1])\n\ndef binom(N, K):\n\treturn mult(mult(fact[N], ifact[K]), ifact[N-K])\n\ndef get(i, j):\n\tX = i*j\n\tY = (n-i)*j\n\tZ = (n-j)*i\n\ttot = X+Y+Z\n\tans = 0\n\tif (i+j)%2 == 0:\n\t\tans = 1\n\telse:\n\t\tans = (MOD - 1)\n\tans = mult(ans, binom(n, j))\n\tans = mult(ans, binom(n, i))\n\tans = mult(ans, fast_exp(k, n*n - tot))\n\tans = mult(ans, fast_exp(k-1, tot))\n\treturn ans\n\nans = 0\nfor i in range(0, n+1):\n\tfor j in range(0, n+1):\n\t\tans = (ans + get(i, j)) % MOD\n\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "1a0dace4675eb7d5f4a21814c0c6c1df", "src_uid": "f67173c973c6f83e88bc0ddb0b9bfa93", "apr_id": "1a0b455fbfd74eae82873bfc044132f8", "difficulty": 2300, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8226059654631083, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\na = list(map(int, input().split()))\nif a.count(1) == 0:\n print(0)\nelif a.count(1) == 1:\n print(1)\nelse:\n ans = 1\n for i in range(1, n):\n if a[i - 1] == 1 and a[i] == 0:\n cnt = 1\n elif a[i] == 0 and cnt > 0:\n cnt += 1\n else:\n ans *= (cnt + 1)\n cnt = 0\n print(ans)\n", "lang": "PyPy 3", "bug_code_uid": "5dd7ba3d5e12a8bfb2b5e5785345dfaa", "src_uid": "58242665476f1c4fa723848ff0ecda98", "apr_id": "d33cbff8fc08a56becdffd10c1f665d0", "difficulty": 1300, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.49158249158249157, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "x,y = map(int,input().split())\nn = int(input())\n\na = [x,y]\n\nif n>=2:\n n-=2\n while n:\n a+=[a[-1]-a[-2]]\n n-=1\n print(a[-1]%(10**9+7))\nelse:\n print(a[n-1]%(10**9+7))\n", "lang": "PyPy 3", "bug_code_uid": "d8a42942b5958547a7e4afc335da40e1", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "ba61a052da774acf5a6b5d888dbbd31f", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4473684210526316, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "# https://codeforces.com/problemset/problem/450/B\n\nMOD = 10**9 + 7\nx, y = map(int, input().split())\nn = int(input())\n\nf = [x, y]\nfor i in range(2, n):\n f.append(f[-1] - f[-2])\n\nprint(f[-1] % MOD)\n\n", "lang": "PyPy 3", "bug_code_uid": "7dd37e6b2b78578df8a07c07f1b9e18e", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "55f89efed60c32e8c15439b18450eda9", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6472148541114059, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "def main():\n (x, y) = map(int, input().split(' '))\n n = int(input())\n f = [x, y]\n for i in range(2, n):\n f.append(f[i-1] - f[i-2])\n print(f[-1] % 1000000007)\n\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "ecfe350dd6bc79ba4729cd25db204271", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "546534c405c22ac0987730a428aa4819", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.34959349593495936, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "x,y=map(int,input().split())\nn=int(input())\nif n==1:\n print(x%1000000007)\nelif n==2:\n print(y%1000000007)\nelse:\n z=[x,y]\n for i in range(1,n-1):\n z.append(z[i]-z[i-1])\n print(z[n-1]%1000000007)", "lang": "PyPy 3", "bug_code_uid": "19f2db137e49b5519e0002d6e3ce2321", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "d07ede9cb6d5024574f4357acec69e95", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6791044776119403, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "f = [int(x) for x in input().split()]\nn = int(input())\n\nfor i in range(2, n):\n f.append(f[i - 1] - f[i - 2])\nprint(f[-1] % 1000000007)\n", "lang": "PyPy 3", "bug_code_uid": "6394af18f7caff6aa96e975d0880da57", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "11d0d82c822ce01235a7e0db19ac2ff7", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9579158316633266, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import sys\nfrom functools import reduce\nfrom collections import Counter\nimport time\nimport datetime\nfrom math import sqrt,gcd\n\n# def time_t():\n# print(\"Current date and time: \" , datetime.datetime.now())\n# print(\"Current year: \", datetime.date.today().strftime(\"%Y\"))\n# print(\"Month of year: \", datetime.date.today().strftime(\"%B\"))\n# print(\"Week number of the year: \", datetime.date.today().strftime(\"%W\"))\n# print(\"Weekday of the week: \", datetime.date.today().strftime(\"%w\"))\n# print(\"Day of year: \", datetime.date.today().strftime(\"%j\"))\n# print(\"Day of the month : \", datetime.date.today().strftime(\"%d\"))\n# print(\"Day of week: \", datetime.date.today().strftime(\"%A\"))\n\ndef ip(): return int(sys.stdin.readline())\n\ndef sip(): return sys.stdin.readline()\n\ndef mip(): return map(int,sys.stdin.readline().split())\n\ndef mips(): return map(str,sys.stdin.readline().split())\n\ndef lip(): return list(map(int,sys.stdin.readline().split()))\n\ndef matip(n,m):\n lst=[]\n for i in range(n):\n arr = lip()\n lst.append(arr)\n return lst\n\ndef factors(n): # find the factors of a number\n return list(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))\n\ndef minJumps(arr, n): #to reach from 0 to n-1 in the array in minimum steps\n jumps = [0 for i in range(n)]\n if (n == 0) or (arr[0] == 0):\n return float('inf')\n jumps[0] = 0\n for i in range(1, n):\n jumps[i] = float('inf')\n for j in range(i):\n if (i <= j + arr[j]) and (jumps[j] != float('inf')):\n jumps[i] = min(jumps[i], jumps[j] + 1)\n break\n return jumps[n-1]\n\ndef dic(arr): # converting list into dict of count\n return Counter(arr)\n\ndef check_prime(n):\n if n<2:\n return False\n for i in range(2,int(n**(0.5))+1,2):\n if n%i==0:\n return False\n return True \n\n# --------------------------------------------------------- #\n# sys.stdin = open('input.txt','r')\n# sys.stdout = open('output.txt','w')\n# --------------------------------------------------------- #\n\nx,y = mip()\nn = ip()\nif n==1:\n print(x%1000000007)\nif n==2:\n print(y%1000000007)\nelse:\n lst = [x,y]\n for i in range(n-2):\n p = lst[-1]-lst[-2]\n lst.append(p)\n print(lst[-1]%1000000007)", "lang": "PyPy 3", "bug_code_uid": "2b8a1baf96a4d99d6f67599cef777139", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "368a7df510b3a93328c02de6a671b4cd", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6237288135593221, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "x, y= map(int, input().split())\nz = int(input())\n\nlst = [0 for _ in range(z)]\nlst[0] = x\nlst[1] = y\nfor i in range(2, z, 1):\n lst[i] = (lst[i-1]-lst[i-2])\n\nprint(lst[z-1]%1000000007)", "lang": "PyPy 3", "bug_code_uid": "cc780e9b8c8b5cd71f93286073c363da", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "74384789dfa3ae73dfc4548d0d7d23d1", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9135135135135135, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "def b(n, k):\n v = 0\n while n:\n n, v = n // k, 10 * v + n % k\n return str(v)[::-1]\nk = int(input())\nfor i in range(1, k):\n print(' '.join(b(i * j, k) for j in range(1, k)))", "lang": "Python 3", "bug_code_uid": "ad77d4e7f684e3924ef576be9abd8cb8", "src_uid": "a705144ace798d6b41068aa284d99050", "apr_id": "b77a126142d7f8d4a67d9408dd007ce0", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9983844911147012, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(raw_input())\ndef rad_n(n,x):\n\tr =''\n\twhile x>n:\n\t\tr=str(x%n)+r\n\t\tx = x/n\n\tr=str(x)+r\n\treturn r\nl = len(str(rad_n(n,(n-1)*(n-1))))\n#print l\nfor i in xrange(1,n):\n\tfor j in xrange(1,n):\n\t\ta = rad_n(n,i*j)\n\t\tif j==1:\n\t\t\tprint a,\n\t\telif jl:\n return False\n \n \n for wait in range(2*k):\n if get_depth(t+wait, i)>l:\n break\n \n if canWinFromThere(t+wait+1,i+1):\n return True\n return False\n\n for u in range(2*k):\n if canWinFromThere(u,0): \n print(\"Yes\")\n break\n else:\n print(\"No\")\n\n \n\n\n", "lang": "PyPy 3", "bug_code_uid": "8c8e0abab26344779e4982fc138b3b2d", "src_uid": "4941b0a365f86b2e2cf686cdf5d532f8", "apr_id": "38c666eb89d5b390001bd038a260f9c9", "difficulty": 1900, "tags": ["dp", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9336585365853659, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import re, sys\nfrom collections import Counter\n\n\ndef check(num, K):\n cnt = 0\n\n while num:\n if num%10 != 0:\n break\n\n cnt += 1\n num /= 10 \n \n if cnt == K:\n return True\n \n return False\n\n\ndef main():\n N, K = map(int, raw_input().split()) \n sqrt, val = 0, 1\n\n for i in range(K):\n val *= 10\n \n for i in range(val):\n if i*i < val:\n sqrt = i + 1\n else:\n break\n \n answer = N * val\n\n for i in range(1, sqrt+1):\n if val%i != 0:\n continue\n \n num = N * i\n\n if check(num, K):\n if num < answer:\n answer = num\n \n num = N * (val / i)\n\n if check(num, K):\n if num < answer:\n answer = num\n \n print answer\n\n############################################################\n############################################################\n############################################################\nif(__name__ == \"__main__\"):\n main()", "lang": "Python 2", "bug_code_uid": "cf13ba9c6814634294044ad50f7bba81", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "b55e83d4707d5349fb2d8484062742f2", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9885931558935361, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\nif n==3:\n print (1)\nelif n==1:\n print (2)\nelif n==4:\n print (2)\nelif n==2:\n print (3)\nelse\n print (2)", "lang": "PyPy 3", "bug_code_uid": "477495bc477390afc6d4da76f5a5f4f3", "src_uid": "c702e07fed684b7741d8337aafa005fb", "apr_id": "e9dcac19b61e12605a430de98879805a", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.22296173044925124, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "n = int(raw_input())\ns= raw_input()\nli=s.split()\nfor i in range(len(li)):\n li[i]=int(li[i])\nif 1 in li:\n print \"-1\"\nelse :\n print \"1\" ", "lang": "Python 2", "bug_code_uid": "7577558431b5c12a9786a37d9a56d94e", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "f57cfbd285b484a0b177237191096881", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.976, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a1, b1 = map(int, stdin.readline().split())\na2, b2 = map(int, stdin.readline().split())\na3, b3 = map(int, stdin.readline().split())\nmx, mn = max(a1, b1), min(a1, b1)\nx = [0]*4\ny = [0]*4\nx[0], y[0] = a2+a3, max(b2, b3)\nx[1], y[1] = a2+b3, max(b2, a3)\nx[2], y[2] = b2+a3, max(a2, b3)\nx[3], y[3] = b2+b3, max(a2, a3)\n\ndef solve():\n for i in xrange(4):\n if mx >= max(x[i], y[i]) and mn >= min(x[i], y[i]):\n print \"YES\"\n return\n print \"NO\"\n return\nsolve()", "lang": "Python 2", "bug_code_uid": "a2c150bd0f2d197311fd6c1bd12e3e4d", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "eb93533d793478fac558d731d0548018", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2658959537572254, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "a=int(input())\nl=[]\nfor i in range(a):\n l.append(int(input())\nb=sum(l)\nprint(int(4.5*a-b)+1)\n\n", "lang": "Python 3", "bug_code_uid": "6b80538d7131992eeb868733c269b7f9", "src_uid": "715608282b27a0a25b66f08574a6d5bd", "apr_id": "2967e125e962c09e079cbe8a749d66f2", "difficulty": 900, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9982905982905983, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "nimport sys\nn = int(input())\na = list(map(int,sys.stdin.readline().strip().split()))\navg = sum(a)/n\ncount = 0\n#print(avg)\nif avg >= 4.5:\n print('0')\nelse:\n a.sort()\n i = 0\n while avg < 4.5:\n a[i] = 5\n count += 1\n avg = sum(a)/n\n i += 1\n print(count)\n", "lang": "Python 3", "bug_code_uid": "f883bd551401ff9b6c2b321e4c24c205", "src_uid": "715608282b27a0a25b66f08574a6d5bd", "apr_id": "4880ff7eec8325bb0178048d22efdc2c", "difficulty": 900, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.08288288288288288, "equal_cnt": 27, "replace_cnt": 25, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 28, "bug_source_code": "a, b = map(int, input().split())\nif a == b:\n print(0)\nelse:\n a2 = 0\n a3 = 0\n a5 = 0\n while True:\n if a % 2 == 0:\n a = a // 2\n a2 += 1\n elif a % 3 == 0:\n a = a // 3\n a3 += 1\n elif a % 5 == 0:\n a = a // 5\n a5 += 1\n else:\n break\n b2 = 0\n b3 = 0\n b5 = 0\n while True:\n if b % 2 == 0:\n b = b // 2\n b2 += 1\n elif b % 3 == 0:\n b = b // 3\n b3 += 1\n elif b % 5 == 0:\n b = b // 5\n b5 += 1\n else:\n break\n if a != b:\n print(-1)\n else:\n print(abs(a2 - b2) + abs(a3 - b3) + abs(a5 - b5))", "lang": "PyPy 3", "bug_code_uid": "27d4087baa6c2223e1dec48fec80617e", "src_uid": "4a3767011ddac874efa021fff7c94432", "apr_id": "e59a811682af05eb319b8cec179cbbf4", "difficulty": 2000, "tags": ["dp", "games", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.44976076555023925, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n,m,s=map(int,input().split())\nans=min(n,s)*min(m,s)\nprint(ans)", "lang": "Python 3", "bug_code_uid": "7fcf5aa2206b3bcc3153f8ee1fcbfbc3", "src_uid": "e853733fb2ed87c56623ff9a5ac09c36", "apr_id": "55ab12ae08a7fcfb27886762d3fda41d", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8661654135338346, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "from math import ceil\nn, m, s = map(int, raw_input().split())\narr = []\nfor i in xrange(min(s, n)):\n for j in xrange(min(s, m)):\n arr.append(int(ceil(1.0 * (m - j) / s) * ceil(1.0 * (n - i) / s)))\nprint n * m if max(arr) is 1 or max(arr) is 0 else max(arr) * arr.count(max(arr))\n", "lang": "Python 2", "bug_code_uid": "1ac16a8e09c8eccf26765e9c724ef5e6", "src_uid": "e853733fb2ed87c56623ff9a5ac09c36", "apr_id": "bab605492fa2c1b2b1ce6325664d6ecb", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9993746091307066, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import string\n\ndef determinant(a11, a12, a21, a22):\n\treturn a11 * a22 - a21 * a12\n\nfirst = [int(coeff) for coeff in input().split()]\nsecond = [int(coeff) for coeff in input().split()]\n\n# Determine rang\nrang = 2\nif determinant(first[0], first[1], second[0], second[1]) == 0:\n\trang = 1\n\n# Check consistency\ntilda_rang = 2\nif (determinant(first[0], first[2], second[0], second[2]) == 0) and (determinant(first[1], first[2], second[1], second[2]) == 0) and (rang == 1):\n\ttilda_rang = 1\n\n# Check the special case of null matrix\nif rang = 1:\n\tif (first[0] == 0) and (first[1] == 0) and (second[0] == 0) and (second[1] == 0):\n\t\trang = 0\n\t\tif (first[2] == 0) and (second[2] == 0):\n\t\t\ttilda_rang = 0\n\t\telse:\n\t\t\ttilda_rang = 1\n\nif rang != tilda_rang:\n\tprint('0')\nelif rang == 2:\n\tprint('1')\nelse:\n\tprint('-1')", "lang": "Python 3", "bug_code_uid": "a957cd6e351663cce19ec0cde0378277", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "c304988ee9a2373677773af377c643e5", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9988322304398599, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def plane(a, b, c):\n if a == b == 0 != c:\n return 0\n else:\n return -1\n\ndef hline(b1, c1, a2, b2, c2):\n if b1 == 0:\n if c1 == 0:\n return plane(a2, b2, c2)\n else:\n return -1\n elif a2 == 0:\n if b2 == 0 != c2:\n return 0\n elif c2 * b1 == c1 * b2:\n return -1\n else:\n return 0\n else:\n return 1\n\ndef vline(a1, c1, a2, b2, c2):\n return hline(a1, c1, b2, a2, c2)\n\n\ndef intersect(a1, b1, c1, a2, b2, c2):\n if a1 == b1 == 0:\n if c1 == 0:\n return plane(a2, b2, c2)\n else:\n return 0\n if a1 == 0:\n return hline(b1, c1, a2, b2, c2)\n if b1 == 0:\n return vline(a1, c1, a2, b2, c2)\n if a2 == b2 == 0:\n if c2 == 0:\n return plane(a1, b1, c1)\n else:\n return -1\n if a2 == 0:\n return hline(b2, c2, a1, b1, c1)\n if b2 == 0:\n return vline(a2, c2, a1, b1, c1)\n else:\n if a1 * b2 == a2 * b1:\n if c1 * a2 == c2 * a1:\n return -1\n else:\n return 0\n else:\n return 1\n\n\n\n\na1, b1, c1 = map(int, input().split())\na2, b2, c2 = map(int, input().split())\n\nprint(intersect(a1, b1, c1, a2, b2, c2))\n\n", "lang": "Python 3", "bug_code_uid": "1a527ed46ec62cfe9f1920fbe7c55dca", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "70a8de256313978d5c57a59d607c282a", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6408094435075885, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "C, Ha, Hb, Wa, Wb = (int(x) for x in raw_input().split())\n\nif Ha * Wb > Hb * Wa:\n Ha, Hb, Wa, Wb = Hb, Ha, Wb, Wa\n\nres = 0\nfor x in xrange(0, Wb):\n r = x * Ha + (C - x * Wa) / Wb * Hb\n res = max(r, res)\n \nprint res\n ", "lang": "Python 2", "bug_code_uid": "124066dff741c2dcc73de74a29ac217d", "src_uid": "eb052ca12ca293479992680581452399", "apr_id": "388ef2d43f527e41108448a57b6fe519", "difficulty": 2000, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7246376811594203, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "C, H1, H2, W1, W2 = map(int, raw_input().split())\n\nif H1 * W2 < H2 * W1:\n H1, H2 = H2, H1\n W1, W2 = W2, W1\n\nr = C % W1\nx0 = C // W1\nbest = 0\nfor k in xrange(min(x0 + 1, W2)):\n ans_opt = (x0 - k) * H1 + (r + k * W1) * H2 / W2\n if ans_opt < best:\n break\n ans = (x0 - k) * H1 + (r + k * W1) // W2 * H2\n best = max(ans, best)\nprint best\n", "lang": "Python 2", "bug_code_uid": "f4bff3b90004a840583992c42456f25e", "src_uid": "eb052ca12ca293479992680581452399", "apr_id": "ea6a0b3fdb04429f4528dda1486586b3", "difficulty": 2000, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6394779771615008, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\ni = 1\ns = 0\nflag = False\n\nwhile (s < n):\n for j in range(1, i+1):\n s += 1\n\n if (s == n):\n flag = True\n val = j\n break\n \n i += 1\n\n if (flag):\n break\n\nprint(val)", "lang": "PyPy 3", "bug_code_uid": "7877fba20ccf2bd2b066cc08e86abd5a", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "5dfa600b088c47ff5328f60396e8fec9", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2175, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "from fractions import gcd\n\nN = input()\nH = dict()\n\ndef number (n,b):\n if not H.has_key((n,b)):\n if n == 1 and b == 1: H[n,b] = 0\n elif n>b and b>0: H[n,b] = (n-1)/b + number ((n-1)%b+1,b)\n elif b>n and n>0: H[n,b] = (b-1)/n + number (n,(b-1)%n+1)\n else: H[n,b] = 10000000\n return H[n,b]\n\nm = min (number(N,b) for b in range (N+1))\nprint m\n#print [b for b in range (N+1) if number(N,b)==m]\n# for b in range (N+1): print number(N,b),b,gcd(N,b)\n\n", "lang": "Python 2", "bug_code_uid": "545127007a248bea3716a6cc4869b9ac", "src_uid": "75739f77378b21c331b46b1427226fa1", "apr_id": "1f67d4880636662d5be1cc02f14c17fc", "difficulty": 1900, "tags": ["brute force", "math", "dfs and similar", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5179331306990882, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "from collections import deque\n\n\nclass CodeforcesTask134BSolution:\n def __init__(self):\n self.result = ''\n self.n = 0\n\n def read_input(self):\n self.n = int(input())\n\n def process_task(self):\n go = deque([(1, 1, 0)])\n while go:\n exploring = go.popleft()\n if exploring[0] == self.n or exploring[1] == self.n:\n self.result = str(exploring[2])\n break\n else:\n go.append((exploring[0] + exploring[1], exploring[1], exploring[2] + 1))\n go.append((exploring[0], exploring[1] + exploring[0], exploring[2] + 1))\n\n def get_result(self):\n return self.result\n\n\nif __name__ == \"__main__\":\n Solution = CodeforcesTask134BSolution()\n Solution.read_input()\n Solution.process_task()\n print(Solution.get_result())\n", "lang": "PyPy 3", "bug_code_uid": "cdbf5456e49153ed2f14502d3cda5863", "src_uid": "75739f77378b21c331b46b1427226fa1", "apr_id": "dc5b052b777ddc7fd753fd10a2303dcb", "difficulty": 1900, "tags": ["brute force", "math", "dfs and similar", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9916666666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\nc = n - 10\nelif c == 10:\n print(15)\n exit()\nelif c > 11 or c <= 0:\n print(0)\nelse:\n print(4)", "lang": "PyPy 3", "bug_code_uid": "ed27e292dd524687d68721aadf15182c", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "6d9c26856de710df8fadaa310430a6e6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.23741007194244604, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = input()\nprint \"codeforces\" + \"s\" * (n - 1)\n", "lang": "Python 2", "bug_code_uid": "5dce8fdbf2e182446816b7ba419eed2e", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "27e9c69c7df4bf3cfc6f8e54108fc083", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.21409921671018275, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "k = int(input())\nmyStr = 'codeforce'+ 's'*k\nprint myStr", "lang": "Python 2", "bug_code_uid": "f8ceb07b6a6ec957b75b2f042437edda", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "4116e982452c312b35a6a30e89bea2ee", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9882352941176471, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "n, k = map(int, input().split())\ns = list(input())\nans = False\nfor i in range(len(s) - k):\n flag = True\n for j in range(i, i + k):\n if (s[j] == 'Y'):\n flag = False\n break\n if ((i + k) < len(s)) and s[i + k] == 'N': flag = False\n if (i > 0) and (s[i - 1] == 'N'): flag = False\n # print(i, flag)\n if (flag):\n ans = True\n break\nmaximum = 0\ni = 0\nwhile (i < len(s)):\n now = 0\n while (s[i] != 'N'):\n i += 1\n if (i >= len(s)):\n break\n if (i >= len(s)): break\n while (i < len(s)) and (s[i] == 'N'):\n i += 1\n now += 1\n maximum = max(maximum, now)\nif ans and (maximum <= k):\n print('YES')\nelse: print('NO')\n", "lang": "Python 3", "bug_code_uid": "aadfd4a381651013a12982168fa5fb89", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "eab2dcc210dccc80cf401c32d029b6d5", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9838585703305149, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "text = input()\nbracket = False\nbracket_word_count = 0\nmax_length = 0\nbracket_s = \"\"\nnon_bracket_s = \"\"\nfor ch in text:\n\tif bracket:\n\t\tif ch == ')':\n\t\t\tbracket = False\n\t\t\tbracket_word_count += sum(1 for s in bracket_s.split('_') if s)\n\t\t\tbracket_s = \"\"\n\t\telse:\n\t\t\tbracket_s += ch\n\telse:\n\t\tif ch == '(':\n\t\t\tbracket = True\n\t\t\tmax_length = max(max_length, max(len(s) for s in non_bracket_s.split('_')))\n\t\t\tnon_bracket_s = \"\"\n\t\telse:\n\t\t\tnon_bracket_s += ch\nmax_length = max(max_length, max(len(s) for s in non_bracket_s.split('_'))\nbracket_word_count += sum(1 for s in bracket_s.split('_') if s)\nprint('{} {}'.format(max_length, bracket_word_count))", "lang": "Python 3", "bug_code_uid": "68a5ec6d21a88612cafec39d54820398", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "a565b4ecdc498b062807b3563373cdaf", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6511627906976745, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "n,k=map(int,input().split())\ns=[1]\nfor i in range(n):\n s.append((max(s)+1))\n s+=s[:-1]\nprint(s[k-1])\n \n", "lang": "Python 3", "bug_code_uid": "171fd0ce57209690f08461ba73167096", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "187a6afbcf6458a934d2f05c4f23fa14", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2822822822822823, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "a=[int(i) for i in input().split()]\nb=[1]\nc=[]\nfor i in range(a[0]):\n c=[i+2]\n b=b+c+b\n if len(b)>=a[1]:\n print(b[a[1]-1])\n break\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "973edab2b6791b56da7de2b5db47f344", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "0d19c15bc12a98cc4a4dfa44f1725022", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.44715447154471544, "equal_cnt": 19, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "n,k=map(int,input().split())\na=[1]\nb=[]\nfor i in range(2,n+1):\n\tb=a+[i]\n\ta=b+a\nprint(a[k-1])\t", "lang": "Python 3", "bug_code_uid": "6b6040e6989d81cf8d4bc9be06251adc", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "32d184aca8899188cafa1ba10a445bbc", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6206896551724138, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n,k=map(int,input().split())\na=[1]\nfor i in range(n):\n b=a[:]\n a.append(max(a)+1)\n a.extend(b)\nprint(a[k-1])", "lang": "Python 3", "bug_code_uid": "c325f716a84995c57f3ab556c155ea40", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "877cf9b92a7c9c6983212572e52da942", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6438356164383562, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 9, "insert_cnt": 0, "fix_ops_cnt": 16, "bug_source_code": "string = input()\nnumbers = string.split()\na = int(numbers[0])\nb = int(numbers[1])\nsequence = []\nfor x in range(a):\n sequence += [x + 1] + sequence\nprint(sequence[b - 1])", "lang": "Python 3", "bug_code_uid": "99993902665ba6df78e9ecc9235f7312", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "3ac37a73f7f55f491c0335123be0516c", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.22176591375770022, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n, k = [int(x) for x in input().split()]\nstart = [1]\ni = 0\ndigit = 2\nwhile i != n-1 and k > len(start):\n start = start + [digit] + start\n digit = digit + 1\n i += 1\nprint(start[k-1])", "lang": "Python 3", "bug_code_uid": "e6865a8f891f9a42697810dfece31459", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "d501d4bb9f14d6a0a21ab0ae2465611f", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7429340511440108, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,k=map(int,input().split())\na,b=map(int,input().split())\nr=[]\ni=1\np=n*k\nwhile i<=n*k:\n r.append(i)\n i+=k\ns=1+a\nc=[]\nfor i in r:\n c.append((i-b)%p)\n c.append((i+b)%p)\nmx=0\nmn=1111111111111111111111111\nfor i in c:\n dp=i-s\n dp%=p\n if not dp:ns=1\n else:\n j=1\n while (j*p)%dp:j+=1\n ns=(j*p)//dp\n mx=max(mx,ns)\n mn=min(mn,ns)\nprint(mn,mx)", "lang": "Python 3", "bug_code_uid": "3231574ae640ab82f4b4b66e950d7226", "src_uid": "5bb4adff1b332f43144047955eefba0c", "apr_id": "048f10880eac7ee9f03d3753bcd70572", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9952904238618524, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def cnt_flowers(r, g, b):\n return r // 3 + g // 3 + b // 3\n\n\ndef main():\n r, g, b = map(int, input().split())\n n = min(r, g, b) + 1\n ans = [0] * n\n for i in range(0, n):\n rr = r - i\n gg = g - i\n bb = b - i\n ans[i] = (cnt_flowers(rr, gg, bb) + i)\n print(max(ans))\n\n\nmain()", "lang": "Python 3", "bug_code_uid": "aa3e3bebd6e328ae79c910a48fc37e1d", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "5d9dc1474d0482fbba36f110f5c48604", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9518716577540107, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "x, n = map(int, input().split())\nMOD = 10**9 + 7\nc = 4*x\nif c == 0:\n print(0)\nelif n == 0:\n ans = 2 * x\nelse:\n ans = (((c - 2) * pow(2, n -1, MOD) + 1) + MOD) % MOD\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "fa7bd6c04e443c82e94218c755897bb9", "src_uid": "e0e017e8c8872fc1957242ace739464d", "apr_id": "75d66967d2ea2c56a616918ea65740ed", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8364485981308412, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "import sys\n#sys.stdin = open ('input.txt')\n#sys.stdout = open ('output.txt', 'w')\n\nh, m = map (float, raw_input ().split (':'))\nh += m / 60.\nif h not in [12, 0]:\n\tx = 30. * h\nelse:\n\tx = 0\nif m not in [12, 0]:\n\ty = 6. * m\nelse:\n\ty = 0\n\nprint x, y\n", "lang": "Python 2", "bug_code_uid": "3f32a945a77a3e7aad725e3915d55e6b", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "b73f2a31d7e20ea95136de10ccd7a82a", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2843601895734597, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n,k=[int(i) for i in input().split()]\nl=[]\nfor i in range(n):\n l.append(i+1)\n \nimport itertools\nl_C_k=list(itertools.combinations(l,k))\n\nl_xor_sum=[]\nfor i in l_C_k:\n xor_sum=i[0]^i[1]\n for j in i[2:]:\n xor_sum=xor_sum^j\n l_xor_sum.append(xor_sum)\n \nprint(max(l_xor_sum))\n", "lang": "Python 3", "bug_code_uid": "b0dbf151f46f0a99765ac4e0efd1cc07", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "4bd69098530039e786eec0ddccbadd06", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8413793103448276, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "import sys\nfrom math import *\n\ndef minp():\n\treturn sys.stdin.readline().strip()\n\ndef mint():\n\treturn int(minp())\n\ndef mints():\n\treturn map(int, minp().split())\n\nn = mint()\np = [0]*n\nx = dict()\ny = dict()\nfor i in range(n):\n\ta = tuple(mints())\n\tp[i] = a\n\tif a[0] in x:\n\t\tx[a[0]].append(i)\n\telse:\n\t\tx[a[0]] = [i]\n\tif a[1] in y:\n\t\ty[a[1]].append(i)\n\telse:\n\t\ty[a[1]] = [i]\n\ndel(pow)\nr = 1\nq = [0]*n\nw = [True]*n\nql = 0\nqr = 0\nfor i in range(n):\n\tif w[i]:\n\t\tw[i] = False\n\t\tq[qr] = i\n\t\tqr += 1\n\t\tqlb = ql\n\t\te = 0\n\t\txs = set()\n\t\tys = set()\n\t\twhile ql < qr:\n\t\t\tv = q[ql]\n\t\t\tql += 1\n\t\t\ta = p[v]\n\t\t\txs.add(a[0])\n\t\t\tys.add(a[1])\n\t\t\tfor u in x[a[0]]:\n\t\t\t\te += 1\n\t\t\t\tif w[u]:\n\t\t\t\t\tw[u] = False\n\t\t\t\t\tq[qr] = u\n\t\t\t\t\tqr += 1\n\t\t\tfor u in y[a[1]]:\n\t\t\t\te += 1\n\t\t\t\tif w[u]:\n\t\t\t\t\tw[u] = False\n\t\t\t\t\tq[qr] = u\n\t\t\t\t\tqr += 1\n\t\tvc = ql-qlb\n\t\t#print(vc,e,vc*3-1)\n\t\tif vc*3-1 == e:\n\t\t\tr = (r*(pow(2,vc+1,1000000007)-1))%1000000007\n\t\telse:\n\t\t\tr = (r*(pow(2,len(xs)+len(ys),1000000007)))%1000000007\nprint(r)", "lang": "Python 3", "bug_code_uid": "93f39bb270dd9dcd4c19d09094c62603", "src_uid": "8781003d9eea51a509145bc6db8b609c", "apr_id": "9c5ba941bcb0d8ccc9aedc168e7e34a5", "difficulty": 2300, "tags": ["graphs", "trees", "dfs and similar", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9052437902483901, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\ndisjointSet = [-1] * n\ndef root(x, level=200):\n if disjointSet[x] < 0:\n return x\n if level < 1:\n while disjointSet[x] >= 0:\n x = disjointSet[x]\n return x\n disjointSet[x] = root(disjointSet[x], level - 1)\n return disjointSet[x]\n\ndef join(x, y):\n r1, r2 = root(x), root(y)\n if r1 == r2:\n return\n disjointSet[r2] = r1\n\npoints = []\nvertPoints = {}\nhorizPoints = {}\nfor i in range(n):\n a, b = map(int, input().split())\n points.append((a, b))\n if a in vertPoints:\n join(i, vertPoints[a])\n else:\n vertPoints[a] = i\n if b in horizPoints:\n join(i, horizPoints[b])\n else:\n horizPoints[b] = i\n \nsets = {}\nfor i in range(n):\n r = root(i)\n if r in sets:\n sets[r].append(points[i])\n else:\n sets[r] = [points[i]]\n\nans = 1\nfor i in sets:\n s = sets[i]\n horiz = [x for x,y in s]\n vert = [y for x,y in s]\n tmp = len(set(horiz)) + len(set(vert))\n if tmp <= len(s):\n ans *= 2 ** tmp\n else:\n ans *= 2 ** tmp - 1\n ans %= 10 ** 9 + 7\n\nprint(ans % (10 ** 9 + 7))", "lang": "Python 3", "bug_code_uid": "0896ae2a0f8e23ff8fd7e98a48a88478", "src_uid": "8781003d9eea51a509145bc6db8b609c", "apr_id": "ade2eeebd8126a58d3a08c31b2362495", "difficulty": 2300, "tags": ["graphs", "trees", "dfs and similar", "dsu"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6321243523316062, "equal_cnt": 35, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 27, "fix_ops_cnt": 36, "bug_source_code": " import sys\nimport time\n\nfor line in sys.stdin:\n ll = len(line)-1\n fail=0\n for i in range(ll):\n if i == ll-1-i : continue\n x = int(line[i])\n y = int(line[ll-1-i])\n if (x,y) not in [(3,3),(4,6),(6,4),(7,7),(8,0),(0,8),(5,9),(9,5)]:fail=1\n if fail: print(\"No\")\n if not fail:print(\"Yes\")\n ", "lang": "Python 3", "bug_code_uid": "4ddc83a271d1e46c803634a6fce68481", "src_uid": "0f11f41cefd7cf43f498e511405426c3", "apr_id": "9246f05213f7fc5ba68012ca7ca0ed69", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.805993690851735, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "key=input()\nstr=input()\na=['q','w','e','r','t','y','u','i','o','p']\nb=['a','s','d','f','g','h','j','k','l',';']\nc=['z','x','c','v','b','n','m',',','.','/']\nif key=='R':\nfor i in str:\n if i in a:\n print(a[a.index(i)-1],end='')\n elif i in b:\n print(b[b.index(i)-1],end='')\n elif i in c:\n print(c[c.index(i)-1],end='')\n else:\n print(i,end='')\nelse:\n for i in str:\n if i in a:\n print(a[a.index(i)+1],end='')\n elif i in b:\n print(b[b.index(i)+1],end='')\n elif i in c:\n print(c[c.index(i)+1],end='')\n else:\n print(i,end='')", "lang": "Python 3", "bug_code_uid": "08645f5555c528dd90cd7542f3ff5771", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "5ff54c2398acb6f21a07b3758e03b63e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9817615658362989, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "\nimport sys\n#sys.stdin=open(\"data.txt\")\ninput=sys.stdin.readline\n\nn,a,b=map(int,input().split())\n\nif an: break\n pascal.append(newrow)\n def getcom(a,b):\n # return a+b choose b\n # if larger than n, return infinite\n if len(pascal[a])>b: return pascal[a][b]\n if b==0: return 1\n if b==1: return a\n return 100000005\n\n # start with the null node (prefix cost 0)\n # can split a node into two other nodes with added cost c+a+b\n # new nodes have prefix costs c+a, c+b\n # want n-1 splits in total\n n-=1 # now represents number of splits needed\n\n # binary search the last cost added\n lo=0\n hi=a*int((n**0.5)*3+3)\n\n while 1:\n mid=(lo+hi)//2\n mid=11\n # count stuff\n c0=0 # < mid\n c1=0 # = mid\n for i in range(mid//a+1):\n j=(mid-i*a)//b\n if (mid-i*a)%b!=0:\n # c0 += iC0 + (i+1)C1 + (i+2)C2 + ... + (i+j)Cj\n for k in range(j+1):\n print(mid,i,k)\n c0+=getcom(i,k)\n if c0>n: break\n else:\n for k in range(j):\n print(mid,i,k)\n c0+=getcom(i,k)\n if c0>n: break\n print(mid,i,j,\"c1\")\n c1+=getcom(i,j)\n print(mid,\"is\",c0,c1)\n if nlen(numbers):\n pattern.append(count)\n numbers.extend(pattern)\n count+=1\nprint(numbers[n-1])\n", "lang": "Python 3", "bug_code_uid": "56fda52ff6c73044f19d808050e81553", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "fbc94d5ebe6cba7cfe8fdd920d6a4d8f", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6176470588235294, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "while True:\n n = int(input())\n if n in [1,60]:\n break\nif (n%2 ==0):\n print(n)\nelse:\n print(n-1)\n", "lang": "Python 3", "bug_code_uid": "6a1532a762b2a3a0e8914a29f18ef8ec", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "apr_id": "b18b095eec916fc6961f510d3a7ec339", "difficulty": 1000, "tags": ["dp", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.13062665489849956, "equal_cnt": 17, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "x=int(input())\ny=input()\na=[]\nd1=0\nd2=[]\nm=0\nfor c in x:\n x1=0\n x2=0\n s=c==\"_\" or c==\")\" or c==\"(\"\n if s and isalpha(x[x.index(c)+1]):\n a.append(x.index(c))\n \n if c==\")\" and x[a[len(a)-1]]==\"(\":\n x1=a.[len(a)-1]+1\n x2=index(c)\n b=[]\n for i in x[x1:x2]:\n if i==\"_\" and isalpha(x[x.index(i)+1]):\n d1+=1\n for i in range((len(a)-1)):\n y1=a[i+1]-a[i]-1\n d2.append(y1)\n a=[]\nprint(max(d2),d1)", "lang": "Python 3", "bug_code_uid": "c3f16b822cd5fceb2f21df1bd07307d8", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "d6c7d83d482edf15f2780b62da72f959", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09960828203693341, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "def kthDivisor(n, k):\n divisors = []\n i = 1\n while i * i < n:\n if n % i == 0:\n divisors.append(i)\n i += 1\n if i * i > n:\n i -= 1\n while i > 0:\n if n % i == 0:\n divisors.append(n/i )\n i -= 1\n if len(divisors) < k:\n return -1\n return int(divisors[k - 1])\n\nn,k=map(int,input().split())\nprint(kthDivisor(n,k))", "lang": "Python 3", "bug_code_uid": "4e7d57da745173cc329016a24f3bc6a8", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "e03933afa4f1b845cc8159968aeed5df", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7855421686746988, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "from math import ceil\na,b,c = map(int,input().split())\nt = max(a,b,c)\nif t == c:\n\tprint(32+3*ceil((c-2)/2))\nelif t == b:\n\tprint(31+3*ceil((b-2)/2))\nelif t == a:\n\tprint(30+3*ceil((a-2)/2))\n\n", "lang": "Python 3", "bug_code_uid": "f5924438ed83ca1027800a925acea3fe", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "3c30fd0be10c1430511f346f6a7f22cd", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5671641791044776, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\ns = 0\nfor i in range(n):\n if (i + 1) % 2520 == 0:\n s += 1\nprint (s)", "lang": "Python 3", "bug_code_uid": "da892d4a44756ac8a20c15e850f78409", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "a53222cc9d0edc419d761a765cdb2f63", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.875, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "l=\"\"\nk=int(input())\nindex=0\ncounter=1\nwhile True:\n for i in str(counter):\n if index<=9999:\n l+=i\n index+=1\n counter+=1\n if index>9999:\n break\nif 1<=k<=10000:\n print(l[k-1])", "lang": "Python 3", "bug_code_uid": "0ca76990338ce7533d58c1955b8b371a", "src_uid": "1503d761dd4e129fb7c423da390544ff", "apr_id": "5daffae8204a76f501011f601959fcb3", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.40588235294117647, "equal_cnt": 33, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 16, "fix_ops_cnt": 33, "bug_source_code": "l=''\nk=int(input())\nindex=0\ncounter=1\n\nfor i in range(1,k+1):\n if index<=k-1:\n l+=str(i)\n index+=1\n else:\n break \n \nif 1<=k <=10**12: \n print(l[k-1])", "lang": "Python 3", "bug_code_uid": "66cfd58a4bd6b6f95c4f9828d76229ca", "src_uid": "1503d761dd4e129fb7c423da390544ff", "apr_id": "5daffae8204a76f501011f601959fcb3", "difficulty": 1800, "tags": ["divide and conquer", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9980119284294234, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\na = list(map(int, input().split()))\nidx = []\nfor i in range(1, n // 2 + 1):\n idx.append(2 * i + 1)\na.sort()\ns1 = 0\ns2 = 0\nfor i in range(0, n // 2):\n s1 += abs(a[i] - 2 * i -a 1)\n s2 += abs(a[i] - 2 * i - 2)\nprint(min(s1, s2))", "lang": "PyPy 3", "bug_code_uid": "3fce677b332b434ab670a318a6425c2d", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "90b60ced70d8fea07dbf43fe8cbb705b", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4226415094339623, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "mod=int(10e8+7)\na,b,n,x=map(int,input().split())\nexp=a\nans=1\nwhile n>0:\n if(n%2==1):\n ans=ans*exp\n exp=exp**2\n n//=2\n\nif ans!=1: \n res=((ans-1)//(a-1))%mod\n ans=ans%mod\n print(((ans*x)%mod+(res*b)%mod)%mod)\nelse:\n print(((ans*x)%mod+((n+1)*b)%mod)%mod)", "lang": "Python 3", "bug_code_uid": "4c730f4c28106a102f86e84c8cf50383", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "265c149f8128893792730cee731aad2c", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8136882129277566, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = map(int, raw_input().split())\nprint \"%.12f\" % (1.0 / n + 1.0 * (m - 1) / (n * m - 1) * (n - 1) / n)\n", "lang": "Python 2", "bug_code_uid": "78139d0a42405450f092f1f604547c66", "src_uid": "0b9ce20c36e53d4702869660cbb53317", "apr_id": "42ab7bda2981f3aa8d2654eee2ed0ac1", "difficulty": 2100, "tags": ["probabilities", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4282115869017632, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "n, k =map(int, input().split())\nfor i in range(0 , k):\n last_numeral = 10*(1-(n/10-truncate(n/10)))\n if last_numeral = 0:\n n=n/10\n else \n n=n-1\n print(n)", "lang": "Python 3", "bug_code_uid": "d444f47a8b9f383f7391eda4440bf6a4", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "ab373af71ad87db88ce27670ac78035f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.649746192893401, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "\n\n\ndef check(4,512):\n for i in range(x):\n if number%10 == 0:\n number = number / 10\n print(number)\n else:\n number = number -1\n print(number)\n\n\ncheck()\n", "lang": "Python 3", "bug_code_uid": "c07d8640f588c6c519545b86fccf26d1", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "4742908cc345994c1de6529029319f90", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.33271028037383177, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import collections\nn,s,e = map(int,raw_input().split())\na = bin(n)[2:]\n#print a\nb = str(a[0])\nfor i in xrange(1,len(a)):\n\tb = str(b)+a[i]+str(b)\nprint collections.Counter(b[s-1:e])['1']", "lang": "Python 2", "bug_code_uid": "7dba4e7ff077cbb784e76fe0ebb6823b", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "40ebb5f5e77d1adc6362d524e51e7205", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9581749049429658, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "num = int(input())\n\ncount = 0\nwhile num != 0:\n lst = [int(i) for i in str(num)]\n num -= max(lst)\n count += 1\n\nreturn count\n", "lang": "PyPy 3", "bug_code_uid": "44603261513f8c8cf8dfe77d66565e3d", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "30c9f445f94a83d9ac216bda469b8efb", "difficulty": 1100, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8232445520581114, "equal_cnt": 28, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 13, "fix_ops_cnt": 29, "bug_source_code": "# read line1 in, split into elements, cast to integers, stored at List_1\nlist_1 = map(int,raw_input().split())\n\n# read line2 in, split into elements, cast to integers, stored at interesting minutes\ninteresting_minutes = map(int,raw_input().split())\n \n#check the first element to see if it is greater than 15, print 15, break out of the loop\nif interesting_minutes[0] > 15:\n print 15\nelse:\n\tfor index in range(len(interesting_minutes)):\n\t #check the last element to see if 90 - (this element) greater than 15\n\t if index == len(interesting_minutes) -1:\n if 90 - interesting_minutes[index] > 15:\n print interesting_minutes[index] + 15\n break\n else:\n print 90\n break\n \n\t #for all elements which is not the first and the last, calculate the distance between the next element and current \n\t else: \n\t distance = interesting_minutes[index+1] - interesting_minutes[index]\n\t if distance > 15:\n\t print int(interesting_minutes[index] + 15)\n\t break", "lang": "Python 3", "bug_code_uid": "10102ea0347665cde4b34f95f37e2b8a", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "34f3096731c059068ead95973efe1e0f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9422632794457275, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "a=int(input())\nb=int(input())\nc=int(input())\nd=int(input())\ne=int(input())\nf=int(input())\n \nc1 = min(a,d)*e + f*(min(b,c,max(0,d-a))\nc2 = min(d, b, c) * f + min(max(d - min(b, c), 0), a) * e)\n\nprint(c1,c2)\nprint(max(c1,c2))", "lang": "Python 3", "bug_code_uid": "dceb83195c3e7a5edd045a209c95568e", "src_uid": "84d9e7e9c9541d997e6573edb421ae0a", "apr_id": "e8c2873cc734d0f982bb925bf0df786c", "difficulty": 800, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9984101748807631, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=int(input())\n\nb=int(input())\nc=int(input())\n\nd=int(input())\n\ne=int(input())\nf=int(input())\n\n\nbig=max(e,f)\nx=min(b,c)\n\nif (big==f):\n if((d-x)>0):\n sum=min(x,d)*f + min(a,(d-x))*e\n else:\n sum=d*f\nelse:\n if((d-a)>0)\n sum=min(a,d)*e + min(x,(d-a))*f\n else:\n sum=d*e\nprint(sum)", "lang": "Python 3", "bug_code_uid": "3b3814524b26c9e0f6b9cfe63389775d", "src_uid": "84d9e7e9c9541d997e6573edb421ae0a", "apr_id": "e958a2aaf67bf711d08ce4dd5e7a9d0e", "difficulty": 800, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.14563106796116504, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import math\nimport sys\ninput = raw_input()\na = input.split()\nx = [int(i) for i in a]\n\ncount = 0\n#print x\nx.sort()\ntotal = sum(x)\nwhile (total > 2) and (x[2] != total):\n\tx.sort()\n#\tprint x\n#\tif x[2] == 1:\n#\t\tcount += 1\n#\t\tbreak\n#\tmax_value = max(x)\n#\tmax_index = x.index(max_value)\n\tx[2] -= 2\n#\tx.sort()\n#\tmax_value = max(x)\n#\tmax_index = x.index(max_value)\n\tx[1] -= 1\n\tcount += 1 \n\ttotal -= 3\n\t\nprint int(count\t)\n\t\n\n\t\n\n", "lang": "Python 2", "bug_code_uid": "e722a2476700e99e8e40dc25f904fd02", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "a5a81b2450f0a0dec2ef8f63fe69f87b", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8974358974358975, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import math\nx, y = map(int, raw_input().split())\nans = {}\nmod = 10 ** 9 + 7\nif y%x !=0:\n\tprint 0\nelse:\n\ta=y/x\n\tfactors=[]\n\tfor i in xrange(2, int(math.floor(math.sqrt(a))+1)):\n\t\tif a%i==0:\n\t\t\tfactors.append(i)\n\t\t\ta!=i*i and factors.append(a/i)\n\tfactors.sort()\n\tans[1]=1\n\tdef getAns(f):\n\t\tif f in ans:\n\t\t\treturn ans[f]\n\t\tres=2**(f-1)%mod\n\t\tres=(res+mod-1)%mod\n\t\tfor i in factors:\n\t\t\tif i>=f:\n\t\t\t\tbreak\n\t\t\tif f%i==0:\n\t\t\t\tres+=(mod-getAns(i))\n\t\t\t\tres%=mod\n\n\t\tans[f]=res\n\t\treturn res\n\tprint getAns(a)\n", "lang": "Python 2", "bug_code_uid": "b6a00d3c7fbed794b888e8d906325f49", "src_uid": "de7731ce03735b962ee033613192f7bc", "apr_id": "cb4cd9b8c865e2e67af4d56422289d5c", "difficulty": 2000, "tags": ["dp", "combinatorics", "bitmasks", "number theory", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8375378405650857, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "from collections import defaultdict\nx, y = map(int, input().split())\nif y%x != 0: \n\tprint(0)\n\texit()\nx = y//x\ndivisors = []\nfor i in range(1,int(x**(.5))+1):\n\tif x%i == 0:\n\t\tdivisors.append(i)\n\t\tdivisors.append(x//i)\nif divisors[-1] == divisors[-2]: divisors.pop()\ndivisors.sort()\nva = defaultdict(int)\nva[1] = 1\nfor i in range(1, len(divisors)):\n\tk = divisors[i]\n\tcount = 2**(k-1)\n\tfor j in range(i):\n\t\tif k%divisors[j] == 0: count -= va[divisors[j]]\n\tva[k] = count\nprint(va[x])", "lang": "PyPy 3", "bug_code_uid": "a0dba749340bf2f3a438ba2734336300", "src_uid": "de7731ce03735b962ee033613192f7bc", "apr_id": "5a9b72fdd78af1b39ae592b65a541072", "difficulty": 2000, "tags": ["dp", "combinatorics", "bitmasks", "number theory", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.999348109517601, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import fileinput\ni=0\ncostMatrix = []\n\nfor line in fileinput.input():\n if i<3:\n costMatrix.append([int(i) for i in line.split()])\n i+=1\n else:\n n = int(line)\n\n\ndef switchC(MAT):\n SW = [[0]*3 for i in range(3)]\n SW[0][1]=MAT[0][2]\n SW[0][2]=MAT[0][1]\n SW[1][0]=MAT[1][0]\n SW[2][0]=MAT[1][0]\n SW[1][2] = MAT[2][1]\n SW[2][1] = MAT[1][2]\n return SW\n\ndef switchC2(MAT):\n SW = [[0]*3 for i in range(3)]\n SW[0][1]=MAT[1][0]\n SW[0][2]=MAT[1][2]\n SW[1][0]=MAT[0][1]\n SW[2][0]=MAT[2][1]\n SW[1][2] = MAT[0][2]\n SW[2][1] = MAT[2][0]\n return SW\n\ndef switchC3(MAT):\n SW = [[0]*3 for i in range(3)]\n SW[0][1]=MAT[2][1]\n SW[0][2]=MAT[2][0]\n SW[1][0]=MAT[1][2]\n SW[2][0]=MAT[0][2]\n SW[1][2] = MAT[1][0]\n SW[2][1] = MAT[0][1]\n return SW\n\ndef hashMAT(n,MAT):\n M = max(n,MAT[0][1],MAT[0][2],MAT[1][0],MAT[1][2],MAT[2][0],MAT[2][1])\n hashed = n + M*MAT[0][1]+M**2*MAT[0][2]+M**3*MAT[1][0]+M**4*MAT[1][2]+M**5*MAT[2][0]+M**6*MAT[2][1]\n return hashed\n\na = {}\n\ndef SmallY(n,MAT):\n h = hashMAT(n,MAT)\n isIN = h in list(a.keys())\n if n == 1:\n if isIN:\n return a[h]\n else:\n a[h] = min(MAT[0][2], MAT[0][1]+MAT[1][2])\n return a[h]\n else:\n if isIN:\n return a[h]\n else:\n a[h] = min(MAT[0][2]+SmallY(n-1,switchC(MAT))+SmallY(n-1,switchC2(MAT)),MAT[0][1]+MAT[1][2]+2*SmallY(n-1,MAT)+SmallY(n-1,switchC3(MAT)))\n return a[h]\n\nprint(SmallY(n,costMatrix))\n\n", "lang": "Python 3", "bug_code_uid": "f3f22dc4ffd493236c3f94c9b219022f", "src_uid": "c4c20228624365e39299d0a6e8fe7095", "apr_id": "29b443642c8ffda6bea7f747594e8a58", "difficulty": null, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9823008849557522, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\nval = [[]]\nfor x in sorted(int(x) for x in input().split()):\n for l in val:\n if x >= len(l):\n l.append(x)\n break\n if len(val[-1]) > 0:\n val.append([])\nprint(len(val) - 1)\n", "lang": "Python 3", "bug_code_uid": "3a6ede40da4305fba77b04e823a1a834", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "36be4c2eb030eb0d22910d16867237e8", "difficulty": 1400, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4823529411764706, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "num_interesting_minutes = input()\nminutes_list = [int(i) for i in input().split()]\nif minutes_list[0] > 15:\n return 15\nwill_watch_minutes = minutes_list[0]\nfor i in range(len(minutes_list) - 1):\n if (amount := (minutes_list[i + 1] - minutes_list[i])) <= 15:\n will_watch_minutes += amount\n else:\n will_watch_minutes += 15\n break\nprint(will_watch_minutes)", "lang": "PyPy 3", "bug_code_uid": "30b05e781a778c3b4c8bef4f3a170f41", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "ae0b0aaf370a58a99b7009a5781f073e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4260355029585799, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n=int(input())\ni=1\nmu=2520\nbonus=0\nwhile(mu<=n):\n mu=2520\n if(mu<=n):\n bonus+=1\n i+=1\n mu=mu*i\nprint(bonus)\n", "lang": "Python 3", "bug_code_uid": "f431df45a8c855b64e666cc5a96833e6", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "3b3e92fffaffe3f4fea49b1d6e8e7cb8", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9907120743034056, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a,b = map(int,input().split())\ndays = list(map(int,input().split()))\nc = max([days[i]-days[i+1] for i in range(len(days)-1)])-b)\nprint(c) if c > 0 else print(0)\n", "lang": "Python 3", "bug_code_uid": "a1f9ae049a6612bb39ae8c0caa05a2be", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "6a1f3f8bb0dbe5f0bac46d758079a383", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9984956373483101, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import sys\nimport os\nfrom io import BytesIO, IOBase\n\n#########################\n# imgur.com/Pkt7iIf.png #\n#########################\n\n# returns the list of prime numbers less than or equal to n:\n'''def sieve(n):\n if n < 2: return list()\n prime = [True for _ in range(n + 1)]\n p = 3\n while p * p <= n:\n if prime[p]:\n for i in range(p * 2, n + 1, p):\n prime[i] = False\n p += 2\n r = [2]\n for p in range(3, n + 1, 2):\n if prime[p]:\n r.append(p)\n return r'''\n\n# returns all the divisors of a number n(takes an additional parameter start):\n'''def divs(n, start=1):\n divisors = []\n for i in range(start, int(math.sqrt(n) + 1)):\n if n % i == 0:\n if n / i == i:\n divisors.append(i)\n else:\n divisors.extend([i, n // i])\n return divisors'''\n\n# returns the number of factors of a given number if a primes list is given:\n'''def divn(n, primes):\n divs_number = 1\n for i in primes:\n if n == 1:\n return divs_number\n t = 1\n while n % i == 0:\n t += 1\n n //= i\n divs_number *= t\n return divs_number'''\n\n# returns the leftmost and rightmost positions of x in a given list d(if x isnot present then returns (-1,-1)):\n'''def flin(d, x, default=-1):\n left = right = -1\n for i in range(len(d)):\n if d[i] == x:\n if left == -1: left = i\n right = i\n if left == -1:\n return (default, default)\n else:\n return (left, right)'''\n\n# returns (b**p)%m \n'''def modpow(b,p,m):\n res=1\n b=b%m\n while(p):\n if p&1:\n res=(res*b)%m\n b=(b*b)%m\n p>>=1\n return res'''\n\n# if m is a prime this can be used to determine (1//a)%m or modular multiplicative inverse of a number a\n'''def mod_inv(a,m):\n return modpow(a,m-2,m)'''\n\n# returns the ncr%m for (if m is a prime number) for very large n and r\n'''def ncr(n,r,m):\n res=1\n if r==0:\n return 1\n if n-r= 0:\n if s[i] == '0':\n cnt += 1\n else:\n if cnt >= 6:\n return True\n return False\n\nprint 'yes' if check() else 'no'\n\n# need to be positive \n", "lang": "Python 2", "bug_code_uid": "a24e2f69fd4fc3cfcae8ed14fa0a3162", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "5bd64f844034df58198b940e1b53b9ba", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9981024667931688, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l,r=map(int,input().split())\n \na=[]\ndef foo(n):\n\ta.append(n)\n\tif n>10*r:\n\t\treturn\n\tfoo(10*n+4)\n\tfoo(10*n+7)\n\treturn\n \nfoo(0)\na.sort()\n \ndef get_sum(m):\n\ts=0\n\tfor i in range(1,len(a)):\n\t\ts+=a[i]*(min(a[i],m)-min(a[i-1],m))\n\treturn s\n \nprint(get_sum(r)-get_sum(l-1)", "lang": "Python 3", "bug_code_uid": "8b02d690b9760f8baa7036d68c0d840e", "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd", "apr_id": "005fb0ef01639f58bde733ea1af69d08", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9858429858429858, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "ans = 0\nmod = 1000000007\na, b, n = map(int, input().split())\ndef chk(x):\n while x:\n if x % 10 != a and x % 10 != b:\n return 0\n x //= 10\n return 1\nf = [1]\nfor i in range(1, n + 1):\n f.append(i * f[-1])\nfor x in range(n + 1):\n if chk(x * a + (n - x) * b):\n ans += pow(f[x] * f[n - x], mod - 2, mod)\n ans %= mod\nprint(ans * f[n] % mod)\n", "lang": "Python 3", "bug_code_uid": "e546e4183fd17a7c823f950e570bcac2", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "1bf8f78594ea88a3d7221ad2c0c1d6c7", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.46321525885558584, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "s=input().split()\nL=[]\nfor i in range(1,len(s)):\n L.append(int(s[i]))\nL.sort()\ntoPrint=\"\"\nfor x in L:\n toPrint+=str(x)+\" \"\ntime.sleep(1.3)\nprint(toPrint)", "lang": "Python 3", "bug_code_uid": "7e93140c1cb864d53bf5d46929206a5d", "src_uid": "29e481abfa9ad1f18e6157c9e833f16e", "apr_id": "67bbed8c8db4bd89feea70103c4c381d", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4184811471056824, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "primes = []\n\ndef list_primes_upto(upto :int):\n pcl = [1 for x in range(upto+1)]\n global primes\n primes = []\n if upto >= 2: primes.append(2)\n if upto >= 3: primes.append(3)\n for i in range(6, upto + 2, 6):\n if i-1 <= upto and pcl[i-1] == 1:\n primes.append(i-1)\n for k in range((i-1)**2, upto+1, (i-1)*2):\n pcl[k] = 0\n if i+1 <= upto and pcl[i+1] == 1:\n primes.append(i+1)\n for k in range((i+1)**2, upto+1, (i+1)*2):\n pcl[k] = 0\n return\n\n\nt = int(input())\n\ntests = []\nfor q in range(t):\n tests.append([int(x) for x in input().split()])\n\nprimes_limit = 0\nfor tp in tests:\n if tp[0]-tp[1] == 1:\n primes_limit = max(primes_limit, tp[0]+tp[1])\n\nlist_primes_upto(primes_limit)\n\nfor a, b in tests:\n yes = True\n if a-b != 1:\n yes = False\n if yes:\n apb = a+b\n is_apb_prime = True\n for p in primes:\n if not is_apb_prime or p >= apb:\n break\n is_apb_prime = is_apb_prime and (apb % p != 0)\n yes = yes and is_apb_prime\n print(\"YES\" if yes else \"NO\")\n", "lang": "Python 3", "bug_code_uid": "23ed15fe1123b92ab148d441727eb10f", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "12974da55583fbb82408492d680ebae8", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6982758620689655, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "a,b = ( x for x in input().split(\" \"))\ni = 0 \nwhile(b>a):\n a*=3\n b*=2\n i+=1\nprint(i)", "lang": "Python 3", "bug_code_uid": "bbbcfa8dbbc9521ece72d9e6943c866f", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "c2223f3f4022a0cf6106757a6e311842", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9704142011834319, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "d, c = map(int, input().split())\nm = 0\nds = list(map(int, input().split()))\nfor i in range(d-1):\n\tm = max(ds[i] - ds[i+1], m)\nif (m != 0)\n\tprint(m - c)\nelse:\n\tprint(m)", "lang": "PyPy 3", "bug_code_uid": "14083eb128dc45a24670406ca76469bc", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "e68dc81d57e3c2d462700b476410df4b", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8844221105527639, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a,b,c,d=input().split()\nn=min(int(a),min(int(c),int(d))\nm=int(a)-n\nj=min(int(b),m)\nprint(256*n+32*j)\n", "lang": "Python 3", "bug_code_uid": "a3a3e9bd7526744b0c75cec980c6788a", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "b58d77d1c314cbaf6918c54eab545d26", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8269720101781171, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "from math import *\nimport sys\nfrom queue import *\n\n\nn = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nf = 0\ns = 0\nal = 0\nfor i in range(n):\n if a[i] + b[i] == 2:\n al += 1\n elif a[i] == 1:\n f += 1\n elif b[i] == 1:\n s += 1\nif f == 0 || s == f:\n print(-1)\nelse:\n print(ceil((s + 1) / f))\n", "lang": "PyPy 3", "bug_code_uid": "780194b8565b68587338267b3554d0c4", "src_uid": "b62338bff0cbb4df4e5e27e1a3ffaa07", "apr_id": "8f87939cdce2fb7868d320188aba7d07", "difficulty": null, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9969230769230769, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def one_or_zero(n):\n if n%2 == 0:\n return 0\n else:\n return 1\n\n\nif __name__ == \"__main__\":\n n = int(input())\n print(\"%d\" % one_or_zero(n)", "lang": "Python 3", "bug_code_uid": "2dbf855846b34a09540124dcf6bbbf60", "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795", "apr_id": "70a9907ae27b204e6c7d2f1a8058aa82", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.05016949152542373, "equal_cnt": 17, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 18, "bug_source_code": "total = []\n\ndef excg(s, p1, p2, new):\n if p1 > p2:\n (p1, p2) = (p2, p1)\n #print ('--', s, p1, p2, new)\n s = s[:p1] + s[p1+1:p2] + s[p2+1:]\n #print (s + new)\n #input()\n return s + new\n\ndef calc(s):\n global total\n\n if len(s) == 1:\n if s[0] not in total:\n total += s[0]\n return\n\n pr = s.find('R')\n pr2 = s.find('R', pr + 1)\n\n pg = s.find('G')\n pg2 = s.find('G', pg + 1)\n\n pb = s.find('B')\n pb2 = s.find('B', pb + 1)\n\n if pr+pr2>0: calc(excg(s, pr, pr2, 'R'))\n if pg+pg2>0: calc(excg(s, pg, pg2, 'G'))\n if pb+pb2>0: calc(excg(s, pb, pb2, 'B'))\n\n if pr+pb>0: calc(excg(s, pr, pb, 'G'))\n if pr+pg>0: calc(excg(s, pr, pg, 'B'))\n if pb+pg>0: calc(excg(s, pb, pg, 'R'))\n\n \nn = input()\ns = input()\n\ncalc(s)\n\nfor b in total: print(b, end='')\n", "lang": "Python 3", "bug_code_uid": "fa76a297955318641e881991bef953f6", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "dbb1ee3a742a2e30ec61e7044e1ac8ab", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5525114155251142, "equal_cnt": 20, "replace_cnt": 12, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 20, "bug_source_code": "Inp = str( raw_input() )\narr = Inp.split()\na = long( arr[0] )\nb = long( arr[1] )\nans = 0L\nMOD = 1000000007L\n\nfor i in range( 1, b ):\n Sum = 0L\n Sum = ( a * i ) % MOD\n Sum = ( Sum + i * b * a * ( a + 1 ) / 2 ) % MOD\n ans = ( ans + Sum ) % MOD\n\nprint ans\n \n \n", "lang": "Python 2", "bug_code_uid": "7c299ddf138f64b376d2fe7820162158", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "742d0bfe56bb47c0e6f817ad2c039ada", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6910112359550562, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import math\n\nline = raw_input()\na, b = [int(x) for x in line.split()]\n\nnice = 0\n\nfor i in range (1, a+1):\n for j in range (1, b):\n nice += (i*j)*b + j\n \nprint nice%1000000007", "lang": "Python 2", "bug_code_uid": "0114eadca7a329f41a9f1c317c1e87ff", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "37151969ca5616ae6452ef448c5d0f59", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6302250803858521, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "#!/usr/bin/env python\n# coding: utf-8\n\n# In[120]:\n\n\nn, k = [int(i) for i in input().split()]\n\n\n# In[122]:\n\n\npolozh = [i + 1 for i in range(n)]\nvin = [-1 for i in range(1,n)]\n\nfor j in range(n):\n hod_list = polozh[0:n-j] + vin[0:j]\n if sum(hod_list) == k:\n break\n#out = 0\n#for i in hod_list:\n# if i == -1:\n# out +=1\n \nprint(j)\n\n", "lang": "Python 3", "bug_code_uid": "d8d7f01eef86b49101363f023fce5a29", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "779b2aefa05dad48976e4e8d35ec049f", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9953488372093023, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=2*int(input())\nw=sorted(map(int,input().split()))\nr=10000\nfor i in range(n):\n for j in range(i):\n u=[w[k] for k in range(n) if i!=k!=j)\n r=min(r,sum(u[i+1]-u[i] for i in range(0,n-3,2)))\nprint(r)\n", "lang": "Python 3", "bug_code_uid": "13adbcfb7ced75af3120bfa4ec158e5e", "src_uid": "76659c0b7134416452585c391daadb16", "apr_id": "94b58b4043eb8da98211231b7b2d1ce2", "difficulty": 1500, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9258589511754068, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "big = input()\nsmall = input()\nleft = [0] * (len(small) + 1)\nleft[0] = -1\nwsk = -1\nfor i in range(1, len(small) + 1):\n while True:\n wsk += 1\n if big[wsk] == small[i - 1]:\n left[i] = wsk\n break\nbig = big[::-1]\nsmall = small[::-1]\nright = [0] * (len(small) + 1)\nright[0] = -1\nwsk = -1\nfor i in range(1, len(small) + 1):\n while True:\n wsk += 1\n if big[wsk] == small[i - 1]:\n right[i] = wsk\n break\nwyn = 100000000\nfor i in range(len(left))", "lang": "PyPy 3", "bug_code_uid": "ae7768e39aca9eda65df2d8e064fe075", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "apr_id": "1f1b6a4b77700ad539386759b0e0f961", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4888888888888889, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "x = int(raw_input())\nqts = set()\nfor i in range(2, x+1):\n n = x / i\n for m in range(1, n+1):\n \tqts.add(m)\n\nprint(len(qts) + 1)", "lang": "Python 2", "bug_code_uid": "7dd9f3f324b69134caa9ac50692845e2", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "6646c615f1ba5465dab2831ee2d6b5a2", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4567901234567901, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "from sys import stdin\nlines = stdin.readlines()\nn = int(lines[0])\n\ndef split(x):\n summ = 0\n for i in range(1,x/2+1):\n if x % i == 0:\n summ += 1\n elif x / i > 1:\n summ += 1\n return summ+1\nprint split(n)", "lang": "Python 2", "bug_code_uid": "143bacfcefdb8f384ee9ee90064ea7d0", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "d2ea03533f3a08bf7a60cc57531fbbbb", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5186953062848051, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 15, "bug_source_code": "n=input()\nt=int(input())\nb=[]\nc=0\nd=\"\"\nfor i in range(t):\n x=(input())\n b.append(x)\n d=d+x\nif len(b)>1:\n if d.count(n[0])>=n.count([n[0]) and d.count(n[1])>=n.count(n[1]):\n if any(c for c in b if c[1]==n[0] or c[0]==n[1]):\n print(\"YES\")\n else:\n print(\"NO\")\n else:\n print(\"NO\")\nelse:\n if b[0]==n or b[0][::-1]==n:\n print(\"YES\")\n else:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "7ee9ee99a69b502200456e12f16df408", "src_uid": "cad8283914da16bc41680857bd20fe9f", "apr_id": "1bc48cda848b7a83d352e1438632016c", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.16243654822335024, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\ncoins = [1,5,10,20,100]\n\n\n\nif(n%100==0):\n print(n//100)\nelse:\n optimal = [(10 ** 9) + 1] * (n + 1)\n optimal[0] = 0\n for i in range(n+1):\n for coin in coins:\n if(coin<=i):\n tmp = optimal[i-coin] +1\n if(tmp= 0:\n sol[i] = 1 + sol[i-j]\n break\nprint(sol[n])", "lang": "PyPy 3", "bug_code_uid": "ad79b026e3acf0ca1e256b8b35bfcdeb", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "d00283c8c7f7e02af6028ef44e1acbfd", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1700960219478738, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import sys\ndef minCoins(coins, m, V):\n table = [0 for i in range(V + 1)]\n\n table[0] = 0\n\n for i in range(1, V + 1):\n table[i] = sys.maxsize\n\n for i in range(1, V + 1):\n\n for j in range(m):\n if (coins[j] <= i):\n sub_res = table[i - coins[j]]\n if (sub_res != sys.maxsize and sub_res + 1 < table[i]):\n table[i] = sub_res + 1\n return table[V]\n\nV = int(input())\ncoins = [1,5,10,20,100]\nm = len(coins)\nprint(minCoins(coins,m,V))", "lang": "PyPy 3", "bug_code_uid": "46f084440281fa546c15eff68dc24d21", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "f4f1f99356e44f50246814197b2ced85", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7850208044382802, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\nj = 0\nwhile 1:\n if n == 0:\n break\n if n >= 100:\n n -= 100\n j += 1\n elif n >= 20:\n n -= 20\n j += 1\n elif n >= 5:\n n -= 5\n j += 1\n elif n >= 1:\n n -= 5\n j += 1\nprint(j)", "lang": "PyPy 3", "bug_code_uid": "694e81b592aae5a81bb7cd530705e49d", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "9f26f260244d03c0cf60ef73bc89741b", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9713679745493107, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,m=input().split()\nn=int(n)\nm=int(m)\nif(m>=n):\n m=n\n print(n)\nelse:\n a=2*(n-m)\n u=1\n l=n-1-m\n while(u!=l):\n mid=(u+l)//2\n if(mid*(mid+1)>=a):\n if((mid-1)*mid=a):\n mid+=1\n break\n else:\n u=mid+1\n print(mid+m)\n \n \n \n \n\n \n", "lang": "Python 3", "bug_code_uid": "260e4bbd928b8544bab06c5db4ad1f31", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "79720014f70cca5e26f0742d7694a7b2", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8273716951788491, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\ndef swap (a, b):\n if a > b: \n tmp = a\n a = b\n b = tmp\n\na = input ();\nb = input ();\nc = input ();\n\nif a > b:\n swap (a, b)\n\ni = 0\nans = False\nwhile a*i <= c and not ans:\n if (c-a*i) % b == 0:\n ans = True\n i += 1\n\nif ans == True:\n print (\"Yes\")\nelse:\n print (\"No\")\n\n", "lang": "Python 3", "bug_code_uid": "6a7b71bc5a2ee05c67071375c531809e", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "1697ca5325d83b8c37532236b8a59fe3", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9128065395095368, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,m,k = map(int,input().split())\n\nsteps = dict()\nfor x in range(n):\n steps[x] = (x+1,1)\n\n\ncurrent = n*m - 1\nif k < n:\n print (k+1,1)\nelse:\n remaining = k - n\n row_from_down = remaining // 2\n\n row = n - row_from_down\n # 11 10\n if row%2:\n col = remaining % (m-1)\n col = m - col\n\n else:\n col = remaining % (m-1)\n col += 2\n print (row, col)\n\n", "lang": "Python 3", "bug_code_uid": "a864669af772b1af9ec162b327cdac44", "src_uid": "e88bb7621c7124c54e75109a00f96301", "apr_id": "27300fc8cdf0c9a6803d0fc1ba6ab621", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19963031423290203, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "n, m, k = map(int, input().split())\ns = list()\nfor i in range(n):\n s.append((0, i))\nfor i in range(n - 1, -1, -1):\n if i % 2:\n for q in range(1, m):\n s.append((q, i))\n else:\n for q in range(m - 1, 0, -1):\n s.append((q, i))\no = s[k % (n * m)]\nprint(o[1] + 1, o[0] + 1)\n", "lang": "Python 3", "bug_code_uid": "7795a9818c9a4ffb0104fb3bd7c8633a", "src_uid": "e88bb7621c7124c54e75109a00f96301", "apr_id": "38b22092eb1d4a7dafb555137880a7e9", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.32020997375328086, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import sys\n\nif __name__ == \"__main__\":\n n, a, b, p, q = [int(i) for i in sys.stdin.readline().strip().split()]\n ass = set(xrange(a, n+1, a))\n bss = set(xrange(b, n+1, b))\n first_part = len(ass - bss) * p\n second_part = len(bss - ass) * q\n third_part = len(bss & ass) * max(p, q)\n print first_part + second_part + third_part\n\n\n", "lang": "PyPy 2", "bug_code_uid": "a6dc4272873b3c29d40397264cc38c7c", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "2b50d7867cd0efc0b77ea524811f250f", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4241051200724966, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "'''\nCreated on 12.05.2012\n\n@author: matt\n'''\n\n\ndef primes(n):\n n = n + 1\n store = [True for i in range(n)]\n store[0] = store[1] = False\n index = 1\n while True:\n index += 1\n while index < n and store[index] == False:\n index += 1\n if index >= n:\n yield n-1\n for i in range(index ** 2, n, index):\n store[i] = False\n yield index\n\ndef factorize(n):\n MP = int(n // 2 + 1)\n P = primes(MP)\n k = n\n factors = {}\n while k != 1:\n nextp = next(P)\n while k % nextp == 0:\n if not nextp in factors:\n factors[nextp] = 0\n factors[nextp] += 1\n k //= nextp\n return factors \n \ndef solve():\n try: input = raw_input\n except: pass\n N = int(input())\n k = N\n r = N\n factors = factorize(k)\n fs = sorted([(i, j) for i, j in factors.items()])\n for i,j in fs:\n for t in range(j):\n r += k // i\n k //= i\n print str(r)\n\nsolve()\n \n \n", "lang": "Python 2", "bug_code_uid": "b0f57c8dceb5ff103a65c628f7cd867e", "src_uid": "821c0e3b5fad197a47878bba5e520b6e", "apr_id": "8d8459ebb5009f2a066aa98487459c68", "difficulty": 1200, "tags": ["number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6147540983606558, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "n=input()\ns=n\nwhile n != 1:\n for i in range(n/2,0,-1):\n if not n%i:\n n = i\n break\n s+=n\nprint s ", "lang": "Python 2", "bug_code_uid": "6df8d0e846229e51fda53d216d8aed52", "src_uid": "821c0e3b5fad197a47878bba5e520b6e", "apr_id": "1f2f96b264a7634eafebc47ac8470f49", "difficulty": 1200, "tags": ["number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.052770448548812667, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import sys\ndef basic(n, coins):\n dp = [0 for _ in range(n+1)]\n dp[0] = 0\n count = 0\n for i in range(1, n+1):\n dp[i] = sys.maxsize\n\n for j in range(1, n+1):\n for k in range(len(coins)):\n if coins[k] <= j:\n res = dp[j-coins[k]]\n if (res != sys.maxsize) and (res+1 < dp[j]):\n dp[j] = res + 1\n\n return dp[n]\n\n\nn = int(input())\n# arr = list(map(int, input().split(' ')))\ncoins = [1, 5, 10, 20, 100]\nprint(basic(n, coins))", "lang": "PyPy 3", "bug_code_uid": "0bfe897c86acc0a33b708f1d58c68204", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "3c66eac1928ec13e71a684b8ad22fbd5", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1948529411764706, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "import sys\n\ndef calculateCoins(withdraw_balance,dollar_coins,coins_length):\n bill_values = []\n bill_values.append(0)\n \n for i in range(1,withdraw_balance+2):\n bill_values.append(sys.maxsize)\n \n if(withdraw_balance == 0):\n return(bill_values[0])\n \n for i in range(1,withdraw_balance+2):\n for j in range(0,coins_length):\n if(dollar_coins[j] <= i):\n sub_result = bill_values[i - dollar_coins[j]]\n \n if(sub_result != sys.maxsize and sub_result < bill_values[i]):\n bill_values[i] = sub_result +1\n \n \n return(bill_values[withdraw_balance])\n\n\n\n\nwithdraw_balance = input()\ndollar_coins = [100, 20, 10, 5, 1]\ncoins_length = len(dollar_coins)\n\ntotal_bills = calculateCoins(int(withdraw_balance),dollar_coins,coins_length)\nprint(total_bills)\n\n", "lang": "PyPy 3", "bug_code_uid": "c202fe14c1e4b5e3e87a64d24da4127b", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "14816b870fcb5b8f79b6e5ac70409c9b", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7146529562982005, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "m, d = map(int, input().split())\nm -= 1\nd -= 1\na = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\ncnt = 1\nfor i in range(a[m])\n d = (d+1) % 7\n if d == 0:\n cnt += 1\nprint(cnt)", "lang": "PyPy 3", "bug_code_uid": "a56b7631a941eb4049df0702e0fd4bd5", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "bc074377cc9bb907cceb7217a43640c3", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5194805194805194, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "x,y=[int(x) for x in input().split()]\na=[]\nfor i in range(1,x+1,2):\n a.append(i)\nfor i in range(2,x+1,2):\n a.append(i)\nprint(a.pop(y-1))\n", "lang": "PyPy 3", "bug_code_uid": "7477ad7a1316d3e0beedade55a8aaef4", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "9448ec31b11cff25ea0583f2fff4dbad", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9785202863961814, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k=map(int,input().split())\na=[int(x) for x in input().split()]\na.sort(reverse=True)\nx=a[:k]\n\n\nj=k\nwhile(j= z:\n i = 0\n else:\n i = int((z-t)/float(b) + 1)\n amount = t+b*(i-1)\n while amount < z:\n i += 1\n amount = t+b*(i-1)\nelse:\n powers = [1]\n s = 1\n for i in range(1,n):\n np = powers[-1]*k\n powers.append(np)\n s += np\n s -= np\n \n z = powers[n-1]+b*s\n if t >= z:\n i = 0\n else:\n i = 1\n amount = powers[i-1]*(t*(k-1)+b)-b\n while amount < z*(k-1):\n i += 1\n amount = powers[i-1]*(t*(k-1)+b)-b\n\nprint(i)\n ", "lang": "Python 2", "bug_code_uid": "af1a5c1b1ec39aedacd15aba46280e86", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "1a430ba3281d7ecf8fa681656a986b83", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9029535864978903, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "s=input()\nL=['a','u','i','o','e','0','2','4','6','8']\ni=0\ns=0\nwhile i1:\n \n t = []\n \n for i in range(n):\n if l[i][0]>k:\n t.append([l[i][0]-k,l[i][-1])\n \n l = t[:]\n \nprint(l[0][-1]+1)", "lang": "PyPy 3", "bug_code_uid": "2ea6ce9408aaa14e0bbe3245f3a598ec", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "8d1f891f2792088598166757e94599e9", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6383419689119171, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "s=input().strip()\n\ncon1, con2 = 'http://', 'ftp://'\n\nif s[0]=='h':\n\tstart= 4\n\tend = 4\n\tfor i in range(4,len(s)-1):\n\t\tif s[i]+s[i+1] == 'ru' && start !=end:\n\t\t\tend = i\n\t\t\tbreak\n\tans = s[start:end]\n\n\tans = con1+ans+'.ru/'+s[end+2:]\n\tprint(ans)\n\nelif s[0]=='f':\n\tstart= 3\n\tend = 3\n\tfor i in range(3,len(s)-1):\n\t\tif s[i]+s[i+1] == 'ru' && start !=end:\n\t\t\tend = i\n\t\t\tbreak\n\tans = s[start:end]\n\n\tans = con2+ans+'.ru/'+s[end+2:]\n\tprint(ans)", "lang": "Python 3", "bug_code_uid": "6a07eb551e9111d6bb33c8b43f0eebea", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "d505bceebe2193fd5f1a27d54c5b11c1", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2041522491349481, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "w = input()\nind = True\nalf = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"]\nwhile (ind):\n for i in range(len(w)):\n if i >= len(w):\n break\n if w[i] in alf:\n if w[i + 1] in alf:\n w = w.replace(w[i + 1], \"\");\n ind = False\nprint(w)", "lang": "Python 3", "bug_code_uid": "16221c803a2a2610c0e5f6bcb293ee65", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "b7f7ad58a720a8eb93588d13045ea9b7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7713787085514834, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "A=list(map(int,input().split()))\nmaxi=0\nfor i in range(0,14):\n B=[]\n B=A.copy()\n summ=0\n if(B[i]>0):\n if((13-i)>=B[i]):\n for j in range(i+1,i+1+B[i]):\n B[j]+=1\n else:\n for j in range(i+1,14):\n B[j]+=1\n for j in range(0,B[i]-(13-i)):\n B[j]+=1\n B[i]=0\n for j in range(0,14):\n if(B[j]%2==0):\n summ+=B[j]\n if(summ>maxi):\n maxi=summ\nprint(maxi)\n", "lang": "Python 3", "bug_code_uid": "0826e071c75c40a9d9cd55e3dbd6aa88", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "3bb2e774487b67d0205bd422ffbe026d", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9936305732484076, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "# swapcase()convert the lower into upper and upper into lower\n# like geeksFORgeeks =>> GEEKSforGEEKS\n\nn=input()\nb=a[1:]\nprint([n,n.swapcase()][b.upper()==b])", "lang": "Python 3", "bug_code_uid": "452d2135ac7aee5aa2b50a6c276dce97", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "e455278f5e751c05fc8de6b550d4f9c1", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9153132250580046, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\nonsegment = lambda x, y, z: min(y,z) <= x <= max(y,z)\noninterval = lambda x, y, z: min(y,z) < x < max(y,z)\ndef inrectangle(p0, p1, p2):\n return oninterval(p0[0], p1[0], p2[0]) and oninterval(p0[1], p1[1], p2[1])\ndef onborder(p0, p1, p2):\n return onsegment(p0[0], p1[0], p2[0]) and onsegment(p0[1], p1[1], p2[1]) and not inrectangle(p0, p1, p2)\npoints = []\nfor i in range(3):\n points.append(tuple(int(x) for x in input().split()))\npoints.sort()\nif (all((point[0] == points[0][0] for point in points)) or\n all((point[1] == points[0][1] for point in points))):\n print(1)\nelif points[0][1] == points[2][1]:\n print(3 if points[0][0] < points[1][0] < points[2][0] else 2)\nelif onborder(points[1], points[0], points[2]) or onborder((points[2], points[0], points[1]) or (points[0], points[1], points[2]:\n print(2)\nelse:\n print(3)\n", "lang": "Python 3", "bug_code_uid": "83f54efdc296c606813257d896e15d8a", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "fb842907326b02183eb7895396acef76", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7294117647058823, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "n=int(raw_input())\ni=1%n\nk=2%n\nv=[-1]*n\nv[0]=1\nwhile not (k==v[i]):\n\tv[i]=k\n\ti=(i+k)%n\n\tk=(k+1)%n\nif v.count(-1)!=0:\n\tprint 'NO'\nelse:\n\tprint 'YES'\n", "lang": "Python 2", "bug_code_uid": "47f4e3b9e0341d65e6f3a0416bfe7b58", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "2cae53e7938936deb82ce749f46f4d5c", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9692227438706312, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 12, "bug_source_code": "#!/usr/bin/env pypy\nfrom __future__ import division, print_function\n\nimport os\nimport sys\nfrom __builtin__ import xrange as range\nfrom cStringIO import StringIO\nfrom future_builtins import ascii, filter, hex, map, oct, zip\nfrom io import IOBase\n\nimport __pypy__\n\n\ndef memoize(f):\n \"\"\" Memoization decorator for a function taking one or more arguments. \"\"\"\n\n class memodict(dict):\n def __getitem__(self, *key):\n return dict.__getitem__(self, key)\n\n def __missing__(self, key):\n ret = self[key] = f(*key)\n return ret\n\n return memodict().__getitem__\n\n\ndef main():\n n, T = map(int, input().split())\n t, g = [0] * n, [0] * n\n for i in range(n):\n t[i], g[i] = map(int, input().split())\n\n def solve(T, p, mask):\n if T < 0:\n return 0\n if T == 0:\n return 1\n\n res = 0\n for i in range(n):\n if mask[i] == 0 and p != g[i]:\n new_mask = mask[:]\n new_mask[i] = 1\n res += solve(T - t[i], g[i], new_mask)\n\n return res\n\n print(solve(T, -1, [0] * n))\n\n\n# region fastio\n\nBUFSIZE = 8192\n\n\nclass FastI(IOBase):\n def __init__(self, file):\n self._fd = file.fileno()\n self._buffer = StringIO()\n self.newlines = 0\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(\"\\n\") + (not b)\n ptr = self._buffer.tell()\n self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)\n self.newlines -= 1\n return self._buffer.readline()\n\n\nclass FastO(IOBase):\n def __init__(self, file):\n self._fd = file.fileno()\n self._buffer = __pypy__.builders.StringBuilder()\n self.write = lambda s: self._buffer.append(s)\n\n def flush(self):\n os.write(self._fd, self._buffer.build())\n self._buffer = __pypy__.builders.StringBuilder()\n\n\ndef print(*args, **kwargs):\n sep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop(\"end\", \"\\n\"))\n if kwargs.pop(\"flush\", False):\n file.flush()\n\n\nsys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\n# endregion\n\nif __name__ == \"__main__\":\n main()\n", "lang": "PyPy 2", "bug_code_uid": "278bfbdac1b6beb0db8767b4f65cf7e4", "src_uid": "ac2a37ff4c7e89a345b189e4891bbf56", "apr_id": "01303d3373fb8f9d0d2bd98357d933b8", "difficulty": 2100, "tags": ["dp", "combinatorics", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2918825561312608, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "P = 10**9+7\nN, T = map(int, input().split())\nA = [[], [], []]\nfor _ in range(N):\n t, g = map(int, input().split())\n A[g-1].append(t)\n\n\ndef calc(X, pr, t):\n if t < 0:\n return 0\n if t == 0:\n return 1\n if len(X[0])+len(X[1])+len(X[2]) == 0:\n return 0\n \n ans = 0\n for k in range(3):\n if pr != k:\n for i in range(len(X[k])):\n Y = [[X[k][j] for j in range(len(X[k])) if j != i] if _ == k else [a for a in X[_]] for _ in range(3)]\n ans = (ans + calc(Y, k, t-X[k][i])) % P\n return ans\n \n \nprint(calc(A, -1, T))\n", "lang": "PyPy 3", "bug_code_uid": "0d28991839bf7c1b15e23de5c4e7dfd2", "src_uid": "ac2a37ff4c7e89a345b189e4891bbf56", "apr_id": "dc0f90885e7b92c7b3e7be1288df7e3f", "difficulty": 2100, "tags": ["dp", "combinatorics", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7129909365558912, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "from collections import*\nn,m=map(int,input().split())\nc=Counter(i*i%m for i in range(1,n+1))\nprint(sum(c[k]*c[(m-k)%m]for k in c))", "lang": "Python 3", "bug_code_uid": "344df8fbe1e6c34697f83dd8dc841e4c", "src_uid": "2ec9e7cddc634d7830575e14363a4657", "apr_id": "ffa8cf3a9c3a779f139abe16074d40e2", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19256756756756757, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "b=int(input())\na=[]\nfor i in range(b):\n a.append(int(input()))\nc=a.index(1)\nd=a.index(b)\ne=0\nif(cabs(d-c)):\n print(abs(b-d))\n else:\n print(abs(d-c))\nelse:\n if(abs(b-c)>abs(c-d)):\n print(abs(b-c))\n else:\n print(abs(d-c))\n", "lang": "Python 3", "bug_code_uid": "8a8ca3ea556f74c8fef6b33a6925b635", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "9457619dabf676fea7e59b5bd3d9c5ec", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9931506849315068, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\na = list(map(int,input().split()))\nb = list(map(int,intput().split())\nif sum(a) >= sum(b):\n print(\"Yes\")\nelse:\n print(\"No\")", "lang": "PyPy 3", "bug_code_uid": "d7a47b6b3ee9a426088e02de4428b7e0", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "e6d0e2f15290735b285f5a48a9b33d4e", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2457627118644068, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "x=input()\nl=0\nfor n in range(int(x)+1):\n\tif n%4==0:\n\t\tif str(n) in x:\n\t\t\tl+=1\n\t\tfor k in range(1,len(x)-len(str(n))+1):\n\t\t z='0'*k+str(n)\n\t\t if z in x:\n\t\t l+=1\nprint(l)", "lang": "Python 3", "bug_code_uid": "b24f65dc7d47062debc77a10b06af334", "src_uid": "eb815f35e9f29793a120d120968cfe34", "apr_id": "b0f8705c7a1c65af8aa257a81cffeb46", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5009345794392523, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import math\ndef ar():\n return map(int,raw_input().split())\nc,d=ar()\nn,m=ar()\nk=ar()[0]\nreq=(n*m)-k\nmi=100000000\nfor i in range(req+1):\n for j in range(req+3):\n if n*i+j >=req:\n if c*i+j*d= need:\n result = min(x * c + y * d, result)\n\nprint result \n", "lang": "Python 2", "bug_code_uid": "f7aff446ca3baa0a68b9e9d66564cc5d", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "apr_id": "8158d7b71a71df844601c9b07bbcd5a0", "difficulty": 1500, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9722222222222222, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "import sys \nsys.stdin=open(\"input.in\",'r')\nsys.stdout=open(\"out1.out\",'w')\nn=int(input())\nprint((n-1)//2)", "lang": "Python 3", "bug_code_uid": "6b2980f1595622e3cdb095a650f2f7e4", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "7a36f6478af97a6714c70f155ca043cf", "difficulty": 1000, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.17532971295577968, "equal_cnt": 21, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 5, "fix_ops_cnt": 21, "bug_source_code": "h, m, s, t1, t2 = list(map(int, input().split()))\n\nh = h * 3600\n\nif s >= 5:\n s = round(s / 5 * 3600)\n\nelse:\n s = s * 3600\n\nif m >= 5:\n m = round(m / 5 * 3600)\n\nelse:\n m = m * 3600\n\n\nt1 = t1 * 3600\nt2 = t2 * 3600\n\n\nif (t2 > h and t1 < h) or (t2 > m and t1 < m) or (t2 > s and t1 < s)\n print(\"NO\")\n\nelse:\n print(\"YES\")", "lang": "Python 3", "bug_code_uid": "d25809695bd7b3f99f17a3d8b089f5fa", "src_uid": "912c8f557a976bdedda728ba9f916c95", "apr_id": "dbcba5828bdcb925ee77b5fa74058322", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8294020844761383, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import sys\nm=[1000000]\ndef madd(*a):\n m.append(sum(map(lambda x: 2**x,a)))\nfor i in range(19): \n madd(i)\ndef padd(l):\n for i in range(2,len(l)+1):\n for j in range(len(l)-i+1):\n madd(*l[j:j+i])\n\npadd(range(3))\npadd(range(3,7))\npadd(range(7,12))\npadd(range(12,16))\npadd(range(16,19))\npadd([7,12,16])\npadd([3,8,13,17])\npadd([0,4,9,14,18])\npadd([1,5,10,15])\npadd([2,6,11])\npadd([0,3,7])\npadd([1,4,8,12])\npadd([2,5,9,13,16])\npadd([6,10,14,17])\npadd([11,15,18])\na1 = (raw_input()+raw_input()+' '+raw_input()+raw_input()+raw_input()).split()\na = zip(a1,[0,3,7]+[1,4,8,12]+[2,5,9,13,16]+[6,10,14,17]+[11,15,18])\npx = sum([2**y for x,y in a if x=='O'],0)\nq = [False]*600000\nm.sort()\nmc = []\nfor i in xrange(px+1):\n if m[0]<=i:\n mc.append(m[0])\n m=m[1:]\n for p in mc:\n if i&p!=p: continue\n n = i^p\n if not q[n]: \n q[i] = True\n break\n \nprint \"Karlsson\" if q[px] else \"Lillebror\"\n\n", "lang": "Python 2", "bug_code_uid": "25e24f0c75005489b46e2887fa66358d", "src_uid": "eaa022cc7846c983a826900dc6dd919f", "apr_id": "50bda87e05332771c113d984b3bb3dcd", "difficulty": 2000, "tags": ["dp", "games", "dfs and similar", "bitmasks", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7778439547349613, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "from itertools import *\nimport sys\nfrom array import *\n\nl = [\n[1,2,3],\n[4,5,6,7],\n[8,9,10,11,12],\n[13,14,15,16],\n[17,18,19],\n\n[1,4,8],\n[2,5,9,13],\n[3,6,10,14,17],\n[7,11,15,18],\n[12,16,19],\n\n[3,7,12],\n[2,6,11,16],\n[1,5,10,15,19],\n[4,9,14,18],\n[8,13,17]\n]\n\nmask = []\nfor k in range(0,len(l)):\n\tfor i in range(0,len(l[k])):\n\t\tfor j in range(i,len(l[k])):\n\t\t\tval = 0\n\t\t\tfor p in range(i,j+1):\n\t\t\t\tval |= (1 << (l[k][p]-1))\n\t\t\tmask.append(val)\nmask = array('l', sorted(list(set(mask))))\n\nlst = []\nfor i in range(0,5):\n\tlst += map(lambda x: 1 if x==\"O\" else 0, raw_input().split())\nnum = 0\nfor i in range(0,len(lst)):\n\tif lst[i]==1:\n\t\tnum |= (1 << i)\n\nup = (1<<19)\nans = array('l',[0]*up)\n\nfor i in count(1):\n\tif i==up:\n\t\tbreak\n\n\tgood = False\n\tfor m in mask:\n\t\tif (i | m) == i:\n\t\t\tif ans[i ^ m] == 0:\n\t\t\t\tgood = True\n\t\t\t\tbreak\n\n\tans[i] = ( 1 if good else 0 )\n\nprint \"Karlsson\" if ans[num]==1 else \"Lillebror\"\n\n", "lang": "Python 2", "bug_code_uid": "67bbcbbc102aecb8b8b2ddfa2f5a09f3", "src_uid": "eaa022cc7846c983a826900dc6dd919f", "apr_id": "a4abb6d2c2234f825206ea94dd1dc36f", "difficulty": 2000, "tags": ["dp", "games", "dfs and similar", "bitmasks", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9998828353837141, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "(x11, y11, x12, y12, x13, y13, x14, y14) = map(int, input().split())\n\n(x21, y21, x22, y22, x23, y23, x24, y24) = map(int, input().split())\n\ndef xxx(x1, y1, x2, y2, x3, y3):\n return (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1)\n\nflag = False\n\nif xxx(x11, y11, x12, y12, x21, y21) >= 0 and xxx(x12, y12, x13, y13, x21, y21) >= 0 and xxx(x13, y13, x14, y14, x21, y21) >= 0 and xxx(x14, y14, x11, y11, x21, y21) >= 0:\n flag = True\n\n\nif xxx(x11, y11, x12, y12, x22, y22) >= 0 and xxx(x12, y12, x13, y13, x22, y22) >= 0 and xxx(x13, y13, x14, y14, x22, y22) >= 0 and xxx(x14, y14, x11, y11, x22, y22) >= 0:\n flag = True\n \nif xxx(x11, y11, x12, y12, x23, y23) >= 0 and xxx(x12, y12, x13, y13, x23, y23) >= 0 and xxx(x13, y13, x14, y14, x23, y23) >= 0 and xxx(x14, y14, x11, y11, x23, y23) >= 0:\n flag = True\n\nif xxx(x11, y11, x12, y12, x24, y24) >= 0 and xxx(x12, y12, x13, y13, x24, y24) >= 0 and xxx(x13, y13, x14, y14, x24, y24) >= 0 and xxx(x14, y14, x11, y11, x24, y24) >= 0:\n flag = True\n\nx = x21 + (x23 - x21) / 2\ny = y21 + (y23 - y21) / 2\n\nif xxx(x11, y11, x12, y12, x, y) >= 0 and xxx(x12, y12, x13, y13, x, y) >= 0 and xxx(x13, y13, x14, y14, x, y) >= 0 and xxx(x14, y14, x11, y11, x, y) >= 0:\n flag = True\n\n\n\n \n\nif xxx(x21, y21, x22, y22, x11, y11) >= 0 and xxx(x22, y22, x23, y23, x11, y11) >= 0 and xxx(x23, y23, x24, y24, x11, y11) >= 0 and xxx(x24, y24, x21, y21, x11, y11) >= 0:\n flag = True\n\n\nif xxx(x21, y21, x22, y22, x12, y12) >= 0 and xxx(x22, y22, x23, y23, x12, y12) >= 0 and xxx(x23, y23, x24, y24, x12, y12) >= 0 and xxx(x24, y24, x21, y21, x12, y2) >= 0:\n flag = True\n \nif xxx(x21, y21, x22, y22, x13, y13) >= 0 and xxx(x22, y22, x23, y23, x13, y13) >= 0 and xxx(x23, y23, x24, y24, x13, y13) >= 0 and xxx(x24, y24, x21, y21, x13, y13) >= 0:\n flag = True\n\nif xxx(x21, y21, x22, y22, x14, y14) >= 0 and xxx(x22, y22, x23, y23, x14, y14) >= 0 and xxx(x23, y23, x24, y24, x14, y14) >= 0 and xxx(x24, y24, x21, y21, x14, y14) >= 0:\n flag = True\n\nx = x11 + (x13 - x11) / 2\ny = y11 + (y13 - y11) / 2\n\nif xxx(x21, y21, x22, y22, x, y) >= 0 and xxx(x22, y22, x23, y23, x, y) >= 0 and xxx(x23, y23, x24, y24, x, y) >= 0 and xxx(x24, y24, x21, y21, x, y) >= 0:\n flag = True\n\n\n\n\n\n\nif xxx(x11, y11, x12, y12, x21, y21) <= 0 and xxx(x12, y12, x13, y13, x21, y21) <= 0 and xxx(x13, y13, x14, y14, x21, y21) <= 0 and xxx(x14, y14, x11, y11, x21, y21) <= 0:\n flag = True\n\n\nif xxx(x11, y11, x12, y12, x22, y22) <= 0 and xxx(x12, y12, x13, y13, x22, y22) <= 0 and xxx(x13, y13, x14, y14, x22, y22) <= 0 and xxx(x14, y14, x11, y11, x22, y22) <= 0:\n flag = True\n \nif xxx(x11, y11, x12, y12, x23, y23) <= 0 and xxx(x12, y12, x13, y13, x23, y23) <= 0 and xxx(x13, y13, x14, y14, x23, y23) <= 0 and xxx(x14, y14, x11, y11, x23, y23) <= 0:\n flag = True\n\nif xxx(x11, y11, x12, y12, x24, y24) <= 0 and xxx(x12, y12, x13, y13, x24, y24) <= 0 and xxx(x13, y13, x14, y14, x24, y24) <= 0 and xxx(x14, y14, x11, y11, x24, y24) <= 0:\n flag = True\n\nx = x21 + (x23 - x21) / 2\ny = y21 + (y23 - y21) / 2\n\nif xxx(x11, y11, x12, y12, x, y) <= 0 and xxx(x12, y12, x13, y13, x, y) <= 0 and xxx(x13, y13, x14, y14, x, y) <= 0 and xxx(x14, y14, x11, y11, x, y) <= 0:\n flag = True\n\n\n\n \n\nif xxx(x21, y21, x22, y22, x11, y11) <= 0 and xxx(x22, y22, x23, y23, x11, y11) <= 0 and xxx(x23, y23, x24, y24, x11, y11) <= 0 and xxx(x24, y24, x21, y21, x11, y11) <= 0:\n flag = True\n\n\nif xxx(x21, y21, x22, y22, x12, y12) <= 0 and xxx(x22, y22, x23, y23, x12, y12) <= 0 and xxx(x23, y23, x24, y24, x12, y12) <= 0 and xxx(x24, y24, x21, y21, x12, y12) <= 0:\n flag = True\n \nif xxx(x21, y21, x22, y22, x13, y13) <= 0 and xxx(x22, y22, x23, y23, x13, y13) <= 0 and xxx(x23, y23, x24, y24, x13, y13) <= 0 and xxx(x24, y24, x21, y21, x13, y13) <= 0:\n flag = True\n\nif xxx(x21, y21, x22, y22, x14, y14) <= 0 and xxx(x22, y22, x23, y23, x14, y14) <= 0 and xxx(x23, y23, x24, y24, x14, y14) <= 0 and xxx(x24, y24, x21, y21, x14, y14) <= 0:\n flag = True\n\nx = x11 + (x13 - x11) / 2\ny = y11 + (y13 - y11) / 2\n\nif xxx(x21, y21, x22, y22, x, y) <= 0 and xxx(x22, y22, x23, y23, x, y) <= 0 and xxx(x23, y23, x24, y24, x, y) <= 0 and xxx(x24, y24, x21, y21, x, y) <= 0:\n flag = True\n\n\n \nif flag:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "d2fb78be092c18bda86a19d018485248", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "apr_id": "ab8e2096b326c6f345fe642c982b4b1f", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9683257918552036, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m=map(int,input().split())\na=2*n\nb=3*m\ni=6\nwhile i<=min(a,b):\n if b 0:\n avail[i] -= 1\n #print \"shift\", i\n backtrack(stack + [i], avail, sumleft - i)\n avail[i] += 1\n\n # reduce\n if len(stack) < 2:\n return\n\n s = 1 + stack[-1]\n for i in range(2, len(stack) + 1):\n s += stack[-i]\n if s >= n + 1:\n break\n\n if avail[s] > 0:\n avail[s] -= 1\n #print \"reduce\", s\n backtrack(stack[:-i] + [s], avail, sumleft - s)\n avail[s] += 1\n \n\nbacktrack([], F, sum(c))\nprint \"NO\"\n", "lang": "Python 2", "bug_code_uid": "aba726a3c61c69a1672abc0f6be00bb1", "src_uid": "ed0925cfaee961a3ceebd13b3c96a15a", "apr_id": "c7476241662000bd2ed475d2f01804b4", "difficulty": 2300, "tags": ["data structures", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5808383233532934, "equal_cnt": 22, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 10, "fix_ops_cnt": 22, "bug_source_code": "def solve():\n\tn1= raw_input() \n\tn2= raw_input()\n\tn3= raw_input()\n\tn4= raw_input()\n\n\tif n1 > n2: print \"First\"\n\telse: print \"Second\"\n\nsolve()\n", "lang": "Python 3", "bug_code_uid": "23b46cffa09b4dad313e985bd4f8f931", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "bb6215458c99f6db85ddbb4738c08563", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.28428927680798005, "equal_cnt": 26, "replace_cnt": 15, "delete_cnt": 9, "insert_cnt": 3, "fix_ops_cnt": 27, "bug_source_code": "#include\n#include\n#include\n#include\nusing namespace std;\n\nint main()\n{\n int n1,n2,k1,k2;\n while(scanf(\"%d%d%d%d\",&n1,&n2,&k1,&k2)!=EOF)\n {\n if(n1>n2)\n printf(\"First\\n\");\n else printf(\"Second\\n\");\n }\n return 0;\n}\n", "lang": "Python 3", "bug_code_uid": "9a33492793527732076b2fac6e2399a1", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "932460b98eaee339ed3801e89f684e40", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3469387755102041, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "h, m = map(int, raw_input().split(\":\"))\nrh = int(str(h)[::-1])\nif rh < 60 and m < rh:\n print \"%02d:%02d\" % (rh, m)\nelse:\n while 1:\n nm = int(str((h+1)%24)[::-1])\n if nm < 60:\n break\n print \"%02d:%02d\" % (int(str(nm)[::-1]), nm)", "lang": "Python 2", "bug_code_uid": "7be545bc1e8b10da34623885ea0e25f2", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "81012cc32df92e9c92ce0c2ccd6289c3", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1938534278959811, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 19, "bug_source_code": "n=input()\nk=n.index(' ')\na=int(n[:k])\nb=int(n[k+1:])\nd=input()\nk1=n.index(' ')\na1=int(d[:k1])\nb1=int(d[k1+1])\nc1=int(d[k1+3])\nfor i in range(a1):\n a-=2\nfor i in range(b1):\n a-=1\n b-=1\nfor i in range(c1):\n b-=3\nc=(a+b)*(-1)\nprint(c) \n", "lang": "Python 3", "bug_code_uid": "d3398db62b1ff0a9c19ce6da28a9e70e", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "3f375f5e64c622b7e3cf253c35664d52", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8617021276595744, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "s = input()\nc = s.count(\"VK\")\nif s.count(\"VV\") or s.count(\"KK\"):\n c+=1\nprint c", "lang": "Python 3", "bug_code_uid": "be9207bcd2836b1f88f4b7074079beb5", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "5796f0c224880395a913a7c6e6f3c874", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9968102073365231, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def build_fac():\n global mod\n fac = [1] * int(2e5 + 1)\n for i in range(1, int(2e5)):\n fac[i] = i*fac[i-1] % mod\n return fac\n\ndef inv(x):\n global mod\n return pow(x, mod-2, mod)\n\ndef ncr(n, r):\n global fac\n if n < 0 or n < r: return 0\n return fac[n]*inv(fac[r])*inv(fac[n-r]) % mod\n\ndef cf(f, w, h):\n global mod\n if w == 0: return 1\n rs = 0\n for k in range(1, min(w//(h+1),f+1)+1):\n rs += ncr(f+1, k) * ncr(w-k*h-1, k-1) % mod\n rs %= mod\n return rs\n\nf, w, h = map(int,input().split(' '))\nmod = int(1e9 + 7)\n\nfac = build_fac()\ncnt = cf(f, w, h)\nrs = cnt*inv(ncr(f+w, w)) % mod\n\nprint(rs)", "lang": "PyPy 3", "bug_code_uid": "d43d6b34e2e5770997660c575b4682c7", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "33a4b796650034fe0a0dcb4256225580", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9436363636363636, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import math\ngetInputList = lambda : list(input().split())\ngetInputIntList = lambda : list(map(int,input().split()))\n\n\nn = int(input())\n\nh = n//2\nleft = 1 \nright = n\n\ndef eat(k,n):\n\ta = 0\n\twhile n > 0:\n\t\t#print(a,n,k)\n\t\ta += min(k,n)\n\t\tn -= min(k,n)\n\t\tn -= (n*10)//100\n\treturn a\n\nans = eat(39259424579862572,n)\nif n != 1:\n\twhile left <= right:\n\t\tm = (left + right)//2\n\t\teat1 = eat(m,n)\n\t\teat2 = 0\n\t\tif m-1 > 0:\n\t\t\teat2 = eat(m-1,n)\n\t\t\n\t\tif eat1 >= h and eat2 < h:s\n\t\t\tprint(m)\n\t\t\tbreak\n\t\tif eat1 < h:\n\t\t\tleft = m\n\t\telse:\n\t\t\tright = m\n\t\t\nelse:\n\tprint(1)", "lang": "Python 3", "bug_code_uid": "4a5ff08e18d336c193c6252fcaa72158", "src_uid": "db1a50da538fa82038f8db6104d2ab93", "apr_id": "df8f9ae6264ddc7d251ebd3b1f661e5c", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9818181818181818, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,m=map(int,input().split())\nprint(3*pow(3,n-1,m)-1)%m", "lang": "Python 3", "bug_code_uid": "b9fa281b88411d48c042ec139696a216", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "82efe6090c1374563e9dac52cc1f7892", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9941520467836257, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]\ndp = [[10**18 for i in range(15)] for j in range(1006)]\ninf = 10**18\nfor pw in range(64):\n\tdp[pw + 1][0] = 2**pw\nfor idx in range(1,13):\n\tfor i in range(1005):\n\t\tfor pw in range(64):\n\t\t\tif(i % (pw + 1)==0):\n\t\t\t if(dp[i // (pw + 1)][idx-1] > inf // (prime[idx]**pw)):break\n\t\t\t\tdp[i][idx] = min(dp[i][idx],dp[i // (pw + 1)][idx-1] *(prime[idx]**pw))\nprint(dp[int(input())][12])", "lang": "Python 3", "bug_code_uid": "33f328cba766a6b5717ac68589a68421", "src_uid": "62db589bad3b7023418107de05b7a8ee", "apr_id": "809e2a398a02fb03038d29c322d19178", "difficulty": 2000, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9195402298850575, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "[n] = raw_input().split()\nn = int (n)\nv = []\nfor i in range (n) :\n v.append(0)\nv = raw_input().split()\nmx = int (-1)\nvotes = int (0)\nfor x in v :\n x = int (x)\n mx = max (mx, x)\n votes += x\nvotes = n * mx - votes\nwhile (votes < n * mx - votes) :\n mx = mx + 1\nprint mx ", "lang": "Python 2", "bug_code_uid": "3715733d2ba794ab142656157dc1f2f4", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "dba8b063ef3aaf0513f99d064115066c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.046296296296296294, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#include \n\nusing namespace std;\n\nint main()\n{\n int k,n;\n int t=0,a[n];\n cin >> n >> k;\n int b[n],r=0,c[n];\n\n\n for (int i=0;i> a[i];\n for (int j=0;j1 and b<2*n and 2*m>=6:\n write(\"YES\")\nelse:\n write(\"NO\")", "lang": "Python 2", "bug_code_uid": "1723533db8132be2a1ba0c6122580993", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "cbb20d664615e9f0640e314dfb038b5d", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7887788778877888, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "n, bx = int(raw_input()), int(raw_input())\n\nX = 0\nfor inx in xrange(n):\n\tX += bx ** (n - inx - 1)\n\nm, by = int(raw_input()), int(raw_input())\n\nY = 0\nfor inx in xrange(n):\n\tY += by ** (m - inx - 1)\n\t\nif X < Y:\n\tprint '<'\nif X > Y:\n\tprint '>'\nif X == Y:\n\tprint '='", "lang": "Python 2", "bug_code_uid": "dc5038aadae8a21a36f3061c5dfc083b", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "5e374dd6b0257e801b869aff00985e97", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8980891719745223, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import sys\n\nwhile True:\n a, b, r = [ int(i) for i in sys.stdin.readline().split() ]\n if a < r * 2 or b < r * 2:\n print 'Second'\n else:\n print 'First'", "lang": "Python 2", "bug_code_uid": "cb9491f6d77fd1948a6f4c5ec6ed2330", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "0863fe62a4c5ef8c1515c676bce64cce", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.11578947368421053, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "t = int(input())\nfor _ in range(t):\n n, m = [int(x) for x in input().split()]\n a = list()\n b = list()\n for _ in range(m)\n x, y = [int(x) for x in input().split()]\n a.append(x)\n b.append(y)\n ", "lang": "Python 3", "bug_code_uid": "4e5e3e96d665234e8af50053903ae907", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "70fc0cbf26b5918ad6ffaae9b4297016", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9612903225806452, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n=eval(input())\na=eval(input())\nb=eval(input())\nc=eval(input())\nx = 0\nif ( b - c < a ):\n x = (n - c)//(b - c)\n n -= x*(b - c)\nl += n//a\nprint(l)\n", "lang": "Python 3", "bug_code_uid": "5afb2115169847a1c9097d214b7b16f5", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "apr_id": "baa6a4ccbbb54df2a87669b6340e706d", "difficulty": 1700, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6231884057971014, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "n, k = list(map(int, input().split()))\na = list(map(int, input().split()))\nlibrary = []\nmoney = 0\nfor i in range(len(a)):\n if a[i] not in library:\n money += 1\n if len(library) < k:\n library.append(a[i])\n else:\n curmin = n\n curindex = 0\n for j in range(len(library)):\n if a[i+1::].count(library[j]) < curmin:\n curmin = a[i+1::].count(library[j])\n curindex = j\n library[curindex] = i\nprint(money)\n", "lang": "Python 3", "bug_code_uid": "4df20020af61e1574282ef975913d803", "src_uid": "956228e31679caa9952b216e010f9773", "apr_id": "80e3d235ca6bff04be2a26da4a8e416a", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9822161422708618, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "p=int(input())\nif x == 2:\n print(1)\nans=0\nfor x in range(1,p):\n m=x%p\n if m==1:\n if x==2:\n q=True\n else:\n q=False\n else:\n q=False\n for i in range(2,p):\n m=(m*x)%p\n if m==1:\n if i==p-1:\n q=True\n break\n ans+=q\nprint(ans)\n \n", "lang": "PyPy 3", "bug_code_uid": "27a122453dc67ab8e6222b7e9228c2c3", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "3b577c158b240eb69770b3d217ff53ec", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9970210230657929, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\"\"\"Basic number theory functions.\n Functions implemented are:\n gcd(a,b) - Compute the greatest common divisor of a and b.\n xgcd(a,b) - Find [g,x,y] such that g=gcd(a,b) and g = ax + by.\n powmod(b,e,n) - Compute b^e mod n efficiently.\n invmod(b,n) - Compute 1/b mod n.\n isprime(n) - Test whether n is prime using a variety of pseudoprime tests.\n isprimeF(n,b) - Test whether n is prime or a Fermat pseudoprime to base b.\n isprimeE(n,b) - Test whether n is prime or an Euler pseudoprime to base b.\n eulerphi(n) - Compute Euler's Phi function of n - the number of integers strictly less than n which are coprime to n.\n carmichaellambda(n) - Computer Carmichael's Lambda function of n - the smallest exponent e such that b**e = 1 for all b coprime to n.\n factor(n) - Find a factor of n using a variety of methods.\n factors(n) - Return a sorted list of the prime factors of n.\n factorPR(n) - Find a factor of n using the Pollard Rho method\n isprimitive(g,n) - Test whether g is primitive - generates the group of units mod n.\n sqrtmod(a,n) - Compute sqrt(a) mod n using various algorithms.\n TSRsqrtmod(a,grpord,n) - Compute sqrt(a) mod n using Tonelli-Shanks-RESSOL algorithm.\n A list of the functions implemented in numbthy is printed by the command info().\"\"\"\n \n \nVersion = 'NUMBTHY.PY, version 0.6, 24 Nov, 2012, by Robert Campbell, '\n \nimport math # Use sqrt, floor\n \ndef gcd(a,b):\n \"\"\"gcd(a,b) returns the greatest common divisor of the integers a and b.\"\"\"\n if a == 0:\n return abs(b)\n return abs(gcd(b % a, a))\n \ndef powmod(b,e,n):\n \"\"\"powmod(b,e,n) computes the eth power of b mod n. \n (Actually, this is not needed, as pow(b,e,n) does the same thing for positive integers.\n This will be useful in future for non-integers or inverses. Currently assumes e>0.)\"\"\"\n accum = 1; i = 0; bpow2 = b\n while ((e>>i)>0):\n if((e>>i) & 1):\n accum = (accum*bpow2) % n\n bpow2 = (bpow2*bpow2) % n\n i+=1\n return accum\n \ndef xgcd(a,b):\n \"\"\"xgcd(a,b) returns a list of form [g,x,y], where g is gcd(a,b) and\n x,y satisfy the equation g = ax + by.\"\"\"\n a1=1; b1=0; a2=0; b2=1; aneg=1; bneg=1\n if(a < 0):\n a = -a; aneg=-1\n if(b < 0):\n b = -b; bneg=-1\n while (1):\n quot = -(a // b)\n a = a % b\n a1 = a1 + quot*a2; b1 = b1 + quot*b2\n if(a == 0):\n return [b, a2*aneg, b2*bneg]\n quot = -(b // a)\n b = b % a;\n a2 = a2 + quot*a1; b2 = b2 + quot*b1\n if(b == 0):\n return [a, a1*aneg, b1*bneg]\n \ndef isprime(n):\n \"\"\"isprime(n) - Test whether n is prime using a variety of pseudoprime tests.\"\"\"\n if (n in [2,3,5,7,11,13,17,19,23,29]): return True\n return isprimeE(n,2) and isprimeE(n,3) and isprimeE(n,5)\n \ndef isprimeF(n,b):\n \"\"\"isprimeF(n) - Test whether n is prime or a Fermat pseudoprime to base b.\"\"\"\n return (pow(b,n-1,n) == 1)\n \ndef isprimeE(n,b):\n \"\"\"isprimeE(n) - Test whether n is prime or an Euler pseudoprime to base b.\"\"\"\n if (not isprimeF(n,b)): return False\n r = n-1\n while (r % 2 == 0): r //= 2\n c = pow(b,r,n)\n if (c == 1): return True\n while (1):\n if (c == 1): return False\n if (c == n-1): return True\n c = pow(c,2,n)\n \ndef factor(n):\n \"\"\"factor(n) - Find a prime factor of n using a variety of methods.\"\"\"\n if (isprime(n)): return n\n for fact in [2,3,5,7,11,13,17,19,23,29]:\n if n%fact == 0: return fact\n return factorPR(n) # Needs work - no guarantee that a prime factor will be returned\n \ndef factors(n):\n \"\"\"factors(n) - Return a sorted list of the prime factors of n.\"\"\"\n if (isprime(n)):\n return [n]\n fact = factor(n)\n if (fact == 1): return \"Unable to factor \"+str(n)\n facts = factors(n/fact) + factors(fact)\n facts.sort()\n return facts\n \ndef factorPR(n):\n \"\"\"factorPR(n) - Find a factor of n using the Pollard Rho method.\n Note: This method will occasionally fail.\"\"\"\n for slow in [2,3,4,6]:\n numsteps=2*math.floor(math.sqrt(math.sqrt(n))); fast=slow; i=1\n while i6])", "lang": "Python 2", "bug_code_uid": "51aaa8e4d5cf2c801034b67ff6defca8", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "7eec0ba29e31cc9911fe32508219e637", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8596256684491979, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "import sys\n\np = sys.stdin.readline().strip().split()\np = [int(xy) for xy in p]\np = [(p[0],p[1]), (p[2],p[3]), (p[4],p[5])]\n\ndef solve():\n\tdef right(a, b, c):\n\t\treturn (b[1] - a[1]) * (c[1] - a[1]) == -(c[0] - a[0]) / (b[0] - a[0])\n\n\tdef almost_right(a, b, c):\n\t\tdx = [1,-1,0,0]\n\t\tdy = [0,0,1,-1]\n\t\tfor i in range(4):\n\t\t\ta_ = (a[0]+dx[i], a[1]+dy[i])\n\t\t\tif right(a_, b, c):\n\t\t\t\treturn True\n\t\treturn False\n\n\tfor i in range(3):\n\t\tif right(p[i], p[(i + 1) % 3], p[(i + 2) % 3]):\n\t\t\tprint \"RIGHT\"\n\t\t\treturn\n\n\tfor i in range(3):\n\t\tif almost_right(p[i], p[(i + 1) % 3], p[(i + 2) % 3]):\n\t\t\tprint \"ALMOST\"\n\t\t\treturn\n\n\tprint \"NEITHER\"\n\treturn\n\nsolve()\n\n", "lang": "PyPy 2", "bug_code_uid": "450f5a8a23d8557da05b4f74fd90ad91", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "15243a6d60bbc5d5a952d6e87d8aa044", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.19420783645655879, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "from math import factorial as fact\nn = input ()\nC = lambda n, k: fact (n) / (fact (n - k) * fact (k))\nprint (2 * C (n * 2 - 1, n - 1) - n) % 1000000007\n\n", "lang": "Python 2", "bug_code_uid": "ab45db5b2781eca395453cf1bad9d4ec", "src_uid": "13a9ffe5acaa79d97df88a069fc520b9", "apr_id": "b0b0ee5105548a63e4cc490e41e1a61b", "difficulty": 1900, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5607250755287009, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "\ndef frange(start, stop, step=1):\n while start x2:\n x4 = x2\nif x6 > x2:\n x6 = x2\n\nif y4 > y2:\n y4 = y2\nif y6 > y2:\n y6 = y2\n\n\na = {(x, y) for x in frange(x1, x2) for y in frange(y1, y2)}\nb = {(x, y) for x in frange(x3, x4) for y in frange(y3, y4)}\na = a - b\ndel b\nv = {(x, y) for x in frange(x5, x6) for y in frange(y5, y6)}\na = a - v\n\n\n\nif len(a):\n print(\"YES\")\nelse:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "2ed50efd2368ef0b23398120c0581772", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "68c2e3c6ffea1921e1657fbefac76bce", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8888888888888888, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n,k=input().split()\nn=int(n)\nk=int(k)\ncnt=n//k\nif(count%2==0):\n cout<<\"NO\";\nelse:\n cout<<\"YES\";\n", "lang": "Python 3", "bug_code_uid": "ed672afe02979628b624fe77e197577a", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "3690dc4c2b5cd6bf2e5c70a8684d5520", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.40458015267175573, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n=int(input())\nfor i in range(1,1000000000,1):\n j=str(n+i)\n j=j.replace(\"0\",\"\")\n if len(j)==1:\n print(i)\n break\n\n \n", "lang": "Python 3", "bug_code_uid": "ac061056b2a29885a74b32c547d7072c", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "212153a210561de66af94d8f3641b819", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5788423153692615, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())+1\n#l = list(map(int, input().strip().split(' ')))\nimport collections\ncounter = 1\nwhile True :\n if collections.Counter(str(n))['0']+1 == len(str(n)):\n print(counter)\n break\n\n else:\n n+=1\n counter+=1", "lang": "Python 3", "bug_code_uid": "8389a8202cc91c0b598474f23fe517e1", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "c8c66068f305bffac157c3ceccd249e4", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8436625349860056, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "from __future__ import print_function\nimport sys\nfrom collections import deque,defaultdict\nimport math\nimport functools\nimport itertools\nfrom bisect import bisect_left,bisect_right\nimport operator\nimport heapq\nfrom random import random,randint,randrange,shuffle\ntrue=True\nfalse=False\nnull=None\nSLOW=True\ntry:\n range=xrange\nexcept:\n ignored=1\ndef fast():\n global SLOW\n SLOW=False\ndef compute(val, func): return func(val)\ndef seq(lo,hi,step=1): \n return range(lo,hi+1,step)\ndef sround(val,nd):\n return '{0:.{1}f}'.format(val,nd)\ndef ceil(a,b):\n ans=a//b\n if a%b!=0: ans+=1\n return ans\ndef e1e(d,e): return d*(10**e)\nmod=e1e(1,9)+7\ntry:\n memoi=functools.lru_cache(None)\nexcept:\n class memoize(dict):\n def __init__(self,f):\n self.f=f\n def __call__(self,*args):\n return self[args]\n def __missing__(self,key):\n ans=self[key]=self.f(*key)\n return ans\n memoi=memoize\nclass ndarray(list):\n def __init__(self,defval,sizes):\n self.sizes=sizes\n self.dimension=len(sizes)\n self.pm=pm=list(sizes)\n pm.append(1)\n for ii in reversed(range(self.dimension)): pm[ii]*=pm[ii+1]\n list.__init__(self,[defval]*pm[0])\n def ___i1d___(self,ixs):\n if SLOW and len(ixs)!=self.dimension: raise LookupError('Dimension must be {}.'.format(self.dimension))\n ans=0\n for ii in range(self.dimension):\n ix=ixs[ii]\n if SLOW and ix>=self.sizes[ii]:\n raise IndexError('Index[{}]={} >= Len[{}]={}.'.format(ii,ix,ii,self.sizes[ii]))\n ans+=ix*self.pm[ii+1]\n return ans\n def __getitem__(self,ixs):\n ixs=self.___i1d___(ixs)\n return list.__getitem__(self,ixs)\n def __setitem__(self,ixs,val):\n ixs=self.___i1d___(ixs)\n list.__setitem__(self,ixs,val)\n def _str_(self,dim0=0,ofs=0):\n lft=\" \"*dim0\n if dim0+1==self.dimension: return lft+str(list.__getitem__(self,slice(ofs,ofs+self.sizes[dim0])))\n ans=[]\n for ii in range(self.sizes[dim0]):\n ans.append(self._str_(dim0+1,ofs))\n ofs+=self.pm[dim0+1]\n ans=\"{0}[\\n{1}\\n{0}]\".format(lft,\",\\n\".join(ans))\n return ans\n def __str__(self):\n return self._str_()\ndef arrays(defval,*sizes):\n if len(sizes)==1: return [defval]*sizes[0]\n return ndarray(defval,sizes)\ndef perr(*args,**kwargs): \n if SLOW:\n print(*args,file=sys.stderr,**kwargs)\ndef line():\n ln=sys.stdin.readline().strip()\n #perr(ln)\n if ln=='': sys.exit()\n return ln\ndef lines(n): return [line() for i in range(n)]\ndef split(ln=None): return (ln or line()).split()\ndef num(str=None):\n str=str or line()\n return float(str) if '.' in str else int(str)\ndef nums(o=None):\n if o is not None:\n if isinstance(o, int): o=lines(o)\n elif isinstance(o, str): o=split(o)\n return list(map(num, o or split()))\ndef loop(f,n=0):\n for tcid in range(n or 99999999): f(tcid+1)\ndef repeat(n,f):\n for _ in range(n): yield f()\ndef recursi(root,fchildren,ctop):\n p=deque()\n c=deque()\n q=deque()\n q.append(root)\n while len(q)>0:\n pp=q.popleft()\n for cc in fchildren(pp):\n p.append(pp)\n c.append(cc)\n q.append(cc)\n for _ in range(len(p)):\n ctop(c.pop(),p.pop())\n\"\"\"\nrecursi(root,fchilds,ctop)\ne1e(d,e) mod arrays(defv,*sz) repeat(n,f)\nceil(a,b) sround(val,nd) true false null @memoi\nnum(?) nums(?) split(?) lines(n) line()\nperr(print) seq() loop(f(tcid),0) compute(v,f) fast()\n\"\"\"\n#\ndef mainloop(tcid): #\n ignored=1 #\n n=num()\n dp=arrays(0,n+1,4)\n dp[0,0]=1\n for ii in seq(1,n):\n for jj in range(4):\n for kk in range(4):\n if jj!=kk:\n dp[ii,jj]+=dp[ii-1,kk]\n dp[ii,jj]%=mod\n print(dp[n,0])\ntcmax=0\nloop(mainloop,tcmax) #\n#", "lang": "Python 2", "bug_code_uid": "c7cb2decc9277325426e89c84b5338d6", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "bfe9853795b0d532893a69baa3df2374", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.34267413931144913, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 17, "bug_source_code": "I = lambda : map(int, raw_input().split())\nmod = 1000000007\n\ndef stat(n, k):\n if n < 1: return 0\n if k == 1: return 1\n if cache[n][k] != None: return cache[n][k]\n\n ret = sum(stat(i, k-1) * (n-i-1) for i in xrange(1, n-1))\n ret %= mod\n cache[n][k] = ret\n return ret\n\ndef foo(n, k):\n global cache\n cache = [[None]*(k+1) for _ in range(n+1)]\n return sum(stat(i, k) * (n-i-1) for i in xrange(1, n-1)) % mod\n\ndef main():\n n, m, k = I()\n r1 = foo(n, k)\n r2 = foo(m, k)\n print r1 * r2 % mod\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 2", "bug_code_uid": "fbc588b3bc6469b1d6215d533338a1ba", "src_uid": "309d2d46086d526d160292717dfef308", "apr_id": "5c2c0c7ec08aac1f00d16d696cb9899f", "difficulty": 2000, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9821428571428571, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "raw1 = input().split(\" \")\nn = int(raw1[0])\nk = float(raw1[1])\n\nraw2 = input().split(\" \")\navg = 0\nfor idx in raw2\n avg += int(idx)\n\nadd = 0\nwhile((k - 0.5) * (len(raw2)+add) > avg):\n avg += k\n add += 1\nprint(add)\n ", "lang": "PyPy 3", "bug_code_uid": "227fd04d5561109d20e67ed60e6f8394", "src_uid": "f22267bf3fad0bf342ecf4c27ad3a900", "apr_id": "1ddcc7691143834f1fbd9458200b4f24", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.13333333333333333, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "n, k = input().split()\nn = int(n)\nk = int(k)\nk -= 1\n\ndivisors= []\nd = 1\nwhile d * d <= n:\n if n % d == 0:\n divisors.append(d)\n l = n // d\n if l != d:\n divisors.append(l)\ndivisors.sort()\n\nres = -1\nif k < len(divisors):\n res = divisors[k]\nprint(res)\n\n", "lang": "PyPy 3", "bug_code_uid": "ae5d3977d1f3dc3b86670af71f220c28", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "363fef76b0bc5100bffdf22cafe76815", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9790209790209791, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "st=input().split(' ')\nx=int(st[0])\ny=int(st[1])\n\nprint((pow(3,x,y)-1)%m)", "lang": "PyPy 3", "bug_code_uid": "54eed803d2b2d8798f7f2a780f1f8a90", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "4dc50248720729c068b126b746503f83", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.010638297872340425, "equal_cnt": 3, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#include \n\nint main() {\n\n return 0;\n}", "lang": "PyPy 3", "bug_code_uid": "6698f494e4f9a9934f9cc4bbb1c06587", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "apr_id": "3bd4065a69c834dfdb290c7b6a2dac1f", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9899193548387096, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def f(a, b):\n k = min(a, 2)\n return a - k, b - 22 + 10 * k\n\ndef g(a, b):\n if b > 21: return a, b - 22\n if b > 11: return a - 1, b - 12\n if b > 1: return a - 2, b - 2\n\ndef main():\n a, b = map(int, input().split())\n k = min(a // 2, b // 24)\n a -= 2 * k\n b -= 24 * k\n \n while a > 0:\n a, b = f(a, b)\n if a < 0 or b < 0: return 0\n a, b = g(a, b)\n if a < 0 or b < 0: return 1\n if a == 0: return (b // 22) % 2\n\nprint(['Hanako', 'Ciel'][main()])", "lang": "Python 3", "bug_code_uid": "b47bfd0e55f6bd5cb3c68d7e67afb724", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "3920f040a0b254ae6148c0ca03fb8ab8", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9982279976373302, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def validar_partidas(n,ganadores):\n perdedor = 3\n partida = [1,2]\n result = 0\n if ganadores[0]==3:\n result=-1\n else:\n for j in range(len(ganadores)):\n if ganadores[j]==perdedor:\n result=-1\n elif partida.count(ganadores[j])>0:\n if partida[0]==ganadores[j]:\n espectador = perdedor\n perdedor=partida[1]\n partida[1]=espectador\n else:\n espectador=perdedor\n perdedor=partida[0]\n partida=espectador\n if result == -1:\n print(\"NO\")\n else:\n print(\"YES\")\n\nif __name__ == \"__main__\":\n n = int(input(\"\"))\n ganadores = list()\n for i in range(n):\n ganadores.append(int(input(\"\")))\n validar_partidas(n,ganadores)", "lang": "Python 3", "bug_code_uid": "0a66154dc6d17b8f04e0baa1df521b34", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "apr_id": "d05078d5e24439cfe4dc39b0a40d2d5f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8522550544323484, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "w,h=map(int,input().split())\nu1,d1=map(int,input().split())\nu2,d2=map(int,input().split())\nnetw=w\n\nwhile h:\n netw=netw+i\n if h == d1:\n if netw>=u1:\n netw=netw-u1\n else:\n netw=0\n elif h == d2:\n if w>=u2:\n netw=netw-u2\n else:\n netw=0\n h-=1\n\nprint(netw)\n \n", "lang": "PyPy 3", "bug_code_uid": "958351232c8e80e82ef392e4d4884df4", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "67329226c3e0e33922beae9cd7015af6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.918141592920354, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "(n, c) = [int(i) for i in input().strip().split(' ')]\np = [int(i) for i in input().strip().split(' ')]\nt = [int(i) for i in input().strip().split(' ')]\n\nl_pts = 0\nr_pts = 0\nl_cnt = 0\nr_cnt = 0\nfor i in range(n):\n l_cnt += t[i]\n l_pts += p[i] - l_cnt*c\n r_cnt += t[n-i-1]\n r_pts += p[n-i-1] - r_cnt*c\nif l_pts > r_pts:\n print('Limak')\nelif r_pts > l_pts:\n print('Radewoosh')\nelse:\n print('Tie')\n", "lang": "Python 3", "bug_code_uid": "c42a25da71d347eba59d02cf7a9695a6", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "apr_id": "537bd7ed14ed84e1842b2cb6a3215bdf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4065573770491803, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,m=map(int,input().split())\nif(n==0):\n print(\"Impossible\")\nelse:\n print([n,m][m>n],m+n-1])", "lang": "Python 3", "bug_code_uid": "22b3ffdcd4d896990ab460d39887d3cb", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "b642f1e54793172546cc3c9651ecb4e5", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.27863247863247864, "equal_cnt": 21, "replace_cnt": 16, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 21, "bug_source_code": "n,m=map(int,raw_input().split())\nr=[]\nb=[]\nturn=1\ns=[]\nvas=0\npet=0\nfor i in range(n):\n\tr.append(\"r\")\nfor i in range(m):\n\tb.append(\"b\")\nfor i in range(n+m):\n\tif turn==0:\n\t\tif s[i-1]==\"b\" and len(r)>0:\n\t\t\ts.append(\"r\")\n\t\t\tr=r[1:]\n\n\t\telif s[i-1]==\"r\" and len(b)>0:\n\t\t\ts.append(\"b\")\n\t\t\tb=b[1:]\n\t\telif len(b)>0:\n\t\t\ts.append(\"b\")\n\t\t\tb=b[1:]\t\t \n\t\telse:\n\t\t\ts.append(\"r\")\n\t\t\tr=r[1:]\n\t\tturn+=1\n\telse:\n\t\tif i==0:\n\t\t\ts.append(\"b\")\n\t\t\tb=b[1:]\n\t\telse:\t\t\n\t\t\tif s[i-1]==\"r\" and len(r)>0:\n\t\t\t\ts.append(\"r\")\n\t\t\t\tr=r[1:]\n\n\t\t\telif s[i-1]==\"b\" and len(b)>0:\n\t\t\t\ts.append(\"b\")\n\t\t\t\tb=b[1:]\n\t\t\telif len(b)>0:\n\t\t\t\ts.append(\"b\")\n\t\t\t\tb=b[1:]\t\t \n\t\t\telse:\n\t\t\t\ts.append(\"r\")\n\t\t\t\tr=r[1:]\n\t\tturn-=1\ns=''.join(s)\n# print s\ns_back=s\nwhile s.count('rr')>0:\n\tvas+=s.count('rr')\n\ts=s.replace('rr','r')\n\t# print s,vas\nwhile s.count('bb')>0:\n\tvas+=s.count('bb')\n\ts=s.replace('bb','b')\n\t# print s,vas\n# print s_back\npet+=s_back.count('br')\npet+=s_back.count('rb')\na1=[vas,pet]\n# print a1\ns=[]\nr=[]\nb=[]\nturn=1\nvas=0\npet=0\nfor i in range(n):\n\tr.append(\"r\")\nfor i in range(m):\n\tb.append(\"b\")\nfor i in range(n+m):\n\tif turn==0:\n\t\tif s[i-1]==\"b\" and len(r)>0:\n\t\t\ts.append(\"r\")\n\t\t\tr=r[1:]\n\n\t\telif s[i-1]==\"r\" and len(b)>0:\n\t\t\ts.append(\"b\")\n\t\t\tb=b[1:]\n\t\telif len(b)>0:\n\t\t\ts.append(\"b\")\n\t\t\tb=b[1:]\t\t \n\t\telse:\n\t\t\ts.append(\"r\")\n\t\t\tr=r[1:]\n\t\tturn+=1\n\telse:\n\t\tif i==0:\n\t\t\ts.append(\"r\")\n\t\t\tr=r[1:]\n\t\telse:\t\t\n\t\t\tif s[i-1]==\"r\" and len(r)>0:\n\t\t\t\ts.append(\"r\")\n\t\t\t\tr=r[1:]\n\n\t\t\telif s[i-1]==\"b\" and len(b)>0:\n\t\t\t\ts.append(\"b\")\n\t\t\t\tb=b[1:]\n\t\t\telif len(b)>0:\n\t\t\t\ts.append(\"b\")\n\t\t\t\tb=b[1:]\t\t \n\t\t\telse:\n\t\t\t\ts.append(\"r\")\n\t\t\t\tr=r[1:]\n\t\tturn-=1\ns=''.join(s)\n# print s\ns_back=s\nwhile s.count('rr')>0:\n\tvas+=s.count('rr')\n\ts=s.replace('rr','r')\n\t# print s,vas\nwhile s.count('bb')>0:\n\tvas+=s.count('bb')\n\ts=s.replace('bb','b')\n\t# print s,vas\n# print s_back\npet+=s_back.count('br')\npet+=s_back.count('rb')\na2=[vas,pet]\nfor i in max(a1,a2):\n\tprint i,", "lang": "Python 2", "bug_code_uid": "53cdde862a350a6893461b6dd6886fa5", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "8806262d32c4971c715f300d6348676b", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.04355108877721943, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "def f(L,n):\n\ti = n-1\n\tif i==0:\n\t\treturn L*c[0]\n\tv1 = f(L,n-1)\n\tv2 = (L+l[i]-1)//l[i]*c[i]\n\tv3 = L//l[i]*c[i] + f(L%l[i],n-1)\n\treturn min(v1,v2,v3)\n\nn, L = map(int, input().split())\nc = list(map(int, input().split()))\nl = [2**i for i in range(n)]\nprint(f(L,n))", "lang": "Python 3", "bug_code_uid": "a7c2a33c41cebba2c892b242e3365661", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "d9ae72d11054323b01e3f9e42c17a3e3", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09223300970873786, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "import itertools\nfrom itertools import combinations\nn, k = [int(x) for x in input().split()]\ns = input()\na = []\n\ni = len(s)\nb = set()\nwhile i >= 0:\n h = list(combinations(s, i))\n for j in h:\n if j not in b:\n if(len(b) < k):\n b.add(j)\n else:\n break\n i -= 1\n\n\nif len(b) < k:\n print(-1)\nelse:\n sum = 0\n for i in b:\n sum = sum + n - len(i)\n print(sum)\n", "lang": "Python 3", "bug_code_uid": "ad7247eed6598a1ee22273f6e9735e96", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "apr_id": "7f5123834867ddda7074317b19ffeca9", "difficulty": 2000, "tags": ["graphs", "dp", "implementation", "shortest paths"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8310344827586207, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import re\n\npassword = input()\ncodes = {}\n\nfor i in range(0, 10):\n code = input()\n codes[code]= i\n\npassword = \"\"\n\nwhile len(password) < 8:\n for code in codes:\n if re.search(\"^\"+code, password):\n password += codes[code]\n\nprint(password)", "lang": "Python 3", "bug_code_uid": "a87d108aab4356b3ba8734d5d7ee41a4", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "f9e94c881c14879e6c229fe1d8f9fea5", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6034285714285714, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nx = [int(input()) for i in range(n)]\nfor i in range(n):\n #3, 7\n if x[i] % 3 == 0 or x[i] % 7 == 0:\n print(\"YES\")\n else:\n k = 1\n k1 = 1\n while True:\n while True:\n if 3 * k + 7 * k1 == x[i]:\n print(\"YES\")\n break\n if 3 * k + 7 * k1 >= x[i]:\n print(\"NO\")\n break\n k1 += 1\n k += 1\n \n", "lang": "Python 3", "bug_code_uid": "585e4366a6de1d9921931083e9a2dcef", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "c892ab49aa158562727afa93ce5d466f", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9624413145539906, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "a=input()\nb=input()\nc=str(int(a)+int(b))\naa,bb,cc='','',''\nfor i in a: if i!='0': aa+=i\nfor i in b: if i!='0': bb+=i\nfor i in c: if i!='0': cc+=i\nif int(aa)+int(bb)==int(cc): print(\"YES\") else: print(\"NO\")", "lang": "Python 3", "bug_code_uid": "d4c53ef04a7ad8c75a0d4e3fbdc5eec6", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "5c59c2fe4c6c2e7abd02c806addc4cef", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9441233140655106, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = int(raw_input())\nx = 1\nc = n - 1\nd = {tuple(): 0}\ndef do(l):\n if tuple(l) in d: return d[tuple(l)]\n c = set()\n for x in l:\n r = list(l)\n t = x\n while t <= l[-1]:\n if t in r: r.remove(t)\n t += x\n c.add(do(tuple(r)))\n for i in xrange(100):\n if i not in c:\n d[tuple(l)] = i\n return i\n#y = [do(range(1, i+1)) for i in xrange(1, 30)]\n#print y\ny = [0, 1, 2, 1, 4, 3, 2, 1, 5, 6, 2, 1, 8, 7, 5, 9, 8, 7, 3, 4, 7, 4, 2, 1, 10, 9, 3, 6, 11, 12]\nfor i in xrange(2, 10 ** 5):\n if i * i > n: break\n j = int(i ** 0.5 + 1e-8)\n if j * j == i: continue\n j = i\n t = 0\n while j <= n:\n t += 1\n j *= i\n x ^= y[t]\n c -= t\nx ^= c & 1\nprint \"Vasya\" if x else \"Petya\"\n", "lang": "Python 2", "bug_code_uid": "d51a5297d983960547a42024c7038380", "src_uid": "0e22093668319217b7946e62afe32195", "apr_id": "9cc3604695b39713cafd7bb67b49eebd", "difficulty": 2300, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6419753086419753, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "n = int(input())\ns = list(map(int,input().split()))\nr = sum(s)-n\nif n<=2\"\n if(r%2==0):\n print(3)\n else:\n print(2)\nelse:\n print(n-1)", "lang": "Python 3", "bug_code_uid": "c7b60752ad505ff580052c1eed90146f", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "d5e8753ff30642854c03405d723915d3", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9984472049689441, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,p = [],[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499]\nfor i in range(0, len(p)):\n\tfor j in range(i+1, len(p)):\n\t\tk = 1\n\t\twhile p[j]*(p[i]**k) < 3000: \n\t\t\tl = 1\n\t\t\twhile (p[i]**k)*(p[j]**l) < 3000:\n\t\t\t\ta.append((p[i]**k)*(p[j]**l))\n\t\t\t\tl+=1\n\t\t\tk+=1\na, i, x= sorted(set(a)), 0, int(input())\nwhile i < len(a) x >= a[i]: i+=1\nprint(i)", "lang": "PyPy 3", "bug_code_uid": "a6138f388c7fa9a110d5478b36e4716b", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "7ecc5b1b09381636702072b1525e6c3d", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9466292134831461, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "# -*- coding: utf-8 -*-\nimport os\nimport re\nimport math\nimport nltk\nimport json\n\nn = input()\na = map(int, raw_input().split())\nif n == 1:\n if a[0] == 0:\n print \"UP\"\n elif a[0] == 15:\n print \"DOWN\"\n else:\n print \"-1\"\nelif a[n-1] == 0:\n print \"UP\"\nelif a[n-1] == 15:\n print \"DOWN\"\nelif a[n-2] > a[n-1]:\n print \"DOWN\"\nelse:\n print \"UP\"\n", "lang": "Python 2", "bug_code_uid": "f1636030d549b263192fb54fdb05d7e9", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "16caf1a4362241a81bb5198593e0b1db", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9917936694021102, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "r = dict()\nsb = 0\nsw = 0\nr['Q'] = r['q'] = 9\nr['B'] = r['b'] = 3\nr['K'] = r['k'] = 0\nr['N'] = r['n'] = 3\nr['p'] = r['P'] = 1\nr['R'] = r['r'] = 5\n\ns1 = 'prqkbn'\ns2 = s1.upper()\n\nfor i in range(8):\n t = input()\n for k in t:\n if k in s1:\n sb += r[k]\n else:\n if k in s2:\n sw += r[k]\nif sw == sk:\n print('Draw')\nelse if sw > sk:\n print('White')\nelse:\n print('Black')\n", "lang": "Python 3", "bug_code_uid": "75acefcf3f94e1c8d2fe2f06d2e1869a", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "599d741e6fd127b628fb227d80178e79", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.22784810126582278, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "(a, b) = [i for i in raw_input().split()]\nif len(a) < len(b):\n\tprint b\nelif len(a) > len(b):\n\tprint a[:len(a) - len(b)] + b\nelse:\n\tprint 10 ** len(b) + int(b)\n", "lang": "Python 2", "bug_code_uid": "b6b921b24ba607bec557f5dae8ce0835", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "aa7e4f100c42cc51b83d3dbbe5a8dfad", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.45685279187817257, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "from _collections import defaultdict\nn,m = list(map(int,input().split()))\na =defaultdict(int)\nfor i in range(1,n+1):\n f = abs(i-m)\n for j in range(1,n+1):\n b = abs(i-j)\n if b y:\n\t\treturn y\n\telse:\n\t\treturn x\n\ndef Abs(x):\n\tif x > 0:\n\t\treturn x\n\telse:\n\t\treturn -x\n\ndef solve(x,y):\n\tif x == i and y == j:\n\t\treturn 0\n\tif x <= a and x+a > n:\n\t\treturn INF\n\tif y <= b and y+b > m:\n\t\treturn INF\n\ttx = Abs(x-i)\n\tty = Abs(y-j)\n\tif tx%a == 0 and ty%b == 0 and Abs(tx//a - ty//b)%2 == 0:\n\t\tif tx/a > ty/b:\n\t\t\treturn tx/a\n\t\telse:\n\t\t\treturn ty/b\n\treturn INF\n\nans = INF\nans = mini(ans,solve(1,1))\nans = mini(ans,solve(1,m))\nans = mini(ans,solve(n,1))\nans = mini(ans,solve(n,m))\n\nif ans == INF:\n\tprint 'Poor Inna and pony!'\nelse:\n\tprint ans", "lang": "Python 2", "bug_code_uid": "9afaa5dcef43a1915fcb2481e76179a5", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "7fe827b1e7ff4ade3e55c4bed2bf9455", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.21765913757700206, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "# -*- coding: utf-8 -*-\n\nfrom itertools import islice, izip\nfrom collections import Counter\n\n\nif __name__ == '__main__':\n n, t = map(int, raw_input().split())\n a = map(int, raw_input().split())\n r = a * min(n, t)\n d = [1]\n for i in islice(r, 1, None):\n d.append(max(v + 1 if j <= i else 1 for j, v in izip(r, d)))\n l = max(d)\n if t < n:\n print l\n else:\n counts = Counter(a)\n print l + (t - n) * max(counts.itervalues())\n\n\n", "lang": "Python 2", "bug_code_uid": "6931bebfb809b8f3afef2d486dfc3591", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "76a9c6f558a2f4374356b4fa8a640d44", "difficulty": 1900, "tags": ["dp", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.35125448028673834, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "# -*- coding: utf-8 -*-\nimport sys,math,heapq,itertools as it,fractions,re,bisect,collections as coll\n\nn, T = map(int, raw_input().split())\na = map(int, raw_input().split())\na = a * min(T, 200)\nm = len(a)\nnums = [1] * m\nfor i in xrange(m - 1, -1, -1):\n tmp = 0\n for j in xrange(i + 1, min(m, i + 1 + 2 * n)):\n if a[j] >= a[i]:\n tmp = max(tmp, nums[j])\n nums[i] += tmp\n\nif T <= 200:\n print max(nums)\nelse:\n ans = 0\n for i in xrange(n):\n ans = max(ans, nums[i] + (nums[i] - nums[i + n]) * (T - 200))\n print ans\n", "lang": "Python 2", "bug_code_uid": "94ae5c48c3a5d4c0438e268d770a3fb1", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "ea3dddee751b23d4acd58cd0c4375bb2", "difficulty": 1900, "tags": ["dp", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.997002997002997, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "trash, n = [int(x) for x in input().split()]\nx = [str(x) for x in input().split()]\ns = list(x[0])\ndone = False\nfor i in range(len(s)):\n if s[i] == 'T' or s[i] == 'G':\n for j in range(i+n, len(s), n):\n if s[j] == 'T' or s[j] == 'G':\n print('YES')\n done = True\n break\n if s[j] == '#':\n print('NO')\n done = True\n break\n if done:\n break\nif not done:\n print('NO)", "lang": "PyPy 3", "bug_code_uid": "440845bab50f3b67b7bf17b19113b501", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "a584fd6c1ef8b22ae3897f8990029e34", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9853181076672104, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\n\nelements = list(map(int, input().split()))\n\nif len(elements) != n:\n raise ValueError(\"wrong element number\")\n\nindices = []\n\nfor i, element in enumerate(elements):\n if element in (1, n):\n indices.append(i)\n\nprint(indices[1] - indices[0] + max(indices[0] - 1), (n - indices[1]))", "lang": "Python 3", "bug_code_uid": "ba373b19d4f12f1fa89309dbef2e1297", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "8ddc5f8ca33f89c27bdf148cec2b96d1", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9829059829059829, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b=map(int,input().split())\nfrom collections import defaultdict\nfrom math import gcd\na,b=min(a,b),max(a,b)\nif b%a==0:\n print(0)\nelse:\n d=b-a\n d1=defaultdict(int)\n l=[]\n for i in range(1,d+1):\n if i**2<=d:\n if d%i==0:\n if i!=d//i:\n l.append(i)\n l.append(d//i)\n else:\n l.append(i)\n ans=1000000000000000000\n for i in l:\n x=a//i\n if a%i!=0:\n x+=1\n y=x*i-a\n if (b+y)%(a+y)==0:\n ans=min(ans,b+y)\n z=b+y\n if d1[z]!=0:\n d1[z]=min(y,d1[z])\n else:\n d1[z]=y\n x=a//d\n if a%d!=0:\n x+=1\n k=x*d-a\n lcm=((a+k)*(b+k))//gcd(a+k,b+k)\n if lcmans:\n print(d1[ans])\n else:\n print(min(k,d1[ans]))\n \n \n \n \n", "lang": "PyPy 3", "bug_code_uid": "8f0942a2e6d2ff2e0629d5fbe88fb9f4", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "aa8d58c970e9c6576aebc18920396b79", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9342560553633218, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "s = input().strip()\n\nj = 3\nif s[0] == 'h':\n j = 4\n\ni = j\nk = 0\nwhile i < len(s):\n if k > 0 and s[i] == 'r' and s[i + 1] == 'u':\n break\n i += 1\n k = 1\n\nif i + 2 == len(s):\n print s[:j] + \"://\" + s[j:i] + \".ru\"\nelse:\n print s[:j] + \"://\" + s[j:i] + \".ru/\" + s[i+2:]", "lang": "Python 3", "bug_code_uid": "9cd13317145211344d0dd254122fcc09", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "507cc01249634cc45a55589f38546cf3", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9979296066252588, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\na = sorted(list(map(int, input().split())))\nb = []\ncount = 1\nif n==1:\n\tprint(\"1\")\nelse:\n\tfor i in range(n-1):\n\t\tif a[i]==a[i+1]:\n\t\t\tcount+=1\n\t\telse:\n\t\t\tb.append(count)\n\t\t\tcount=1\n\t\tif i==n-2\n\t\t\tb.append(count)\n\tprint(max(b))", "lang": "Python 3", "bug_code_uid": "c9f037e39132ba94850089e8f7026a5c", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "39ddc35888365c461a718a508be51ad8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8615384615384616, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "s = 'bcdfghjklmpqrstvwxz'\ng = 'aeiouyn'\nn = input()\nfor i in range(len(n)-1):\n if n[i] in s:\n if n[i+1] in s or n[i+1]=='n':\n print('NO')\n exit(0)\n if i+1=len(n) and n[i+1] in s:\n print('NO')\n exit(0)\nprint('YES')\n \n", "lang": "Python 3", "bug_code_uid": "87328d79bed3b72b1e37a9f2df56f1bf", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "95a5489adc308767dcfa4bb9a1bbc483", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9951690821256038, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k, t = map(int, input().split())\nif t < k:\n print(t)\nelif t < n:\n print(k)\nelse\n print(n + k - t)", "lang": "Python 3", "bug_code_uid": "8a7f8cf44322b30763326b926fb66479", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "995e6aa540b06d36bf2e62dd95801552", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8876404494382022, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "n=open(0)\nn=int(n)\nresult=(4**(n-3))*24+(n-3)*(3**2)*4*(4**(n-4))\nprint(result)", "lang": "Python 3", "bug_code_uid": "008dced0e9d0cb7b94d62d9a4be989b8", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "c5275c0e4e3e443b752ea474018c212e", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.22522522522522523, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\n\npackets = [i for i in range(1, n+1)]\n\nres = 0\nfor i in range(1, n+1):\n m = sum(packets[:i])\n if m >= n:\n res = len(packets[:i])\n break\nprint(res)\n", "lang": "Python 3", "bug_code_uid": "0d33f8706bd45b2f0c9ba297ba1b82d6", "src_uid": "95cb79597443461085e62d974d67a9a0", "apr_id": "00980a8d33d2b7db203a5b5b144679d9", "difficulty": 1300, "tags": ["math", "constructive algorithms", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19723865877712032, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "def reading(pages, speed, max_speed, busting, fee):\n pages -= speed\n days = 1 #first day\n is_reached = False\n while (pages > 0):\n if is_reached == False:\n pages -= speed - fee + (days - 1)*busting\n days += 1\n else:\n pages -= speed - fee + (days - 1)*busting\n return days\nd = input()\na,b,c,f,e = d.split(',')\nprint (reading(int(a),int(b),int(c),int(f),int(e)))\n\n", "lang": "Python 3", "bug_code_uid": "1c11e11b793c66824e1a9bdba73f6dcb", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "6562cf17894eb2cb8f32c002e4a5e388", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9130772819157207, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#------------------------------what is this I don't know....just makes my mess faster--------------------------------------\nimport os\nimport sys\nfrom io import BytesIO, IOBase\n \nBUFSIZE = 8192\n \nclass FastIO(IOBase):\n newlines = 0\n \n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n \n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n \n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n \n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n \n \nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\n \n \nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n \n#----------------------------------Real game starts here--------------------------------------\n'''\n \n \n___________________THIS IS AESTROIX CODE________________________\n KARMANYA GUPTA\n \n'''\n#_______________________________________________________________#\nimport math\ndef fact(x):\n\tif x == 0:\n\t\treturn 1\n\telse:\n\t\treturn x * fact(x-1)\ndef lower_bound(li, num): #return 0 if all are greater or equal to\n\tanswer = -1 \n\tstart = 0\n\tend = len(li)-1\n\n\twhile(start <= end):\n\t\tmiddle = (end+start)//2\n\t\tif li[middle] >= num:\n\t\t\tanswer = middle\n\t\t\tend = middle - 1\n\t\telse:\n\t\t\tstart = middle + 1\n\treturn answer #index where x is not less than num\ndef upper_bound(li, num): #return n-1 if all are small or equal\n\tanswer = -1\n\tstart = 0\n\tend = len(li)-1\n\n\twhile(start <= end):\n\t\tmiddle = (end+start)//2\n\n\t\tif li[middle] <= num:\n\t\t\tanswer = middle\n\t\t\tstart = middle + 1\n\t\t\n\t\telse:\n\t\t\tend = middle - 1\n\treturn answer #index where x is not greater than num\ndef abs(x):\n\treturn x if x >=0 else -x\n#_______________________________________________________________#\n\n\n\nfor t in range(1):\n\tstring = [1]\n\tn, k = list(map(int, input().split()))\n\tcnt = 2\n\tfor i in range(n-1):\n\t\ttemp = string[:]\n\t\t#print(temp)\n\t\ttemp.insert(0, cnt)\n\t\tstring += temp\n\t\tcnt += 1\n\t\t#print(string)\n\tprint(string[k-1])\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "ab6481521531bea04f65b4ddc930296c", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "27c0bcd4ffb7705f098b121fd629f800", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5236363636363637, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "n,k = list(map(int,input().split()))\ncnt = 1\nans = ''\nfor i in range(n):\n ans = ans+' '+str(cnt)+' '+ans\n cnt+=1\n# print(ans.lstrip().rstrip())\narr = ans.split()\nprint(arr[k-1])", "lang": "PyPy 3", "bug_code_uid": "b66fcca95bb8f3270326a2325fbae428", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "83fc5cbcfc490c8deea95fe885771877", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.037422037422037424, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n,k=map(int,input().split())\n\nl=[1]\nfor i in range(n-1):\n l+=l\n l.insert(len(l)//2,i+2)\n# print(l)\nprint(l[k-1])", "lang": "PyPy 3", "bug_code_uid": "8215118c8f8d850f333fcfaa97a98abd", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "a3279d6d36b625736e7073287560cc61", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.43956043956043955, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "n,z=map(int,input().split())\nl=[1]\nk=2\nfor i in range(n-1):\n x=len(l)\n l.append(k)\n k+=1\n for j in range(x):\n p=l[j]\n l.append(p)\nprint(l[z-1])", "lang": "PyPy 3", "bug_code_uid": "97567613846cfe44a59a769a483365a8", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "6cdf6332569cfb3ae4e472c36d7aad43", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.14696485623003194, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#author: dokueki\n\n\n# import sys\n# sys.stdin = open('./input.in.txt', 'r')\n# sys.stdout = open('./output.out.txt', 'w')\n\n\nn, k = map(int, input().split())\nhash_map = {}\nflag = False\nfor i in range(51):\n hash_map[i] = []\nlength = (2**n)-1\nif k == (length//2)+1:\n print(n)\nelse:\n for i in range(2, n):\n grab = (2**(i-1)-1)\n while grab < (2**n)-1:\n hash_map[i].append(grab+1)\n grab += 2**i\n # hash_map[i].append(grab+1)\n# print(hash_map)\n ans = []\n for key, v in hash_map.items():\n if k in v:\n ans.append(key)\n # print(ans)\n if len(ans):\n print(ans[0])\n else:\n print(1)\n", "lang": "PyPy 3", "bug_code_uid": "3751633be3cfcc8fe1f34badeb73f24f", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "61d39439ac29ffb8dd3036d405c92542", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6408839779005525, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "n,k=map(int,input().split())\na=[1]\nb=2\nfor i in range(n-1):\n a=a+[b]+a\n b+=1\nprint(a[k-1])", "lang": "PyPy 3", "bug_code_uid": "ed96272455ef593979c048ee02299329", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "cce99e46134ed6979b07b7b88b435bf5", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5233644859813084, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "n,k=map(int,input().split())\nl=[1]\nfor i in range(1,n):\n l1=l\n l.extend(l)\n l.insert(len(l)//2,i+1)\nprint(l[k-1])\n", "lang": "PyPy 3", "bug_code_uid": "bcd68313a5f496778ac5e4580f61cfb2", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "e7e6d3b8b34f0b446e382ba7d8e4730b", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5060240963855421, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "n,k = map(int,input().split())\narr = [1]\nmax = 1\nfor i in range(n):\n arr.append(max+1)\n max+=1\n for j in arr[0:-1]:\n arr.append(j)\nprint (arr[k-1])\n", "lang": "PyPy 3", "bug_code_uid": "2b91f9846d18dc4d4f94eebe4f5fd8fc", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "00bf99c5ce2c10f3c9573fd2e1ad43d6", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6040816326530613, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "\nn , k = map(int,input().split())\n\nl = [1]\n\nfor i in range(n - 1):\n l = l + l\n l.insert(len(l)//2 , max(l) + 1 )\n\n\n#print(l)\nprint(l[k-1])\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "080f2b81012d91c1d75489345bd2ce96", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "05d409c1be1230dd2a9f1af7e0ee4887", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.18658892128279883, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,k = map(int,input().split())\nseq = [1]\ncounter = 2\nfor i in range(n):\n seq = seq+[counter]+seq\n counter+=1\nprint(seq[k-1])", "lang": "PyPy 3", "bug_code_uid": "1326d70dc79efd7e583091940b499aac", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "55dbf067d3e670e76593ea95b4f9e71c", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9800443458980045, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,d = list(map(int,input().split()))\nword = input()\nif \"0\"*d in word:\n\tprint(-1)\nelse:\n cnt=0\n i=0\n while i 0 and b > 0: \n a, b = max(a, b) - min(a, b), min(a, b) \n count += 1\n\nprint(count)\n", "lang": "Python 3", "bug_code_uid": "decc0048ccb7469df6f57342260ffc02", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "2c2b321dee8218344b24cb4493237ef3", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.959937156323645, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\nimport math\n\n\n##sys.stdin = open('input.txt', 'r')\n\nw, b = map(int, raw_input().split())\n\ndp = [[2.0 for i in xrange(b + 1)] for j in xrange(w + 1)]\n\n#print dp\n\ndef DP(wi, bi, dp):\n if 0 == wi:\n return 0\n ans = float(wi) / (wi + bi)\n if 0 == bi or 1 == bi:\n dp[wi][bi] = ans\n return ans\n\n s = float(bi) / (wi + bi) * float(bi - 1) / (wi + bi - 1)\n ans += s * (float(wi) / (wi + bi - 2) * DP(wi - 1, bi - 2, dp))\n if bi > 2:\n ans += s * float(bi - 2) / (wi + bi - 2) * DP(wi, bi - 3, dp)\n dp[wi][bi] = ans\n return ans\n\nans = DP(w, b, dp)\n\nprint ans\n", "lang": "Python 2", "bug_code_uid": "ebc0ef2dec6782584b69da7a7903abc8", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "90cb54495a552d0e6c4538bf049ebdd7", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5703422053231939, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = input()\n\na = n[0]\nb = n[1]\nc = n[2]\nd = n[3]\ne = n[4]\n\nn = a+c+e+d+b\nn = int(n)\n\nans = (n**5)%100000\n\nif(ans<10) ans = \"0000\" + str(ans)\nif(ans<100) ans = \"000\" + str(ans)\nif(ans<1000) ans = \"00\" + str(ans)\nif(ans<10000) ans = \"0\" + str(ans)\n\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "2dd1bf98b658b6e3407a3d5240baffad", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "e2add0a7093a99f60a2cfe58ec1fa770", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9401273885350319, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "# print (\"Input n\")\nn = int(input())\n\n# print (\"Input the first soldiers cards (number then values)\")\nonecards = input().split()\nonecards.pop(0)\nfor i in range(len(onecards)):\n onecards[i] = int(onecards[i])\n\n# print (\"Input the second soldiers cards (number then values)\")\ntwocards = input().split()\ntwocards.pop(0)\nfor i in range(len(twocards)):\n twocards[i] = int(twocards[i])\n\nstartone = []\nfor i in range(len(onecards)):\n startone.append(onecards[i])\nonelength = len(startone)\n\nstarttwo = []\nfor i in range(len(twocards)):\n starttwo.append(twocards[i])\ntwolength = len(starttwo)\n\nplays = 0\nwhile True:\n cone = onecards.pop(0)\n ctwo = twocards.pop(0)\n if (cone > ctwo):\n onecards.append(ctwo)\n onecards.append(cone)\n else:\n twocards.append(cone)\n twocards.append(ctwo)\n plays = plays + 1\n if (len(twocards) == 0):\n print (str(plays) + \" 1\")\n break\n if (len(onecards) == 0):\n print (str(plays) + \" 2\")\n break\n if ((onecards == startone and twocards == starttwo) or plays > math.factorial(10)):\n print (-1)\n break\n\n \n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "e5e40485a3967a6a8710c1ec1d02e88f", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "41755405f83a4076b6cb583553b8dd98", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9601593625498008, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "N,P,T = raw_input().split()\nn = int(N)\nt = int(T)\np = float(P)\nq = 1-p\na = [0 for i in xrange(t+1)]\nb = [0 for i in xrange(t+1)]\nfor j in xrange(1,t+1):\n for i in xrange(1,t+1):\n b[i] = p*(1+a[i-1]) + q*a[i]\n a = b[:]\nprint a[n]", "lang": "Python 2", "bug_code_uid": "5c9cc037cf4de6e5978fba1c423ccd9d", "src_uid": "20873b1e802c7aa0e409d9f430516c1e", "apr_id": "72c0bf724422807b7251e8191d8b9d3d", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "probabilities"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3500931098696462, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "def comb1(n, r):\n if n == 0 or r == 0: return 1\n return comb1(n, r-1)*(n-r+1)/r\n\nn,p,t = raw_input().split()\nn,p,t = int(n),float(p),int(t)\nq=1-p\nans=0\nfor m in xrange(0,t+1):\n if t-m<=n:\n ans+=(t-m)*comb1(t,m)*p**(t-m)*q**m\n else:\n ans+=n*comb1(t,m)*p**(t-m)*q**m\nprint ans", "lang": "PyPy 2", "bug_code_uid": "994c0c899cb864b4a8ed6a928e75e74c", "src_uid": "20873b1e802c7aa0e409d9f430516c1e", "apr_id": "34e8092385ea469df2c638da1bc1291b", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "probabilities"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9112107623318386, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 11, "bug_source_code": "'''\n Sample Input\n\n 5 1 2 1 2 \n Len char, timetype 1, timetype 2, ping 1, ping 2 \n'''\n\n\ndef calculate(total1, total2):\n if total1 < total2:\n print('First')\n elif (total1 > total2):\n print('Second')\n else:\n print('Friendship')\n\n\nif __name__ == '__main__':\n\n fileInput = raw_input()\n file_numbers = fileInput.split()\n\n total1 = file_numbers[1] + file_numbers[3]\n total2 = file_numbers[2] + file_numbers[4]\n\n calculate(total1, total2)\n\n sys.exit(0)\n", "lang": "Python 2", "bug_code_uid": "b3041796b6dbc0c85c380254f803c39c", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "275d36679ad606256b843833318ef422", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5318471337579618, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "print(['', 'Washington', ' Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buc", "lang": "Python 3", "bug_code_uid": "0c5fb74ee91c3d799c0f19be131cc73a", "src_uid": "0b51a8318c9ec0c80c0f4dc04fe0bfb3", "apr_id": "7840e6e0bd496760fcaf45d9d40312e9", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6383430695698353, "equal_cnt": 27, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 19, "fix_ops_cnt": 27, "bug_source_code": "def arrayPrint(a):\n s = ''\n for i in a:\n s += str(i) + ' '\n return s[0:len(s)-1]\n\n\ns = raw_input()\n\nj = 0\nbasic = {}\nfor i in range(10):\n basic[str(i)] = i\nfor i in range(65,90):\n basic[ chr(i) ] = len(basic)\na = ''\nfor i in s:\n if i != ':':\n if (len(a) == 0 and i == '0') == 0:\n a = a + i\n j += 1\n else:\n break\n\nb = s[j + 1:len(s)]\nj = 0\nfor i in b:\n if i == '0':\n j += 1\n else:\n break \n\nb = b[j:len(b)]\nif len(a) == 0:\n a = '0'\nif len(b) == 0:\n b = '0' \n\n\nif (len(a) <= 1 and len(b) <= 1):\n print -1\nelse:\n minbas = max(basic[max(a)],basic[max(b)]) + 1\n aa = []\n basa = minbas\n sum = 0\n if a != '0':\n while sum < 24:\n sum = 0\n j = len(a) - 1\n for i in a:\n sum += basic[i]*(basa**j)\n j -= 1\n if sum < 24:\n aa.append(basa) \n basa += 1 \n \n basa = minbas\n sum = 0\n bb = []\n if b != '0':\n while sum < 60:\n sum = 0\n j = len(b) - 1\n for i in b:\n sum += basic[i]*(basa**j)\n j -= 1\n if sum < 60:\n bb.append(basa) \n basa += 1 \n if a == '0':\n c = bb\n else:\n if b == '0':\n c = aa\n else: \n c = list(set(bb) & set(aa)) \n if len(c) == 0:\n print 0\n else:\n print arrayPrint(c)", "lang": "Python 2", "bug_code_uid": "19872312db53ae52d94e5d92464a3162", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "b537de5f815474fef4e9264334ac52e0", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5838926174496645, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "a, b = map(int, input().split())\nl = list(set(range(1, b + 1)).difference(set(range(1, a + 1))))\nn = 1\nfor num in l:\n n *= num % 10\n n %= 10\nprint(n)\n\n", "lang": "Python 3", "bug_code_uid": "3e75a331ff10a5a61677ff8072e6a19c", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "48446b88879505c262ce8418d531b2f1", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9795158286778398, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a=raw_input()\nb=raw_input()\nc=list(b)\nd=len(b)-1\nj=0\nfor i in range(0,int(a[2])):\n while jd3 and a2>a4) and (d1>d4 and a2>a3)) or (d2>d3 and a1>a4 and d2>d4 and a1>a3):\n\tprint(\"Team 1\")\nelif ((d1 Team2[0] and Team1[1] > Team2[1]:\n ret = \"Team 1\"\n pass\n elif Team2[0] > Team1[0] and Team2[1] > Team1[1]:\n ret = \"Team 2\"\n pass\n else:\n ret = \"Draw\"\n ans.append(ret)\nret = \"\"\nfor i in range(2):\n if ans[i * 2] == ans[i * 2 + 1] == 'Team 1':\n ret = \"Team 1\"\nfor i in range(2):\n if ans[i * 2] == 'Team 2' or ans[i * 2 + 1] == 'Team 2':\n continue\n break\nelse:\n ret = \"Team 2\"\nif ret:\n print ret\nelse:\n print \"Draw\"\n", "lang": "Python 2", "bug_code_uid": "945edb106fd599b07c09839bc4f3addd", "src_uid": "1a70ed6f58028a7c7a86e73c28ff245f", "apr_id": "9660b89c980f5183559a3b366bebe722", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9871794871794872, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nc=0\nfor v in range(1:n+1):\n if n%v==0:\n c+=1\nprint(c-1)", "lang": "PyPy 3", "bug_code_uid": "b9516536e09862e37ef61ff0ff37a509", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "43184600d8b4f08a3e83d294619566c2", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3456, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "n, d, *_ = map(int, input().split())\n*x, = map(int, input().split())\n\n\nx.sort()\n\ndef solve(x, d):\n\tif x[-1] - x[0] <= d:\n\t\treturn 0\n\telse:\n\t\treturn min(solve(x[:-1], d), solve(x[1:], d)) + 1\n\nprint(solve(x, d))\n", "lang": "Python 3", "bug_code_uid": "97882641ab8be7b7438f2581d026f35b", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "d990e3ad594977ed259176a0d83c279c", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9979123173277662, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "p=input().split()\nn=int(p[0])\nk=int(p[1])\np=input().split()\nm=0\nfor i in range(n):\n p[i]=int(p[i])\nfor i in range(k):\n o=p[:]\n j=i\n while jm:\n m=x\nprint(m)", "lang": "Python 3", "bug_code_uid": "984252bdfcea4cd89d764c3dbbf4d82b", "src_uid": "6119258322e06fa6146e592c63313df3", "apr_id": "ccee33efe8e6e99ba2dbfe55149ac054", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5379876796714579, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n,m = map(int,raw_input().split());\nmod = 10**9 + 7;\n\nans = pow(2*m - 1,n,mod)\nans -= pow(m,n,mod);\nans *= m; ans %= mod;\nans *= pow(m-1,mod - 2,mod); ans %= mod;\nans += pow(m,n,mod);\nans = (ans%mod + mod)%mod;\nprint ans;", "lang": "PyPy 2", "bug_code_uid": "3d978dbc24c7a02ecce7aef8a482543a", "src_uid": "5b775f17b188c1d8a4da212ebb3a525c", "apr_id": "71e675858694ce6f3836488c53dbe832", "difficulty": 2300, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7378435517970402, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import math\n\ndef euclid_algorithm(a, b):\n t1, t2 = abs(a), abs(b)\n #saving equalities:\n #t1 == x1 * a + y1 * b,\n #t2 == x2 * a + y2 * b. \n x1, y1, x2, y2 = int(math.copysign(1, a)), 0, 0, int(math.copysign(1, b))\n if t1 < t2:\n t1, t2 = t2, t1\n x1, y1, x2, y2 = x2, y2, x1, y1\n\n while t2 > 0:\n k = int(t1 // t2)\n t1, t2 = t2, t1 % t2\n #t1 - k * t2 == (x1 - k * x2) * a + (y1 - k * y2) * b\n x1, y1, x2, y2 = x2, y2, x1 - k * x2, y1 - k * y2\n\n return t1, x1, y1\n\ndef opposite_element(x, p):\n gcd, k, l = euclid_algorithm(x, p)\n if gcd != 1:\n return -1\n return k % p\n\np = 10 ** 9 + 7\nn, m = [int(x) for x in input().split()]\nS = pow(m, n, p)\nk = opposite_element(m, p)\nl = (2*m - 1) * k % p\nq = opposite_element(l - 1, p)\nS += pow(m, n, p) * (pow(l, n, p) - 1) * q\nS %= p\nprint(S)\n", "lang": "PyPy 3", "bug_code_uid": "90fa15d33c48689365616156d59f81ba", "src_uid": "5b775f17b188c1d8a4da212ebb3a525c", "apr_id": "f64e7234debfc6321c0f5cf857afcbc6", "difficulty": 2300, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.940279542566709, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "number,k = input().split(' ')\n\nif(len(number)<=int(k)):\n print(len(number)-1)\nelse:\n countZero = 0\n countDelete = 0\n for i in range(1,len(number)+1):\n if(countZero==int(k)):\n break\n if(number[-i]=='0'):\n countZero+=1\n else:\n countDelete+=1\n if(len(number)-(countDelete)b else A(i,b))*(0 if n-i>w else A(n-i,w))*(n-1-i)%B for i in range(1,n-1))%B\n", "lang": "Python 2", "bug_code_uid": "6577d75ffe64c1e83ec261cb6688e6e3", "src_uid": "63e93a161bbff623323e66c98d5e20ac", "apr_id": "f9aa69d1ffce987dc919c76bd8e330a1", "difficulty": 2100, "tags": ["combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9921875, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,s = map(int, input().split())\na = list(map(int, input().split())\n\nif sum(a) - max(a) <= s:\n print(\"YES\")\nelse: print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "a4f0cda6a91216a9163d8f5b5643552d", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "d582db842579eef59646644492946202", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7654075546719682, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "n = int(raw_input())\nl = []\nunimod = False\n\nfor i in range(n):\n\tx= int(raw_input())\n\tl.append(x)\n\ni=0\nwhile(l[i+1]>l[i] and (i+1)< n):\n\ti = i+1\nif((i+1)==n):\n\tunimod = True\nelif(l[i+1]= 97 and i in x:\n a += x[i]\n else if i in x:\n b += x[i]\nif a == b:\n print(\"Draw\")\nelif a < b:\n print(\"White\")\nelse:\n print(\"Black\")", "lang": "PyPy 3", "bug_code_uid": "25f1a1597be8d8c47ef4f22d18266365", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "dac46953f13a9be3c26a8405df5b6311", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6984126984126984, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "a, b = map(int, input().split())\nret = 0\nwhile 1:\n if b > a:\n a, b = b, a\n elif a == b:\n break\n a -= b\n ret = ret + 1\nprint(ret + 1)", "lang": "Python 3", "bug_code_uid": "45d62ab3b6497ac75c03367c9867eb47", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "9287e8c58385d03312a85c41fb224cf9", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09037900874635568, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\ncounter = 0\nfor nol in range(n):\n p, q = map(int, input().split())\n c = q-p\n if c > 1:\n counter += 1\nprint(counter)", "lang": "PyPy 3", "bug_code_uid": "9a46ea3dd9a4e753b7cf6ab70073b50d", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "abec8ff9cea68336b2733cb2e5f48804", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.04065040650406504, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "import io\nimport os \ninput = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\nfrom types import GeneratorType \ndef bootstrap(f, stack=[]):\n def wrappedfunc(*args, **kwargs):\n if stack:\n return f(*args, **kwargs)\n else:\n to = f(*args, **kwargs)\n while True:\n if type(to) is GeneratorType:\n stack.append(to)\n to = next(to)\n else:\n stack.pop()\n if not stack:\n break\n to = stack[-1].send(to)\n return to \n return wrappedfunc\n\n\nfrom bisect import bisect_left \ndef solve():\n n, m = map(int, input().split())\n a = []\n for i in range(m):\n ai, bi = map(int, input().split())\n a.append((ai, bi))\n a.sort(key = lambda x: x[0])\n b = []\n presum = [0]\n for i in range(m):\n b.append(a[i][1])\n a[i] = a[i][0]\n presum.append(presum[-1]+a[i])\n ma = 0\n for i in range(m):\n s = a[i]\n ind = bisect_left(a, b[i])\n if m-ind>n-1:\n s+=presum[m]-presum[m-n+1]\n else:\n s+=presum[m]-presum[ind]\n s+=b[i]*(n-1-(m-ind))\n if ind<=i:\n if m-ind<=n-1:\n s-=a[i]\n s+=b[i]\n else:\n s-=a[i]\n s+=a[m-n]\n #print(s)\n if s>ma:\n ma = s\n print(ma)\ndef main():\n t = int(input())\n for i in range(t):\n solve()\n if i!=t-1:\n input()\nmain()", "lang": "PyPy 3", "bug_code_uid": "0310c466d84df55e3d344715b6edee1b", "src_uid": "e6dc3bc64fc66b6127e2b32cacc06402", "apr_id": "ab203709bfb34b8613324d3be5bd43b1", "difficulty": 1800, "tags": ["flows", "greedy", "math", "brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4669260700389105, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "def main():\n n, m, k = map(int, raw_input().split())\n if n + m < k + 2:\n print -1\n return\n if n < m:\n n, m = m , n\n result = max((m / 1) * (n / (k + 1)), (n / 1) * (m / (k + 1)))\n\n for x in range(2, min(k + 2, m + 1)):\n a = (n / x)\n b = (m / k - x) \n if a * b > result:\n result = a * b\n elif (n * m) / (x * (k + 2 - x)) < result:\n break\n print result\nmain()\n", "lang": "Python 2", "bug_code_uid": "3b2b292a601afaeb70f15201b480c5c4", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "56ac2277bec3087f3d9885aa4c740c50", "difficulty": 1700, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.909410729991205, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "from itertools import permutations\n\ndef dist(x, y):\n if x > y: x, y = y, x\n return min(y-x, x+12-y)\n\ndef solve(a, b, c):\n for x, y, z in permutations([a, b, c]):\n d1, d2, d3 = dist(x, y), dist(y, z), dist(x, z)\n if d1 == 3 and d2 == 4 and d3 == 12-7:\n return \"minor\"\n if d1 == 4 and d2 == 3 and d3 == 12-7:\n return \"major\"\n return \"strange\"\n\nfor i in [1, 2, 3]:\n a, b, c = map(lambda x: ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'B', 'H'].index(x), raw_input().split())\n print solve(a, b, c)\n", "lang": "Python 2", "bug_code_uid": "a0afa927931743d1deb46c833ed27b68", "src_uid": "6aa83c2f6e095848bc63aba7d013aa58", "apr_id": "7ec5d423e1580258fc8dd470f1bda289", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9183673469387755, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "x=input()\ny=input()\ni,cnt=0,0\nwhile ir1 or l2> r2):\n return 0\n if top==2:\n return 1\n if (l1>top):\n l1 -=top\n r1 -= top\n if (l2>top):\n l2-=top\n r2-=top\n #print(l1,r1,l2,r2,top)\n if (l1==l2 and r1==r2):\n return r1-l1+1\n if (l1==0 and r1==top-1):\n return r2-l2+1\n if (l2==0 and r2==top-1):\n return r1-l1+1\n if ( (l1<= l2 and l2<= r1) or (l2<= l1 and l1<= r2)):\n ans = min(r1,r2) -max(l1,l2) +1\n else:\n ans = 0\n #print(ans)\n top = top//2\n ans = max(ans, f(l1,min(r1,top-1),l2,min(r2,top-1), top))\n ans = max(ans, f(l1,min(r1,top-1),max(top+1,l2),r2, top))\n ans = max(ans, f(max(l1,top+1),r1, l2,min(r2,top-1), top))\n ans = max(ans, f(max(l1,top+1),r1, max(l2,top+1),r2, top))\n aaa = max(aaa,ans)\n return ans\n\na = input().split()\n\n\nprint(f(int(a[0]),int(a[1]),int(a[2]),int(a[3]),2**36))", "lang": "Python 3", "bug_code_uid": "bf49ecac7b1191ef86baee2fd171cb8c", "src_uid": "fe3c0c4c7e9b3afebf2c958251f10513", "apr_id": "bca908b6e09c2f4de485ed8d0125c897", "difficulty": 2400, "tags": ["divide and conquer"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5004035512510089, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "from itertools import *\n\nl1, r1, l2, r2 = map(int, raw_input().split())\nla = []\nlb = []\n\ndef foo(l, r, pv, li):\n if l > r or pv < 1:\n return\n while r < pv:\n pv /= 2\n while l > pv:\n l -= pv\n r -= pv\n li.append((l, r))\n if l < r:\n foo(l, pv - 1, pv / 2, li)\n foo(pv + 1, r, pv / 2, li)\n\npv = 2 ** 32\nfoo(l1, r1, pv, la)\nfoo(l2, r2, pv, lb)\n\nans = 0\n#print la\n#print lb\nfor a in la:\n for b in lb:\n if a == b:\n ans = max(ans, a[1] - a[0] + 1)\n else:\n ans = max(ans, min(a[1], b[1] - max(a[0], b[0])))\nprint ans\n", "lang": "Python 2", "bug_code_uid": "270052ab74d4ac0f12c4298fda70dfcd", "src_uid": "fe3c0c4c7e9b3afebf2c958251f10513", "apr_id": "1ae2907187a3209349d6725a708dcc1d", "difficulty": 2400, "tags": ["divide and conquer"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9397590361445783, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import string\nbase = raw_input().strip()\nres = set()\nfor i in range(len(base)+1):\n left, right = base[:i], base[i:]\n for photo in string.ascii_lowercase:\n res.add(left+photo+right)\nprint len(res)\n", "lang": "Python 3", "bug_code_uid": "afccf8e7822e5022cea007b6fee895ce", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "apr_id": "40e483d3dd9cd98e460e32b1726ab45a", "difficulty": 900, "tags": ["math", "brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9844357976653697, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\nm,a,b=map(int,(input().split()))\nvis=[-1]*(a+b+5)\nnow=0\nmaxd=0\nwhile True:\n vis[now]=maxd\n #print(now,maxd)\n if now>=b:\n now-=b\n else:\n now+=a\n if now==0:\n break\n maxd=max(maxd,now)\nans=0\n#for i in range(0,a+b):\n #print(vis[i])\nfor i in range(0,a+b):\n if vis[i]!=-1:\n ans+=max(0,m-vis[i]+1)\nrest=m-(a+b)+1\nif m>=a+b:\n g=math.gcd(a,b)\n tmp=(m//g-(a+b-1)//g)*g\n fir=rest-tmp\n lst=rest\n cnt=tmp//g+1\n ans+=(fir+lst)*cnt//2\nprint(int(ans))\n", "lang": "Python 3", "bug_code_uid": "86ce97fac6aa5e94af21555546bf6a9a", "src_uid": "d6290b69eddfcf5f131cc9e612ccab76", "apr_id": "97309ccd16ae1de2884a3c663b044f30", "difficulty": 2100, "tags": ["math", "dfs and similar", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.655591054313099, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "def aux(x, a, b, i, vis):\n\tif i-b >= 0 and i-b not in vis:\n\t\tvis.add(i-b)\n\t\taux(x, a, b, i-b, vis)\n\tif i+a <= x and i+a not in vis:\n\t\tvis.add(i+a)\n\t\taux(x, a, b, i+a, vis)\n\n\ndef single(x, a, b, vis):\n\tif x-a in vis:\n\t\tvis.add(x)\n\t\taux(x, a, b, x, vis)\n\treturn len(vis)\n\ndef sum_seq(n):\n\treturn n * (n+1) / 2\n\ndef solve(m, a, b):\n\tvis = set([0])\n\ttot = 0\n\tfor i in xrange(m+1):\n\t\tone = single(i, a, b, vis)\n\t\ttot += one\n\t\tif i > 0 and one == i + 1:\n\t\t\treturn tot + sum_seq(m+1) - sum_seq(i+1)\n\treturn tot\n\n\nm, a, b = map(int, raw_input().split())\nprint solve(m, a, b)", "lang": "PyPy 2", "bug_code_uid": "dc46a9c340f6c0c1ca174734014f00de", "src_uid": "d6290b69eddfcf5f131cc9e612ccab76", "apr_id": "2a1bf498c134410352dcd7fe105e0817", "difficulty": 2100, "tags": ["math", "dfs and similar", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5439838220424671, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "def primes(num):\n prime = [True for i in range(num+1)]\n p = 2\n while (p * p <= num):\n\n # If prime[p] is not changed, then it is a prime\n if (prime[p] == True):\n\n # Update all multiples of p\n for i in range(p * 2, num+1, p):\n prime[i] = False\n p += 1\n if(prime[num]== True):\n return 1\n else:\n return 0\n\n\nt=int(input())\nfor i in range(t):\n a,b=map(int,input().split())\n if(abs(a-b)==1 and (a+b)%2==1):\n ans=primes(a+b)\n if(ans==1):\n print(\"YES\")\n else:\n print(\"NO\")\n else:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "e5d5370b04031ba680fc67fa8b38f9c0", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "958180fa45a032cca7bd7a128bf96a63", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.955177743431221, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\n\ns = raw_input();\nad, b = s.split('e')\na, d = ad.split('.')\nb = int(b);\n\nwhile (b):\n if (len(d) > 0):\n if a == '0':\n a = d[0]\n else:\n a += d[0]\n d = d[1:]\n else:\n a += '0'\n b -= 1;\n\nif (len(d) > 0):\n print a + '.' + d\nelse:\n print a\n", "lang": "Python 2", "bug_code_uid": "e1c21e80952a943023af81fc4fecc7fc", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "a84c7af3331c4c72b7e9c9efd5470bfc", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.52, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import sys\n\nn = int(sys.stdin.readline().strip())\nmas = map(int, sys.stdin.readline().strip().split())\n\nif mas[-1] - 1 == mas[-2]:\n print \"UP\"\nelse:\n print \"DOWN\"\n", "lang": "Python 2", "bug_code_uid": "2519adc59eba632c514d7f16bd3ef1b4", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "957fef0c8ac094aced5e92cabcc6a7e2", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9711538461538461, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "print(sum([1 for x in input() if x in ['a', 'e', 'i', 'o', 'u', 'y'] or (x in ['1', '3', '5', '7', '9']]))\n", "lang": "PyPy 3", "bug_code_uid": "1b9c891f16c41a54f6509433d2db9a9f", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "e842433f76725321bc9fc3b0318f23b5", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9512966476913346, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "s1=input()\ns2=input()\nn=len(s1)\nm=len(s2)\nfrom collections import Counter \nc1=Counter(s1)\nc2=Counter(s2)\nif c1['2'] and c1['5']:\n tot=c2['2']+c2['5']\n a=c1['2']\n b=c1['5']\n \n have2=a/b*tot \n have5=b/a*tot \nelif c1['2'] or c1['5']:\n have2=have5=c2['2']+c2['5']\nif c1['6'] and c1['9']:\n tot=c2['6']+c2['9']\n a=c1['6']\n b=c1['9']\n have6=a/b*tot \n have9=b/a*tot \nelif c1['6'] or c1['9']:\n have6=have9=c2['6']+c2['9']\nmini=10**9 \nfor i in c1.keys():\n if i not in \"2569\" and c1[i]:\n mini=min(mini,c2[i]//c1[i]) \nif c1['2'] :\n mini=min(mini,have2//c1['2'])\nif c1['5']:\n mini=min(mini,have5//c1['5'])\nif c1['6'] :\n mini=min(mini,have6//c1['6'])\nif c1['9']:\n mini=min(mini,have9//c1['9'])\nprint(mini if mini!=10**9 else 0 )", "lang": "PyPy 3", "bug_code_uid": "c7c224d908d220b5e797f2cc6365b677", "src_uid": "72a196044787cb8dbd8d350cb60ccc32", "apr_id": "18cc0e444950f7b2c10563225e18cbc2", "difficulty": 1500, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3380281690140845, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "sequence = list(map(int, input().split()))\na = sequence[0]\nb = sequence[1]\nc = sequemce[2]\n \nwhile a < b\n a += c\n if a == b:\n print(\"YES\")\n break\nif a > b:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "31a49a8abb7fafb790d8b294c5ec4485", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "eb905fd2b707e184614c756369908d37", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.35714285714285715, "equal_cnt": 7, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "gets;p (gets.split.uniq-['0']).size", "lang": "Python 3", "bug_code_uid": "5a654ca72375f43971c5765afee19400", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "898850fdb870401e4a3ce4a2cd7e6baa", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3168831168831169, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "word=input().split(\" \")\nn=int(word[0])\nk=int(word[1])\narr=[]\ni=1\nwhile i<=n:\n\tarr.append(i)\n\ti=i+2\nj=2\nwhile j<=n:\n\tarr.append(j)\n\tj=j+2\nprint(arr[k-1])", "lang": "PyPy 3", "bug_code_uid": "65521de9a2657f2899b2be9aebb46ccf", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "3169016ee729897344484616d0d7559f", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8772946859903382, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x = list(map(int,input().split()))\nh1,h2 = x[0],x[1] # h1 < h2\nh = h2 - h1\ny = list(map(int,input().split()))\na,b = y[0],y[1]\nif a <= b:\n if h / a > 8:\n print (-1)\n else:\n print (0)\nelse:\n if h / a <= 8:\n print (0)\n else:\n t = 8\n h = h - 8 * a\n t0 = 24 * (h // (-12 * b + 12 * a))\n t += t0\n h -= t0 * 0.5 *(a - b)\n t += 12\n h += 12 * b\n t += h / a\n print (int((t + 14) // 24))\n", "lang": "Python 3", "bug_code_uid": "7bd7ac782bd8a6ae1d2e80d25900dc10", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "apr_id": "0298d9a3ca8238fbb65458ea0cd4b345", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.37479806138933763, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "vp = int(raw_input())\nvd = int(raw_input())\nt = int(raw_input())\nf = int(raw_input())\nc = int(raw_input())\ns = t * vp\ntd = t\nans = 0\nvr = vd - vp\nwhile (vr > 0 and s < c):\n ttvr = s\n if s * vr + vp * ttvr >= c * vr: break\n ans += 1\n s = s * vr + vp * (2 * ttvr + f * vr)\n vp *= vr\n vd *= vr\n c *= vr\n vr *= vr\nprint ans\n", "lang": "Python 2", "bug_code_uid": "eb9f57eea1d58abf4387516259aa346c", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "10722313fd4390db788966e186035b1c", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6298076923076923, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "#!/usr/bin/env python\n\n\"\"\" @file\tescape.py\n\t@brief\tcalculate how many coins the princess needs to drop\n\n\t@author dopey\n\"\"\"\n\nimport sys\n\nif __name__ == \"__main__\":\n\tv_p = int(sys.stdin.readline())\n\tv_d = int(sys.stdin.readline())\n\tv_t = int(sys.stdin.readline())\n\tv_f = int(sys.stdin.readline())\n\tv_c = int(sys.stdin.readline())\n\n\tcoins = 0\n\n\t# check if princess is faster than dragon \n\tif (v_p >= v_d):\n\t\tprint coins\n\n\twhile (1):\n\t\ttime_overtake = v_t/(v_d-v_p)\n\t\tif time_overtake*v_d >= v_c:\n\t\t\tbreak\n\n\t\tv_t = time_overtake*v_d + (time_overtake+v_f)*v_p\n\t\tcoins += 1\n\n\tprint coins\n", "lang": "Python 2", "bug_code_uid": "bb03b05cf564b3c2c0d0c83a8f04cc89", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "da6028bd547262c94caa3462636a6432", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6436781609195402, "equal_cnt": 21, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 14, "fix_ops_cnt": 21, "bug_source_code": "word=input()\ns={\"a,e,i,o,u\"}\nfor x in word.lower():\n pass\nelse:\n print(\".\"+x, end=\"\")\n ", "lang": "Python 3", "bug_code_uid": "f9cf55ee55a774d789667d780b133a40", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "ee6a6de9b0a5ac4a0f6d9c265b3bc4b7", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4171779141104294, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "s=[str(i) for i in range(1,10**8)]\np=[]\nfor i in s:\n x=0\n for j in list(i):\n x+=int(j)\n if x==10:\n p.append(i)\nn=int(input())\nprint(p[n-1])\n \n", "lang": "Python 3", "bug_code_uid": "a20c9e93a23273c6564874818f789062", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "47ec928807961ffc990f79909f33e97c", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6884272997032641, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n = map(int, input().split()) \nmax = map(int, input().split())\ntotal = 0\nnumber = 0\narr = []\n\nfor i in range(1, n + 1):\n total += map(int, input().split())\n\nif total + (n-1) * 10 > max:\n print(\"-1\")\nelif max - total - (n-1) * 10 >= 5:\n tmp = int(2*(n-1) + (max - total - (n-1) * 10)/5)\n print(tmp)\nelse:\n tmp = int(2*(n-1))\n print(tmp)", "lang": "Python 3", "bug_code_uid": "c17d6f98339992f345e677d6e6427806", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "41d8620cb1bd07cdb9a989529202e269", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9428571428571428, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\nprint n*(n*n+5)/6", "lang": "PyPy 3", "bug_code_uid": "910f4e8e9c42383f5dd5fde1e49f8c35", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "1931a8eacae77bad1e404ccfeab87441", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.27129337539432175, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "def gcd(a,b):\n if(a==0):\n return b\n\treturn gcd(b%a,a)\t\nn=int(input(\"\"))\t\nm=n\nflag=1\nwhile n:\n\tx=int(input(\"\"))\n\tif(flag==1):\n\t\tg=gcd(x,x)\n\t\tflag=0\n\telse:\n\t\tg=gcd(g,x)\n\tn=n-1\nprint m*g\t", "lang": "Python 2", "bug_code_uid": "137da0c4281c3b15de5707e9d7de6b55", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "2cc41c313f352d8dfeffe7663a62d37e", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9714285714285714, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "foo = bar = 0\nquz = 1\nfor bar in range(int(input())):\n foo += int(input())\n if foo * quz < baz * bar: break\n baz, quz = foo, bar\nprint(baz / quz)", "lang": "Python 3", "bug_code_uid": "398b481c46ad3d80c93413cae024787d", "src_uid": "32fc378a310ca15598377f7b638eaf26", "apr_id": "3f7ab5c9b1a85defb7e0a3690c306b07", "difficulty": 1700, "tags": ["trees", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.03272727272727273, "equal_cnt": 28, "replace_cnt": 20, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 29, "bug_source_code": "x1, y1, x2, y2 = map(int, raw_input().split())\nx3, y3, x4, y4 = map(int, raw_input().split())\nx5, y5, x6, y6 = map(int, raw_input().split())\n \ndef cut(x1, y1, x2, y2, xi, yi, xj, yj):\n if yi <= y1 and yj >= y2:\n if xi <= x1:\n x1 = min(x2, max(xj, x1))\n else:\n x2 = max(x1, min(xi, x2))\n if xi <= x1 and xj >= x2:\n if yi <= y1:\n y1 = min(y2, max(yj, y1))\n else:\n y2 = max(y1, min(yi, y2))\n return (x1, y1, x2, y2)\n \nx1, y1, x2, y2 = cut(x1, y1, x2, y2, x3, y3, x4, y4)\nx1, y1, x2, y2 = cut(x1, y1, x2, y2, x5, y5, x6, y6)\nprint 'YES' if (y2 - y1) * (x2 - x1) > 0 else 'NO'", "lang": "Python 3", "bug_code_uid": "575231c7e546854d4bd1d922a7b1660d", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "bcc7a76e6f13408f253f9b65bc89ff1a", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4842454394693201, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "nums = map(int, raw_input().split())\n\na = [int(i) for i in range(nums[0], nums[1]+1)]\nb = [int(j) for j in range(nums[2], nums[3]+1)]\nc = a+b\nk, m = 0, len(b)\n\nachou = False\nwhile k < len(a) and achou == False:\n q = 0\n while q < m:\n if c[k] / c[m] == nums[4]:\n print \"YES\"\n achou = True\n break\n else:\n q += 1\n k += 1\nif achou == False:\n print \"NO\"", "lang": "PyPy 2", "bug_code_uid": "fa2252d43b27f09be1cafcede0960e19", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "537c9db83f9c910e33b16973232a708b", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7368421052631579, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\n# exam\n# 5 3 2\n# o x o x o \n# 1 1 2 0 3 \n# 5 4 2\n# o o o x o\n# 1 4 5 5 6 \n\n# n - num of questions (max: 10E9)\n# m - num of correct answers\n# k - when his points double\nn, m, k = [ int(x) for x in raw_input().split(\" \") ]\n\n# n = 11, k = 3 \n# o o x o o x o o x o o\n# max m that has no double = 8 ( = k-1 * (n // k ) + n % k)\nmaxm = (k-1) * (n // k) + n % k\nif( m <= maxm):\n\t# no double\n\tprint m % 1000000009\nelse:\n\t# has double\n\t# to minumum point, we should use double as faster as possible.\n\tnumdouble = m - maxm\n\tpoint = 0\n\tfor i in range(numdouble):\n\t\tpoint += k\n\t\tpoint *= 2\n\tpoint += m - (numdouble * k) \n\tprint point % 1000000009\n\n# 0 0 0 0 0 0 0 0 0 o \n# 1 2 6 7 81819204243\n\n# o o o o o ... ... ... o o o x o o o x o o o\n", "lang": "Python 2", "bug_code_uid": "0b3d82057cf7554d019a3bb922308fc9", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "43dda9815ba129e73660e66377826dcf", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5341040462427745, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "import sys\nn_questions, n_corrects, n_k = (int(x) for x in sys.stdin.readline().split())\nn_gaps = n_questions-n_corrects\nscore = n_gaps * (n_k-1)\nn_consec_left = n_corrects - score\nscore += (n_consec_left % n_k) + n_k * ((2 ** ((n_consec_left / n_k) + 1)) - 2)\nprint(score % 1000000009)\n", "lang": "Python 2", "bug_code_uid": "01c59ebbbff548dcffb499f14ccfa5f7", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "e62735e415f74540fd76ee8e583b03ee", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5270758122743683, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "line = raw_input()\ndata = [int(i) for i in line.split()]\nn,m,k = data\n\nlimit = n - (n/k)\nif m <= limit : print m % 1000000009 \nelse:\n score = 0\n totry = m - limit\n for i in range(totry):\n score += k\n score *= 2\n m -=k\n score += m\n print score % 1000000009", "lang": "Python 2", "bug_code_uid": "2c158f568f0e185758f94522644f8deb", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "d606ff599b024c65e8d460002663bfba", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8632286995515696, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import math\nif __name__==\"__main__\":\n n,m,k = map(int, raw_input().split())\n md = m+0.\n maxA = 10**9+9\n\n if (math.ceil(md/(k-1))-1)*k+ (m-(math.ceil(md/(k-1))-1)*(k-1)) <= n:\n print m%maxA\n else:\n p1=math.floor((n+0.)/k)\n extra=int(m-p1*(k-1)-(n-p1*k))\n #print n,extra, p1\n res=0\n for i in range(int(extra)):\n res=((res+k)*2)%maxA\n res = (res+ (m-extra*k))%maxA\n print res\n", "lang": "Python 2", "bug_code_uid": "dfa60f462831ede588de7ec12d601661", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "05c2def4f327615b14ffb7927ddf00cb", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "n,m,k = map(int, raw_input().split())\nw = n - m\ns = (k-1) * w\nm = max(0,m-s)\nnn = m/k\nres = 0\nfor i in xrange(nn):\n\tres += k\n\tres *=2\nres += s + m%k\nprint res%1000000009", "lang": "Python 2", "bug_code_uid": "5af902a8721f499c8f8347792a098fef", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "e4780d7bc07cd882c7dd7e2087043c68", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7563515201999167, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "# -*- coding: cp1251 -*-\nimport sys\nimport itertools\ndef calc(cnt, k):\n ydv = cnt/k\n ostat = cnt - ydv * k\n #ydv\n #1 - 2*k, 2 - 6*k, 3 - 14*k, 30*k\n q = 2\n b1 = k<<1\n #b1 = k*2\n ppc = s = \"0b1\" + ''.join(['0']*(ydv))\n ppc = eval(ppc)\n res = b1*ppc - b1\n\n\n #res = b1 * ((1<<(ydv))-1)\n #res = b1 * (2**ydv) - b1\n return res + ostat\n\ndef calc___________(cnt, k):\n res = 0\n acc = 0\n for i in xrange(cnt):\n res += 1\n acc += 1\n if acc == k:\n acc = 0\n res *= 2\n\n return res\n\ndef solve(n, m, k):\n ans_plus = m\n ans_minus = n-m\n #fails_cnt = n/k\n if ans_minus * k + k - 1 >= n:\n #if fails_cnt <= ans_minus:\n #print \"!\"\n return m\n else:\n #++++++++++++ ____ .+++.+++.+++|\n ans_plus -= ans_minus * (k - 1)\n return calc(ans_plus, k) + (m - ans_plus)\n\nn, m, k = map(int, sys.stdin.readline().split())\n\nprint str(solve(n, m, k) % (10**9+9))\n", "lang": "Python 2", "bug_code_uid": "8a0a37fe15a5817df374d6787242c112", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "f7357f01671831d19199aa42ff6b26db", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.05639476334340383, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n,m=[int(i) for i in input().split()]\ns=str(input())\nif(len(s)==1 and m>0):\n print(0)\nelif(len(s)==1 and m==0):\n print(s)\nelse:\n e=m\n f=''\n for i in range(0,len(s)):\n if(i==0 and e>0):\n if(s[i]!='1'):\n f=f+'1'\n e=e-1\n else:\n f=f+s[i]\n elif(i==0 and e==0):\n f=f+s[i]\n else:\n if(s[i]!='0' and e>0):\n f=f+'0'\n e=e-1\n elif(s[i]=='0'):\n f=f+s[i]\n else:\n f=f+s[i]\n print(f)", "lang": "PyPy 3", "bug_code_uid": "f9736b2d7f32f462dcdb18c1e649b16e", "src_uid": "0515ac888937a4dda30cad5e2383164f", "apr_id": "25840a774c55da2832e863ed4e6860f8", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9985401459854014, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k=map(int,input().split())\nl=list(input())\n\nif k==0:\n print(*l,sep='')\nelif n==1:\n print(0)\nelse:\n if l[0]!='1':\n #print(\"HI\")\n l[0]='1'\n k-=1\n for i in range(1,n):\n print(k)\n if k>0 and int(l[i])>0:\n if l[i]!='0':\n l[i]='0'\n k-=1\n print(*l,sep='')\n", "lang": "PyPy 3", "bug_code_uid": "c773ece3f59bd0d3363eb83ff47d1dff", "src_uid": "0515ac888937a4dda30cad5e2383164f", "apr_id": "5ee57f757edd0c2b5dcef20ea0bf9bcb", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7287543655413271, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "length = int(input(''))\ndigits = list(int(i) for i in str(input('')))\nrdigits = digits[::-1]\nsdigits = 0\nfor i in digits:\n sdigits += i\n\ndef f(n):\n s = [1]\n i=2\n while i*i <= n:\n if n%i == 0:\n s.append(int(i))\n s.append(int(n/i))\n i += 1\n return s\n\ndef check(d):\n d2 = digits[:]\n while len(d2) >0:\n s = 0\n while True:\n c = len(d2)-1\n s += d2[c]\n d2.pop()\n if (s >= d or sum(d2) == 0):\n break\n if (s > d or sum(d2) == 0):\n break\n if (s == 0 or d) and sum(d2) == 0:\n return True\n else:\n return False\n \nfinal = False\nfor i in f(sdigits):\n if check(i) == True:\n final = True\n print('YES')\n break\n \nif final == False:\n print('NO')", "lang": "Python 3", "bug_code_uid": "b6fba704fd37d2ae4f8b4b1552fc9f93", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "01660ff8a34d0cfa2d7a15bc5026434d", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8900804289544236, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = input().split(\" \")\nk = int(n[1])\nn = int(n[0])\ndays = 1\ncandies = input().split(\" \")\nfor i in range(len(candies)):\n can = int(candies[i])\n if can > 8:\n k -= 8\n if (i + 1) != len(candies)\n candies[i + 1] += can - 8\n else:\n k -= can\n if k < 1:\n print(days)\n break\n days += 1\nif k > 0:\n print(-1)\n", "lang": "Python 3", "bug_code_uid": "f46530f2f8268cc0bb5723c57f645078", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "f71a8066c92357e93bd241b320f8d7eb", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5972850678733032, "equal_cnt": 20, "replace_cnt": 6, "delete_cnt": 11, "insert_cnt": 3, "fix_ops_cnt": 20, "bug_source_code": "n = input()\nlist = []\nwhile list.count(n) == 0:\n list.append(n)\n n += 1\n while n % 10 == 0:\n n /= 10\nprint(len(list))", "lang": "Python 3", "bug_code_uid": "02627ac4c67af91089fc0429eae5e72e", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "e9961dc2cb8a1c1b6cc226ad4c0b1f26", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9734513274336283, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "string=raw_input()\nnumcount=[]\nfor i in string:\n if i !='+':\n numcount.append(i)\nnumcount.sort()\nfinalstring=''\nfor i in range(len(numcount)-1):\n finalstring+=i+'+'\nfinalstring+=numcount[-1]\nprint finalstring", "lang": "Python 2", "bug_code_uid": "814e860a72983524e1f38d90d2e24639", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "f91884ce712ead83f01657dbbbf075bc", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9275905118601748, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "from functools import reduce\n\ndef factorial(n):\n return reduce(lambda x, y: x*y, range(1,n+1))\n\ncolors = {\n 'R' : 0,\n 'O' : 0,\n 'Y' : 0,\n 'G' : 0,\n 'B' : 0,\n 'V' : 0\n}\n\nfor c in list(input()):\n colors[c] += 1\n\namount = list(reversed(sorted([(colors[key], key) for key in colors])))\n\namount = [x[0] for x in amount]\n\nif amount[0] == 6 or amount[0] == 5:\n print(\"1\")\nelif amount[0] == 4:\n print(\"2\")\nelif amount[0] == 3:\n if amount[1] == 3:\n print(\"2\")\n elif amount[1] == 2:\n print(\"5\")\n elif amount[1] == 1:\n print(\"5\")\nelif amount[0] == 2:\n if amount[1] == amount[2] == 2:\n print(\"4\")\n elif amount[1] == 2:\n while True: pass\n else:\n print(factorial(6) // 48)\n\nelif amount[0] == 1:\n print(factorial(6) // 24)\n\n\n\n", "lang": "Python 3", "bug_code_uid": "a8b7994d627ca39641c3ea25ad1d1d08", "src_uid": "8176c709c774fa87ca0e45a5a502a409", "apr_id": "149c0d3c2b3fb01c274d99071dac9295", "difficulty": 1700, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9965156794425087, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = [i for i in map(int, input().split())\nb = sorted(a[0:3])\nn = a[3] - b[1] + b[0],0\nm = a[3] - b[2] + b[1],0\nsol = max(n) + max(m)\nprint(sol)", "lang": "PyPy 3", "bug_code_uid": "f47d43cb446a3961ae77820de4270469", "src_uid": "47c07e46517dbc937e2e779ec0d74eb3", "apr_id": "e3a8bcbaef324c2bb80b37f8c2954d81", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7934782608695652, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "a,b,c,d=map(int,input().split(\" \"))\nls=[a,b,c]\nls=sorted(ls)\nans=0\nif(abs(ls[1]-ls[0]) numY:\n print(\">\")\n else:\n print(\"=\")", "lang": "Python 3", "bug_code_uid": "b0bff971c1b07afc8d5edae100b7b3bc", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "2efeb530fc7d3035fad6e4056584dc46", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.021600392734413353, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "s, x1, x2 = [int(item) for item in input().split()]\nt1, t2 = [int(item) for item in input().split()]\np, d = [int(item) for item in input().split()]\nv1, v2 = 1/t1,1/t2\n\nv2 *= int((x2 - x1)/(abs(x2 - x1)))\n\nx = x1\nc = int(v2/abs(v2))\nt = 0\nwhile p != x:\n t += 1\n p += d * v1\n if p == 0 or p == s:\n d *= -1\n x += v2\n if x == x2:\n print(t)\n break\nelse:\n print(int(t + (x2 - x) / (v1 * d)))", "lang": "Python 3", "bug_code_uid": "1861632cf624d58290f3210116c10533", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "862503cba7d88cbaca78e3293cac331f", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9571428571428572, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "s = raw_input()\nres = pow(2, len(s)-1)*(int(s, 2))\nprint res%1000000007", "lang": "Python 3", "bug_code_uid": "f9f9833842470368954e6be7cecc845b", "src_uid": "89b51a31e00424edd1385f2120028b9d", "apr_id": "b4bffc1dc55dccd4c01eb4a6faf3a9d8", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9959677419354839, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "MOD = 1000000007\n\ns = input()\nn = len(s)\np = [1]\nfor i in range(101):\n p.append((2*p[-1]) %MOD)\n\n\nres = 0\nm = n\ng = 0\nfor i in range(n):\n if s[i] == '1':\n res += (p[g] * (p[2*m-2]%MOD)) % MOD\n res = res % MOD\n g += 1\n m -= 1\n \nprint(res)", "lang": "Python 3", "bug_code_uid": "fa46daf8aedcc26df6dbb1ef16fb2f9a", "src_uid": "89b51a31e00424edd1385f2120028b9d", "apr_id": "eb60b8908c660b222db17dc5f1c3eb67", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6887417218543046, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "x=input()\ny=input()\nl=0\n\nfor i in range(y+1):\n if x>=y:\n break\n x*=x\n l+=1\n i=x\n \nif x==y:\n print\"YES\"\n print l\nelse:\n print\"NO\"\n", "lang": "Python 2", "bug_code_uid": "1f2f7a80817b0667891e8a4deac48669", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "d1f2afbe582ca8aec6fe18af9d5bd59b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8548057259713702, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import sys\n\ndef solve():\n a = list(map(int, input().split()))\n diffs = list()\n for i in range(3):\n diffs.append(a[i+1]-a[i])\n if diffs[0] == diffs[1] == diffs[2]:\n return a[3] + diffs[0]\n # print(diffs)\n if diffs[1] / diffs[0] == diffs[2] / diffs[1]:\n val = a[3] * diffs[2] / diffs[1]\n if val // a[3] == a[1] // a[0] == a[2] // a[1]:\n return int(val)\n return 42\n\nif sys.hexversion == 50594544 : sys.stdin = open(\"test.txt\")\nprint(solve())", "lang": "PyPy 3", "bug_code_uid": "6117c88f2310311288de39f256b0007e", "src_uid": "68a9508d49fec672f9c61766d6051047", "apr_id": "e349f96db5ae6de5b2b4b15d4981e0fa", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.997229916897507, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# -*- coding: utf-8 -*-\n# @Author: Amit dwivedi\n# @Date: 2019-03-20 21:30:03\n# @Last Modified by: Amit dwivedi\n# @Last Modified time: 2019-06-21 22:46:22\nll= lambda : list(map(int,input().split()))\ntestcases=1\ntestcases=int(input())\nfor testcase in range(testcases):\n\t[n]=ll()\n\tif n==1:\n\t\tprint(1)\n\telif n==2:\n\t\tprint(5)\n\telse:\n\t\tn-=1\n\t\tprint(2*n*(n+1)+1)\n", "lang": "Python 3", "bug_code_uid": "1719f837a550bec87c7a0ba1848d05fc", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "e84febed0e04701884fbaa0bb08efd18", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7601246105919003, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#x=int(input())\na,b,c,d=map(int,input().split())\nif (a+b==c+d or a+c==b+d or a+d==b+c) and sum(x)%2==0:\n print(\"YES\")\nelse:\n print(\"NO\")\n\n", "lang": "PyPy 3", "bug_code_uid": "e7914119b7541afd11ecdcef9613b71f", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "163e559217903288b1a3cc3404372934", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9254901960784314, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,k = map(int,input().split())\ncounts = 3+(n-1)*2\naux = min(k-1,n-k)\ncounts+= (n-1+aux)\nprint(counts)\n//Submit de prueba", "lang": "Python 3", "bug_code_uid": "1368e75116f1ff01c0620ae2ba1e8500", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "apr_id": "d6216522da4f640936b13deb9e4c2270", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9052631578947369, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,k=map(int,input())print(min(k-1,n-k)+3*n)", "lang": "Python 3", "bug_code_uid": "4240f1876862956e81a6bb5d7df15b43", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "apr_id": "4d13ca9df7f6a651ae45a732f0ea1b0a", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.14854111405835543, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "from itertools import permutations\ns=input()\nd={}\nc=1\nm=-1\nl=[]\nd={}\nfor i in range(len(s)):\n l.append(list(permutations(s,i+1)))\nfor i in range(len(l)):\n for j in range(len(l[i])):\n l[i][j]=''.join(l[i][j])\nfor i in l:\n for j in i:\n if(j==j[::-1]):\n if(j not in d):\n d[j]=0\nprint(max(d))\n", "lang": "Python 3", "bug_code_uid": "09f21ad6220ecf35a4592a62600f8075", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "apr_id": "92e5e2ef34faf2c5aabb2b68fa1dd497", "difficulty": 800, "tags": ["bitmasks", "greedy", "implementation", "brute force", "strings", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9892313405124397, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#bayan bus c328\n\nfrom sys import stdin\n\ndef bayan():\n while True:\n n=int(stdin.readline().strip())\n if n==\"\":\n break\n else:\n mat=[[\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\"],[\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\"],[\"#\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"],[\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\",\"#\"]]\n mat=pasajero(n,mat)\n imp(mat)\n\ndef pasajero(n,mat):\n col=0\n while col<=10:\n fila=0\n while fila<=3:\n if n==0:\n break\n else:\n if fila==2 and col>0:\n n=n+1\n else:\n mat[fila][col]=\"O\"\n n-=1\n fila+=1\n col+=1\n return mat\ndef imp(mat):\n f1=mat[0]\n f2=mat[1]\n f3=mat[2]\n f4=mat[3]\n f1=\".\".join(f1)\n f2=\".\".join(f2)\n f3=\".\".join(f3)\n f4=\".\".join(f4)\n print(\"+\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"+\")\n print(\"|\"+f1+\".\"+\"|\"+\"D\"+\"|\"+\")\")\n print(\"|\"+f2+\".\"+\"|\"+\".\"+\"|\")\n print(\"|\"+f3+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\".\"+\"|\")\n print(\"|\"+f4+\".\"+\"|\"+\".\"+\"|\"+\")\")\n print(\"+\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"-\"+\"+\")\n\n \n \n \nbayan()\n", "lang": "Python 3", "bug_code_uid": "e1ddbb7cff37072df2770baa68fde0bf", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "3aa909b1f916ecab9b80cb3481851892", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9994086339444116, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\n\nprint (\"+------------------------+\")\n\n\n\nif n>4:\n if (n-4)%3 == 0:\n r1 = 1 + (n-4)/3\n r2 = r1\n r3 = r1 \n elif (n-4)%3 == 1:\n r1 = 2 + (n-4)//3\n r2 = 1 + (n-4)//3\n r3 = r2\n else:\n r1 = 2 + (n-4)//3\n r2 = r1\n r3 = 1 + (n-4)//3\n\n print (\"|\",end=\"\")\n for i in range(r1):\n print(\"O.\",end=\"\")\n for i in range(11-r1):\n print(\"#.\",end=\"\")\n print (\"|D|)\")\n print (\"|\",end=\"\")\n for i in range(r2):\n print(\"O.\",end=\"\")\n for i in range(11-r2):\n print(\"#.\",end=\"\")\n print (\"|.|\")\n print (\"|O.......................|\")\n print (\"|\",end=\"\")\n for i in range(r3):\n print(\"O.\",end=\"\")\n for i in range(11-r3):\n print(\"#.\",end=\"\")\n print (\"|.|)\")\n print (\"+------------------------+\")\nelse:\n if n == 0:\n r1= 0\n r2 = 0\n r3 = 0\n elif n == 1:\n r1 = 1\n r2 = 0\n r3 = 0\n elif n == 2 or n == 3:\n r1 = 1\n r2 = 1\n r3 = 0\n elif n == 4:\n r1 = 1\n r2 = 1\n r3 = 1\n print (\"|\",end=\"\")\n for i in range(r1):\n print(\"O.\",end=\"\")\n for i in range(11-r1):\n print(\"#.\",end=\"\")\n print (\"|D|)\")\n print (\"|\",end=\"\")\n for i in range(r2):\n print(\"O.\",end=\"\")\n for i in range(11-r2):\n print(\"#.\",end=\"\")\n print (\"|.|\")\n if n <3:\n print (\"|#.......................|\")\n else:\n print(\"|O.......................|\")\n print (\"|\",end=\"\")\n for i in range(r3):\n print(\"O.\",end=\"\")\n for i in range(11-r3):\n print(\"#.\",end=\"\")\n print (\"|.|)\")\n print (\"+------------------------+\")\n", "lang": "Python 3", "bug_code_uid": "99dd150b0c283fc3347aafac29cf2798", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "8f8564f55156a2fe69f04bb6ff91b9ee", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4387755102040816, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "first = input()\nsecond = input()\ni = 1\nwhile first[i]>second[0] :\n s = s + first[i]\n i += 1\nprint(s+second[0])", "lang": "Python 3", "bug_code_uid": "75bff626e75582d3dda26a3b726ec83a", "src_uid": "aed892f2bda10b6aee10dcb834a63709", "apr_id": "a4af0e750062460232beb71fa6ea98c6", "difficulty": 1000, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9160554197229014, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "# -*- coding: utf-8 -*-\n\nimport sys\nfrom collections import Counter\n\ndef input(): return sys.stdin.readline().strip()\ndef list2d(a, b, c): return [[c] * b for i in range(a)]\ndef list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]\ndef list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\ndef ceil(x, y=1): return int(-(-x // y))\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]\ndef Yes(): print('Yes')\ndef No(): print('No')\ndef YES(): print('YES')\ndef NO(): print('NO')\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\n\ndef bfs(src, S, K):\n from collections import deque\n\n que = deque([(src)])\n res = set()\n while que:\n s = que.popleft()\n res.add(s)\n if len(res) == K:\n return res\n for i in range(len(s)):\n t = s[:i] + s[i+1:]\n if t in res:\n continue\n que.append(t)\n return res\n\nN, K = MAP()\nS = input()\n\nres = bfs(S, S, K)\nif len(res) < K:\n print(-1)\nelse:\n ans = 0\n for s in res:\n ans += N - len(s)\n print(ans)\n", "lang": "PyPy 3", "bug_code_uid": "1446b5b520e817f147196be9a4968053", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "apr_id": "152ec29be5c458b1433bc9128bdff4e0", "difficulty": 2000, "tags": ["graphs", "dp", "implementation", "shortest paths"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9828326180257511, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x1,x2,a,b=map(int,raw_input().split())\nif x1+a<=x2<=x1+b: print 'FIRST'; print x2\nelif a<=0<=b: print 'DRAW'\nelif a>0:\n if x1>x2: print 'DRAW'\n else:\n s=(x2-x1)%(a+b)\n if s==0: print 'SECOND'\n elif a<=s<=b: print 'FIRST';print x1+s\n else: print 'DRAW'\nelse:\n if x1 x2:\n print(\"DRAW\")\n else:\n if (x2 - x1) % (a + b) == 0:\n print(\"SECOND\")\n elif a <= (x2 - x1) % (a + b) <= b:\n print(\"FIRST\")\n print(x1 + (x2 - x1) % (a + b))\n else:\n print(\"DRAW\")", "lang": "PyPy 3", "bug_code_uid": "73c577aa7511c44406ded70af520ce87", "src_uid": "4ea8cc3305a0ee2c1e580b43e5bc46c6", "apr_id": "7201dcfa9c8d58125309b0bf6dbf8f0f", "difficulty": 2400, "tags": ["math", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3658269441401972, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "def get_num5(x):\n num5 = 0\n if x == 0:\n return 0\n for i in range(x+1):\n temp = i\n if i == 0:\n continue\n while(temp % 5 ==0):\n num5 +=1 \n temp = temp/5\n return num5\nm = input()\nMAX = 99999999999\ni = 0\ns= ''\nwhile (i < MAX):\n num = get_num5(i*5)\n if(num == m):\n l1 = [x for x in range(i*5,(i+1)*5)]\n for ii in l1:\n s = s + str(ii)+ ' '\n print 5\n print s\n break\n elif num>m:\n print 0\n break\n i = i+1\n\n", "lang": "Python 2", "bug_code_uid": "5a4551d61dc2d2267a57288ec8c43c3b", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "d8ab0ae31157da75aca7345e388424ca", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1154639175257732, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "n, a, b = map(int, raw_input().strip().split())\ncon = 0\nfor i in xrange(1, n + 1):\n if i - 1 >= a and n - i <= b:\n con += 1\nprint con\n", "lang": "Python 2", "bug_code_uid": "c4d1524669d6e1b913109b3e7d2ac417", "src_uid": "7219d1837c83b5920992aee5a60dc0d9", "apr_id": "ed14f9745204d2c3270e71273e0c595c", "difficulty": 1800, "tags": ["brute force", "constructive algorithms", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.15554115359688916, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "l1 = input().split()\nl = int(l1[0])\njump = int(l1[1])\nstring = input()\ng = string.find(\"G\")\nt = string.find(\"T\")\n\nif (g != 0) and g+1 g):\n while g < len(string):\n g += jump\n if string[g] == \"#\":\n print(\"NO\")\n exit()\n elif string[g] == \".\":\n continue\n else:\n print(\"YES\")\n exit()\nelse:\n while g > 0:\n g -= jump\n if string[g] == \"#\":\n print(\"NO\")\n exit()\n elif string[g] == \".\":\n continue\n else:\n print(\"YES\")\n exit()\n\n", "lang": "Python 3", "bug_code_uid": "0c4e8ea1b73ad99ef27d3b3af7409b15", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "ce40d01823bce93c11270167c3cba39a", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9318181818181818, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "a = input()\nprint(str(bin(int(a,16))[-1])", "lang": "Python 3", "bug_code_uid": "e5148e1168510cb97b4047b7f9dc3d66", "src_uid": "e52bc741bb72bb8e79cf392b2d15354f", "apr_id": "0f46f29eeea10f86de00ac2abaa5fb23", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9881422924901185, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\ufeff#!/usr/bin/python\n\nimport sys, os\nsys.setrecursionlimit(10000)\n\ndef readline():\n\treturn sys.stdin.readline().strip()\ndef readrow():\n\treturn readline().split(' ')\n\n(h, m) = map(int, readline().split(':'))\nh %= 12\nprint('%.1f %.0f' % (h*30+m/2, m*6))\n\n\n", "lang": "Python 2", "bug_code_uid": "497d1c47728abf6a78538fd6fec172fc", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "988411793e78bc94e4a1bce16f6dacb3", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3492063492063492, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "x,y,z=[int(a) for a in input().split()]\na=[]\nb=1\na.append(x)\nz1=z+1\nfor i in range(z):\n f=x+(b*y)\n g=x+(b*y)+1\n if f>z:\n break\n a.append(f)\n a.append(g)\n b+=1\nif z in a:\n print(\"YES\")\nelse:\n print(\"NO\")\n \n \n \n \n \n \n \n \n ", "lang": "PyPy 3", "bug_code_uid": "3065a01afdd31c42dd5e3f62a43e4337", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "842065c1dd1826f3429e32fd20b6c127", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2857142857142857, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "input()\nn = [int(x) for x in input().split()]\na = -1\naa = 0\ni = -1\nwhile i < len(n):\n aaa = aa + len([x for x in n[i+1:] if x])\n if aaa > a:\n a = aaa\n while i < len(n) and n[i]:\n i+=1\n aa+=1\nprint(a)\n", "lang": "Python 3", "bug_code_uid": "0132a2d4cfe3c5fb19abdbae6f928c17", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "apr_id": "568370b212fc3115442fe6ec67c6ddb9", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.048604860486048604, "equal_cnt": 5, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def inc(arr):\n for i in range(len(arr) - 1, -1, -1):\n w = arr[i]\n if w == 0:\n for j in range(len(arr) - 1, i, -1):\n arr[j] = 0\n arr[i] = 1\n return arr\n\n\ndef proveralo1(a, arr):\n c = []\n for i in range(len(arr)):\n if arr[i] == 1:\n c.append(a[i])\n return c\ndef proveralo2(c):\n f = 0\n for i in range(len(c)):\n if f == 1 and c[i] == 0:\n return False\n if f == 0 and c[i] == 1:\n f = 1\n return True\n\n\nn = int(input())\narr = [0] * n\na = list(map(int,input().split()))\ns = 0\nc1 = []\nwhile True:\n c = []\n r = 0\n arr = inc(arr)\n c = proveralo1(a,arr)\n if proveralo2(c) == True:\n r = len(c)\n if r > s:\n s = r\n c1 = c\n if inc(arr) == None:\n break\nprint(s)", "lang": "Python 3", "bug_code_uid": "ad9747c6ab9852cbbf0a3acb3d8c8e1e", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "apr_id": "e9a732fad817745dc2e4a51f1c6ed3f8", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8313725490196079, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\ns=input()\nfor i in range(2,n+1):\n r = s[i - 1::-1]\n l = s[i:n]\n s = r + l\nprint(s)\nif n%i==0:\n", "lang": "Python 3", "bug_code_uid": "db56c9e11fbd118f3ae6e72f4f14fe30", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "apr_id": "05caa2251f2551207719d8bec06ad38b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9983633387888707, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "word = input()\nl = len(word)\n#check if the word has majority upper case letters or not\ncount = 0\nfor i in word:\n if i.isupper():\n count+=1\n\n#make cases for both even and odd length\nif((l%2==0 and count>(l/2)) or (l%2==1 and count>=(l//2+1)):\n print(word.upper())\nelse:\n print(word.lower())", "lang": "Python 3", "bug_code_uid": "4ff276b42bc28609afebf1b6270a8532", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "ae200e2a465b5bbf9b82585f9e140f92", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6275303643724697, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 11, "bug_source_code": "j = int(input())\nk = 0\nl = []\n\nfor i in range(1, j + 1):\n k = k + i\n l.append(k)\n\n\ndesired = int()\ni = 0\nwhile desired <= j:\n desired += l[i]\n i += 1\n\nprint(i - 1)", "lang": "Python 3", "bug_code_uid": "34621ac7811c47dfd67c16d54dba51df", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "a7799a46281db0140a983fb2d68d4ecb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6763285024154589, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "for i in xrange(100):\n n=int(input())\n if n%2==0:\n x=n/2\n print (x-1)/2\n else:\n x=n//2\n print x//2\n", "lang": "PyPy 2", "bug_code_uid": "d05e5f9aef8bcc32f3e140185470d7d9", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "ebb99f738d8418cb5c1fb1860c16545a", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9920462762111352, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\nimport math\n\ndef readints() :\n l = sys.stdin.readline()\n return map(int, l.split(' '))\n\ndef readstring() :\n l = sys.stdin.readline()[:-1]\n return l\n\ndef readint() :\n l = sys.stdin.readline()\n return int(l)\n\ndef clearchars(s, chars) :\n for c in chars :\n s = s.replace(c, '')\n return s\n\ndef gcd(a, b) :\n if (a < b ) :\n a, b = b, a\n if b == 0 :\n return a\n return gcd(b, a % b)\n\ndef hist(a) :\n h = {}\n for x in a :\n try : \n h[x] += 1\n except KeyError :\n h[x] = 1\n return h\n\ndef lucky(n) :\n s = set(str(n))\n return all(map(lambda x: x in '47', s)) \n\ndef yslice(a, j) :\n return map(lambda x: x[j], a)\n\ndef dist2(a, b) :\n return ((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) ** 0.5\n\ndef chain_len(a) :\n l = .0\n for d, e in zip(a, a[1:]) :\n l += dist2(d, e)\n return l\n\ndef is_prime(x) :\n if x == 1 :\n return False\n sq = int(x ** 0.5) \n for i in [2] + range(3, sq + 1, 2) :\n if x % i == 0 :\n return False\n return True\n\n\ndigits = '0123456789'\n\ndef noe() :\n print \"NO\"\n exit(0)\n\ndef yese() :\n print \"YES\"\n exit(0)\n\n\nx, t, a, b, da, db = readints()\n\nfor i in range(t) :\n for j in range(t) :\n if x == a - da * i + b - db *j or x == a - da * i or x == b - db * j :\n yese()\nnoe()\n", "lang": "Python 2", "bug_code_uid": "e017df122b3eebcb7bb2459aa2c7632a", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "b9bffea3a622b92304ad5e370b23d990", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5501165501165501, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "x, t, a, b, da, db = map(int, raw_input().split())\n\nresult = False\nta = a + b - x\nfor i in range(t):\n\tc = ta - i * db\n\tif c % da == 0 and c/da <= t:\n\t\tprint 'YES'\n\t\tresult = True\n\t\tbreak\nif not result:\n\tprint 'NO'", "lang": "Python 2", "bug_code_uid": "06416563b890f4c3ec5542405f9badf3", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "1483912b276bf281f5ab2914fbce0e84", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8788501026694046, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import pdb\nimport sys\nimport math\n\nfile = sys.stdin\n#file = open(\"test\", \"r\")\n\ndef is_valide(i):\n i *= 2\n root = int(math.sqrt(i))\n if root*(root + 1) == i or (root - 1)*root == i or (root + 1)*(root + 2) == i:\n return True\n else:\n return False\n\nnum = int(file.readline().rstrip())\nroot = int(math.sqrt(num))\nfor i in range(1, num):\n if is_valide(i) and is_valide(num - i):\n print \"YES\"\n break\nelse:\n print \"NO\"\n", "lang": "Python 2", "bug_code_uid": "0323fb89167fd0e565f3744c6b310f4d", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "6db8cddc1dbc62a13019dc22357ba836", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8433734939759037, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "s=input()\nk=0\nfor i in s:\n\tif i in range(33,127):\n\t\tif i in \"+HQ9\":\n\t\t\tprint(\"YES\")\n\t\t\tk=1\n\t\t\tbreak\n\t else:\n\t\t k=0\nif(k==0):\n\tprint(\"NO\")", "lang": "Python 3", "bug_code_uid": "7c9dbbbb2205dd87df92b2e36cc5b8e2", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "7e89694dce7314d6621c38275a79ef6b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.030112923462986198, "equal_cnt": 11, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "n = int(input())\nxs = [int(elm) for elm in input().split(\" \")] \n\ndef calc_min_diff(xs):\n if n == 1:\n return 1\n\n min_cur_diffs = []\n twice_flags = []\n for i in range(n):\n cur_diffs = [abs(xs[j] - xs[i]) for j in range(n) if xs[j] != xs[i] and i != j]\n #print(\"cur_diffs\", cur_diffs)\n #print(\"xs\", xs)\n if len(cur_diffs) == 0:\n #print(\"out1\")\n return 1\n\n min_cur_diff = min(cur_diffs)\n \n twice_flag = False\n for cur_diff in cur_diffs:\n #if cur_diff % min_cur_diff != 0:\n #print(cur_diff, min_cur_diff)\n if cur_diff == min_cur_diff:\n pass\n elif cur_diff == min_cur_diff * 2:\n twice_flag = True\n else:\n #print(\"out2\")\n return -1\n min_cur_diffs.append(min_cur_diff)\n twice_flags.append(twice_flag)\n \n \n min_diff = min(min_cur_diffs)\n for min_cur_diff, twice_flag in zip(min_cur_diffs, twice_flags):\n if twice_flag:\n if min_cur_diff != min_diff:\n #print(\"out3\")\n return -1\n else:\n if min_cur_diff in [min_diff, min_diff*2]:\n pass\n else:\n #print(\"out4\")\n return -1\n \n if not twice_flag and min_diff % 2 == 0:\n ret = min_diff // 2\n else:\n ret = min_diff\n return ret\n\nout = calc_min_diff(xs)\nprint(out)", "lang": "Python 3", "bug_code_uid": "9ed5fd39588ba4c0538789c081eba6e7", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "4410f94eaef240fc6320dd695255a645", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7519125683060109, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "P = 998244853\nN, M = map(int, input().split())\n\nfa = [1]\nfor i in range(4040):\n fa.append(fa[-1]*(i+1)%P)\n\nfainv = [pow(fa[-1], P-2, P)]\nfor i in range(4040)[::-1]:\n fainv.append(fainv[-1]*(i+1)%P)\n\nfainv = fainv[::-1]\n\ndef C(a, b):\n return fa[a]*fainv[a-b]*fainv[b]%P\n\nX = [0] * N + [C(N+M, M)]\nfor i in range(N):\n X[i] = C(N+M, M) - C(N+M, M-i-1) if 0<=M-i-1<=N+M and N-M= S(int(m) + c) * k):\n sequence += str(int(m) + c)\n w -= S(int(m) + c) * k\n\n c += 1\n else:\n break\n\nprint c", "lang": "Python 2", "bug_code_uid": "4f3e2fde28543d183002afb794e384a5", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "ec4ebd33647b9150527d2aef4c605da9", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3441295546558704, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x,y = [int(x) for x in input().split()]\nxf,yf = [int(x) for x in input().split()]\n\ni=0\nwhile x!=xf or y!=yf:\n if xyf:\n y-=1\n if x>xf:\n x-=1\n if y x:\n\t\tx = x^y; y = x^y; x = x^y\n\tif y == 1:\n\t\treturn 1\n\treturn gcd(y, x%y)\n\nch = ['A', 'B']\ns = []\nb = 0\nif x < y:\n\tb = 1\n\tx = x^y; y = x^y; x = x^y\nif gcd(x,y) > 1:\n\tprint 'Impossible'\nelse:\n\twhile y!=0:\n\t\tl = x//y\n\t\ts.append(l)\n\t\tr = x%y\n\t\tx = y\n\t\ty = r\n\ts[-1]-=1\n\tst = ''\n\tfor el in s:\t\n\t\tst += '{}{}'.format(el, ch[b])\n\t\tb = 1-b\n\tprint st\n\n\n\n\n\n\n\n\n", "lang": "PyPy 2", "bug_code_uid": "d7fae24b0081354f066bd93df40fea7c", "src_uid": "6a9ec3b23bd462353d985e0c0f2f7671", "apr_id": "b32af857d04dee008c20f94b0641bd10", "difficulty": 2400, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2064516129032258, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a,b,c=map(int,input().split())\nprint(c//(a*b))", "lang": "Python 3", "bug_code_uid": "26ce3e485b88906c140b6109f148795d", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "c6d5a6ac8fafdd0f1b6aa975d73465cb", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9921259842519685, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=set()\na.update(list(map(int,input().split())))\nprint(4-len(a)", "lang": "Python 3", "bug_code_uid": "b42d01c1d5b55bdcdb8f5c70d44e6583", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "e730a9df5b4814a302da0f8bc6b68e48", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.14587737843551796, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n = int(raw_input())\n\nR = 0\nwhile True:\n n += 1\n R += 1\n \n t = int(n / (10 ** 9))\n t2 = int((n / (10 ** 8)) % 10)\n t3 = int((n / (10 ** 7)) % 10)\n t4 = int((n / (10 ** 6)) % 10)\n t5 = int((n / (10 ** 5)) % 10)\n t6 = int((n / (10 ** 4)) % 10)\n t7 = int((n / (10 ** 3)) % 10)\n t8 = int((n / (10 ** 2)) % 10)\n t9 = int((n / 10) % 10)\n t10 = int(n % 10)\n if n > 0:\n if t == 8:break\n elif t2 == 8:break\n elif t3 == 8:break\n elif t4 == 8:break\n elif t5 == 8:break\n elif t6 == 8:break\n elif t7 == 8:break\n elif t8 == 8:break\n elif t9 == 8:break\n elif t10 == 8:break\n\nprint R", "lang": "Python 2", "bug_code_uid": "74ee649f5d52437dcb06c6fa2fc4204a", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "abe8946ede31094f12e2ca8c88f4fcaa", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9658314350797267, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = input();\ns = raw_input();\n\nmaxc = 0;\ncount = 0;\n\nfor i in range(1,n):\n if s[i] == s[i-1]:\n count+=1;\n if count > maxc:\n maxc = count;\n # else:\n # count = 0;\nprint maxc;\n\n10\nGGBRBRGGRB\n", "lang": "Python 2", "bug_code_uid": "7dcf7576889bc3a4d0cd9473c9c7a2bf", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "41f097f8d1e6667ad6e9b32504eda334", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9868371568258744, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "debug = False\n\ndef gcd(a, b):\n \"\"\"Return greatest common divisor using Euclid's Algorithm.\"\"\"\n while b: \n a, b = b, a % b\n return a\n\ndef lcm(a, b):\n \"\"\"Return lowest common multiple.\"\"\"\n return a * b // gcd(a, b)\n\ndef lcmm(list_of_integers):\n \"\"\"Return lcm of args.\"\"\" \n if len(list_of_integers) > 2:\n return lcm(list_of_integers.pop(), lcmm(list_of_integers))\n else:\n return lcm(*list_of_integers)\n\ndef is_bijection(list_of_integers):\n buckets = [ 0 for _ in range(len(list_of_integers)) ]\n for number in list_of_integers:\n buckets[number] += 1\n return 0 not in buckets\n \ndef get_cycle_with_person(person, cycles):\n for cycle in cycles:\n if cycle[-1] == person:\n if debug:\n print('found person ' + str(person) + ' in cycle ' + str(cycle))\n return cycle\n return None\n\n\ndef get_cycle_with_crush(crush, cycles):\n for cycle in cycles:\n if cycle[0] == crush:\n if debug:\n print('found crush ' + str(crush) + ' in cycle ' + str(cycle))\n return cycle\n return None\n\ndef append_cycle_to_other_cycle(cycles, cycle, other_cycle):\n if debug:\n print('appending' + str(cycle) + ' to ' + str(other_cycle))\n for element in cycle:\n other_cycle.append(element)\n cycles.remove(cycle)\n\n\ndef make_new_cycle(first, second, cycles):\n cycles.append([first, second] if first != second else [first])\n\ndef get_cycle_length(cycle):\n return len(cycle)//2 if len(cycle)%2 == 0 else len(cycle)\n\ndef main():\n numer_of_people = int(input())\n crushes = list(map(lambda x: int(x) - 1, input().split(' ')))\n if debug:\n print(crushes)\n if not is_bijection(crushes):\n print('-1')\n return 0\n list_of_cycles = []\n for person, crush in enumerate(crushes):\n cycle_with_person = get_cycle_with_person(person, list_of_cycles)\n cycle_with_crush = get_cycle_with_crush(crush, list_of_cycles)\n if cycle_with_person is not None:\n if cycle_with_crush is not None:\n if cycle_with_person != cycle_with_crush:\n append_cycle_to_other_cycle(list_of_cycles, cycle_with_crush, cycle_with_person)\n else:\n cycle_with_person.append(crush)\n else:\n if cycle_with_crush is not None:\n cycle_with_crush.insert(0,person)\n else:\n make_new_cycle(person, crush, list_of_cycles)\n print(lcmm([ get_cycle_length(cycle) for cycle in list_of_cycles]))\n return 0\n\nif __name__ == \"__main__\":\n main()\n", "lang": "Python 3", "bug_code_uid": "771cd1f2ef663e43d6779ada83e55d8f", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "5528cecb8b2f464ff9384a008dd5679f", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9800443458980045, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = input()\ni = len(s) - 1\nc = 0\nwhile i >= 0 and c < 6:\n if s[i] == '1':pass\n else:c+=1\n i-=1\nif c < 6:\n print('no')\n exit()\nwhile i >=0:\n if s[i] == '1':\n print('yes')\n exit()\nprint('no')", "lang": "Python 3", "bug_code_uid": "cf080589417f17eaf271feedc852ea21", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "7106eca0ff751ed0fe3dd9096cbf1f4f", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5964912280701754, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "w = int(input())\nif(w%2==0):\n print(1):\nelse:\n print(2)", "lang": "Python 3", "bug_code_uid": "595679e61e898fb1b3ecb7dccc15c90a", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "06c70379dff6215a65bd682f7708c36a", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.28029197080291973, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "a, b = [int(x) for x in input().split(' ')]\nf = True\nc = 0\n\nwhile((a - c) >= 0 or (b - c) >= 0):\n c += 1\n if(f):\n if(a - c >= 0):\n f = False\n a -= c\n l = 'Valera'\n else:\n if(b - c >= 0):\n f = True\n b -= c\n l = 'Vladik'\nprint(l)\n", "lang": "Python 3", "bug_code_uid": "86312e919c909e13db592cb04eac5a2f", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "b517e46c856b6bdf864d87e48a3de954", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.945240101095198, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "p , x , y = map(int , input().split())\nTshirt = []\ns = 0\nhk = 0\nsuchk = 0\nwhile(x < y):\n hk += 1\n x += 100\n\ndef genT():\n Tshirt = []\n s = x\n i = (s // 50) % 475\n for j in range(25):\n i = (i * 96 + 42) % 475\n Tshirt.append(26 + i)\n# print(Tshirt)\n\ngenT()\nif(p in Tshirt):\n print(suchk)\n exit(0)\n\norgx = x\n\nwhile(x >= y):\n x -= 50\n genT()\n if(p in Tshirt):\n print(suchk)\n print(\"f\")\n exit(0)\n\nx = orgx\nwhile(not (p in Tshirt)):\n# Tshirt = []\n hk += 1\n if(hk % 2 == 1): suchk += 1\n x += 50\n genT()\n\nprint(suchk)\n", "lang": "Python 3", "bug_code_uid": "5508381044feb13e44de88c526faa461", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "apr_id": "244b4f3593febee843c3cad69939b6b7", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6863905325443787, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": " b=int(input())\n g=int(input())\n n=int(input()\n t1=max(0,n-b)\n t2=min(n,g)\n print(t2-t1+1)\n \n ", "lang": "PyPy 3", "bug_code_uid": "163f30370c480b377d716b6012b4c53c", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "3f897695483b6b54a24836da0654d356", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.661993769470405, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "import sys\nrange = xrange\ninput = raw_input\nimport __pypy__\nmulmod = __pypy__.intop.int_mulmod\n\nMOD = 10**9+7\nn, k = [int(x) for x in input().split()]\n\ndef f(n):\n s = 0\n for i in range(n):\n s += pow(i,k,MOD)\n s %= MOD\n return s\n\nprecalc = [0]\nfor i in range(k + 1):\n precalc.append((precalc[-1] + pow(i,k,MOD)) % MOD)\n\ndef interpolate(samples, x):\n x %= MOD\n m = len(samples)\n if x < m:\n return samples[x]\n \n modinv = [1]*m\n for i in range(2, m):\n modinv[i] = mulmod(-(MOD//i), modinv[MOD%i], MOD)\n\n invfac = [1]\n for i in range(1, m):\n invfac.append(mulmod(invfac[-1], modinv[i], MOD))\n invneg_fac = [invfac[i] * (1 - 2 * (i & 1)) for i in range(m)]\n\n xfac_down = [1]\n for j in reversed(range(x - (m - 1), x + 1)):\n xfac_down.append(xfac_down[-1] * j)\n \n xfac_up = [1]\n for j in range(x - (m - 1), x + 1):\n xfac_up.append(xfac_up[-1] * j)\n \n s = 0\n for i in range(m):\n pr = precalc[i]\n #pr = mulmod(pr, pow(x - i, MOD - 2, MOD), MOD)\n pr = mulmod(pr, xfac_down[i] * xfac_up[m - 1 - i] % MOD, MOD)\n pr = mulmod(pr, mulmod(invneg_fac[m - i - 1], invfac[i], MOD), MOD)\n s = (s + pr) % MOD\n return s\nprint (interpolate(precalc, n + 1) - (k == 0)) % MOD\n", "lang": "PyPy 2", "bug_code_uid": "420482792a94aecf98126700f79013b4", "src_uid": "6f6fc42a367cdce60d76fd1914e73f0c", "apr_id": "47c4a32681b552fdb10262539baf4265", "difficulty": 2600, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9634255129348795, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "# hardcoded F bcoz CF doesn't provide multipliers for PyPy2 :/\n\nn, k = map(int, raw_input().strip().split())\n\nif n == 10 ** 9:\n if k == 10 ** 6:\n print 617381606\n exit()\n else:\n print 729344740\n exit()\n\nif k == 0: \n print n\n exit()\n\nMOD = 1000000007\nMOD2 = MOD * MOD\n\nMAX = k + 3\nf = 1\ninvfact = [1] * MAX\n\nfor i in xrange(2, MAX):\n f *= i\n if f >= MOD2: f %= MOD\n\ninvfact[MAX - 1] = pow(f, MOD - 2, MOD)\nfor i in xrange(MAX - 2, -1, -1):\n invfact[i] = invfact[i + 1] * (i + 1)\n if invfact[i] >= MOD2: invfact[i] %= MOD\n\ny = []\n\npx = 0\nfor i in xrange(k + 2):\n px += pow(i, k, MOD)\n if px >= MOD: px -= MOD\n y.append(px)\n\n if i == n:\n print y[i]\n exit()\n\n# Lagrange Interpolation\nPROD = 1\nfor i in xrange(k + 2):\n PROD *= (n - i)\n if PROD >= MOD2: PROD %= MOD\n\nans = 0\nsgn = 0\nif k & 1: sgn = 1\nfor i in xrange(k + 2):\n sgn ^= 1\n \n add = pow(n - i, MOD - 2, MOD)\n add *= (invfact[i] * invfact[k + 1 - i] * y[i])\n if add >= MOD2: add %= MOD\n\n if sgn: add = MOD - add\n\n ans += add\n if ans >= MOD: ans -= MOD\n\nans *= PROD\nans %= MOD\n\nprint ans", "lang": "PyPy 2", "bug_code_uid": "06928de93faba90238fa2bedbde1a43a", "src_uid": "6f6fc42a367cdce60d76fd1914e73f0c", "apr_id": "30a48fe30fa337f3164f20e6dbcedafc", "difficulty": 2600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.14184397163120568, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\nl=[]\nl=list(map(int,input().split()))[:12]\nfor j in range(0,12):\n for k in range(j+1,12):\n x=l[j]\n y=l[k]\n if(x=n):\n print(\"1\")\nelse:\n s=l[0]\n c=1\n for k in range(1,12):\n s=s+l[k]\n c=c+1\n if(s>=n):\n break\n print(c)\n if(c=1):\n print(\"-1\")\n", "lang": "Python 3", "bug_code_uid": "0a39522bbc1bcdee6b31a6e0030dcb7e", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "1324b823376be0f60f6d819fcc95a063", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.23488573908012728, "equal_cnt": 30, "replace_cnt": 21, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 30, "bug_source_code": "input = raw_input\nn, m = map(int, input().split(\" \"))\n\nif n >= 2 and m >= 2:\n c = [2 for i in range(n+1)]\n t = [2 for i in range(n+1)]\n y = [2 for i in range(n+1)]\n #t = c.copy()\n #y = c.copy()\n #c[2] = 2\n #t[2] = 2\n #y[2] = 2\n\n #T = [[0 for i in range(m+1)] for i in range(n+1)]\n T2 = [2 for i in range(n+1)]\n for i in range(3, n+1):\n c[i] = c[i-1] + y[i-1]\n #t[i] = t[i-1]\n y[i] = c[i-1]\n\n #C[i][2] = 2\n #T[i][2] = c[i] + y[i] - 2\n T2[i] = c[i] + y[i] - 2\n #Y[i][2] = t[i] = 2\n\n \n #C = [[2 for i in range(m+1)] for i in range(n+1)]\n Cn = [2 for i in range(m+1)]\n #Tn2 = T[n][2] = T2[n]\n #T = [[Tn2 for i in range(m+1)] for i in range(n+1) ]\n Tn = [T2[n] for i in range(m+1)]\n #Y = C.copy()\n #Yn = Cn.copy()\n Yn = [2 for i in range(m+1)]\n #T[2][2] = c[2] + y[2] - 2\n #Y[2][2] = t[2]\n\n\n for j in range(3, m+1):\n #if n == 2 and j == 3:\n # Cn[j] = Yn[j-1] + Cn[j-1]\n # Yn[j] = Yn[j-1] + Cn[j-1]\n\n #else:\n if True:\n #C[n][j] = C[n][2] = 2\n #Cn[j] = Cn[2] = 2\n #T[n][j] = T[n][2]\n #Tn[j] = Tn[2]\n #Y[n][j] = Y[n][j-1] + C[n][j-1]\n Cn[j] = Yn[j-1] + Cn[j-1]\n Yn[j] = Cn[j-1]\n #print(Yn[j])\n\n #out = C[n][m] + Y[n][m] + T[n][m]\n\n #for j in range(m+1):\n # print(j, Cn[j], Tn[j], Yn[j])\n\n out = Cn[m] + Yn[m] + Tn[m]\n\nelif n == 1 and m == 1:\n out = 2\nelse:\n n = max(n, m)\n b1 = [0 for i in range(n+1)]\n b2 = [0 for i in range(n+1)]\n w1 = [0 for i in range(n+1)]\n w2 = [0 for i in range(n+1)]\n #b2 = b1.copy()\n #w1 = b1.copy()\n #w2 = b1.copy()\n b1[1] = 1\n w1[1] = 1\n\n for i in range(2, n+1):\n b1[i] = w1[i-1] + w2[i-1]\n b2[i] = b1[i-1]\n w1[i] = b1[i-1] + b2[i-1]\n w2[i] = w1[i-1]\n out = b1[n] + b2[n] + w1[n] + w2[n]\n\nprint(out)", "lang": "PyPy 2", "bug_code_uid": "35ecaadb5627c0de42ecfb98df6c6847", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "f06b7374d66ccd40f051cca206cfe525", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9792626728110599, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "# ========= /\\ /| |====/|\n# | / \\ | | / |\n# | /____\\ | | / |\n# | / \\ | | / |\n# ========= / \\ ===== |/====| \n# code\n\ndef condn(x,n,m):\n return (x//2) >= n and (x//3) >= m and (x//2 + x//3 - x//6) >= (n+m)\n \nif __name__ == \"__main__\":\n n,m = map(int,input().split())\n x = 3000010\n while condn(x,n,m):\n x -= 1\n print(x+1)", "lang": "Python 3", "bug_code_uid": "03dec7f22edd6d2997762a715f16e6d4", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "apr_id": "beaf90bf87bcd1609421cab2a3f0cff7", "difficulty": 1600, "tags": ["greedy", "math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.34146341463414637, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\nsum = 0\nL = [x for x in range(1,n+1)]\nfor i in L:\n c = str(i)\n sum = sum+len(c)\nprint(sum)", "lang": "PyPy 3", "bug_code_uid": "cc208e9cbccd328849a5560da7e42076", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "34fc6de5609071f89b7da42836df8ada", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9541284403669725, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = input().split()\na = int(n[0])\nb = int(n[1])\n\nm = input().split()\nc = int(m[0])\nd = int(m[1])\n\nfor i in range(100):\n for j in range(100):\n if(a*i+b=c*j+d):\n print (b+a*i)\n\nprint (\"-1\")", "lang": "Python 3", "bug_code_uid": "e90c49975e30250dff4e953476483a41", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "apr_id": "412a1d513885a88e2f72db7f19fc133e", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8793103448275862, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n, m = raw_input().split(\" \")\nn = int(n)\nm = int(m)\ni=0\nfor a in range(0, n*m):\n for b in range(0, n*m):\n if a*a+b == n and a+b*b == m:\n i=i+1\nprint i", "lang": "Python 2", "bug_code_uid": "4a7bbbd98f3254d3a1dc38e56c4c7f76", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "10fa0209d93117554e3cd6b0b5e3e480", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9329529243937232, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "from sys import stdin\nn=int(stdin.readline().strip())\ns=list(map(int,stdin.readline().strip().split()))\nans=0\ny=2\nwhile len(s)>0:\n s1=[]\n arr=y\n flag=False\n for i in range(len(s)):\n if s[i]%arr!=0:\n s1.append(s[i])\n else:\n flag=True\n s=s1.copy()\n if flag==True:\n ans+=1\n y+=1\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "f99fd39fd481191ebfd9ee382a3478e6", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "e68638bcef80c3b69d34d56bc887554d", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6173361522198731, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "a = input()\nb = input()\n\nla = len(a)\nlb = len(b)\nif (la>lb or la 0 ):\n print(\"NO\")\nelif(la == flag2):\n print(\"YES\")\n", "lang": "Python 3", "bug_code_uid": "0c8fd7c12c39df7369f7b01a2f6322d5", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "9ddf4a98571f77232c7c30ad72ff14f1", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5411334552102377, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n = int(input())\nl = list(map(int,input().split()))\ns = 0\nwhile(s=0 and c>=0):\n print(int(d),int(c),int(n-d-c))\n break\n \n", "lang": "Python 3", "bug_code_uid": "8b67369075d34fd21f0247ea23202f5f", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "3084ed9c93386660b00705839305e0ea", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2891156462585034, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "def choose(m, n, mod):\n x = m - n\n y = 1\n for i in range(1, n + 1):\n x += 1\n y *= x\n y //= i\n return y % mod\n\nn = int(raw_input())\nmod = 1000000007\nresult = (2 * choose(2 * n - 1, n - 1, mod) - n) % mod\nprint(result)\n", "lang": "PyPy 2", "bug_code_uid": "e115c4c368ed61317971ecf0682b8cd0", "src_uid": "13a9ffe5acaa79d97df88a069fc520b9", "apr_id": "2f689b0f61a153a2ada7479115a2f0bc", "difficulty": 1900, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8789161727349704, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def maximbuys(n,k):\n if (k==0 or k==n):\n return [0,0]\n if (n==2 and k==1):\n return [1,1]\n i = 2\n count = 0\n while(i<=n-1):\n i+=3\n count+=1\n if (k<=count):\n return [1,2*k]\n maxHouse = 2*count\n if (i==n+2):\n return [1,maxHouse-(k-count)]\n if (i==n+1):\n if (k==count+1):\n return [1,maxHouse]\n else:\n return [1,maxHouse-(k-count-1)]\n if(i==n):\n if (k==count+1):\n return [1,maxHouse+1]\n if (k==count+2):\n return [1,maxHouse]\n return [1,maxHouse-(k-count-2)]\n(n,k) = map(int,input().split())\nprint(*maximbuys(n,k))", "lang": "Python 3", "bug_code_uid": "c6400cf410ecea739d7be9ea73eeb1c1", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "49486a2d9db79aac4ced579d0685e491", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3981042654028436, "equal_cnt": 26, "replace_cnt": 9, "delete_cnt": 14, "insert_cnt": 4, "fix_ops_cnt": 27, "bug_source_code": "s1 = input()\ns2 = input()\nletters = list(\"abcdefghijklmnopqrstuvwxyz\")\n\ncounter1 = 0\nfor i in s1 :\n counter1 += letters.index(i.lower)\n\n\ncounter2 = 0\nfor j in s2 :\n counter2 += letters.index(j.lower)\n\n\nif counter2 > counter1 :\n print(-1)\n\nelif counter1 > counter2 :\n print(1)\n\nelse :\n print(0)\n", "lang": "Python 3", "bug_code_uid": "05b6a7bd5451d7ca4877a42aefac9c8f", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "334534719bc88f3f4ff2bd794ba1918a", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7563380281690141, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "\nn,t = map(int,input().split()) \n\nstring = input() \n\nstrr = [char for char in string]\nif len(strr)==1 :\n \n print(string)\n\nfor _ in range(t) :\n i = 0\n \n while(True) :\n \n if(strr[i]==\"B\" and strr[i+1]==\"G\") :\n \n strr[i] = \"G\" \n strr[i+1] = \"B\"\n \n i = i + 2 \n else :\n i = i + 1\n \n if i ==n-1 :\n \n break\n if i==n :\n break\n \n \nfin = \"\" \n\nfor i in strr :\n fin = fin + i \n \nprint(fin)\n \n \n \n \n ", "lang": "PyPy 3", "bug_code_uid": "a4dda3155be42a8f3329f49a055f62fe", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "e8e6ef49b227bf41cd265d5b7461de31", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.15441630636195183, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "N = int(input())\nA = list(map(int, input().strip().split(' ')))\n\n\nlongest = [-1, -1]\nMAXcount = 0\nCURcount = 0\ncounting = 0\ntemp = [-1, -1]\n\nfor i in range(N-1):\n if (A[i+1] == A[i]+1):\n \n if (counting == 0):\n temp[0] = i\n counting = 1\n CURcount+=1\n else:\n if(counting == 1):\n temp[1] = i+1\n counting = 0\n MAXcount = CURcount\n CURcount = 0\n\n if counting == 1 and i == N-2:\n temp[1] = i+2\n\n if((temp[1] - temp[0]) > (longest[1] - longest[0])):\n longest[0] = temp[0]\n longest[1] = temp[1]\n\nif A[-1] == 1000 and (longest[1] - longest[0]) == N:\n print(N-1)\nelif A[0] == 1 and (longest[1] - longest[0]) == N:\n print(N-1)\nelse:\n print((longest[1] - longest[0]) - 2)\nelif (longest[1] - longest[0]) <= 2:\n print(0)", "lang": "Python 3", "bug_code_uid": "4c72a8ffc7e9658e3ada7bf1a39ef821", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198", "apr_id": "0f208af69efbca83de48665d09133c64", "difficulty": 1300, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.39322033898305087, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "import math\ns=[]\nqw=\"\"\nz=list(map(int,input().split()))\na=z[0]*z[1]\nb=z[2]**2*math.pi\nd=a//b\nfor i in range(1,int(d)+1):\n s.append(i)\nif s[-1]%2==0:\n print(\"Secomd\")\nelse:\n print(\"First\")\n\n", "lang": "Python 3", "bug_code_uid": "dccbe805af2476b6a90e764ee8356407", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "778278f3901341f2b27d4fcff8708393", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8547945205479452, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "n=int(input())\nc=0\ny=n\nwhile(c!=1):\n y+=1\n a=y/1000;\n b=y/100%10\n c=y/10%10\n d=y%10\n if(a!=b && a!=c&& a!=d && b!=c && b!=d && c!=d):\n c=1\nprint(y)", "lang": "PyPy 3", "bug_code_uid": "a9d68d53627156d006c938163d68d640", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "apr_id": "5a0285fff197d0b6953161d12f58fce5", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.614138438880707, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "from collections import defaultdict\nimport sys\n\ndef gcd(a1, a2):\n if a2 == 0:\n return a1\n else:\n return gcd(a2, a1 % a2)\nif __name__ == \"__main__\":\n #n, m = list(map(int, input().split()))\n a1, b1, a2, b2, L, R = map(int, input().split())\n LCM = a1 * a2 // gcd(a1, a2)\n if abs(b1 - b2) % gcd(a1, a2) != 0:\n print(0)\n sys.exit(0)\n for i in range(max([b1, b2, L]), R + 1):\n if (i - b1) % a1 == 0 and (i - b2) % a2 == 0:\n print((R - i) // LCM + 1)\n sys.exit(0)\n print(0)\n ", "lang": "Python 3", "bug_code_uid": "23a2ea4dbaf6f802aea01d72dbdbe903", "src_uid": "b08ee0cd6f5cb574086fa02f07d457a4", "apr_id": "f8cefc36051c97c08ced5c201c45a253", "difficulty": 2500, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.16608187134502925, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "a1,b1,a2,b2,l,r=map(int,raw_input().split())\nks1=(l-b1)/a1\nke1=(r-b1)/a1\nks2=(l-b2)/a2\nke2=(r-b2)/a2\n\nlst1=[]\nlst2=[]\nks1=max(0,ks1)\nke1=max(0,ke1)\nks2=max(0,ks2)\nke2=max(0,ke2)\nfor i in range(ks1,ke1+2):\n if(a1*i+b1>=l and a1*i+b1<=r):\n lst1.append(a1*i+b1)\nfor i in range(ks2,ke2+2):\n if(a2*i+b2>=l and a2*i+b2<=r):\n lst2.append(a2*i+b2)\n\nset1=set(lst1)\nset2=set(lst2)\n\nl=len(set1.intersection(set2))\nprint l\n \n", "lang": "Python 2", "bug_code_uid": "a3f756bfaf844768e5f09ea5be006965", "src_uid": "b08ee0cd6f5cb574086fa02f07d457a4", "apr_id": "b2f0838fa9267929436598db70b09cc7", "difficulty": 2500, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3654320987654321, "equal_cnt": 28, "replace_cnt": 15, "delete_cnt": 6, "insert_cnt": 8, "fix_ops_cnt": 29, "bug_source_code": "T,A,B=map(int,raw_input().strip().split(\" \"))\n\ndef gcd(a, b):\n\tif b == 0:\n\t\treturn a\n\treturn gcd(b, a%b)\n\nif A>B:\n\tA,B=B,A\n\nG=gcd(A,B)\nL=A*B/G\n\ntie = (T/L)*A + min(A-1,(T%L))\n\ng=gcd(tie,T)\nprint \"%d/%d\" % (tie/g,T/g)", "lang": "Python 3", "bug_code_uid": "b007661808e9691d16743571f59d53aa", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "bb0549efba2c7feb2f57d436b6f5f055", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9358047016274864, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import sys\n#sys.stdin = open('game.in', 'r')\n#sys.stdout = open('game.out', 'w')\n\nline = raw_input().split(' ')\nA, B, N = int(line[0]), int(line[1]), int(line[2])\nN -= 1\n\nnl = 0\nlist = [0]*100\nwhile 1 == 1:\n\tcurb = nl + 1\n\tle, ri = 1, N\n\twhile le < ri:\n\t\tcura = (le+ri+1)//2\n\t\tif (cura**curb <=N):\n\t\t\tle = cura\n\t\telse:\n\t\t\tri = cura-1;\n\tif (le > 1):\n\t\tnl += 1\n\t\tlist[nl] = le\n\telse:\n\t\tbreak\n\nwin = []\nfor i in range(50000):\n\twin.append([])\n\tfor j in range(50):\n\t\twin[i].append(-1);\n\t\t\ndef get(win, list, nl, a, b, n):\n\tif (a == 1) and (b > nl):\n\t\treturn 3\n\tif (a > list[b]):\n\t\treturn 1\n\tif (b == 1) and (a > list[2]):\n\t\tif ((a&1) != (n&1)):\n\t\t\treturn 1\n\t\telse:\n\t\t\treturn 2\n\tif (win[a][b] != -1):\n\t\treturn win[a][b]\n\tx, y = get(win, list, nl, a+1, b, n), get(win, list, nl, a, b+1, n)\n\tif (x == 2) and (y == 2):\n\t\twin[a][b] = 1\n\t\treturn 1\n\tif (x == 3) and (y == 3):\n\t\twin[a][b] = 3\n\t\treturn 3\n\twin[a][b] = 2\n\treturn 2\n\nret = get(win, list, nl, A, B, N)\nif (ret == 1):\n\tprint \"Masha\"\nif (ret == 2):\n\tprint \"Stas\"\nif (ret == 3):\n\tprint \"Missing\"", "lang": "Python 2", "bug_code_uid": "ebcbe41a437dff0624f1f46fa5e49bab", "src_uid": "cffd5c0b7b659649f3bf9f2dbd20ad6b", "apr_id": "ff2e1a40303517da5e78ed26b82b4cc1", "difficulty": 2000, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.98438855160451, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import sys\n#sys.stdin = open('game.in', 'r')\n#sys.stdout = open('game.out', 'w')\n\nline = raw_input().split(' ')\nA, B, N = int(line[0]), int(line[1]), int(line[2])\nN -= 1\n\nnl = 0\nlist = [0]*100\nwhile 1 == 1:\n\tcurb = nl + 1\n\tle, ri = 1, N\n\twhile le < ri:\n\t\tcura = (le+ri+1)//2\n\t\tif (cura**curb <=N):\n\t\t\tle = cura\n\t\telse:\n\t\t\tri = cura-1;\n\tif (le > 1):\n\t\tnl += 1\n\t\tlist[nl] = le\n\telse:\n\t\tbreak\n\nwin = []\nfor i in range(50000):\n\twin.append([])\n\tfor j in range(50):\n\t\twin[i].append(-1);\n\t\t\ndef get(win, list, nl, a, b, n):\n\tif (a == 1) and (b > nl):\n\t\treturn 3\n\tif (a > list[b]):\n\t\treturn 1\n\tif (b == 1) and (a > list[2]):\n\t\tif ((a&1) != (n&1)):\n\t\t\treturn 1\n\t\telse:\n\t\t\treturn 2\n\tif (win[a][b] != -1):\n\t\treturn win[a][b]\n\tx, y = get(win, list, nl, a+1, b, n), get(win, list, nl, a, b+1, n)\n\tif (x == 2) or (y == 2):\n\t\twin[a][b] = 1\n\t\treturn 1\n\tif (x == 3) or (y == 3):\n\t\twin[a][b] = 3\n\t\treturn 3\n\twin[a][b] = 2\n\treturn 2\n\t\nj = nl\nwhile j > 0:\n\ti = list[j]\n\twhile i > 0:\n\t\tget(win, list, nl, i, j, N)\n\t\ti -= 1\n\tj -= 1\n\nret = get(win, list, nl, A, B, N)\nif (ret == 1):\n\tprint \"Masha\"\nif (ret == 2):\n\tprint \"Stas\"\nif (ret == 3):\n\tprint \"Missing\"", "lang": "Python 2", "bug_code_uid": "3532e175401fb97a245caf30c8eda6c6", "src_uid": "cffd5c0b7b659649f3bf9f2dbd20ad6b", "apr_id": "ff2e1a40303517da5e78ed26b82b4cc1", "difficulty": 2000, "tags": ["dp", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9942528735632183, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\ns = input()\nif s == \"-\"*n :\n print(0)\nelif s == \"+\"*n :\n print(len(s))\nelse:\n inc = 0\n dec = 0\n for i in range(n):\n if s[i] == \"+\":\n inc += 1\n elif s[i] == \"-\":\n dec += 1\n if inc < dec:\n inc += 1\nprint(inc-dec)\n \n \n \n \n \n", "lang": "Python 3", "bug_code_uid": "e5c7e1077e7474fb7d3a47c7580dffdf", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "dd6cb61cba21c065efb37cda057d6cec", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9968454258675079, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\ns=input()\nmi=0\nfor i in s:\n if i == '-' and mi==0:\n mi+=0\n elif i == '-' and mi>0:\n mi-=1\n else:\n mi+=1\nprint(m)\n", "lang": "Python 3", "bug_code_uid": "d3c1d2e67752c700001d8dae3e638145", "src_uid": "a593016e4992f695be7c7cd3c920d1ed", "apr_id": "811ffc938cc282cd99598511b4410085", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.15551537070524413, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "'''\nt=int(input())\nfor _ in range(t):\n n=int(input())\n if n%2==0:\n print([1,1000]*(n//2))\n else:\n print([1,1000]*((n-1)//2)+[1000])\n'''\n\nt=int(input())\nfor _ in range(t):\n n=int(input())\n if n%2==0:\n print(n//2,n//2)\n else:\n multiples = set()\n sol=1\n multiples.update(range(4,n+1,2))\n for i in range(3, n,2):\n if i not in multiples:\n multiples.update(range(i*i, n+1, i))\n if n%i==0:\n sol=i\n print(sol,n-sol)\n'''\nn=int(input())\nmultiples = set()\nsol=1\nmultiples.update(range(4,n+1,2))\nfor i in range(3, n,2):\n if i not in multiples:\n multiples.update(range(i*i, n+1, i))\n if n%i==0:\n sol=i\nprint(sol)\n'''\n\n\n\n", "lang": "Python 3", "bug_code_uid": "afb3d6257bfe97d9995b2031696b4274", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "9cec1258ddef422d1415aeeb3ce6a3fe", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9258809234507898, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "digits = int(input())\n\nticket = input()\nleft = list(ticket[0:digits])\nright = list(ticket[digits:])\n\nleft.sort()\nright.sort()\n\nflagLess = 0\nflagMore = 0\nfinalFlag = 0\n\nfor i in range(digits):\n if(left[i] => right[i]):\n flagMore = 1\n\nfor i in range(digits):\n if(left[i] <= right[i]):\n flagLess = 1\n \n\nif(flagMore or flagLess):\n print(\"NO\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "6c4c1d108c2fdcf6931e1fb29086dec5", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "960145ea1bb79516cca678b4fdbc3c5e", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9607616849394114, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "\n\npointA = raw_input().split()\npointA[0] = int(pointA[0])\npointA[1] = int(pointA[1])\n\npointB = raw_input().split()\npointB[0] = int(pointB[0])\npointB[1] = int(pointB[1])\n\npointC = raw_input().split()\npointC[0] = int(pointC[0])\npointC[1] = int(pointC[1])\n\ndef grad(a, b):\n if a[0] - b[0] != 0:\n ans = float(a[1] - b[1]) / float(a[0] - b[0])\n return ans\n else:\n return 'undef'\n\nonroad = grad(pointA, pointB)\ngo = grad(pointB, pointC)\n\nif go == onroad:\n print 'TOWARDS'\nelse:\n if pointA[1] == pointB[1] and pointA[0] < pointB[0]:\n if pointC[1] >= pointB[1]:\n print 'LEFT'\n else:\n print 'RIGHT'\n elif pointA[1] == pointB[1] and pointA[0] > pointB[0]:\n if pointC[1] >= pointB[1]:\n print 'LEFT'\n else:\n print 'RIGHT'\n elif pointA[0] == point[0] and pointA[1] > pointB[1]:\n if pointC[1] >= pointB[1]:\n print 'LEFT'\n else:\n print 'RIGHT'\n elif pointA[0] == point[0] and pointA[1] > pointB[1]:\n if pointC[1] <= pointB[1]:\n print 'LEFT'\n else:\n print 'RIGHT'\n elif pointA[1] >= pointB[1] and pointA[0] >= pointB[0]:\n if pointC[0] <= pointB[0]:\n print 'RIGHT'\n else:\n print 'LEFT'\n elif pointA[1] >= pointB[1] and pointA[0] <= pointB[0]:\n if pointC[0] <= pointB[0]:\n print 'RIGHT'\n else:\n print 'LEFT'\n elif pointA[1] <= pointB[1] and pointA[0] >= pointB[0]:\n if pointC[0] <= pointB[0]:\n print 'LEFT'\n else:\n print 'RIGHT'\n else:\n if pointC[0] <= pointB[0]:\n print 'LEFT'\n else:\n print 'RIGHT'\n\n\n\n\n\n\n\n\n", "lang": "Python 2", "bug_code_uid": "6843799522d9f14aee4f399e31d18a1e", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "30ecdc08df9ec8df6be956cc10f3347b", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5541125541125541, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "A = int(input())\nB = [int(x) for x in input().split()]\nprint(B.sort(reverse))\n", "lang": "Python 3", "bug_code_uid": "15a975f4e9584f3d1426d19a50af97ed", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "997aa8240e1b114b12dd468f2b981401", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9882044560943644, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "a, b = input().split()\nn=int(input())\nif a==\"^\":\n a1=1\nelif a==\"<\":\n a1=2\nelif a==\"v\":\n a1=3\nelif a==\">\":\n a1=4\nif b==\"^\":\n b1=1\nelif b==\"<\":\n b1=2\nelif b==\"v\":\n b1=3\nelif b==\">\":\n b1=4 \nn=n%4\na2=a1-n\na3=a1+n\nif a2<=0:\n a2=a2+4\nif a3>4:\n a3=a3-4\nif (b1==a2)&(b1!=a3):\n print \"cw\"\nelif (b1!=a2)&(b1==a3):\n print \"ccw\"\nelse:\n print \"undefined\"", "lang": "Python 3", "bug_code_uid": "f1c8faaa51a332e0891ec95057d6b54d", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "7d6b396927881f4d4cb30fbe957fd469", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9985228951255539, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = input().split(' ')\nn = int(input())\nst, end = a[0], a[1]\ncw = ['^', '>', 'v', '<']\nccw = ['^', '<', 'v', '>']\ni, j = cw.index(st), ccw.index(st)\nif cw[(i+n%4)%4] == end and ccw[(j+n%4)%4] == end\n print('undefined')\nelif cw[(i+n%4)%4] == end:\n print('cw')\nelif ccw[(j+n%4)%4] == end:\n print('ccw')\nelse:\n print('undefined')", "lang": "Python 3", "bug_code_uid": "7a734cc296527f599cf8d8f9532e3b55", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "34e6a5221595f0224bc748be31fc6d15", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7473958333333334, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\na = [int(x) for x in input().strip().split(' ')]\nfor i, x in enumerate(a):\n if x == 29:\n a[i] = 28\nb = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\nc = b * 10\n\nflag = False\nfor i in range(len(c):\n if a == c[i:i + len(a)]:\n flag = True\n\nif flag == True: print(\"Yes\")\nelse: print(\"No\")", "lang": "Python 3", "bug_code_uid": "bb2dfb3e8706855d073b88ece097c149", "src_uid": "d60c8895cebcc5d0c6459238edbdb945", "apr_id": "deaefff6edd870ca593924664368effd", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.40877914951989025, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import sys\ninput = sys.stdin.readline\nmod=998244353\n\nN=2000\nCombi=[[] for i in range(N+1)]\nCombi[0]=[1,0]\n\nfor i in range(1,N+1):\n Combi[i].append(1)\n for j in range(i):\n Combi[i].append(Combi[i-1][j]+Combi[i-1][j+1])\n Combi[i].append(0)\n\n\nn,m,k=map(int,input().split())\n\n\nANS=Combi[n-1][k]%mod *m %mod *pow(m-1,k,mod)%mod\nprint(ANS)\n", "lang": "PyPy 3", "bug_code_uid": "3d64bc47ea59cbc40275590772b1ea64", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "apr_id": "71073b48cb729179f3957c2e41e2a807", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9850746268656716, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = input().split()\nn, d = int(a[0]), int(a[1])\na = [int(x) for x in input().split()]\nm = int(input())\na.sort()\nsum = 0\nfor i in [x in range(m) if x < n]:\n sum += a[i]\nsum -= (m-i-1)*d\nprint(sum)", "lang": "Python 3", "bug_code_uid": "678ed00071e7bda2affa1eff7b19cd9d", "src_uid": "5c21e2dd658825580522af525142397d", "apr_id": "d3120fd01649ccb6f160229c05ca7d82", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9035812672176309, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 9, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": " n = int(input())\n t = [0] * (n + 1) \n for i in range(2, n // 2 + 1):\n if t[i] == 0:\n for j in range(2 * i, n + 1, i):\n t[j] += 1 \n print(t.count(2))", "lang": "Python 3", "bug_code_uid": "e520677b1b917874e095cc0d12fa53f9", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "d69edea512925b637ae637c333945515", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9118357487922706, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "from math import factorial\ndef solve(n,p,a):\n if p is 9:\n if n>=a[9]:\n return 1\n else:\n return 0\n elif p is 0:\n ans=0\n for i in range(a[0],n):\n z=solve(n-i,1,a)\n z*=factorial(n-1)\n z//=factorial(i)\n z//=factorial(n-1-i)\n ans+=z\n return ans\n else:\n ans=0\n for i in range(a[p],n+1):\n z=solve(n-i,p+1,a)\n z*=factorial(n)\n z//=factorial(i)\n z//=factorial(n-i)\n ans+=z\n return ans\nhell=1000000007\nn=int(input())\na=input().rstrip().split(' ');\nfor i in range(0,len(a)):\n a[i]=int(a[i])\nans=0\nfor i in range(1,n+1):\n ans+=solve(i,0,a)\n ans%=hell\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "5a2ca94f1bc555cca8abd7a3c57e718b", "src_uid": "c1b5169a5c3b1bd4a2f1df1069ee7755", "apr_id": "6c57ef90efda9d53c2be2dbb68a836a4", "difficulty": 1900, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9361179361179361, "equal_cnt": 39, "replace_cnt": 38, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 38, "bug_source_code": "\"\"\"Template for Python Competitive Programmers prepared by Mayank Chaudhary \"\"\"\n\n# to use the print and division function of Python3\nfrom __future__ import division, print_function\n\n\"\"\"value of mod\"\"\"\nMOD = 998244353\nmod = 10**9 + 7\n\n\"\"\"use resource\"\"\"\n# import resource\n# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])\n\n\"\"\"for factorial\"\"\"\n\n# def prepare_factorial():\n# fact = [1]\n# for i in range(1, 105):\n# fact.append((fact[-1] * i) % mod)\n# ifact = [0] * 105\n# ifact[104] = pow(fact[104], mod - 2, mod)\n# for i in range(104, 0, -1):\n# ifact[i - 1] = (i * ifact[i]) % mod\n#\n# return fact, ifact\n\n\"\"\"uncomment next 4 lines while doing recursion based question\"\"\"\n# import threading\n# threading.stack_size(1<<27)\nimport sys\n# sys.setrecursionlimit(10000)\n\n\n\"\"\"uncomment modules according to your need\"\"\"\n# from bisect import bisect_left, bisect_right, insort\n# import itertools\n# from math import floor, ceil, sqrt, degrees, atan, pi\n# from heapq import heappop, heapify, heappush\n# from random import randint as rn\n# from Queue import Queue as Q\n# from collections import Counter, defaultdict, deque\n# from copy import deepcopy\n'''\ndef modinv(n, p):\n return pow(n, p - 2, p)\n'''\n\n\n# def ncr(n, r, fact, ifact): # for using this uncomment the lines calculating fact and ifact\n# t = (fact[n] * (ifact[r]*ifact[n-r]) % mod)% mod\n# return t\n\n\n\ndef get_ints(): return map(int, sys.stdin.readline().strip().split())\ndef get_array(): return list(map(int, sys.stdin.readline().strip().split()))\ndef input(): return sys.stdin.readline().strip()\n\n\n# def GCD(x, y):\n# while (y):\n# x, y = y, x % y\n# return x\n\n# def lcm(x, y):\n# return (x*y)//(GCD(x, y))\n\n# def get_xor(n):\n# return [n,1,n+1,0][n%4]\n\n# def binary_expo(a, b):\n#\n# result = 1\n# while b:\n# if b&1:\n# result *= a\n# b-=1\n# else:\n# a *= a\n# b >>= 1\n# return result\n\n\n\n\"\"\"*******************************************************\"\"\"\n\ndef main():\n\tn,t,k,d=get_ints()\n\tx = (d//t + 1) * k < n\n\tif x:\n \tprint(\"YES\")\n\telse:\n \tprint(\"NO\")\n\n\n\"\"\" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------\"\"\"\n\npy2 = round(0.5)\nif py2:\n from future_builtins import ascii, filter, hex, map, oct, zip\n\n range = xrange\n\nimport os, sys\nfrom io import IOBase, BytesIO\n\nBUFSIZE = 8192\n\n\nclass FastIO(BytesIO):\n newlines = 0\n\n def __init__(self, file):\n self._file = file\n self._fd = file.fileno()\n self.writable = \"x\" in file.mode or \"w\" in file.mode\n self.write = super(FastIO, self).write if self.writable else None\n\n def _fill(self):\n s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])\n return s\n\n def read(self):\n while self._fill(): pass\n return super(FastIO, self).read()\n\n def readline(self):\n while self.newlines == 0:\n s = self._fill();\n self.newlines = s.count(b\"\\n\") + (not s)\n self.newlines -= 1\n return super(FastIO, self).readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.getvalue())\n self.truncate(0), self.seek(0)\n\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n if py2:\n self.write = self.buffer.write\n self.read = self.buffer.read\n self.readline = self.buffer.readline\n else:\n self.write = lambda s: self.buffer.write(s.encode('ascii'))\n self.read = lambda: self.buffer.read().decode('ascii')\n self.readline = lambda: self.buffer.readline().decode('ascii')\n\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\n\n# sys.stdin = open('input.txt', 'r')\n# sys.stdout = open('output.txt', 'w')\n\n\"\"\" main function\"\"\"\n\nif __name__ == '__main__':\n main()\n # threading.Thread(target=main).start()", "lang": "PyPy 3", "bug_code_uid": "0f71c4368a228f47e3b753015a08f619", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "d81fb6eaedbda4fbb89b7e659dabfd3f", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9962121212121212, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from collections import Counter\n\nrep = input()\na = Counter({'B': 0, 'S': 0, 'C': 0})\na.update(rep)\nrep = a['B'], a['S'], a['C']\n\ninventory = Bi, Si, Ci = list(map(int, input().split(' ')))\n\nfor ingredient in range(3):\n if rep[ingredient] == 0:\n inventory[ingredient] = 0\n\nprice = list(map(int, input().split(' ')))\n\nmoney = int(input())\n\noutput = 0\n\n\ndef make_sandwich():\n global output\n for idx in range(len(inventory)):\n inventory[idx] -= rep[idx]\n output += 1\n\n\nwhile sum(inventory) != 0:\n if all([inventory[idx] >= rep[idx] for idx in range(len(inventory))]):\n make_sandwich()\n continue\n\n for ingredient in range(len(inventory)):\n if inventory[ingredient] < rep[ingredient] and money >= price[ingredient]:\n inventory[ingredient] += 1\n money -= price[ingredient]\n break\n\n if ingredient == 3:\n inventory = [0]\n\np = 0\nfor ingredient in range(3):\n p += rep[ingredient] * price[ingredient]\n\noutput += money // p\nmoney -= p * output\n\nprint(output)\n", "lang": "PyPy 3", "bug_code_uid": "3f386ae38bf31cbf63779ad2cd748fe5", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "fd32003e6472649d11a98d1df2278531", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.34210526315789475, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "s = input()\ncf = 'CODEFORCES'\n\nidx = 0\nfor c in s:\n if (c == cf[idx]):\n idx += 1\n if idx == len(cf):\n print(\"YES\")\n break\nelse:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "74ac0567c97a78b489e42df572dbb9cb", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "apr_id": "5096be335086b5f88623f4d916b814b8", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.63268156424581, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "a,b,f,k=map(int,input().split())\ni=0\nbi=b\nans=0\nwhile ibi:\n print(-1)\n exit()\n else:\n bi-=f\n if k-i==1:\n if a-f>bi:\n bi=b\n ans+=1\n if a-f>bi:\n print(-1)\n exit()\n else:\n i+=1\n if 2*(a-f)>bi:\n bi=b\n ans+=1\n if 2*(a-f)>bi:\n print(-1)\n exit()\n bi-=2*(a-f)\n if k-i==1:\n if f>bi:\n bi=b\n ans+=1\n if f>bi:\n print(-1)\n exit()\n else:\n if 2*f>bi:\n bi=b\n ans+=1\n if 2*f>bi:\n print(-1)\n exit()\n else:\n bi-=f\n i+=1\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "6d4eb9e26a39eb62a137b8fa5e9a5c56", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "06dd49a01e9681a9d202dd4af097dfb4", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8987068965517241, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "a,b,f,k=map(int,input().split())\n#if max(2*f,2*(a-f))>b and k!=1:\n# print('-1')\nif k==1 and max(f,a-f)>b:\n print('-1')\nelse:\n m=b\n dir=1\n l=0\n pos=1\n x=0\n z=0\n while l=f and dir==1:\n m-=f\n dir=1\n pos=2\n elif pos==2 and dir==1:\n if k-l>1 and m>=2*(a-f):\n dir=2\n pos=2\n l+=1\n m-=(2*(a-f))\n elif k-l==1 and m>=(a-f):\n l+=1\n else:\n m=b\n x+=1\n elif pos==2 and dir==2:\n if k-l>1 and m>=2*(f):\n dir=1\n pos=2\n l+=1\n m-=(2*(f))\n elif k-l==1 and m>=(f):\n l+=1\n else:\n m=b\n x+=1 \n else:\n z=1\n break\n if z==0:\n print(x)\n else:\n print('-1')", "lang": "Python 3", "bug_code_uid": "e78848ddcb130862a7b62d6e7216f210", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "c3b2128ed5b0bf3cc17b7ddec0f5c000", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2835249042145594, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n,k=map(int,input().split())\nD={}\nnum=0\nfor i in range(1,k):\n if i in D:\n continue\n elif i<=n and k-i<=n:\n D[i]=1\n D[k-i]=1\n num+=1\nprint(num)\n \n \n \n", "lang": "PyPy 3", "bug_code_uid": "c0bb7f342cb87dd09e17554c7d0201fa", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "71828b19266a6d252daed83710e26a5c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.208130081300813, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "def getPairsCount(arr, n, sums):\n \n m = [0] * 1000\n for i in range(0, n):\n m[arr[i]]\n m[arr[i]] += 1\n \n twice_count = 0\n for i in range(0, n): \n twice_count += m[sums - arr[i]] \n if (sums - arr[i] == arr[i]):\n twice_count -= 1\n return int(twice_count / 2) \nn,k = [int(x) for x in input().split()]\nsums = k\narr = []\nfor i in range(n):\n \tarr.append(i+1)\nprint(getPairsCount(arr, n, sums))", "lang": "PyPy 3", "bug_code_uid": "1b5f610931df362cdee5e8e47ef50a9b", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "0b1e1b39045bcf88aa6f8b4a97793d12", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "a,b=map(int,raw_input().split())\nmod=1000000007\ns=0\nfor r in range(0,b):\n for dq in range (1,a+1):\n s+=(((b%mod)*(dq%mod)*(r%mod))+r)%mod\nprint s%mod ", "lang": "Python 2", "bug_code_uid": "24e929b21bee7f75887d72088ff8d723", "src_uid": "cd351d1190a92d094b2d929bf1e5c44f", "apr_id": "95c20fb11005c4b6ca5b50ea28bfe862", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.974739970282318, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "from __future__ import division, print_function\n\nimport os\nimport sys\nfrom io import BytesIO, IOBase\n\n\ndef main():\n def getFactorialsUpTo(number):\n fact = [0] * (number+1)\n fact[0] = 1\n\n for num in range(1, number+1):\n fact[num] = num * fact[num-1]\n\n return fact\n\n def isGood(number):\n while number > 0:\n lastDigit = number % 10\n if lastDigit != a and lastDigit != b:\n return False\n\n number //= 10\n\n return True\n\n a, b, n = [ int(x) for x in input().split() ]\n mod = 1000000007\n\n fact = getFactorialsUpTo(n)\n\n numOfExcellent = 0\n\n for numOfA in range(n+1):\n numOfB = n - numOfA\n total = numOfA*a + numOfB*b\n\n if isGood(total):\n numOfExcellent += (fact[n] // (fact[numOfA] * fact[numOfB])) % mod\n numOfExcellent %= mod\n\n print(numOfExcellent)\n\n\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n newlines = 0\n\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\n\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\ndef print(*args, **kwargs):\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\n sep = kwargs.pop(\"sep\", \" \")\n file = kwargs.pop(\"file\", sys.stdout)\n\n atStart = True\n for x in args:\n if not atStart:\n file.write(sep)\n file.write(str(x))\n atStart = False\n file.write(kwargs.pop(\"end\", \"\\n\"))\n\n if kwargs.pop(\"flush\", False):\n file.flush()\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\n\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "760040564369a03a9bc8a78dbca24921", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "b2eecf8b47027154f18f56270be8dfed", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.929606272370888, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "from __future__ import division, print_function\n\nimport os\nimport sys\nfrom io import BytesIO, IOBase\nfrom math import factorial as fact\n\ndef main():\n def isGood(number):\n while number > 0:\n lastDigit = number % 10\n if lastDigit != a and lastDigit != b:\n return False\n\n number //= 10\n\n return True\n\n a, b, n = [ int(x) for x in input().split() ]\n mod = 1000000007\n\n numOfExcellent = 0\n\n for numOfA in range(n+1):\n numOfB = n - numOfA\n total = numOfA*a + numOfB*b\n\n if isGood(total):\n numOfExcellent += (fact(n) // (fact(numOfA) * fact(numOfB))) % mod\n numOfExcellent %= mod\n\n print(numOfExcellent)\n\n\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n newlines = 0\n\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\n\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\ndef print(*args, **kwargs):\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\n sep = kwargs.pop(\"sep\", \" \")\n file = kwargs.pop(\"file\", sys.stdout)\n\n atStart = True\n for x in args:\n if not atStart:\n file.write(sep)\n file.write(str(x))\n atStart = False\n file.write(kwargs.pop(\"end\", \"\\n\"))\n\n if kwargs.pop(\"flush\", False):\n file.flush()\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\n\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "61ae92d35659b2991d575ae82cc9b8d0", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "b2eecf8b47027154f18f56270be8dfed", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6719056974459725, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n=input()\ns=input()\nn=int(n)\nt1=len(s)\nk=1\nsum=0\nwhile t1>0:\n m=0\n for i in range(0,t1):\n if int(s[i:t1])w:\n if y[q]<=k:\n c+=1\n q-+1\n else:\n break\nprint(c)\n", "lang": "Python 3", "bug_code_uid": "89fc0e86daa6822b0b50e739251b0111", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "dc22b00c8a243b24eea96c39ee9a8504", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2795969773299748, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "def main():\n l = [input()[4:] for _ in range(int(input()))]\n for i, s in enumerate(l):\n le = len(s)\n if le == 1:\n s = (\"199\", \"198\")[s == \"9\"] + s\n elif le == 2:\n s = \"1999\" if s == \"99\" else \"20\" + s\n elif le == 3:\n s = \"2\" + s\n else:\n if s != \"9\" * le:\n s = \"1\" + s\n l[i] = s\n print('\\n'.join(l))\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "60b370d552c013228765cd95600cbf9f", "src_uid": "31be4d38a8b5ea8738a65bfee24a5a21", "apr_id": "7db7cc0ec38969737f9242dd84797f8e", "difficulty": 2000, "tags": ["greedy", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8860986547085202, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def f(start,ends_with):\n n1=len(start)\n n2=len(ends_with)\n ans=\"\"\n if(int(start[n1-n2:]) self.rank[root_y]:\n self.sets[root_y] = root_x\n else:\n if self.rank[root_x] == self.rank[root_y]:\n self.rank[root_y] += 1\n self.sets[root_x] = root_y\n\ndef test_tree():\n sets = DisjoinSet(N+1)\n nodes = [0 for i in xrange(N+1)]\n not_t = 0\n for i in xrange(N-1):\n edge = edges[x[i]]\n v1 = sets.root(edge[0])\n v2 = sets.root(edge[1])\n if v1 == v2:\n return False\n nodes[edge[0]] += 1\n nodes[edge[1]] += 1\n \n Ktupik = nodes.count(1)\n if Ktupik != K:\n return False\n return True\n \n\nN, M, K = map(int, raw_input().split())\n\nedges = []\nfor i in xrange(M):\n v1, v2 = map(int, raw_input().split())\n edges.append((v1, v2))\n\nx = [i for i in xrange(M)]\nfin = [i for i in xrange(M - N + 1, M)]\ncount = 0\nwhile True:\n if test_tree():\n count += 1\n if x[:N-1] == fin:\n break\n s = N - 2\n while not ( x[s] < M - N + s + 1):\n s -= 1\n x[s] += 1\n for i in xrange(s + 1, M):\n x[i] = x[i-1] + 1\nprint count", "lang": "Python 2", "bug_code_uid": "7accd6d461110db7dc7d9fcfd648c5ce", "src_uid": "8087605a8f316150372cc4627f26231d", "apr_id": "f4d31c45eb4a6cf792b8bca97bd53e06", "difficulty": 2500, "tags": ["dp", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.11428571428571428, "equal_cnt": 18, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "class DisjoinSet:\n def __init__(self, N):\n self.sets = [i for i in xrange(N)]\n self.rank = [0 for i in xrange(N)]\n\n def root(self, x):\n if self.sets[x] == x:\n return x\n return self.root(self.sets[x])\n\n def union(self, x, y):\n root_x = self.root(x)\n root_y = self.root(y)\n if self.rank[root_x] > self.rank[root_y]:\n self.sets[root_y] = root_x\n else:\n if self.rank[root_x] == self.rank[root_y]:\n self.rank[root_y] += 1\n self.sets[root_x] = root_y\n\ndef test_tree():\n sets = DisjoinSet(N+1)\n nodes = [0 for i in xrange(N+1)]\n not_t = 0\n for i in xrange(N-1):\n edge = edges[x[i]]\n v1 = sets.root(edge[0])\n v2 = sets.root(edge[1])\n if v1 == v2:\n return False\n nodes[edge[0]] += 1\n nodes[edge[1]] += 1\n sets.union(v1, v2)\n \n Ktupik = nodes.count(1)\n if Ktupik != K:\n return False\n return True\n \n\nN, M, K = map(int, raw_input().split())\n\nedges = []\nfor i in xrange(M):\n v1, v2 = map(int, raw_input().split())\n edges.append((v1, v2))\n\nx = [i for i in xrange(M)]\nfin = [i for i in xrange(M - N + 1, M)]\ncount = 0\nwhile True:\n if test_tree():\n count += 1\n if x[:N-1] == fin:\n break\n s = N - 2\n while not ( x[s] < M - N + s + 1):\n s -= 1\n x[s] += 1\n for i in xrange(s + 1, M):\n x[i] = x[i-1] + 1\nprint count", "lang": "Python 2", "bug_code_uid": "956f237224c2d8740470035128bf6d98", "src_uid": "8087605a8f316150372cc4627f26231d", "apr_id": "f4d31c45eb4a6cf792b8bca97bd53e06", "difficulty": 2500, "tags": ["dp", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5864661654135338, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "a,p=input().split()\nprint(int(a+a[:-1)%int(p))", "lang": "Python 3", "bug_code_uid": "37423df2fd536cf5e05ea5da6af4e83f", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "34b3da2e3f2c14cc6bd0d9fa27b3b928", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.004694835680751174, "equal_cnt": 1, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "897B.py", "lang": "Python 3", "bug_code_uid": "03076960d81c2b24eed1b078cd2d2ddc", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "2f669a6347e27889182e028cd66fdf4f", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.27586206896551724, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def maximum(l,r):\n\n current = 0\n for i in range(l,r+1)[::-1]:\n #print(i,\"*\")\n for j in range(l,i+1):\n #print(i, j)\n if i^j > current:\n current = i^j\n\n return current\n\n\ninp = input()\nl, r = inp.split(\" \")\nprint(maximum(int(l),int(r)))", "lang": "Python 3", "bug_code_uid": "9379c513c4d283b1c712540044240cae", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "cbdcaf74d91790dea4662b4a02a2de1f", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.43564356435643564, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "a=int(input())\ns=list(input())\nd=s\ns[0]='B'\ns[a-1]='B'\nprint(s.count('W')+1)\nif d[0]='W':\n d=['q','e']+d.remove('W')\nelse:\n d=['q','e']+d\nif d[a-1]=='B':\n d=d+['W']\nx=1\nfor i in range(len(d)):\n print(d.index('W')-x-1)\n x=d.index('W')\n d.remove('W')", "lang": "Python 3", "bug_code_uid": "322b68cbfc6773ef84a61348542c09a4", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "288884680a0115bae48b71c79ec6f06e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.10416666666666667, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "a=input().split()\nb=[[],[],[]]\nt=[0,0,0]\nc=['m','p','s']\nfor i in range (3):\n if a[i][1]==c[0]: b[0].append(int(a[i][0])); t[0]+=1\n elif a[i][1]==c[1]: b[1].append(int(a[i][0])); t[1]+=1\n else: b[2].append(int(a[i][0])); t[2]+=1\nif max(t)==3:\n i=0\n while i<3:\n if t[i]==3: break;\n c=[]\n c.append(abs(b[i][1]-b[i][0]))\n c.append(abs(b[i][1]-b[i][2]))\n c.append(abs(b[i][2]-b[i][0]))\n c.sort()\n if c[0]<=2:\n if c==[0,0,0]: print(0)\n elif c==[0,1,2]: print(0)\n else : print(1) \n else: print(2) \nif max(t)==2:\n i=0\n while i<3:\n if t[i]==2: break;\n i+=1\n if abs(b[i][1]-b[i][0])<=2: print(1)\n else: print(2)\nif max(t)==1:\n print(2);\n", "lang": "PyPy 3", "bug_code_uid": "d1578c96ad04b3f94fa9a67476bd3eb8", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "f246fb7619f22d44cdc458a357371c06", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8851540616246498, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import math\na=int(input());b=int(input());c=int(input());\nx=4;y=1;res=0;\ny+=min(b-1,c-5);x+=c-(y+x);\nwhile y>=1 and x<=a:\n res+=math.comb(a,x)*math.comb(b,y)\n x+=1;y-=1;\nprint(res)", "lang": "Python 3", "bug_code_uid": "337384d04fa6eaadb9d05fe29148c1be", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "ca90dde1e83708c0c72a824ec431a4ec", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.872093023255814, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "def dfs(a,b):\n if b==1:\n return a\n if(a>b):\n return 1+dfs(a-b,b)\n return 1+dfs(a,b-a)\n\na,b=map(int,input().split())\nprint(dfs(a,b))", "lang": "Python 3", "bug_code_uid": "653084d778140fcd612bd953165e1751", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "e781330877f0d5582c7ee6d2f99e0f71", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.26218851570964247, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a,b,c=map(int,raw_input().split())\nx,y,z=map(int,raw_input().split())\nif a==x and b==y and c==z:print \"Yes\"\nelif a>=x and b>=y and c>=z:print \"Yes\"\nelif a>x and b>y and c=(z-c):print \"Yes\"\nelif a>x and bz and 2*min((a-x)+(c-z))>=(y-b):print \"Yes\"\nelif ay and c>z and 2*min((c-z)+(b-y))>=(x-a):print \"Yes\"\nelse :print\"No\"", "lang": "Python 2", "bug_code_uid": "a28c4d05fb704893af3ad9618a132662", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "5e6d867df5fd35d6f32290ec049426c0", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6086956521739131, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 11, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": " n = map(int, raw_input().split())\n arr = sorted(map(int, raw_input().split()))\n if arr[0] != arr[n/2]:\n print (\"Alice\") \n else:\n print(\"Bob\")", "lang": "Python 3", "bug_code_uid": "62edce31914f6053d4b35911d7f9fde1", "src_uid": "4b9cf82967aa8441e9af3db3101161e9", "apr_id": "649fa4405dbdaf3cc192c9d8cb243b14", "difficulty": 2000, "tags": ["games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8266666666666667, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = input()\na = [4,7,47,74,44,77,444,447,474,744,477,747,7747,777] \n\nif n in a :\n\tprint(\"YES\")\nelif n%4 == 0 or n%7 == 0 or (n % i in a):\n\tprint(\"YES\")\nelse :\n\tprint(\"NO\")\n", "lang": "Python 2", "bug_code_uid": "b82c0f3e704d13e1f972847adc0fb46e", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "764d2cb90b1a6eb49519c9057c67f975", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9302325581395349, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s = input()\nn = int(input())\n\nt = [j for j, q in enumerate(s) if q == 'T']\nl, r = [0] * 101, [0] * 101\n\nfor i, (a, b) in enumerate(zip([-1] + t, t + [len(s)])):\n v = b - a\n u = v - 1\n\n if i:\n l[i] = l[i - 1] + v\n r[i] = max(r[i - 1] - v, l[i - 1] - 1)\n else:\n u, v = -u, -v\n\n for k in range(i - 1, 0, -1):\n l[k] = max(l[k] - u, l[k - 1] - v)\n r[k] = max(r[k] + u, r[k - 1] + v)\n u, v = -u, -v\n\n l[0] -= u\n r[0] += u\n\nprint(max(l[n % 2:n + 1:2] + r[n % 2:n + 1:2]))", "lang": "PyPy 3", "bug_code_uid": "35aeec6296cef91c6f8b3d0f5bc3d54c", "src_uid": "4a54971eb22e62b1d9e6b72f05ae361d", "apr_id": "6b4610271091405f182f941668a8bedf", "difficulty": 1800, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9427917620137299, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "a = input()\ni = 0\nwhile i < len(a):\n x = a[i:3]\n if a[i:3] == 'ABC' or x == 'ACB' or x == 'BAC' or x == 'BCA' or x == 'CAB' or x == 'CBA':\n print('YES')\n break\n\nif i >= len(a):\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "3e79ba73be424be4b42f017bc899dc2b", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "d79c350193572a7782eff71bc14cf64e", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9977708426214891, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import math\n\nstr1 = input()\nstr2 = input()\nvalue = 0\nvalue_2 = 0\nunknown = 0\nfor x in str1:\n if x == '+':\n value += 1\n else:\n value -= 1\nfor x in str2:\n if x == '+':\n value_2 += 1\n elif x == '-':\n value_2 -= 1\n else:\n unknown += 1\nplus_count = 0\nminus_count = 0\nrav = 0\nx = value - value_2\nif x<= unknown:\n if x >= 0:\n plus_count += x\n rav = unknown - plus_count\n else:\n minus_count += x\n rav = unknown - minus_count\n #print(plus_count, minus_count, rav)\n if plus_count == 0 and minus_count == 0 and rav == 0:\n print('1.000000000000')\n else:\n if rav % 2 == 0:\n rav = int(rav / 2)\n plus_count += rav\n minus_count += rav\n # print(plus_count, minus_count)\n k = max(plus_count, minus_count)\n C = math.factorial(unknown) / (math.factorial(unknown - k) * math.factorial(k))\n O = math.pow(2, unknown)\n res = C / O\n print(f'{res:.12f}')\n else:\n print('0.000000000000')\nelse:\n print('0.000000000000')\n", "lang": "Python 3", "bug_code_uid": "aaf2fba1a77f6f9c7742f86a206003a9", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "4a8c6f92868b23d6662cc6f2ea155da6", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.025735294117647058, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "//#pragma GCC optimize(\"O3\")\n#include \n#define int long long\n#define pb push_back\n#define inf 10000000000000000\n#define N 1000000007\n#define mp make_pair\n#define speed ios_base::sync_with_stdio(0);cin.tie(0);\nusing namespace std;\ntemplate ostream& operator<<(ostream& cout,pair P)\n{return cout<<'('< ostream& operator<<(ostream& cout,vector V)\n{cout<<\"[ \";for(auto v:V)cout<=tar or b>=tar){return 0;}\n\tint mini=min(a,b);\n\tint maxi=max(a,b);\n\tint ans=0;\n\twhile(maxiwhile;merge resize\nsigned main()\n{\n #ifndef ONLINE_JUDGE\n freopen(\"input.txt\",\"r\",stdin);\n freopen(\"output.txt\",\"w\",stdout);\n #endif \n\tspeed\n\t//global var\n\tint x,y,m;cin>>x>>y>>m;\n\tif(x>=m or y>=m)\n\t{\n\t\tcout<<0<<\"\\n\";\n\t}\n\tif(x>0 or y>0)\n\t{\n\t\tint ans=INT_MAX;\n\t\tint mini=min(x,y);\n\t\tint maxi=max(x,y);\n\t\tfor(int i=0;i<200;++i)\n\t\t{\n\t\t\tif(mini>m)\n\t\t\t{\n\t\t\t\tans=min(ans,i);break;\n\t\t\t}\n\t\t\tans=min(ans,(i+solve(mini,maxi,m)));\n\t\t\tmini+=maxi;\n\t\t}\n\t\tcout< n:\n if c[1] > c[0]:\n c[1] = max(c[0], a[1] + b[1] + c[1] - n)\n elif b[1] > b[0]:\n b[1] = max(b[0], a[1] + b[1] + c[1] - n)\n else:\n a[1] = max(a[0], a[1] + b[1] + c[1] - n)\nprint a[1], b[1], c[1]\n", "lang": "Python 2", "bug_code_uid": "cc586348a710df6ccbefee4d9af43a8b", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "7be3c7e964a79370348bde6cf3aafeb5", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9973404255319149, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import itertools\n\na =list(itertools.combinations(list(map(int, input().split())), 3)) \n\nfor i in a:\n if (i[0] + i[1] > i[2]) and (i[0] + i[2] > i[1]) and (i[1] + i[2] > i[0]):\n print(\"TRIANGLE\")\n exit(0)\nfor i in a:\n elif (i[0] + i[1] == i[2]) or (i[0] + i[2] == i[1]) or (i[1] + i[2] == i[0]):\n print(\"SEGMENT\")\n exit(0)\nprint(\"IMPOSSIBLE\")\n\n", "lang": "PyPy 3", "bug_code_uid": "6d25bb6eb1b9672e65f15b49d9812fac", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "e326d8bb16a4fcad9a34e7ca90007183", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8702290076335878, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n = int(raw_input())\nm = map(int, raw_input().strip().split(' '))\nr = map(int, raw_input().strip().split(' '))\n\nsteps = 1000000\nans = 0\nfor i in xrange(1, steps + 1):\n if i % m[i % n] == r[i % n]:\n ans += 1\nprint float(ans) / steps", "lang": "Python 2", "bug_code_uid": "14cc9c522e75f1f02e042639f01c0208", "src_uid": "14b69f42bc192ea472e82f3a3209f1c1", "apr_id": "de40eae719c9b642d98053b57f62e7f9", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8842975206611571, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = int(raw_input())\nm = map(int, raw_input().split())\nr = map(int, raw_input().split())\n\nmaxm = max(m)\ngood = 0\nfor d in range(maxm):\n for i in range(len(m)):\n if d % m[i] == r[i]:\n good += 1\nprint 1. * good / maxm\n", "lang": "Python 2", "bug_code_uid": "c5eaf50f54e6a8f7dd593c5372cadd99", "src_uid": "14b69f42bc192ea472e82f3a3209f1c1", "apr_id": "5460efacfcb63cc795242899497274dc", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9992581602373887, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/python\n\ndef gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n# a*x + b*y = c1\n# -b*x + a*y = c2\n# is it solvable?\ndef is_solvable(a, b, c1, c2):\n if a == 0 and b == 0:\n return c1 == 0 and c2 == 0\n if (c1*b + c2*a) % (a*a + b*b) != 0:\n return false\n y = (c1*b + c2*a) / (a*a + b*b)\n if a != 0:\n return (c1 - b*y) % a == 0\n else:\n return (c2 - a*y) % b == 0\n\n# can we solve for (m, n) in the following equations?\n# x0 + m*cx + n*cy = x1\n# y0 - n*cx + m*cy = y1\ndef can_solve(x0, y0, x1, y1, cx, cy):\n dx = x1 - x0\n dy = y1 - y0\n if cx == 0 and cy == 0:\n return dx == 0 and dy == 0\n if cx == 0:\n return dx % cy == 0 and dy % cy == 0\n if cy == 0:\n return dx % cx == 0 and dy % cx == 0\n d = gcd(abs(cx), abs(cy))\n if (dx % d != 0) or (dy % d != 0):\n return False\n return is_solvable(cx/d, cy/d, dx/d, -dy/d)\n\nx1, y1 = map(lambda(x): int(x), raw_input().split())\nx2, y2 = map(lambda(x): int(x), raw_input().split())\ncx, cy = map(lambda(x): int(x), raw_input().split())\n\npossible = (can_solve(x1, y1, x2, y2, cx, cy) or\n can_solve(-y1, x1, x2, y2, cx, cy) or\n can_solve(-x1, -y1, x2, y2, cx, cy) or\n can_solve(y1, -x1, x2, y2, cx, cy))\nprint \"YES\" if possible else \"NO\"\n \n\n\n", "lang": "Python 2", "bug_code_uid": "2b09bd2efa2dbcf5f6881c3006d79668", "src_uid": "cc8a8af1ba2b19bf081e379139542883", "apr_id": "d6cf771ecd0e672df7fff35a47e4c932", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8006795016987542, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "import math\n\ndef ok(xa, ya):\n x, y = xb - xa, yb - ya\n d = math.gcd(abs(xc), abs(yc))\n if xc == 0:\n return x % yc == 0 and y % yc == 0\n if yc == 0:\n return x % xc == 0 and y % xc == 0\n if (x % d != 0) or (y % d != 0):\n return 0\n a, b, c1, c2 = xc // d, yc // d, x // d, -y // d\n if a == 0 and b == 0:\n return c1 == 0 and c2 == 0\n if (c1 * b + c2 * a) % (a * a + b * b) != 0:\n return 0\n yy = (c1 * b + c2 * a) / (a * a + b * b)\n if a != 0:\n return (c1 - b * yy) % a == 0\n else:\n return (c2 - a * yy) % b == 0\n\n\nxa, ya = map(int,input().split())\nxb, yb = map(int,input().split())\nxc, yc = map(int,input().split())\nif xc == 0 and yc == 0:\n if xa == xb and ya == yb:\n print('YES')\n else:\n print('NO')\n exit(0)\nif ok(xa, ya) or ok(-ya, xa) or ok(-xa, -ya) or ok(ya, -xa):\n print('YES')\nelse:\n print('NO')\n", "lang": "PyPy 3", "bug_code_uid": "f26e4964c6743b90e2189ddfc91717b0", "src_uid": "cc8a8af1ba2b19bf081e379139542883", "apr_id": "1d4ef66cb6dbefb1e6eb572a90b3d8fe", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.12158808933002481, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "a = int(raw_input())\n\nif a == 2:\n print \"Adams\"\nif a == 8:\n print \"Van Buren\"\nif a == 29:\n print \"Harding\"", "lang": "Python 2", "bug_code_uid": "e61a57351a373764650e32778fa5d955", "src_uid": "0b51a8318c9ec0c80c0f4dc04fe0bfb3", "apr_id": "bb0a85cbab324a6725aa3ed25a4cfeb1", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8149171270718232, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import sys\n\ndef main():\n def p(h, m):\n return str(h) == \"{:02d}\".format(m)[::-1]\n (h, m) = map(int, input().split(\":\"))\n m += 1\n while not p(h, m):\n m += 1\n if m == 60:\n h += 1\n m = 0\n sys.stdout.write(\"{:02d}:{:02d}\\n\".format(h, m))\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "c72bad128084b3a9ad58196ef7dcfb20", "src_uid": "158eae916daa3e0162d4eac0426fa87f", "apr_id": "500f0c6e189406314996033d94cb94f8", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9562146892655368, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n, m = map(int, input().split())\nb = []\nfor t in range(n):\n a = input()\n s = [char for char in a]\n b.append(s)\n \ni = 0\nj = 0\n\nwhile i < n:\n while j < m:\n if b[i][j] == \"S\":\n break\n if j+1 == m:\n j = 0\n while j < m:\n b[i][j] = \"X\"\n j+=1\n j = 0\n i+=1\n \ni = 0\nj = 0\nwhile j < m:\n while i < n:\n if b[i][j] == \"S\":\n break\n if i+1 == n:\n i = 0\n while i < n:\n b[i][j] = \"S\" \n i+=1\n i = 0\n j+=1\ntotal = 0\nfor c in range(len(b)):\n for l in range(len(b[c])):\n if b[c][l] == \"X\":\n total+=1\ntotal = 0 ", "lang": "Python 3", "bug_code_uid": "189f169db892f6f1a031eeee843d2145", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "21f4c5ad79b3b2d8489eaccefd3a8750", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3754747693977211, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "def main():\n r,c = map(int, input().split())\n cake = [input() for _ in range(r)]\n rc = r * c\n neigh = []\n for y in range(r):\n for x in range(c):\n if 'S' in cake[y]:\n row = ()\n else:\n row = tuple(range(y * c, y * c + c))\n if any('S' == _[x] for _ in cake):\n col = ()\n else:\n col = tuple(range(x, r * c, c))\n neigh.append((row, col))\n mi = rc\n def deeper(field):\n nonlocal mi\n i = sum(field)\n if mi > i:\n mi = i\n for i, piece in enumerate(field):\n if field:\n row, col = neigh[i]\n if any(field[_] for _ in row):\n f1 = field[:]\n for j in row:\n f1[j] = False\n deeper(f1)\n if any(field[_] for _ in col):\n f1 = field[:]\n for j in col:\n f1[j] = False\n deeper(f1)\n fld = [_ == '.' for s in cake for _ in s]\n deeper(fld)\n print(sum(fld) - mi)\n\n\nmain()\n", "lang": "Python 3", "bug_code_uid": "20b75365468f914cf8b249d26ee51113", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "3c77abe7f5831b17ab966333ad844175", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6036036036036037, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "employees = int(input()) - 1\nleaders = 1\ncnt = 1\n\nwhile (employees <= leaders):\n if employees / leaders == int(employees / leaders):\n cnt += 1\n employees -= 1\n leaders += 1\n\nprint(cnt)\n", "lang": "PyPy 3", "bug_code_uid": "650bf2dec70efde84d31ce354c2e8745", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "b60d9054d3545b6d0b4babb73fb7b1c6", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9990601503759399, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from collections import defaultdict as dd\nfrom collections import deque\nimport bisect\nimport heapq\n\ndef ri():\n return int(input())\n\ndef rl():\n return list(map(int, input().split()))\n\ndef egcd(a, b):\n if a == 0:\n return (b, 0, 1)\n else:\n g, y, x = egcd(b % a, a)\n return (g, x - (b // a) * y, y)\n\ndef modinv(a, m):\n g, x, y = egcd(a, m)\n if g != 1:\n raise Exception('modular inverse does not exist')\n else:\n return x % m\n\nmod = 998244353\ndef solve():\n n, k = rl()\n if k > n:\n print (0)\n return\n elif k == 1:\n print (n)\n return\n\n f = [1]\n fi = [1]\n for i in range(1, n + 1):\n f.append((f[-1]*i)%mod)\n fi.append((fi[-1] * modinv(i, mod))%mod)\n\n def C(a,b):\n return f[a]*fi[b]*fi[a-b]\n\n d = n\n i = 1\n answer = 0\n while d >= k:\n answer = (answer + C(d - 1, k - 1)) % mod\n i += 1\n d = n // i\n print (answer)\n\n\nmode = 'T'\n\nif mode == 'T':\n t = ri()\n for i in range(t):\n solve()\nelse:\n solve()\n", "lang": "PyPy 3", "bug_code_uid": "76877da388bb362a2ef76e6236a73e59", "src_uid": "8e8eb64a047cb970a549ee870c3d280d", "apr_id": "6b6da717b7a7bb7507899f869a7ba862", "difficulty": 2000, "tags": ["math", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9662921348314607, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "a,b,e=list(map(int,input().split())),list(map(int,input().split())),0\nfor i in range(3):\n if a[i]-b[i]>0:extra+=(a[i]-b[i])//2\n else:extra+=a[i]-b[i]\nprint(['Yes','No'][extra<0])", "lang": "Python 3", "bug_code_uid": "6c276346b2b6a7f63c7133fecc60770f", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "97e5b4db4434ee951f67f8f424fa13c7", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9582689335394127, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n,m=map(int,input().split())\na=list(map(int,input().split()))\ny=set(a)\ny=list(y)\nt=[]\nfor i in y :\n t.append(a.count(i))\nt.sort\nt.reverse()\n#print(t)\nfor i in range(1,101):\n s=0\n for j in t :\n s+=j/i;\n if (s>=n) :\n break\n if (s>=n ) :\n ans=i\n else :\n break;\nprint(ans) ", "lang": "Python 3", "bug_code_uid": "fdaa9e7a162323fbe4b2be7182c60087", "src_uid": "b7ef696a11ff96f2e9c31becc2ff50fe", "apr_id": "91670afb7ec83474f50f23df6a21f7e7", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9666666666666667, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "c=int(input())\nprint((n-1)//2)", "lang": "Python 3", "bug_code_uid": "c2b3c1d114095dd9fb3324a45ee96e50", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "4ac4b0cda345bbb4fb0029f88f1aa8d9", "difficulty": 1000, "tags": ["constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7508305647840532, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "w,h = map(int, raw_input().split())\nsum = 0\nfor i in range(1, w):\n for j in range(1, h):\n sum += min(min(i, w - i), min(j, h - j))\nprint sum\n", "lang": "Python 2", "bug_code_uid": "a37a757cb8ba7ad534be6264421e6bbf", "src_uid": "42454dcf7d073bf12030367eb094eb8c", "apr_id": "4eddaefc8f4e9d77891b10c5c6833d9c", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.36363636363636365, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "w, h = map(int, raw_input().split())\nret = 0\nfor i in range(0, w + 1):\n\tfor j in range(0, h + 1):\n\t\tret += min(i, w - i) * min(j, h - j)\nprint ret\n", "lang": "Python 2", "bug_code_uid": "7ee6d36e90687762f76f11ffdf11d031", "src_uid": "42454dcf7d073bf12030367eb094eb8c", "apr_id": "5378d1d1c9996e6a035ab90a00db207a", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9652173913043478, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "x1,y1,z1=input().split()\nx2,y2,z2=input().split()\nif x1==x2 or y1==y2 or z1==z2:\nprint(\"YES\")\nelse:\nprint(\"NO\")", "lang": "Python 3", "bug_code_uid": "ae43164a9658938353f0185320894d50", "src_uid": "91c9dbbceb467d5fd420e92c2919ecb6", "apr_id": "009c97c7182e9bc24bb15e9f2e6fc153", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.21399548532731377, "equal_cnt": 19, "replace_cnt": 18, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": "def check(string):\n\tfor i in range(len(string)-1):\n\t\tif string[i] == string[i+1]:\n\t\t\treturn 0\n\treturn 1\n\ninput()\npainting = input()\ncount =0\ndef fun(string):\n\tfor i in range(len(string)):\n\t\tif string[i] == '?':\n\t\t\tcs =string[:i]+'C'+string[i+1:]\n\t\t\tms =string[:i]+'M'+string[i+1:]\n\t\t\tys =string[:i]+'Y'+string[i+1:]\n\t\t\tglobal count\n\t\t\tif check(cs):\n\t\t\t\tcount+=1\n\t\t\tif check(ms):\n\t\t\t\tcount+=1\n\t\t\tif check(ys):\n\t\t\t\tcount+=1\n\n\t\t\tif count >= 2:\n\t\t\t\tprint('Yes')\n\t\t\t\texit(0)\n\n\t\t\tfun(cs)\n\t\t\tfun(ms)\n\t\t\tfun(ys)\nfun(painting)\nprint ('No')", "lang": "Python 3", "bug_code_uid": "d055de4c90eec3485ac1dad705a911f7", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "41c5ab7e2a83cc6c01fceac3c822f84c", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.25, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "a=[int(i)for i in input().split()]\nb=a[1]\nc=a[2]\nif a[0]//2>=b and a[2]>a[0]//2:\n print(\"Final!\")\nelse:\n if b>c:\n c,b=b,c\n j=1\n while b+1!=c:\n c=c-j\n j+=1\n print(j)", "lang": "Python 3", "bug_code_uid": "6972ac70db8194e7c7789ffaf61ca789", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "fc8ad32e3e2bafb193b8982ca6b9546c", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7619047619047619, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "a, b, m = map(int, input().split())\nt = [0] * m\ns = 10 ** 9 % m\nfor i in range(a):\n k = i * s % m\n if 0 < k < m - b: exit(print(1, str(i).zfill(9)))\n if t[k]: break\n t[k] = 1\nprint(2)", "lang": "PyPy 3", "bug_code_uid": "21b4409623f37388380dfce3b8820e08", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "83ac551d9460419fb45a94ce4468aca9", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9553072625698324, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a, b, m = map(int, input().split())\nk = s = 10 ** 9 % m\ni = 0\nwhile k and i < a:\n if k < m - b: exit(print(1, str(i + 1).zfill(9)))\n k += s\n if k > m: k -= m\nprint(2)", "lang": "PyPy 3", "bug_code_uid": "db3cf12e22e613d395f473c56a8d62c4", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "83ac551d9460419fb45a94ce4468aca9", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8035398230088495, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import math\n\na = int(raw_input())\nb = int(raw_input())\nc = int(raw_input())\nd = int(raw_input())\nmisha = max(3 * a / 10, a - a / 250 * c)\nvasya = max(3 * b / 10, b - b / 250 * d)\nif(misha == vasya):\n print 'Tie'\nelif(misha > vasya):\n print 'Misha'\nelse:\n print 'Vasya'\n", "lang": "Python 2", "bug_code_uid": "97ebb76bf534275995a892e548a36a5f", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "e0454e28528fcec85191c4c3dccc18b9", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9945945945945946, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a,b,c,d = map(int, raw_input().split())\nM = max((3 * a)/10, a - (a/250) * c)\nV = max((3 * b)/10, b - (b/250) * d)\n\nif M > V:\n\tprint \"Misha\"\nelif M < v:\n\tprint \"Vasya\"\nelse:\n\tprint \"Tie\"", "lang": "Python 2", "bug_code_uid": "851d61180ea08294de1778fe1c174d45", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "8a7bcb17b4a968327e31bab78557af53", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9997747240369452, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x = int(input())\n\nif x == 30:\n print(\"1 B\")\nelif x == 31:\n print (\"2 A\")\nelif x == 32:\n print(\"1 A\")\nelif x == 33:\n print(\"0 A\")\nelif x == 34:\n print(\"1 B\")\nelif x == 35:\n print(\"2 A\")\nelif x == 36:\n print(\"1 A\")\nelif x == 37:\n print(\"0 A\")\nelif x == 38:\n print(\"1 B\")\nelif x == 39:\n print(\"2 A\")\nelif x == 40:\n print(\"1 A\")\nelif x == 41:\n print(\"0 A\")\nelif x == 42:\n print(\"1 B\")\nelif x == 43:\n print(\"2 A\")\nelif x == 44:\n print(\"1 A\")\nelif x == 45:\n print(\"0 A\")\nelif x == 46:\n print(\"1 B\")\nelif x == 47:\n print(\"2 A\")\nelif x == 48:\n print(\"1 A\")\nelif x == 49:\n print(\"0 A\")\nelif x == 50:\n print(\"1 B\")\nelif x == 51:\n print(\"2 A\")\nelif x == 52:\n print(\"1 A\")\nelif x == 53:\n print(\"0 A\")\nelif x == 54:\n print(\"1 B\")\nelif x == 55:\n print(\"2 A\")\nelif x == 56:\n print(\"1 A\")\nelif x == 57:\n print(\"0 A\")\nelif x == 58:\n print(\"1 B\")\nelif x == 59:\n print(\"2 A\")\nelif x == 60:\n print(\"1 A\")\nelif x == 61:\n print(\"0 A\")\nelif x == 62:\n print(\"1 B\")\nelif x == 63:\n print(\"2 A\")\nelif x == 64:\n print(\"1 A\")\nelif x == 65:\n print(\"0 A\")\nelif x == 66:\n print(\"1 B\")\nelif x == 67:\n print(\"2 A\")\nelif x == 68:\n print(\"1 A\")\nelif x == 69:\n print(\"0 A\")\nelif x == 70:\n print(\"1 B\")\nelif x == 71:\n print(\"2 A\")\nelif x == 72:\n print(\"1 A\")\nelif x == 73:\n print(\"0 A\")\nelif x == 74:\n print(\"1 B\")\nelif x == 75:\n print(\"2 A\")\nelif x == 76:\n print(\"1 A\")\nelif x == 77:\n print(\"0 A\")\nelif x == 78:\n print(\"1 B\")\nelif x == 79:\n print(\"2 A\")\nelif x == 80:\n print(\"1 A\")\nelif x == 81:\n print(\"0 A\")\nelif x == 82:\n print(\"1 B\")\nelif x == 83:\n print(\"2 A\")\nelif x == 84:\n print(\"1 A\")\nelif x == 85:\n print(\"0 A\")\nelif x == 86:\n print(\"1 B\")\nelif x == 87:\n print(\"2 A\")\nelif x == 88:\n print(\"1 A\")\nelif x == 89:\n print(\"0 A\")\nelif x == 90:\n print(\"1 B\")\nelif x == 91:\n print(\"2 A\")\nelif x == 92:\n print(\"1 A\")\nelif x == 93:\n print(\"0 A\")\nelif x == 94:\n print(\"1 B\")\nelif x == 95:\n print(\"2 A\")\nelif x == 96:\n print(\"1 A\")\nelif x == 97:\n \nprint(\"0 A\")\nelif x == 98:\n print(\"1 B\")\nelif x == 99:\n print(\"2 A\")\nelif x == 100:\n print(\"1 A\")\n", "lang": "Python 3", "bug_code_uid": "13e196746e23fd1f1b10aa78dea61e9a", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "77a0e4d605c6da757988dcc93422fd0c", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9185667752442996, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\narr=list(map(int,input().strip().split(' ')))\nthree=[]\nfor i in arr:\n if len(three)>3:\n break\n if i not in three:\n three.append(i)\nthree.sort()\nif len(three)==3 and three[1]-three[0]==three[2]-three[1]:\n print(three[1]-three[0])\nelif len(three)==2 and (three[1]-three[0])%2==0:\n print(int((three[1]-three[0])/2))\nelif len(three)==1:\n print(0)\nelse:\n print(-1)\n\n \n \n \n", "lang": "Python 3", "bug_code_uid": "8c310cccd6ebc393da597b205d9affe9", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "2097d8d7055ef187694fdbc9750d94f3", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5592515592515592, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Mar 3 23:50:56 2019\n\n@author: loyuli\n\"\"\"\nn = input()\ns = list(map(int, input().split()))\ns = sorted(list(set(s)))\n\nif len(s) > 3:\n print (-1)\nelif len(s) == 1:\n print(0)\nelif len(s) == 2:\n if s[0] % 2 == s[1] % 2:\n print((s[1] - s[0]) // 2)\n else:\n print(s[1] - s[0])\nelse:\n if s[1] == (s[2] - s[0]) // 2 + s[0]:\n print(s[1] - s[0])\n else:\n print(-1)\n\n\n", "lang": "Python 3", "bug_code_uid": "72357f801eb1f81dae90ff7810bdd7c6", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "ecc324d7b761ee1e5667cfcb2986fed4", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7528735632183908, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "d, L, v1, v2 = map( int, raw_input().split() )\n\nf1, f2 = 0, L\nans = 0\n\n\nwhile f1+v1 < f2-v2:\n\tf1 += v1\n\tf2 -= v2\n\tans += 1\n\t\nif v1 != v2:\n\tans += abs( ( 2*d - f1 -f2 ) / ( v1 + v2 + 0.0) )-1\n\t\nprint \"%f\" % (ans)", "lang": "Python 2", "bug_code_uid": "d65c85d6ac16e651f48e740ee3a7676e", "src_uid": "f34f3f974a21144b9f6e8615c41830f5", "apr_id": "2add5f91fc4e5caf95d5ecedfbd47c21", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.24222222222222223, "equal_cnt": 32, "replace_cnt": 16, "delete_cnt": 8, "insert_cnt": 7, "fix_ops_cnt": 31, "bug_source_code": "n, m, nomber = map(int, input().split())\na = []\nfor i in range(m):\n a.append([0]*n*2)\n \nx1 = 1\nx2 = 2\nfor j in range(0, n*2-1, 2):\n a[0][j] = x1\n a[0][j+1] = x2\n x1 = x1 + m*2\n x2 = x2 + m*2\n\nx = 0 \ny = 0 \nfor i in range(1, m):\n for j in range(n*2):\n a[i][j] = a[i-1][j] + 2\n\nfor i in range(m):\n for j in range(n*2):\n if (a[i][j] == nomber):\n x = i #\u043d\u043e\u043c\u0435\u0440 \u0440\u044f\u0434\u0430\n y = j #\u043a\u0430\u043a \u0431\u044b \u043d\u043e\u043c\u0435\u0440 \u043f\u0430\u0440\u0442\u044b\n break\nx = x + 1 \nif y % 2 == 0:\n y = y / 2\n vector = 'L'\nelif y % 2 != 0:\n y = y // 2\n vector = 'R'\ny = int(y) + 1\n\"\"\"\nfor row in a:\n print(' '.join([str (elem) for elem in row]))\n\"\"\"\n#print(a[2][4])\nprint(y, x, vector)\n\n\n\n\n \n", "lang": "Python 3", "bug_code_uid": "08fd0bac40d7c8c92af6dc49c1bd42fe", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "271f6b63f0fcb21900ad6eceb82153ef", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2822085889570552, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "m = 1378 ** int(input())\nprint str(m)[-1]", "lang": "Python 3", "bug_code_uid": "2700e2f2ee6463769b06b5485de53548", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "d1eafa0e7a00fbcea676314455981f9d", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8125, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "i=int(input())\nj=int(input())\nk=int(input())\nq=max(i,j,k)\nprint((p-q)*q)", "lang": "Python 3", "bug_code_uid": "20b98cf8c9a04b04c734d787e4e0e369", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "5c632c4626b4984b9ba030e86a894dbf", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9968413229282794, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\n# Author : raj1307 - Raj Singh\n# Date : 18.03.2020\n\nfrom __future__ import division, print_function\n\nimport os,sys\nfrom io import BytesIO, IOBase\n\nif sys.version_info[0] < 3:\n from __builtin__ import xrange as range\n from future_builtins import ascii, filter, hex, map, oct, zip\n\n\ndef ii(): return int(input())\ndef si(): return input()\ndef mi(): return map(int,input().strip().split(\" \"))\ndef msi(): return map(str,input().strip().split(\" \"))\ndef li(): return list(mi())\n\ndef dmain():\n sys.setrecursionlimit(100000000)\n threading.stack_size(40960000)\n thread = threading.Thread(target=main)\n thread.start()\n \n#from collections import deque, Counter, OrderedDict,defaultdict\n#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace\n#from math import ceil,floor,log,sqrt,factorial\n#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right\n#from decimal import *,threading\n#from itertools import permutations\n#Copy 2D list m = [x[:] for x in mark] .. Avoid Using Deepcopy\n\nabc='abcdefghijklmnopqrstuvwxyz'\nabd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}\nmod=1000000007\n#mod=998244353\ninf = float(\"inf\")\nvow=['a','e','i','o','u']\ndx,dy=[-1,1,0,0],[0,0,1,-1]\ndef getKey(item): return item[1] \ndef sort2(l):return sorted(l, key=getKey,reverse=True)\ndef d2(n,m,num):return [[num for x in range(m)] for y in range(n)]\ndef isPowerOfTwo (x): return (x and (not(x & (x - 1))) )\ndef decimalToBinary(n): return bin(n).replace(\"0b\",\"\")\ndef ntl(n):return [int(i) for i in str(n)]\ndef ncr(n,r): return factorial(n)//(factorial(r)*factorial(n-r))\n\ndef powerMod(x,y,p):\n res = 1\n x %= p\n while y > 0:\n if y&1:\n res = (res*x)%p\n y = y>>1\n x = (x*x)%p\n return res\n\ndef gcd(x, y):\n while y:\n x, y = y, x % y\n return x\n \ndef isPrime(n) : # Check Prime Number or not \n if (n <= 1) : return False\n if (n <= 3) : return True\n if (n % 2 == 0 or n % 3 == 0) : return False\n i = 5\n while(i * i <= n) : \n if (n % i == 0 or n % (i + 2) == 0) : \n return False\n i = i + 6\n return True\n\n\n\ndef read():\n sys.stdin = open('input.txt', 'r') \n sys.stdout = open('output.txt', 'w') \n\n\n\n\n\ndef main():\n \n\n #for _ in range(ii()):\n \n \n n=4\n l=[]\n for i in range(4):\n l.append(si())\n f=0\n for i in range(n-1):\n for j in range(n-1):\n cnt=0\n if s[i][j]=='.':\n cnt+=1\n if s[i+1][j]=='.':\n cnt+=1\n if s[i][j+1]=='.':\n cnt+=1\n if s[i+1][j+1]=='.':\n cnt+=1\n\n if cnt==1:\n f=1\n\n\n if f:\n print('YES')\n else:\n print('NO')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n \n\n\n\n\n\n\n# region fastio\n# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py\n\nBUFSIZE = 8192\n\n\nclass FastIO(IOBase):\n newlines = 0\n\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\n\n\ndef print(*args, **kwargs):\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\n sep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop(\"end\", \"\\n\"))\n if kwargs.pop(\"flush\", False):\n file.flush()\n\n\nif sys.version_info[0] < 3:\n sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\nelse:\n sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\n\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\n# endregion\n\n\nif __name__ == \"__main__\":\n #read()\n main()\n #dmain()\n\n# Comment Read()\n", "lang": "PyPy 2", "bug_code_uid": "02cbfd35328b260c8996cec42b25e1d6", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "60ff16e3db469d4db3037500f67266f9", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.48484848484848486, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#t=int(input())\nfor _ in range(1):\n a,b,c,d=map(int,input().split())\n ans=0\n for i in range(a,b+1):\n for j in range(b,c+1):\n e=i+j-1\n if ed:\n ans+=d-c+1\n else:\n ans+=e-c+1\n print(ans)\n \n \n", "lang": "PyPy 3", "bug_code_uid": "e8970257fb1cdfd3d862e45282053be8", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "ac8125c386c7b7173f8ea342198a2f32", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7339955849889624, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "# import numpy as np\n\ndef get_num_operations(m, x):\n if x < m: return big_number\n if x == m: return 0\n return 1 + get_num_operations(m, int(x / 2))\n\n\nbig_number = 10000000\n\nn, k=map(int, input().split())\nelements_array = list(map(int, input().split()))\n\n\nmax_element = int(max(elements_array))\nbest_result = big_number\nfor m in range(0, max_element + 1):\n cur_results_array = list()\n k_elements = 0\n for element in elements_array:\n cur_operations = get_num_operations(m, element)\n if cur_operations < big_number:\n k_elements += 1\n cur_results_array.append(cur_operations)\n if k_elements == k:\n break\n \n cur_results_array.sort()\n cur_operations = sum(cur_results_array[:k])\n best_result = min(best_result, cur_operations)\n\nprint(best_result)", "lang": "Python 3", "bug_code_uid": "ab0d0e58715b3776ce1dd14ed37ce172", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "27e7e77f023d2fed3543b9566237fc5b", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9941348973607038, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\ns = input().strip()\nf = False\nfor i in range(n):\n for j in range(n):\n x = j\n c = 0\n while x < n:\n if s[x] == '*':\n c += 1\n else:\n c = 0\n if c == 4:\n f = True\n x += i\nif f:\n print('yes')\nelse:\n print('no')", "lang": "Python 3", "bug_code_uid": "72d54b68bee5d3ac5428d44f698d0c30", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "apr_id": "552b7d271dc3288e3e0e6b53373e1517", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8631333721607455, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "def div(num):\n div=[]\n for i in range (1,num+1):\n if num%i==0:\n div.append(i)\n return div\ndef cdiv(n1,n2):\n cd=[]\n for i in range(max(n1,n2)):\n if i in div(n1) and i in div(n2) and i not in cd:\n cd.append(i)\n return cd\nwh,lh,lw=map(int,input().split())\nph=cdiv(wh,lh)\npw=cdiv(wh,lw)\npl=cdiv(lh,lw)\nl , w ,h =1,1,1\nwhile 1:\n if wh==w*h and lh==l*h and lw==l*w:\n break\n for i in ph:\n for j in pw:\n for k in pl:\n if wh==i*j and lh==k*i and lw==k*j:\n h=i\n w=j\n l=k\n break\n if wh==w*h and lh==l*h and lw==l*w:\n break\n if wh==w*h and lh==l*h and lw==l*w:\n break\n \nprint((l+h+w)*4)\n", "lang": "Python 3", "bug_code_uid": "9940e80eca40c4c98798415194319f3f", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "468c64a3c00ac3b7bb68a3b6ed918f56", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.758364312267658, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "\n\nv = int(input())\nn = v\nfor i in range(n):\n if n == 1:\n break\n x = i+1\n if n%x != 0:\n n = n-x\n\nprint(n)\n", "lang": "PyPy 3", "bug_code_uid": "1839c379915306eb359123cbd72cfd3f", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "40a34151a84b2ce61c67c8b08c1ba094", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.24805396990140113, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "import sys\nimport math\n\np, q = map(int, sys.stdin.readline().split())\n\ndef is_palindrome(x):\n s = str(x)\n return all([s[i] == s[len(s)-1-i] for i in xrange(len(s)/2)])\n \ndef get_primes(x):\n arr = [0, 1] + [1, 0]*(x/2)\n for i in xrange(2, int(math.ceil(math.sqrt(n)))+1, 2):\n for j in xrange(i+2, x):\n if j % (i+1) == 0:\n arr[j-1] = 0\n res = [0]*x\n for i in xrange(1, x):\n res[i] = res[i-1] + arr[i]\n return res\n\nn = 2\nrub = [1]\nwhile(1):\n if is_palindrome(n):\n rub.append(rub[-1]+1)\n else:\n rub.append(rub[-1])\n if n >= 17 and p*rub[-1] < q * n / math.log(n):\n break\n n += 1\n\npi = get_primes(n)\n\nwhile(q*pi[n-1] > p*rub[n-1]):\n n -= 1\n\nprint >> sys.stdout, n", "lang": "Python 2", "bug_code_uid": "1e9e746d8b45195af3495acb922181b3", "src_uid": "e6e760164882b9e194a17663625be27d", "apr_id": "a00ca5db165bf1c87ac4d3f70a126657", "difficulty": 1600, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9802289281997919, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "# -*- coding: utf-8 -*-\nimport sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll\n\nMX = 3 * 10 ** 6\nprime = [1] * MX\nprime[0] = prime[1] = 0\nfor i in xrange(2, int(MX ** 0.5 + 1e-8)):\n if prime[i]:\n prime[2 * i::i] = [0] * len(prime[2 * i::i])\n\np, q = map(int, raw_input().split())\npi = rub = ans = 0\nfor i in xrange(1, MX):\n pi += prime[i]\n if i == int(str(i)[::-1]): rub += 1\n if q * pi <= p * rub:\n ans = max(ans, i)\n\nprint ans\n", "lang": "Python 2", "bug_code_uid": "1b9ca748af1ae9a6ccb92def2fe9fb7f", "src_uid": "e6e760164882b9e194a17663625be27d", "apr_id": "61df7f676498a501d625b5ab048f8a6f", "difficulty": 1600, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9581689029202841, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 14, "bug_source_code": "#------------------------template--------------------------#\nimport os\nimport sys\nfrom math import *\nfrom collections import *\nfrom fractions import *\nfrom bisect import *\nfrom heapq import*\nfrom io import BytesIO, IOBase\ndef vsInput():\n sys.stdin = open('input.txt', 'r')\n sys.stdout = open('output.txt', 'w')\nBUFSIZE = 8192\nclass FastIO(IOBase):\n newlines = 0\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\nALPHA='abcdefghijklmnopqrstuvwxyz'\nM=1000000007\ndef value():return tuple(map(int,input().split()))\ndef array():return [int(i) for i in input().split()]\ndef Int():return int(input())\ndef Str():return input()\ndef arrayS():return [i for i in input().split()]\n\n#-------------------------code---------------------------#\n# vsInput()\n \n\ndef primeN(n): \n prime = [True for i in range(n+1)] \n prime[0]=False\n prime[1]=False\n p=2\n while(p*p<=n): \n if(prime[p]): \n for i in range(p*p,n+1,p): \n prime[i]=False\n p+=1\n return prime\n\ndef isPalindrome(n):\n n=str(n)\n return n==n[::-1]\n\n\n\nN=10**7\nprimes=primeN(N)\n\npalindrome=[0,1]\nprime=[0,0]\n\nfor i in range(2,N+1):\n if(isPalindrome(i)):\n palindrome.append(palindrome[-1]+1)\n else:\n palindrome.append(palindrome[-1])\n \n if(primes[i]):\n prime.append(prime[-1]+1)\n else:\n prime.append(prime[-1])\n\n\n# print(prime[40])\n# print(palindrome[40])\n \nans=\"Palindromic tree is better than splay tree\"\np,q=value()\n\nfor i in range(1,N+1):\n if( prime[i]*q <= p*palindrome[i]):\n ans=i\n\nprint(ans)\n\n \n\n \n", "lang": "PyPy 3", "bug_code_uid": "2c9d9cfa45878b5292a3266125e1a7cc", "src_uid": "e6e760164882b9e194a17663625be27d", "apr_id": "b8dfafb3240ce65f6e8b9b5165388d3c", "difficulty": 1600, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9537037037037037, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def int_to_3(a):\n\tstring = \"\";\n\twhile(a>0):\n\t\tstring+=str(a%3)\n\t\ta/=3;\n\tstring = list(string)\n\tstring.reverse()\n\tstring =\"\".join(string)\n\treturn string\n\ndef add_zero(s,n):\n\tif(n<=0):\n\t\treturn s\n\tbefore = ['0']*n\n\tfor x in s:\n\t\tbefore.append(x)\n\treturn \"\".join(before)\n\n#print int_to_3(14)\na,c = [int(x) for x in raw_input().split(' ')]\na3 = int_to_3(a)\nc3 = int_to_3(c)\n#print a3,c3,\nmax_len = max(len(a3),len(c3))\na3 = add_zero(a3,max_len-len(a3))\nc3 = add_zero(c3,max_len-len(c3))\n#print a3,c3\nb = []\nfor i in range(max_len):\t\n\tnew = (int(c3[i])-int(a3[i]))\n\tif(new<0):\n\t\tnew+=3;\n\tb.append(str(new))\nb3 = \"\".join(b)\nprint int(b3,3)\n\t\n\n\n", "lang": "Python 2", "bug_code_uid": "9cba2e2f0d5f019686f4ba39dfca09a1", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "4e05c3a7c3f8f3ef65cb65875fe52174", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9853508095605242, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import string\n\ndef convDecToBase(num, base=3, dd=False):\n if not 2 <= base <= 36:\n raise ValueError, 'The base number must be between 2 and 36.'\n if not dd:\n dd = dict(zip(range(36), list(string.digits+string.ascii_lowercase)))\n if num == 0: return ''\n num, rem = divmod(num, base)\n return convDecToBase(num, base, dd)+dd[rem]\n\na, c = map(str, map(convDecToBase, map(int, raw_input().split(' '))))\n\nclen = max(len(a),len(c))\na = a.zfill(clen)\nc = c.zfill(clen)\n\nb = ''\nfor i in range(clen):\n b1 = ord(c[clen-i-1]) - ord(a[clen-i-1])\n if b1 < 0: b1 += 3\n b += chr(ord('0') + b1)\n\nprint int(b[::-1],3)\n\n", "lang": "Python 2", "bug_code_uid": "27363fed47568471a147b71475340e80", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "45c86f80ad23479563f80682399bb697", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.663680106188817, "equal_cnt": 20, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 19, "bug_source_code": "import sys\n\ndef solve(a, b, c, d):\n #w=[a,b]\n #q=[c,d]\n #[q,p] in w\n #p?\n ind1 = 0\n ind2 = 0\n cnt1 = 1\n cnt2 = 0\n phases = []\n phases2 = []\n\n while True:\n if a[ind1] == c[ind2]:\n ind2 += 1\n if ind2 == len(c):\n #word finished!\n cnt2 += 1\n ind2 = 0\n #check phase\n if ind1 in phases:\n #period!\n phases.append(ind1)\n phases2.append([cnt1, cnt2])\n\n break\n \n #save phase\n phases.append(ind1)\n phases2.append([cnt1, cnt2])\n\n ind1 += 1\n if ind1 == len(a):\n cnt1 += 1\n ind1 = 0\n if cnt1 > b:\n return cnt2 / d\n \n val2 = phases2[-1]\n val1 = phases2[phases.index(ind1)]\n\n step1 = val2[0] - val1[0]\n step2 = val2[1] - val1[1]\n \n delta = -val2[0]*step2/step1+val2[1]\n if False:\n print str(val1[0]) + \" -- > \" + str(val1[1])\n print str(val2[0]) + \" -- > \" + str(val2[1])\n print \"delta = \" + str(delta)\n res = step2 * b / (step1 * d) + delta\n if res < 0:\n return 0\n else:\n return res\n\nif True:\n b, d = map(int, sys.stdin.readline().split())\n \n a = sys.stdin.readline().split()[0]\n c = sys.stdin.readline().split()[0]\n print str(solve(a, b, c, d))\nelse:\n vals = []\n vals.append([841, 7, 'qjqhrksmvedtqldrqgchhsofokfcovut' ,'qhtmothoulodshrfejterjlguvooccsvqrrdfqfvkqhtecuhhuqhshthrkusrc', 5])\n vals.append([933, 5, 'abaabdcbbabacbdddadbbb', 'babbadbaaadbbbbaabbaabccbbdbadbbbbbbdbcbdbaaadbdbdbbbbdcbbdcbdaadbd', 15])\n vals.append([875, 10, 'hjeaiemqfliohlicmhndhbfdmlmcnjjgbg', 'hojqhmbgjlfmlliimlhahfeihgmhhhnbmebhgnfhgmhfjqhmlnnddgmqldelnhebi', 4])\n vals.append([320672, 1, 'wyyojuothwmlvrglfzdzdbtubxuoffvncrswsaznmoijoi', 'ttvlvzxcvczuagwzgbfuwmmt', 40084])\n vals.append([5608475, 1, 'gbagadghfaedhddefgbehbbdedefbaaeddachgebhbcgahfdchffhbhfahhdegdhdfbccgefhcdhhcdfgdgfhcdffaacch', 'fgfadaaecdgabeahcacadcbfhhe', 1869491])\n vals.append([1263204, 1, 'dcbabceabbaebddaaecbddaceaedacddadadcbbadbdccdecdacdcaadbceeddccbceaade', 'abddbccbdca', 1894805])\n vals.append([100, 1, 'bca', 'abc', 99])\n for val in vals:\n b, d, a, c, answer = val\n res = solve(a, b, c, d)\n if res == answer:\n print '++++++++++++++++++++++++++++'\n pass\n else:\n print '----------------------------'\n print val\n print res\n print '----------------------------'\n sys.stdin.readline()\n\n", "lang": "Python 2", "bug_code_uid": "7b57ee9b98a4671d932631a7d2bbba83", "src_uid": "5ea0351ac9f949dedae1928bfb7ebffa", "apr_id": "9723e4acc4ef1487ae6b9d79579385b5", "difficulty": 2000, "tags": ["dfs and similar", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9738541987080899, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "import sys\ndebug = False\ndef solve(a, b, c, d):\n #w=[a,b]\n #q=[c,d]\n #[q,p] in w\n #p?\n ind1 = 0\n ind2 = 0\n cnt1 = 1\n cnt2 = 0\n phases = []\n phases2 = []\n\n while True:\n if a[ind1] == c[ind2]:\n ind2 += 1\n if ind2 == len(c):\n #word finished!\n cnt2 += 1\n ind2 = 0\n #check phase\n if ind1 in phases:\n #period!\n cnt1_, cnt2_ = phases2[phases.index(ind1)]\n step1 = cnt1 - cnt1_\n step2 = cnt2 - cnt2_\n cnt = (b-cnt1)/step1\n cnt1 += step1 * cnt\n cnt2 += step2 * cnt\n phases = []\n phases2 = []\n #save phase\n phases.append(ind1)\n phases2.append([cnt1, cnt2])\n\n ind1 += 1\n if ind1 == len(a):\n cnt1 += 1\n ind1 = 0\n if cnt1 > b:\n return cnt2 / d\n #answ \n val2 = phases2[-1]\n val1 = phases2[phases.index(ind1)]\n\n step1 = val2[0] - val1[0]\n step2 = val2[1] - val1[1]\n \n if debug:\n print str(val1[0]) + \" -- > \" + str(val1[1])\n print str(val2[0]) + \" -- > \" + str(val2[1])\n\n res = step2 * b / (step1 * d)\n res = (b - val2[0]) * step2 / (step1 * d) + val2[1]\n if res < 0:\n return 0\n else:\n return res\n\nif not debug:\n b, d = map(int, sys.stdin.readline().split())\n \n a = sys.stdin.readline().split()[0]\n c = sys.stdin.readline().split()[0]\n print str(solve(a, b, c, d))\nelse:\n vals = []\n vals.append([841, 7, 'qjqhrksmvedtqldrqgchhsofokfcovut' ,'qhtmothoulodshrfejterjlguvooccsvqrrdfqfvkqhtecuhhuqhshthrkusrc', 5])\n vals.append([933, 5, 'abaabdcbbabacbdddadbbb', 'babbadbaaadbbbbaabbaabccbbdbadbbbbbbdbcbdbaaadbdbdbbbbdcbbdcbdaadbd', 15])\n vals.append([875, 10, 'hjeaiemqfliohlicmhndhbfdmlmcnjjgbg', 'hojqhmbgjlfmlliimlhahfeihgmhhhnbmebhgnfhgmhfjqhmlnnddgmqldelnhebi', 4])\n vals.append([320672, 1, 'wyyojuothwmlvrglfzdzdbtubxuoffvncrswsaznmoijoi', 'ttvlvzxcvczuagwzgbfuwmmt', 40084])\n vals.append([5608475, 1, 'gbagadghfaedhddefgbehbbdedefbaaeddachgebhbcgahfdchffhbhfahhdegdhdfbccgefhcdhhcdfgdgfhcdffaacch', 'fgfadaaecdgabeahcacadcbfhhe', 1869491])\n vals.append([1263204, 1, 'dcbabceabbaebddaaecbddaceaedacddadadcbbadbdccdecdacdcaadbceeddccbceaade', 'abddbccbdca', 1894805])\n vals.append([100, 1, 'bca', 'abc', 99])\n vals.append([541, 9, 'bxhwcmunbdxcatppdsw', 'shbppncwbnsxxnxunwsbncpdchcbcspdcppdchmbbcuapphpdxbpcswcxpxpdscxpddbcppdxhpxbuxxdbpdpuudb', 1])\n vals.append([9447267, 1, 'cbdcbdbcdacbcabddbaabcbacbabcaacbabaccddcbbdbbaddcbcbaaadc', 'bbbbdbcbbbdbdbcdcacccbdcadadbacbcccc', 4723633])\n for val in vals:\n b, d, a, c, answer = val\n res = solve(a, b, c, d)\n if res == answer:\n print '++++++++++++++++++++++++++++'\n pass\n else:\n print '----------------------------'\n print val\n print res\n print '----------------------------'\n sys.stdin.readline()\n\n", "lang": "Python 2", "bug_code_uid": "41f1592aea0923fde6b9a2c0ffa65520", "src_uid": "5ea0351ac9f949dedae1928bfb7ebffa", "apr_id": "9723e4acc4ef1487ae6b9d79579385b5", "difficulty": 2000, "tags": ["dfs and similar", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23771790808240886, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "inputs = input().split()\nn, a, b = [int(x) for x in inputs]\n\ncakes = [a, b]\nif n % 2 == 0:\n key_divisor = n // 2\nelse:\n key_divisor = (n + 1) // 2\n \nplates = 2\nwhile plates != n:\n maximum = max(cakes)\n pivot = maximum // key_divisor\n ind = cakes.index(maximum)\n cakes[ind] = pivot\n plates = (plates - 1) + key_divisor\n \nreturn min(cakes)\n\nprint (min(cakes))", "lang": "Python 3", "bug_code_uid": "68c0ce3a54bf9ac310da5a812fdcc8f8", "src_uid": "a254b1e3451c507cf7ce3e2496b3d69e", "apr_id": "12555015090ce94fd4d3395a6efb6599", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3063583815028902, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "# your code goes here\nk=int(input())\nk=k-1\nstr=\"codeforces\"\nres=str.ljust(k+len(str),'s')\n\nprint(res)", "lang": "PyPy 3", "bug_code_uid": "2e52ab7980d9d84accbef18f4a3e0c51", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "93a47c8ef1bb889708054dee11fa3199", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2656546489563567, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import sys\ninput = sys.stdin.readline\n\nk = int(input())\nprint('codeforces'+'s'*(k-1))", "lang": "PyPy 3", "bug_code_uid": "8d2efa630512497e1b964655e65ab57f", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "e9535638e763c07538939a65b59bfe3e", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09497206703910614, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n=int(input())\nprint('codeforce'+n*'s')", "lang": "PyPy 3", "bug_code_uid": "556af6d8b650b9ee8933d84fffaebec5", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "a57664068caeddd8c1f58e2da57607c6", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5588235294117647, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "k,a,b,v=map(int,raw_input().split())\nn=(a+v-1)/v\nd=b/(k-1)*k\nif d 0:\n\tr += int(m/n)\n\tm /= n\nprint r", "lang": "Python 2", "bug_code_uid": "0bcac9672d3181afa09f6ccc41c87a43", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "4832974dd59d3c121c28a4b2f7d56e81", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9288800265869059, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3\n'''\nCreated on 13/09/2018\n\n@author: ernesto\n'''\n\nn, m = [int(x) for x in input().strip().split(\" \")]\n\nposibles_jefes = set(range(1, n + 1))\nanteriores = set()\nposteriores = set()\ncontinuos = [True] * (n + 1)\nmencionados = set()\nposibles_jefes_mencionados = set()\nultimo_en_salir = [True] * (n + 1)\nultima_salida_inesperada = None\n\nops = []\n\nif(m > 1):\n for _ in range(0, m):\n s, n_s = [x for x in input().strip().split(\" \")]\n n = int(n_s)\n ops.append((s, n))\n for i in range(0, m):\n op, num = ops[i]\n cont = False\n if op == '+':\n cont = not i or (ops[i - 1][0] == '-' and ops[i - 1][1] == num)\n posteriores.add(num)\n if op == '-':\n cont = i == m - 1 or (ops[i + 1][0] == '+' and ops[i + 1][1] == num)\n if num not in mencionados:\n anteriores.add(num)\n ultima_salida_inesperada = num\n posteriores.discard(num)\n ultimo_en_salir[num] &= not posteriores\n continuos[num] &= cont \n mencionados.add(num)\n# print(\"anteriores {} posteriores {} continuos {} ops {}\".format(anteriores, posteriores, continuos, ops))\n if not anteriores and not posteriores:\n assert ultima_salida_inesperada is None\n if ops[0][0] == '+' and ops[-1][0] == '-' and ops[0][1] == ops[-1][1] and continuos[ops[0][1]] and ultimo_en_salir[ops[0][1]]:\n posibles_jefes_mencionados.add(ops[0][1])\n else:\n if not posteriores:\n assert ultima_salida_inesperada is not None\n posibles_jefes_filtrados = list(filter(lambda x:continuos[x] and ultimo_en_salir[x] and ultima_salida_inesperada == x, anteriores))\n assert len(posibles_jefes_filtrados) <= 1\n if(posibles_jefes_filtrados):\n assert posibles_jefes_filtrados[0] == ops[-1][1]\n posibles_jefes_mencionados.add(ops[-1][1])\n else:\n if not anteriores:\n assert ultima_salida_inesperada is None\n posibles_jefes_filtrados = list(filter(lambda x:continuos[x] and ultimo_en_salir[x], posteriores))\n# print(\"posibles {}\".format(posibles_jefes_filtrados))\n assert len(posibles_jefes_filtrados) <= 1\n if(posibles_jefes_filtrados):\n assert posibles_jefes_filtrados[0] == ops[0][1]\n posibles_jefes_mencionados.add(ops[0][1])\n else:\n assert ultima_salida_inesperada is not None\n posibles_jefes_mencionados = set(filter(lambda x:ultimo_en_salir[x] and ultima_salida_inesperada == x, anteriores & posteriores))\n\n# print(\"posibles jefes menc {}\".format(posibles_jefes_mencionados))\n posibles_jefes -= (mencionados - posibles_jefes_mencionados)\n \nprint(len(posibles_jefes))\nif(len(posibles_jefes)):\n print(\" \".join(map(str, sorted(posibles_jefes))))\n", "lang": "Python 3", "bug_code_uid": "f7287fce191127406467cf67d27f6129", "src_uid": "a3a337c7b919e7dfd7ff45ebf59681b5", "apr_id": "d7d2c377d7a0cdf219368e63b4eb9d62", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9070003381805885, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "#!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3\n'''\nCreated on 13/09/2018\n\n@author: ernesto\n'''\n\nn, m = [int(x) for x in input().strip().split(\" \")]\n\nposibles_jefes = set(range(1, n + 1))\nanteriores = set()\nposteriores = set()\ncontinuos = [True] * (n + 1)\nmencionados = set()\nposibles_jefes_mencionados = set()\nultimo_en_salir = [True] * (n + 1)\nultima_salida_inesperada = None\n\nops = []\n\nif(m > 1):\n for _ in range(0, m):\n s, n_s = [x for x in input().strip().split(\" \")]\n n = int(n_s)\n ops.append((s, n))\n for i in range(0, m):\n op, num = ops[i]\n cont = False\n if op == '+':\n cont = not i or (ops[i - 1][0] == '-' and ops[i - 1][1] == num)\n posteriores.add(num)\n if op == '-':\n cont = i == m - 1 or (ops[i + 1][0] == '+' and ops[i + 1][1] == num)\n if num not in mencionados:\n anteriores.add(num)\n ultima_salida_inesperada = num\n posteriores.discard(num)\n ultimo_en_salir[num] &= not posteriores\n continuos[num] &= cont \n mencionados.add(num)\n# print(\"anteriores {} posteriores {} continuos {} ops {}\".format(anteriores, posteriores, continuos, ops))\n if not anteriores and not posteriores:\n assert ultima_salida_inesperada is None\n if ops[0][0] == '+' and ops[-1][0] == '-' and ops[0][1] == ops[-1][1] and continuos[ops[0][1]] and ultimo_en_salir[ops[0][1]]:\n posibles_jefes_mencionados.add(ops[0][1])\n else:\n if not posteriores:\n assert ultima_salida_inesperada is not None\n posibles_jefes_filtrados = list(filter(lambda x:continuos[x] and ultimo_en_salir[x] and ultima_salida_inesperada == x, anteriores))\n assert len(posibles_jefes_filtrados) == 1\n assert posibles_jefes_filtrados[0] == ops[-1][1]\n posibles_jefes_mencionados.add(ops[-1][1])\n else:\n if not anteriores:\n assert ultima_salida_inesperada is None\n posibles_jefes_filtrados = list(filter(lambda x:continuos[x] and ultimo_en_salir[x], posteriores))\n# print(\"posibles {}\".format(posibles_jefes_filtrados))\n assert len(posibles_jefes_filtrados) == 1\n assert posibles_jefes_filtrados[0] == ops[0][1]\n posibles_jefes_mencionados.add(ops[0][1])\n else:\n assert ultima_salida_inesperada is not None\n posibles_jefes_mencionados = set(filter(lambda x:ultimo_en_salir[x] and ultima_salida_inesperada == x, anteriores & posteriores))\n\n# print(\"posibles jefes menc {}\".format(posibles_jefes_mencionados))\n posibles_jefes -= (mencionados - posibles_jefes_mencionados)\n \nprint(len(posibles_jefes))\nif(len(posibles_jefes)):\n print(\" \".join(map(str, sorted(posibles_jefes))))\n", "lang": "Python 3", "bug_code_uid": "92f498db3e82e53bd111a2d52dc589ee", "src_uid": "a3a337c7b919e7dfd7ff45ebf59681b5", "apr_id": "d7d2c377d7a0cdf219368e63b4eb9d62", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.39355742296918766, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import math\n# A Dynamic Programming based solution to compute nCr % p \n \n# Returns nCr % p \ndef nCrModp(n, r, p): \n \n # The array C is going to store last row of \n # pascal triangle at the end. And last entry \n # of last row is nCr. \n C = [0 for i in range(r+1)] \n \n C[0] = 1 # Top row of Pascal Triangle \n \n # One by constructs remaining rows of Pascal \n # Triangle from top to bottom \n for i in range(1, n+1): \n \n # Fill entries of current row \n # using previous row values \n for j in range(min(i, r), 0, -1): \n \n # nCj = (n - 1)Cj + (n - 1)C(j - 1) \n C[j] = (C[j] + C[j-1]) % p \n return C[r] \n#q=int(input())\nq=1\nfor _ in range(q):\n n,m=map(int,input().split())\n p=998244353\n ans=nCrModp(m,n-1,p)\n power=1\n for i in range(n-3):\n power=(power*2)%p\n ans=(ans*power)%p \n ans=(ans*(n-2))%p\n print(ans%p)\n \n \n ", "lang": "PyPy 3", "bug_code_uid": "a43db6da8a2dcafdbd0f5fc6fcd9f1b9", "src_uid": "28d6fc8973a3e0076a21c2ea490dfdba", "apr_id": "9468dd11d9e7cb17687649d39563fdbd", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9971988795518207, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = input()\nP = sorted(map(int, input().split()))\ne = sum(abs(p - 1 - 2 * i) for i, p in enumerate(P))\no = sum(abs(p - 1 - (2 * i + 1) for i, p in enumerate(P))\nprint(min(e, o))\n", "lang": "Python 3", "bug_code_uid": "08d9dab95c9863acb6b63686f53457d7", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "e06adab821157a9fa3c9291fe8c9a263", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8489208633093526, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a,b=map(int,input().split())\nif ((a*b<=10000) and (a*b>=1) and ((abs(b-a)==1) or (abs(b-a)==0)) :\n print(\"YES\")\nelse:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "9b202b2145eb14726b43924dd58726f5", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "0f2f52151ed63e6950ba6772f6428833", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.30581478822684854, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import math\n\ndef get_seq_max_length(w,m,k):\n math.log(m,10)\n if w < int((math.log(m,10) + 1)) * k:\n return 0\n max_sum = w/k\n seq_length = 1\n sum = int(math.log(m,10) + 1)\n while (sum + int(math.log(m + seq_length, 10)) + 1) <= max_sum:\n sum += int(math.log(m + seq_length, 10) + 1)\n seq_length += 1\n return seq_length\n\nnums = map(int, raw_input('').split())\nprint get_seq_max_length(*nums)\n \n", "lang": "Python 2", "bug_code_uid": "407d90771279378d2c1e2cc04cd6a57f", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "91ddbcdc0983e35ec72082d0b20cd7f6", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8065040650406504, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "ans = []\n\ndef gcd(x, y):\n while(True):\n if x == y:\n if x == 1:\n return True;\n else:\n return False;\n elif x > y:\n t = x // y;\n if y == 1:\n t -= 1\n ans.append(-t)\n x -= t * y\n else:\n t = y // x\n if x == 1:\n t -= 1\n ans.append(t)\n y -= t * x\n\nx, y = map(long, raw_input().split())\nif gcd(x, y) == False:\n print 'Impossible'\nelse:\n s = ''\n for t in ans:\n if t < 0:\n s += str(-t) + 'A'\n else:\n s += str(t) + 'B'\n print s", "lang": "Python 2", "bug_code_uid": "29a7de244c09efa49d578c3d59ebd7ec", "src_uid": "6a9ec3b23bd462353d985e0c0f2f7671", "apr_id": "41ebe5f97fccd98422978b86262bbbc8", "difficulty": 2400, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.38153846153846155, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "n=int(input())\nm=-1\nfor i in range(n//2+1, 0, -1):\n if n%i==0 and m==-1:\n for j in range(0, i):\n if (2**j-1)*(2**(j-1))==i:\n m=i\n break\n\nif m!=-1:\n print(m)\nelse:\n print(\"1\")", "lang": "Python 3", "bug_code_uid": "ed9a37ee2039b1ddb103467e8c73a49b", "src_uid": "339246a1be81aefe19290de0d1aead84", "apr_id": "27d1236ef37199659b27384ba916ae09", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.99880810488677, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import re\nif re.match( r'^(H|HE|LI|BE|B|C|N|O|F|NE|NA|MG|AL|SI|P|S|CL|AR|K|CA|SC|TI|V|CR|MN|FE|CO|NI|CU|ZN|GA|GE|AS|SE|BR|KR|RB|SR|Y|ZR|NB|MO|TC|RU|RH|PD|AG|CD|IN|SN|SB|TE|I|XE|CS|BA|LA|CE|PR|ND|PM|SM|EU|GD|TB|DY|HO|ER|TM|YB|LU|HF|TA|W|RE|OS|IR|PT|AU|HG|TL|PB|BI|PO|AT|RN|FR|RA|AC|TH|PA|U|NP|PU|AM|CM|BK|CF|ES|FM|MD|NO|LR|RF|DB|SG|BH|HS|MT|DS|RG|CN|NH|FL|MC|LV|TS|OG)*$', input()):\n print(\"YES\")\nelse\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "bafa124329b4bd72bbc814a42fb01813", "src_uid": "d0ad35798119f98320967127c43ae88d", "apr_id": "f9dfab01e90a8beda186cb5afa4d8609", "difficulty": null, "tags": ["dp", "brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9911504424778761, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'B', 'H']\nx, y, z = sorted(map(lambda x:n.index(x), input()))\nl = [x, y, z]\nfor i in range(3):\n if (l[(i + 2) % 3] - l[(i + 1) % 3]) % 12 == 3 and (l[(i + 1) % 3] - l[(i) % 3]) % 12 == 4:\n print('major')\n exit(0)\n elif (l[(i + 2) % 3] - l[(i + 1) % 3]) % 12 == 4 and (l[(i + 1) % 3] - l[(i) % 3]) % 12 == 3:\n print('minor')\n exit(0)\nprint('strange')\n \n", "lang": "Python 3", "bug_code_uid": "558c5c7e9b95c61f61c881f164031d8c", "src_uid": "6aa83c2f6e095848bc63aba7d013aa58", "apr_id": "f3517a4035295f908a79011c8456cef3", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5734265734265734, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import math\n\nline = input().split()\n\nans = 0\nfor a in range(1, int(line[0])+1):\n ans += a*math.factorial(a)*math.factorial(int(line[0])+1-a)\n\nprint(ans%int(line[1]))\n", "lang": "PyPy 3", "bug_code_uid": "6875b82fab11fcf41aeffd7fe794ac39", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "a6cd387a3f828c41d8e8fb3543a592cf", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9023255813953488, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "T, S, q = map(int, input().split())\nprint(int(log(T / S - 0.00001) / log(q)) + 1 if T > S else 1)", "lang": "Python 3", "bug_code_uid": "2017bbbee430677aa0144ddeea37881f", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "apr_id": "cc4eb7d6dcfcc006f8975ccf46f98bea", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.32893910860012554, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a = input()\nk=0\na1 = a[0]+a[1]\na2 = a[3]+a[4]\na3 = a[6]+a[7]\nq=[]\nw=[]\nw1=[]\nq1=[]\nt=[]\nt1=[0]*3\nw.append(int(a[0]))\nw.append(int(a[3]))\nw.append(int(a[6]))\nq.append(a[1])\nq.append(a[4])\nq.append(a[7])\nt = sorted(w)\nt = list(t)\nfor i in range(3):\n for b in range(3):\n if w[i] == t[b]:#\u0446\u0438\u0444\u0440\u044b\n t1[b] = q[i]#\u0431\u0443\u043a\u0432\u044b\nif a1 == a2 and a2 == a3 and a1 == a3:\n print(0)\nelif a1 == a2 or a2 == a3 or a1 == a3:\n print(1) \nelif t1[0]==t1[1]==t1[2] and (t[0]+1) = t[1] = (t[2]-1):\n print(0)\nelif ((t1[0] == t1[1]) and ((abs(t[1] - t[0])==1) or (abs(t[1] - t[0])==2))) or ((t1[0] == t1[2]) and ((abs(t[2] - t[0])==1) or (abs(t[2] - t[0])==2))) or ((t1[2] == t1[1]) and ((abs(t[1] - t[2])==1) or (abs(t[1] - t[2])==2))) :\n print(1)\nelse:\n print(2)\n\n \n \n \n ", "lang": "Python 3", "bug_code_uid": "802e65e602c4fee8280feb93be9d8d2f", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "51adef72749336e42b3279afa770f2d9", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.20297029702970298, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "n=int(input())\ndp=[0 for _ in range(n+1)]\ndp[1]=1\n\nfor i in range(2, n+1):\n dp[i]=dp[i-1]+1\n\n if i >= 5: dp[i]=min(dp[i], dp[i-5]) + 1\n if i >= 10: dp[i]=min(dp[i], dp[i-10]) + 1\n if i >= 20: dp[i]=min(dp[i], dp[i-20]) + 1\n if i >= 100: dp[i]=min(dp[i], dp[i-100]) + 1\n\nprint(dp[n])", "lang": "PyPy 3", "bug_code_uid": "ddf45481f0d2c77484623d7abd906fc0", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "7a9a8f37a1be316c2615f969147fe763", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.0845771144278607, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "cash = int(input())\ndeno = [100,20,10,5,1]\ncount = 0\nwhile cash >=0:\n if cash >= deno[0]:\n cash-=deno[0]\n count+=1\n \n elif cash >= deno[1]:\n cash-=deno[1]\n count+=1\n \n elif cash >=deno[2]:\n cash-=deno[2]\n count+=1\n \n elif cash >=deno[3]:\n cash-=deno[3]\n count+=1\n \n elif cash >=deno[4]:\n cash-=deno[4]\n count+=1\n \nprint(count)", "lang": "PyPy 3", "bug_code_uid": "a316d9e4c2fb1bae2698ea2ae0d9cc05", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "e3d6ae59c57e941b61ac6e9c4f268a4f", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.061167747914735865, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "import sys \n \n# m is size of coins array (number of \n# different coins) \ndef minCoins(coins, m, V): \n \n # table[i] will be storing the minimum \n # number of coins required for i value. \n # So table[V] will have result \n table = [0 for i in range(V + 1)] \n \n # Base case (If given value V is 0) \n table[0] = 0\n \n # Initialize all table values as Infinite \n for i in range(1, V + 1): \n table[i] = sys.maxsize \n \n \n # for all values from 1 to V \n for i in range(1, V + 1): \n \n # Go through all coins smaller than i \n for j in range(m): \n if (coins[j] <= i): \n sub_res = table[i - coins[j]] \n if (sub_res != sys.maxsize and \n sub_res + 1 < table[i]): \n table[i] = sub_res + 1\n return table[V] \n \n# Driver Code \nif __name__ == \"__main__\": \n \n coins = [1,5,10,20,100] \n m = len(coins) \n V = int(input())\n print(minCoins(coins, m, V)) ", "lang": "PyPy 3", "bug_code_uid": "7b799a18733af6f21816375526dd6093", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "919705498ffe7292ad6716db30ae701b", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.0182648401826484, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "# This is simple recurrence that we had learnt that is\n# let S(n) be the number of bills for getting the money out\n# then recurrence is\n# s(n)=1+min(S(n-1),S(n-5),S(n-10),S(n-20),S(n-100))\n# memoization \n# lst conatins list where for each index we have its min bill stores\n\n# we do this problem iterative\nimport sys \n\ndef hitLotery(n):\n\tlst=[-1 for i in range (n+1)]\n\t# base case\n\tlst[0]=0\n\ti=1\n\twhile(i=0):\n\t\t\tb2=lst[i-5]\n\t\telse:\n\t\t\tb2=sys.maxsize \n\n\t\tif(i-10>=0):\n\t\t\tb3=lst[i-10]\n\t\telse:\n\t\t\tb3=sys.maxsize \n\t\tif(i-20>=0):\n\t\t\tb4=lst[i-20]\n\t\telse:\n\t\t\tb4=sys.maxsize \n\t\tif(i-100>=0):\n\t\t\tb5=lst[i-100]\n\t\telse:\n\t\t\tb5=sys.maxsize \n\n\n\t\t# now we have got the previous valuies thus \n\t\t# induction step\n\t\tlst[i]=1+min(b1,b2,b3,b4,b5)\n\t\ti=i+1 \n\n\treturn(lst[n])\n\nn=int(input())\nprint(hitLotery(n))", "lang": "PyPy 3", "bug_code_uid": "d0881adf4b3f205e96971e16042559e0", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "259f1bad8f10b60b92efea5a529c9cd3", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.15432098765432098, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "from math import inf\n\nn = int(input())\n\nbills = [1, 5, 10, 20, 100]\ndp = [0]\n\nfor i in range(1, n+1):\n dp.append(inf)\n\nfor i in range(1, n+1):\n for bill in bills:\n if i - bill >= 0:\n dp[i] = min(dp[i], dp[i-bill]) + 1\n\nprint(dp[n])", "lang": "PyPy 3", "bug_code_uid": "155b6c9a84624a1f139f4684c8b43b15", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "da0cf5354651549d448d8bd9d259ee21", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.829443447037702, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\n\ncoins = [1, 5, 10, 20, 100]\n\ndp = [float(\"inf\") for _ in range(n + 1)]\ndp[0] = 0\n\nfor i in range(1, n + 1):\n candidates = [dp[i - k] + 1 for k in coins if i >= k]\n dp[i] = min(\n candidates\n )\nprint(dp[n])\n", "lang": "PyPy 3", "bug_code_uid": "59d210bd0f67068f95bd1772851f423e", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "7fedf8c3db371d75d473dbdcd181beda", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9157509157509157, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "f = list(map(int, input().split()))\nw = f[0]\nh = f[1]\nn = f[2]\ns = 0\nd = 2\nfor i in range(n):\ns = s + (w + h - d)*2\nd = d + 8\nprint(s)\n", "lang": "Python 3", "bug_code_uid": "7cdd6c512126e434da7462a67057059a", "src_uid": "2c98d59917337cb321d76f72a1b3c057", "apr_id": "ab4d7fd1c0e011209b8841419817e07c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.0881488736532811, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "a,b,c,d,e,f = map(int,input().split())\ng= abs(a-c)/e \nh = abs(b-d)/f\ni = (c-1)/e\nj = (d-1)/f\nk=[]\nif abs(a - c)%e ==0 and abs(b-d)%f==0:\n if (g%2==0 and h%2==0) or (g%2==1 and h%2==1):\n k.append(int(max(g,h)))\n\nif (a-c)%e==0 and (d-1)%g==0:\n if (g%2==0 and j%2==0) or (g%2==1 and j%2==1):\n k.append(int(max(g,j)))\n\nif (c-1)%e==0 and abs(b-d)%f==0:\n if (i%2==0 and h%2==0) or (i%2==1 and h%2==1):\n k.append(int(max(h,i)))\n\n \nif (c-1)%e==0 and (d-1)%g==0:\n if (i%2==0 and j%2==0) or (i%2==1 and j%2==1):\n k.append(int(max(j,i))) \n\n\nif len(k) == 0:\n print('Poor Inna and pony')\nprint(min(k))\n\n", "lang": "Python 3", "bug_code_uid": "e3092221b9131302cad369e6bc742eb1", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "0311e73106e7d928ceffe405b67dd8a2", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.16666666666666666, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\nprint((1 << n - 1) + (n * n - n << n - 3))", "lang": "PyPy 3", "bug_code_uid": "11ca7a87a16f95551aa7eb5574bb3394", "src_uid": "aa2c3e94a44053a0d86f61da06681023", "apr_id": "ac09d02bca7dc710047429bdbdd72147", "difficulty": 1900, "tags": ["dp", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.44150943396226416, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x, y = map(int, input().split())\nn = int(input())\nm = 1000000007\nif n == 1:\n print(x % m)\n quit()\nif n == 2:\n print(y % m)\n quit()\nf = [x, y]\nfor i in range(2, n+1):\n k = (f[i-1] % m-f[i-2] % m) % m\n f.append(k)\nprint(f[n-1])\n", "lang": "PyPy 3", "bug_code_uid": "4db181be0a6ac75ac7abe0091363665a", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "9bf2311b580ceb6dc77cff52d071925b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.43523316062176165, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "x,y=map(int,input().split())\nn=int(input())\nc=[x,y]\nif(x==0 and y==0):\n print(0)\n exit()\nelif(y==0):\n print(x)\n exit()\nfor i in range(1,10000000000000000000000007):\n c.append(c[i]-c[i-1])\nprint(c[n-1]%1000000007)\n", "lang": "PyPy 3", "bug_code_uid": "95194132a57d9da47003ae80baebf421", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "f1623db60b3eabb2f7010a5c90031490", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2177121771217712, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "x,y=map(int,input().split())\nn=int(input())\nl=[]\nl.append(0)\nl.append(x)\nl.append(y)\ni=3\nwhile(i<=n):\n x=l[i-1]-l[i-2]\n l.append(x)\n i=i+1\nprint(l[len(l)-1]%1000000007)\n", "lang": "PyPy 3", "bug_code_uid": "8604c8677de9c4219d98981f4135db27", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "01a58d3e7ed26d4aaf6e209d7d50bafc", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7644683714670256, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "# n = int(input())\n# arr = list(map(int, input().split()))\n# n,m=map(int,input().split())\n# n, m, k = map(int, input().split())\n# arr = list(map(int, input().split()))\n# ls = list(map(int, input().split()))\nx,y=map(int,input().split())\nn = int(input())\nls=[x,y]\nif n>=3:\n for i in range(2, n):\n val = ls[i - 1] + ls[i - 2] * -1\n ls.append(val)\n print(ls[n - 1] % 1000000007)\nelse:\n print(ls[n-1]%1000000007)", "lang": "PyPy 3", "bug_code_uid": "2fecbfc99a9c843350af81300be4b395", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "de6c69817b3e650b1810d6c835e860b2", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9953917050691244, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "string = input().split(' ')\nn = int(string[0])\npos = int(string[1])\na = int(string[2])\nb = int(string[3])\n\nif b==n and a==1:\n\tprint(0)\nelif b==n and a!=1:\n\tif pos>=a:\n\t\tprint(pos-a+1)\n\telse:\n\t\tprint(a-pos+1)\nelif a==1 and b!=n:\n\tif pos<=b:\n\t\tprint(b-pos+1)\n\telse:\n\t\tprint(pos-b+1)\nelse:\n\tif pos<=a:\n\t\tprint(b-pos+2)\n\telif pos>=2\n\t\tprint(pos+2-a)\n\telse:\n\t\tres_left=pos-2*a+2+b\n\t\tres_right=2*b-pos+2-a\n\t\tprint(min(res_left, res_right))", "lang": "Python 3", "bug_code_uid": "fa9d02dc45fecb7e15f4492e482a8c3f", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "17e44a4bf57abb4eed315434f29d95b4", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9548229548229549, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import math\n\nn = int(input())\n\ndef prime_factors(n):\n factors = set()\n d = 2\n while d * d <= n:\n while (n % d) == 0:\n factors.add(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n factors.add(n)\n return factors\n\nfactors = prime_factors(n)\n\nif len(factors) > 1:\n print(1)\nelse:\n print(factors.pop())", "lang": "PyPy 3", "bug_code_uid": "f858e90e30e333475492ba333efbeb20", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "8c0ca78f0801ab9e3b35b349bbcad8e0", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6145251396648045, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a,b=map(int,input().split());a=[i for i in range(1,a+1)];print(b-1 if len(a[:b])-1>len(a[b:]) else b+1)\n", "lang": "Python 3", "bug_code_uid": "23937f572421905265fe02f25b1b29df", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "apr_id": "2d6a72141b298c1ad34ef5619f8f61b5", "difficulty": 1300, "tags": ["games", "greedy", "math", "implementation", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9841688654353562, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def func(x,limit):\n while True:\n if(x < 0):\n x = -x\n elif (x > limit):\n x = 2.0*limit - x\n else:\n return x\ntext = raw_input()\na,b,m = map(int,text.split())\ntext = raw_input()\nvx,vy,vz = map(int,text.split())\ndx = a/2.0 + (m*1.0/-vy)*vx\ndz = (m*1.0/-vy)*vz\nprint dx,dz\ndx = func(dx,a)\ndz = func(dz,b)\nprint \"%.6f %.6f\" % (dx,dz)\n", "lang": "Python 2", "bug_code_uid": "30d8fb81855b97f6cdfc93961af491d3", "src_uid": "84848b8bd92fd2834db1ee9cb0899cff", "apr_id": "a5333e84b810eb8737675bd84ee8b687", "difficulty": 1700, "tags": ["geometry", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9380116959064327, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "v = None\ndef draka(v):\n global v1, v2, v3, v4\n v1, v2, v3, v4 = v[0], v[1], v[2], v[3]\n for i in v:\n if i < 0:\n return 'NEGATIVE'\n if v3 == 0:\n return 'POINT'\n if v1 + v2 > v3 or v2 + v3 > v4:\n return 'TRIANGLE'\n elif v1 + v2 == v3 or v2 + v3 == v4:\n return 'SEGMENT'\n else:\n return 'IMPOSSIBLE'\nwhile v = None:\n v = input().split(' ')\n v = sorted(v)\n v = [int(v) for v in v]\n print(draka(v))", "lang": "Python 3", "bug_code_uid": "052ca018fbc15ce26a201da529176cb1", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "5bb07c7eafdda7576ccf95b465de1d04", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9971830985915493, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k=map(int,raw_input().split(\" \"))\nl1=[]\nl1=list(map(int,raw_input().split(\" \")))[:n]\nb=l1[k-1]\nc=0\nfor j in range(len(l1)):\n if l1[j]>=b and l[j]>0:\n c=c+1\nprint(c)\n", "lang": "PyPy 2", "bug_code_uid": "b85cab13f7bcb5368c57cfcf9c6fef60", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "178de85b6ff79275c11578f733106abe", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6615384615384615, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a='1000'\nb='0101'\na=raw_input()\nb=raw_input()\nfor s in range(len(a)):\n if a[s]==b[s]:\n sys.stdout.write(0)\n if a[s]<>b[s]:\n sys.stdout.write(1)\n#sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "lang": "Python 2", "bug_code_uid": "4efb5ee1f9a13dc9ffed859bae5f2c6f", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "f3831c55fed07b521b69bcc99f99a639", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.968503937007874, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n, d = map(int, raw_input().split())\nt = map(int, raw_input().split())\n\nprint -1 if (d-sum(t))/(len(t)-1)<10 else (d-sum(t))/5\n\n", "lang": "Python 2", "bug_code_uid": "501658b3a6c9c896ae345d67dcb58b1c", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "c9737ab947c79f568b99011a335a9f67", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9483282674772037, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = input()\nk = input()\ni = 1\nres = 240 - int(k)\nsum = 0\nc = 0\nwhile (i <= int(n)):\n sum += 5 * i\n if sum > res:\n break\n c += 1\n i += 1\nprint(c)\n", "lang": "Python 3", "bug_code_uid": "52bc3c6783e79e28ce02a9ca03729a7e", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "e44af55c9e0243ffbe31c207f25b8900", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5152109911678115, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "def ret_input():\n n_k = [int(x) for x in raw_input().split()] \n return n_k\n\ndef primes_sieve(limit):\n limitn = limit+1\n primes = range(2, limitn)\n\n for i in primes:\n factors = range(i, limitn, i)\n for f in factors[1:]:\n if f in primes:\n primes.remove(f)\n return primes\n\ndef gen_factor_list(data):\n n = data[0]\n k = data[1]\n ans = []\n for x in xrange(k-1):\n first = primes_sieve(n)[0]\n ans.append(first)\n n = n / first\n ans.append(n)\n return ans\n\ndef product(faclist):\n p = 1\n for item in faclist:\n p *= item\n return p\n\ndef return_prod(prod, n, fac):\n if prod <> n:\n return '-1'\n else:\n return strlist(fac)\n\ndef strlist(fac):\n ansfin = []\n for item in fac:\n ansfin.append(str(item))\n return \" \".join(ansfin)\n \ndef main():\n data = ret_input()\n #data = [5,1]\n fac = gen_factor_list(data)\n prod = product(fac)\n print return_prod(prod, data[0],fac) \n\nif __name__ == '__main__':\n main()\n", "lang": "Python 2", "bug_code_uid": "5750261ac87635eb9efd0fc6230257b1", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "b28b95f599c88ddae483faa740d83b8f", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9959659345584939, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import sys\nfrom math import *\n\ndef minp():\n\treturn sys.stdin.readline().strip()\n\nn = int(minp())\nm = [None]*n\nk = [None]*3\ndp = [None]*3\ndp[0] = [None]*(n*n)\ndp[1] = [None]*(n*n)\ndp[2] = [None]*(n*n)\npath = [None]*(n*n)\nfor i in range(n):\n\tm[i] = list(map(int, minp().split()))\n\tfor j in range(n):\n\t\tpath[m[i][j]-1] = (i,j)\nfor z in range(3):\n\tk_ = [None]*n\n\tfor i in range(n):\n\t\tkk = [None]*n\n\t\tfor j in range(n):\n\t\t\tkkk_ = [None]*3\n\t\t\tfor zz in range(3):\n\t\t\t\tkkk = [None]*n\n\t\t\t\tfor w in range(n):\n\t\t\t\t\tkkk[w] = [(1000000,0)]*n\n\t\t\t\tkkk_[zz] = kkk\n\t\t\tkk[j] = kkk_\n\t\tk_[i] = kk\n\tk[z] = k_\n\nq = [0]*(10*n*n)\nqr = 0\nkm = [(1,2),(1,-2),(-1,2),(-1,-2),(2,1),(2,-1),(-2,1),(-2,-1)]\nsm = [(1,1),(1,-1),(-1,1),(-1,-1)]\nlm = [(0,1),(0,-1),(-1,0),(1,0)]\nmm = [km,sm,lm]\nfor z in range(3):\n\tfor i in range(n):\n\t\tfor j in range(n):\n\t\t\t#print('========')\n\t\t\tql = 0\n\t\t\tqr = 1\n\t\t\tq[0] = (z, i, j, (0,0))\n\t\t\tkc = k[z][i][j]\n\t\t\tkc[z][i][j] = (0, 0)\n\t\t\twhile ql < qr:\n\t\t\t\tt, x, y, dd = q[ql]\n\t\t\t\t#print(t,x,y,dd)\n\t\t\t\td = kc[t][x][y]\n\t\t\t\tql += 1\n\t\t\t\tif d != dd:\n\t\t\t\t\tcontinue\n\t\t\t\tdd = (d[0]+1, d[1]+1)\n\t\t\t\tfor tt in range(3):\n\t\t\t\t\tif t != tt and kc[tt][x][y] > dd:\n\t\t\t\t\t\tkc[tt][x][y] = dd\n\t\t\t\t\t\tq[qr] = (tt,x,y,dd)\n\t\t\t\t\t\tqr += 1\n\t\t\t\tdd = (d[0]+1,d[1])\n\t\t\t\tif t == 0:\n\t\t\t\t\tfor w in mm[t]:\n\t\t\t\t\t\txx,yy = w[0]+x,w[1]+y\n\t\t\t\t\t\tif xx >= 0 and xx < n and yy >= 0 and yy < n:\n\t\t\t\t\t\t\tif kc[t][xx][yy] > dd:\n\t\t\t\t\t\t\t\tkc[t][xx][yy] = dd\n\t\t\t\t\t\t\t\tq[qr] = (t,xx,yy,dd)\n\t\t\t\t\t\t\t\tqr += 1\n\t\t\t\telse:\n\t\t\t\t\tfor w in mm[t]:\n\t\t\t\t\t\tfor hm in range(n*2):\n\t\t\t\t\t\t\txx,yy = w[0]*hm+x,w[1]*hm+y\n\t\t\t\t\t\t\tif xx >= 0 and xx < n and yy >= 0 and yy < n:\n\t\t\t\t\t\t\t\tif kc[t][xx][yy] > dd:\n\t\t\t\t\t\t\t\t\tkc[t][xx][yy] = dd\n\t\t\t\t\t\t\t\t\tq[qr] = (t,xx,yy,dd)\n\t\t\t\t\t\t\t\t\tqr += 1\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\tbreak\ndp[0][0] = (0,0)\ndp[1][0] = (0,0)\ndp[2][0] = (0,0)\nfor i in range(0,n*n-1):\n\tx,y = path[i]\n\txx,yy = path[i+1]\n\tfor z in range(3):\n\t\tfor j in range(3):\n\t\t\tdist = k[z][x][y][j][xx][yy]\n\t\t\tif dp[j][i] != None:\n\t\t\t\tnd = (dp[j][i][0]+dist[0],dp[j][i][1]+dist[1])\n\t\t\t\tif dp[z][i+1] == None:\n\t\t\t\t\tdp[z][i+1] = nd\n\t\t\t\telse:\n\t\t\t\t\tdp[z][i+1] = min(dp[z][i+1],nd)\nfor j in range(n*n-1,n*n):\n\tqq = [dp[i][j] if dp[i][j] != None else (1000000,0) for i in range(3)]\n\tqm = min(qq)\n\t#print(j,qm)\n\tprint(qm[0], qm[1])", "lang": "Python 3", "bug_code_uid": "3cbf5d1d37a9faa75a12c55847ae115b", "src_uid": "5fe44b6cd804e0766a0e993eca1846cd", "apr_id": "974e1ee02081b2f702aa0839c6c9c803", "difficulty": 2200, "tags": ["dp", "dfs and similar", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.030470914127423823, "equal_cnt": 24, "replace_cnt": 24, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 24, "bug_source_code": "n=int(input())\nlookup={}\nfor i in range(n):\n x=list(map(int,input().split()))\n for j in range(n):\n lookup[x[j]]=(i,j)\nbestrook=[0,0]\nbestbish=[0,0]\nbestknight=[0,0]\nfor i in range(1,n**2):\n x=abs(lookup[i][0]-lookup[i+1][0])\n y=abs(lookup[i][1]-lookup[i+1][1])\n if x==0 or y==0:\n bestrook[0]+=1\n else:\n bestrook[0]+=2\n if x==y:\n bestbish[0]+=1\n elif (x-y)%2==0:\n bestbish[0]+=2\n else:\n bestbish[0]+=1000\n if {x,y}=={1,2}:\n bestknight[0]+=1\n elif x**2+y**2 in [4,16,20,10,18]:\n bestknight[0]+=2\n elif x**2+y**2==2 and lookup[i] not in [(0,0),(n-1,0),(0,n-1),(n-1,n-1)] and lookup[i+1] not in [(0,0),(n-1,0),(0,n-1),(n-1,n-1)]:\n bestknight[0]+=2\n elif {x,y} in [{5,0},{3,0},{1,0},{6,1},{4,1},{5,2},{3,2},{6,3},{4,3},{5,4}]:\n bestknight[0]+=3\n else:\n bestknight[0]+=1000\n bestrook[0]=min(bestrook[0],bestbish[0]+1,bestknight[0]+1)\n bestbish[0]=min(bestrook[0]+1,bestbish[0],bestknight[0]+1)\n bestknight[0]=min(bestrook[0]+1,bestbish[0]+1,bestknight[0])\nbest=(bestrook[0],bestbish[0],bestknight[0])\nif min(best)==best[0]:\n print(bestrook[0],bestrook[1])\nelif min(best)==best[1]:\n print(bestbish[0],bestbish[1])\nelse:\n print(bestknight[0],bestknight[1])", "lang": "Python 3", "bug_code_uid": "53dbf5b6d93b1642e82c5577803579e7", "src_uid": "5fe44b6cd804e0766a0e993eca1846cd", "apr_id": "f20cf71a35cf536626433e6a77ad096e", "difficulty": 2200, "tags": ["dp", "dfs and similar", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.812807881773399, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import collections\nmem = {}\n\ndef f(s,t,i,a,k):\n\n\tif t[0] == t[1]:\n\t\tcc = collections.Counter(s)\n\t\tp = cc[t[0]]\n\t\tp += min(k,len(s) - p)\n\t\treturn p * (p-1)/2\n\tans = 0\n\tif (i,k,a) in mem:return mem[(i,k,a)]\n\tif i == len(s):\n\t\treturn 0\n\tc = (1 if s[i] != t[0] else 0)\n\tif k - c >= 0:\n\t\tans = max(ans, f(s,t,i + 1, a + 1, k - c))\n\tc = (1 if s[i] != t[1] else 0)\n\tif k - c >= 0:\n\t\tans = max(ans, f(s,t,i + 1, a, k - c) + a)\n\tans = max(ans, f(s,t,i+1,a,k))\n\tmem[(i,k,a)] = ans\n\treturn ans\nn,k = map(int, raw_input().split())\nprint f(raw_input(),raw_input(),0,0,k)\t\n", "lang": "PyPy 2", "bug_code_uid": "83da568d58014d60864aa3bb9aaf25bf", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "ccf9440059f0bc79cb7b0cfece11ebf3", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8535433070866142, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def g(i,z,k):\n if i>=n:return 0\n if q[i][z][k]>-1:return q[i][z][k]\n o=g(i+1,z,k);c=s[i]!=t[0]\n if k>=c:o=max(o,g(i+1,z+1,k-c))\n c=s[i]!=t[1]\n if k>=c:o=max(o,g(i+1,z+(t[0]==t[1]),k-c)+z)\n q[i][z][k]=o;return o\nn,k=map(int,input().split());s=input();t=input();q=[[[-1]*n**2for _ in[0]*n]for _ in[0]*n]\nprint(g(0,0,k))", "lang": "PyPy 3", "bug_code_uid": "961032df126fa5f5e3dae95355b188c5", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "6337e74c4f172ac3f9fbca256456a5ba", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9854105877448937, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "l=[]\nfor i in range(11):\n l.append(input())\n if \"x\" in l[i]:\nx,y=map(int,input().split())\nif x>=4 and x<=6:\n x-=3\nelif x>=7:\n x-=6\nif y>=4 and y<=6:\n y-=3\nelif y>=7:\n y-=6\nif x==1:\n p=0\nelif x==2:\n p=4\nelif x==3:\n p=8 \nif y==1:\n p2=0\nelif y==2:\n p2=4\nelif y==3:\n p2=8\ncom=0\nfor i in range(p,p+3):\n for j in range(p2,p2+3):\n if l[i][j]=='.':\n com+=1\nif com==0:\n for i in (0,1,2,4,5,6,8,9,10):\n if i ==4 or i==8:\n print()\n for j in range(11):\n if l[i][j]=='.':\n print(\"!\",end=\"\")\n else:\n print(l[i][j],end=\"\")\n print()\nelse:\n for i in (0,1,2,4,5,6,8,9,10):\n if i==4 or i==8:\n print()\n for j in range(11):\n if i>=p and i < p+3 and j >= p2 and j < p2+3:\n if l[i][j]=='.':\n print(\"!\",end=\"\")\n else:\n print(l[i][j],end=\"\")\n else:\n print(l[i][j],end=\"\")\n print()\n ", "lang": "Python 3", "bug_code_uid": "ef5f82a17e5e8adce0e1433a2d59bb7b", "src_uid": "8f0fad22f629332868c39969492264d3", "apr_id": "d1444e72332533f5e15d16ddcf08897e", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9992119779353822, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = [\"\"]*11\nfor i in range(11):\n a[i]=list(input())\nx,y = map(int, input().split())\nk=0\nx1=(x-1)%3\ny1=(y-1)%3\nif y1==0:\n y2=2\nif y1==1:\n y2=6\n y1=4\nif y1==2:\n y2=10\n y1=8\nif x1==0:\n x2=2\nif x1==1:\n x2=6\n x1=4\nif x1==2:\n x1=8\n x2=10\nfor i in range(x1,x2+1):\n for j in range(y1,y2+1):\n if a[i][j]==\".\":\n a[i][j]=\"!\"\n k=1\nif k==0:\n for i in range(11):\n for j in range(11):\n if i!=3 and i!=7 and j!=3 and j!=7:\n if a[i][j]==\".\":\n a[i][j]=\"!\"\nfor row in a:\n print(' '.join([str(elem) for elem in row]))\nprint()\n#\ufffd\ufffd\ufffd\ufffd\ufffd", "lang": "Python 3", "bug_code_uid": "2f40947c7d85105c15f76185179c0d4d", "src_uid": "8f0fad22f629332868c39969492264d3", "apr_id": "9c41d9ffb936e2208436e0632d622353", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9987639060568603, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def get_day_number(s):\n\tif s == 'monday':\n\t\treturn 1\n\telif s == 'tuesday':\n\t\treturn 2\n\telif s == 'wednesday':\n\t\treturn 3\n\telif s == 'thursday':\n\t\treturn 4\n\telif s == 'friday:\n\t\treturn 5\n\telif s == 'saturday':\n\t\treturn 6\n\telif s == 'sunday':\n\t\treturn 7\n\nfirst_day = get_day_number(input())\nsecond_day = get_day_number(input())\nif (second_day - first_day) % 7 in {0, 3, 2}:\n\tprint('YES')\nelse:\n\tprint('NO')", "lang": "Python 3", "bug_code_uid": "c24fa83db6039d720adb1a1b2def661d", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "848a79d230c3aaa348a048d6fe10f2f3", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9979736575481256, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "from sys import stdin, stdout\nfrom collections import Counter, defaultdict\npr=stdout.write\nimport heapq\nraw_input = stdin.readline\ndef ni():\n return int(raw_input())\n\n\ndef li():\n return list(map(int,raw_input().split()))\n\n\ndef pn(n):\n stdout.write(str(n)+'\\n')\n\n\ndef pa(arr):\n pr(' '.join(map(str,arr))+'\\n')\n\n# fast read function for total integer input\n\ndef inp():\n # this function returns whole input of\n # space/line seperated integers \n # Use Ctrl+D to flush stdin.\n return (map(int,stdin.read().split()))\n \nrange = xrange # not for python 3.0+\n\n\n \n\n# main code\n\nfac=[1]*1005\nmx=1005\nmod=998244353\nfor i in range(1,mx):\n fac[i]=(fac[i-1]*i)%mod\ndef inv(x):\n return pow(x,mod-2,mod)\ndef ncr(n,r):\n num=fac[n]\n den=(fac[r]*fac[n-r])%mod\n return (num*inv(den))%mod\ndef fun(x,y):\n ans=0\n for i in range(min(x,y)+1):\n ans=(ans+(fac[i]*ncr(x,i)*ncr(y,i))%mod)%mod\n return ans\na,b,c=li()\npn((fun(a,b)*fun(b,c)*fun(a,c))%mod)\n\n", "lang": "PyPy 2", "bug_code_uid": "a348277a84315febe2270aaac7f1754c", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "d2bd2c2b1dc0e4fcb641f99301d87695", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9424269264836138, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def num(n):\n return ('7'*((n)//2)+'4'*((n)//2))\ndef lucky(n):\n c4=0\n c7=0\n for i in str(n):\n if(i=='4'):\n c4+=1\n elif(i=='7'):\n c7+=1\n else:\n return False\n if(c4==c7):\n return True\n return False\n \ns=input()\nc4=0\nc7=0\nn=len(s)\nans=''\nif(len(s)%2==1):\n print('4'*((n+1)//2)+'7'*((n+1)//2))\n exit()\nif(int(s)>int(num(n))):\n print(num(n+2)[::-1])\n exit()\nans=int(s)\nwhile(True):\n if(lucky(ans)):\n print(ans)\n break\n ans+=1", "lang": "PyPy 3", "bug_code_uid": "0a4af5403bfb848d37aff50dbeefd085", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "8e4b128efbb271ce1b9cb55ece711bf6", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.1708185053380783, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "from sys import stdin, stdout\n# kr,kb,ky,kg\n\ngarland = list(stdin.readline()[:-1])\ndisabed = garland.count('!')\n\nkr, kb, ky, kg = 0, 0, 0, 0\ncontrol = set(['R', 'G', 'B', 'Y'])\n\n\ndef format_answer():\n return str(kr) + ' ' + str(kb) + ' ' + str(ky) + ' ' + str(kg) + '\\n'\n\n\ndef get_nei(garland, index):\n nei = set()\n left_index = 0 if index < 4 else index - 3\n right_index = len(garland) - 1 if index > len(garland) - 4 else index + 3\n for nei_index in range(left_index, right_index + 1):\n if not index == nei_index and garland[nei_index] != '!':\n nei.add(garland[nei_index])\n return nei\n\nneighbours = {}\n\nwhile disabed:\n\n for index in range(len(garland)):\n if garland[index] == '!':\n nei = get_nei(garland, index)\n diff = control.difference(nei)\n if len(diff) == 1:\n color = diff.pop()\n if color == 'R':\n garland[index] = 'R'\n kr += 1\n if color == 'B':\n garland[index] = 'B'\n kb += 1\n if color == 'G':\n garland[index] = 'G'\n kg += 1\n if color == 'Y':\n garland[index] = 'Y'\n ky += 1\n disabed -= 1\n\nstdout.write(format_answer())", "lang": "Python 3", "bug_code_uid": "61ffd14188437ee70c6e5a41e404a6af", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "038b2195cb08a14199381b77872107a0", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1984732824427481, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "s = list(input())\nr = b = y = g = 0\nwhile '!' in s:\n for i in range(len(s)):\n if s[i] == '!':\n t1 = s[i:i+4]\n t2 = s[i-3:i+1]\n t3 = s[i-1:i+3]\n t4 = s[i-2:i+2]\n\n if not t2: t2 = s[:i+1]\n if not t3: t3 = s[:i+3]\n if not t4: t4 = s[:i+3]\n\n if t1.count('!') == 1 and len(t1) == 4: l = t1[:]\n elif t2.count('!') == 1 and len(t2) == 4: l = t2[:]\n elif t3.count('!') == 1 and len(t3) == 4: l = t3[:]\n elif t4.count('!') == 1 and len(t4) == 4: l = t4[:]\n else: continue\n \n if 'R' not in l:\n s[i] = 'R'\n r+=1\n elif 'Y' not in l:\n s[i] = 'Y'\n y+=1\n elif 'B' not in l:\n s[i] = 'B'\n b+=1\n else:\n s[i] = 'G'\n g+=1\n\nprint(r,b,y,g,sep=' ')\n", "lang": "Python 3", "bug_code_uid": "3bf68ebeba6e4411e3efdce6d2af0dbb", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "39f4f10dfca000b573aef34a3ab83256", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9126984126984127, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n, m = map(int, input().split())\ns, d, k = 1, 1000000009, (1 << m) - 1\nfor i in range(n): s, k = (s * k) % d, k - 1\nprint(s)", "lang": "Python 3", "bug_code_uid": "b27e8df0e75827cad9829e42e18f0b81", "src_uid": "fef4d9c94a93fcf6d536f33503b1d4b8", "apr_id": "042ff455d0d80527a3b1e18b65f21421", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8058252427184466, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n,m=map(int,raw_input().split())\ns=1\nM=10**9+9\nfor i in range(1,n+1):\n s*=2**m-i\n s%=M\nprint s", "lang": "Python 2", "bug_code_uid": "fc5a3852403e0a2fba9c2add3d531b90", "src_uid": "fef4d9c94a93fcf6d536f33503b1d4b8", "apr_id": "d0a152da28cf75431486aa7dd8bbf8e0", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.12340425531914893, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "for q in range(int(input())):\n k,n,a,b = map(int,input().split())\n temp = n\n flag = True\n while n>=0:\n if (n*a)+((temp-n)*b) < k:\n print(n)\n flag = False\n break\n n -= 1\n if flag:\n print(\"-1\")", "lang": "PyPy 3", "bug_code_uid": "b7eca644fdf90c115a2462c4cd7a68ea", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "a114c5c6785058e5160e9547fca452cd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.31431431431431434, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "import sys\nfrom collections import deque\n\nn, x, y = map(int, input().split())\nans = 0\ndq_cost = deque()\ndq_index = deque()\n\nfor i in range(1, n+1):\n ans += x\n while dq_index and dq_index[0] < i:\n dq_cost.popleft()\n dq_index.popleft()\n if dq_cost:\n ans = min(ans, dq_cost[0] - i*x)\n\n ycost = ans + y + x*(i*2)\n while dq_cost and dq_cost[-1] > ycost:\n dq_cost.pop()\n dq_index.pop()\n\n dq_cost.append(ycost)\n dq_index.append(i*2)\n\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "27106f98ac5589e3fa70fa51e38aaa7e", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "78dedc320aa9ce6d796f87521f54cd44", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8956521739130435, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "from math import gcd\na,b,c,d=[int(i) for i in input(),split()]\ng=gcd(c,d)\nc//=g\nd//=g\ne=min(a//c,b//d)\nprint(e*c,e*d)", "lang": "Python 3", "bug_code_uid": "6f33c4dbd980daa450159846cd484c92", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "cefc4b00312a12e1009c335f86749c54", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9873417721518988, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "N=raw_input()\nif 7*'1' in N or 7*'0' in n:\n print 'YES'\nelse:\n print 'NO'", "lang": "PyPy 2", "bug_code_uid": "85d7d5617d7048d743cb8d282f6bad4b", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "483366ef6abe0f84a67276448c50dc8b", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.192, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "k1, k2, k3 = input().strip().split()\nk1, k2, k3 = int(k1), int(k2), int(k3)\n\n\nnums = list(range(20))\nglobal_flag = False\nfor t1 in range(k1):\n for t2 in range(k2):\n for t3 in range(k3):\n flag = [False for x in range(max(t1, t2, t3), len(nums))]\n for n in range(max(t1, t2, t3), len(nums)):\n if (n - t1) % k1 == 0 or (n - t2) % k2 == 0 or \\\n (n - t3) % k3 == 0:\n flag[n - max(t1, t2, t3)] = True\n if all(flag):\n global_flag = True\n \n\n \n \nif global_flag:\n print ('YES')\nelse:\n print ('NO')\n\n", "lang": "Python 3", "bug_code_uid": "da9ed89fce7e4447b7aac9a3e0da7f51", "src_uid": "df48af9f5e68cb6efc1214f7138accf9", "apr_id": "e81cba23b812cff712d30270e02f62b3", "difficulty": 1400, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8748114630467572, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import math\ndef lcm(a,b):\n return (a*b//(math.gcd(a,b)));\na=int(input())\nif(a==1):\n print(1)\n exit()\nif(a==2):\n print(2)\n exit()\nif(a==3):\n print(6)\n exit()\nif(a%2==1):\n print(a*(a-1)*(a-2))\n exit()\nelse:\n r=lcm(lcm(n,n-1),n-2)\n m=lcm(lcm(n-1,n-2),n-3)\n print(max(r,m))\n \n ", "lang": "PyPy 3", "bug_code_uid": "0ffd5420153af7cc366ff93ec9dcaf04", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "e2432b4fdb886383fb6984a338286dca", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6060929983965794, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "# import io, os\n# input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline\nimport sys\n# sys.stdin=open('input.txt','r')\n# sys.stdout=open('output.txt','w')\ninput=sys.stdin.readline\n# sys.setrecursionlimit(300010)\nMOD = 1000000007\nMOD2 = 998244353\nii = lambda: int(input().strip('\\n'))\nsi = lambda: input().strip('\\n')\ndgl = lambda: list(map(int,input().strip('\\n')))\nf = lambda: map(int, input().strip('\\n').split())\nil = lambda: list(map(int, input().strip('\\n').split()))\nls = lambda: list(input().strip('\\n'))\nlet = 'abcdefghijklmnopqrstuvwxyz'\nd=dict()\nsieve=[1]*(1000005)\nfor i in range(2,10**6+4):\n if sieve[i]:\n d[i]=[i]\n for j in range(i*2,10**6+4,i):\n if j in d:\n d[j].append(i)\n else:\n d[j]=[i]\n sieve[j]=0\nn=ii()\nans=set(d[n])\ncnt=[n]\nfor i in range(n-1,-1,-1):\n if any(i in ans for i in d[i]):\n continue\n else:\n ans=ans.union(d[i])\n cnt.append(i)\n if len(cnt)==3:\n break\nprod=1\nfor i in cnt:\n prod*=i\nprint(prod)", "lang": "PyPy 3", "bug_code_uid": "1032e7360b2262cb76e00a2c9e0a922e", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "44e8610504130ddaa0cac146883bd1a0", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.21067415730337077, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "x=int(input())\ny=int(input())\nif x>y:\n if (y-x)%2==0:\n print(\"No\")\n else:\n print(\"Yes\")\nelse:\n if y-x==1:\n print(\"Yes\")\n else:\n print(\"No\")", "lang": "Python 3", "bug_code_uid": "f6b61742856bac0c3e11f21230698027", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "6ac36c51decb8f3f1ac82cb4f210b364", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.676056338028169, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "# cook your code here\nn,k=map(int,raw_input().split(' '))\nif(na or c>b or d==0 or n=0:\n print('-1')\nelse:\n print(d)\n", "lang": "Python 3", "bug_code_uid": "34795965642c8aa3d70494d784be66c5", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "277ba82dd93f8f1db0eb38b268034fee", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.009791921664626682, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "def getOverlap(a0, a1, b0, b1):\n return max(0, min(a1, b1) - max(a0, b0)+1)\n\ndef b():\n\ts1,e1,t1 = list(map(int, input().split(\" \")))\n\ts2,e2,t2 = list(map(int, input().split(\" \")))\n\tperiod = t1*t2\n\tmaxint = 0\n\tmaxmax = min(e1-s1, e2-s2)+1\n\tn = 0\n\twhile s1 < period:\n\t\twhile n*t2 < s1 - e2: n+=1\n\t\ts2 += n*t2\n\t\te2 += n*t2 \n\t\twhile s2 < period:\n\t\t\tx = getOverlap(s1, e1, s2, e2)\n\t\t\t#print(\">15\", s1, e1, s2, e2, x)\n\t\t\tif x > maxint: \n\t\t\t\tmaxint = x\n\t\t\t\tif maxmax == maxint: \n\t\t\t\t\tprint(maxint)\n\t\t\t\t\traise SystemExit()\n\t\t\tif s2 > e1: break\n\t\t\ts2+=t2\n\t\t\te2+=t2\n\t\ts2%=t2\n\t\te2%=t2\n\t\ts1+=t1\n\t\te1+=t1\n\tprint(maxint)\n\nb()", "lang": "PyPy 3", "bug_code_uid": "d706cf3ed7d55d11c398ee5526659554", "src_uid": "faa75751c05c3ff919ddd148c6784910", "apr_id": "99a5cca8fc838107fb531f37e642352a", "difficulty": 1900, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5924855491329479, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 19, "bug_source_code": "import math\n\ndef gcd(a, b):\n \"\"\"Returns the greatest common divisor of a and b.\n Should be implemented using recursion.\n\n >>> gcd(34, 19)\n 1\n >>> gcd(39, 91)\n 13\n >>> gcd(20, 30)\n 10\n >>> gcd(40, 40)\n 40\n \"\"\"\n if b > a:\n return gcd(b, a)\n\n if a % b == 0:\n return b\n\n return gcd(b, a % b)\n\n\n(la, ra, ta) = [int(s) for s in input().split(\" \")]\n(lb, rb, tb) = [int(s) for s in input().split(\" \")]\n\ndelta = gcd(ta, tb)\n\ndef overlap(al, ar, bl, br):\n return max(0, min(ar, br) - max(al, bl) + 1)\n\ndef eval(fst_, snd_):\n result_ = 0\n\n pos_sndl = snd_[0]\n pos_sndr = snd_[1]\n pos_fstl = fst_[0]\n pos_fstr = fst_[1]\n intersection = overlap(pos_sndl, pos_sndr, pos_fstl, pos_fstr)\n result_ = max(result_, intersection)\n # print(delta)\n # print(intersection)\n snd_k = abs(snd_[1] - fst_[0]) // delta + 1\n fst_k = 0 if intersection != 0 else max(abs(snd_[0] - fst_[1]) // delta -1, 0)\n\n for k in range(fst_k, snd_k):\n pos_sndl = snd_[0]\n pos_sndr = snd_[1]\n pos_fstl = k * delta + fst_[0]\n pos_fstr = k * delta + fst_[1]\n intersection = overlap(pos_sndl, pos_sndr, pos_fstl, pos_fstr)\n # print(intersection)\n # print(pos_sndl, pos_sndr, pos_fstl, pos_fstr, intersection)\n result_ = max(result_, intersection)\n\n return result_\n\n\nfst_ = (la, ra, ta)\nsnd_ = (lb, rb, tb)\n\nresult = max(eval(fst_, snd_), eval(snd_, fst_))\nprint(result)", "lang": "PyPy 3", "bug_code_uid": "974628d203147b735470453995aa1285", "src_uid": "faa75751c05c3ff919ddd148c6784910", "apr_id": "2409d5fdfa24c5f96c6f00cd6fe1f323", "difficulty": 1900, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7777777777777778, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import math\nn,m=map(int, input().split())\npackages=list(map(int, input().split()))\ntotal = {}\nfor i in packages:\n if i not in total.keys():\n total[i] = 1\n else:\n total[i] += 1\n\ndict_sort = sorted(total.items(), key=lambda kv: kv[1], reverse=True)\n\nstart, end, mid, ret = 0, len(dict_sort), 0, 0\nwhile start < end:\n c = 0\n mid = math.floor((start + end) / 2)\n for i in range(len(dict_sort)):\n c += math.floor(dict_sort[i][1] / mid)\n if c >= n:\n start = mid + 1\n ret = mid\n else:\n end = mid-1\nprint(ret)", "lang": "Python 3", "bug_code_uid": "369e82b861b6e30331b2396e59e11024", "src_uid": "b7ef696a11ff96f2e9c31becc2ff50fe", "apr_id": "399efa60e992234aa65f5bd9a60ea1a1", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4019138755980861, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "\na1,a2,a3,a4,a5,a6 = map(int,input().split())\nif set(a1,a2,a3,a4,a5,a6) == {1}:\n print (6)\nelse:\n print (a1*a2*2 + a3*a4* + a5*a6*2+1)", "lang": "Python 3", "bug_code_uid": "86bbd7e0f085d1b4cd97875a61096285", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "bae09d90f5bd74d16c3e16212f25e1da", "difficulty": 1600, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6289308176100629, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "col,row = raw_input().split()\nrow = int(row)\ncount = 0\nfor i in range(-1,2,1):\n for j in range(-1,2,1):\n if row+i >=1 and row+i <=8 and ord(col)+j >= ord('a') and ord(col)+j <= ord('ag') and not (row+i ==row and col+i == col):\n count += 1\nprint count", "lang": "Python 2", "bug_code_uid": "f2c7116b4c6d65237fc1e216a6f30805", "src_uid": "6994331ca6282669cbb7138eb7e55e01", "apr_id": "f28bf7515aacaed420a26284975684d6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3300970873786408, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n=input();print\"YNEOS\"[n&n-1>0::2]", "lang": "PyPy 3", "bug_code_uid": "9aa69e0f0017ae0e5c0e0d84d8f6eb39", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "0ad882516d9edf210bf5339e09c26326", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.968503937007874, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "N = int(input())\ni, ans = 1, 0\nwhile True:\n\tsum += (i*(i+1))/2\n\tif sum <= N: ans += 1\n\tif sum >= N: break\n\ti += 1\nprint ans", "lang": "Python 2", "bug_code_uid": "dc95ee07832cef0c8258adc8d4c1410c", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "ca7a38020c41a59e5fd6d85cba7ca136", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9711286089238845, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = input()\nflag = 0 \nfor i in range (0,s.len())\n if(s[i]=='a' or s[i]=='e' or s[i]=='i' or s[i]=='o' or s[i]=='u' or s[i]=='y') :\n flag=1\n elif(s[i]=='A' or s[i]=='E' or s[i]=='I' or s[i]=='O' or s[i]=='U' or s[i]=='Y'):\n flag=1\n elif((s[i]>='a' and s[i]<='z') or(s[i]>='A' && s[i]<='Z')) :\n flag=0\nif(flag):\n print(\"YES\")\nelse :\n print(\"NO\")\n", "lang": "PyPy 3", "bug_code_uid": "4358449a45e0b0d00c2561cf340e1ee8", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "ae6185a1ca45f151d3df778ad646649c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9946236559139785, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n,m,k=map(int,input().split())\na=list(map(int,input().split()))\nm-=1\nleft=m-1\nright=m+1\nwhile True:\n if left>=0:\n if a[left]0:\n x=left\n break\n else:\n left-=1\n elif right0:\n x=right\n break\n else:\n right+=1\nprint((abs(m-x))*10)", "lang": "PyPy 3", "bug_code_uid": "cf3421bfff329d2c301690dec4d95a5a", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "3938f14fc20a292db627c3513c94bb27", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9965546942291128, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "z,zz=input,lambda:list(map(int,z().split()))\nzzz=lambda:[int(i) for i in stdin.readline().split()]\nszz,graph,mod,szzz=lambda:sorted(zz()),{},10**9+7,lambda:sorted(zzz())\nfrom string import *\nfrom re import *\nfrom collections import *\nfrom queue import *\nfrom sys import *\nfrom collections import *\nfrom math import *\nfrom heapq import *\nfrom itertools import *\nfrom bisect import *\nfrom collections import Counter as cc\nfrom math import factorial as f\nfrom bisect import bisect as bs\nfrom bisect import bisect_left as bsl\nfrom itertools import accumulate as ac\ndef lcd(xnum1,xnum2):return (xnum1*xnum2//gcd(xnum1,xnum2))\ndef prime(x):\n p=ceil(x**.5)+1\n for i in range(2,p):\n if (x%i==0 and x!=2) or x==0:return 0\n \n return 1\ndef dfs(u,visit,graph):\n visit[u]=True\n for i in graph[u]:\n if not visit[i]:\n dfs(i,visit,graph)\n\n###########################---Test-Case---#################################\n\"\"\"\n\n\n\n\"\"\"\n###########################---START-CODING---##############################\n\na,b=zz()\n\nc=b\nif b>=a:\n print(a)\n exit()\nfor i in range(2,n-v+1):\n c+=i\nprint(c)\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "d4b28538ec7c2abb43542521f6a528c1", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "562e7cab9204e764e348cb9c0a6d403f", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.06387225548902195, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "k=int(input())\n#s=['c','o','d','e','f','o','r','c','e']\ns=\"codeforce\"\ns=s+\"s\"*(k)\nprint(s)", "lang": "PyPy 3", "bug_code_uid": "804d0978d3154bcbc89b5a409821e9be", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "4804d7afca89f8707cd4fe3550dd0d3d", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9320388349514563, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "d = {1:1, 2:1, 3:1, 4:1, 5:1}\nprint(d[int(input())]", "lang": "Python 3", "bug_code_uid": "0375137a5533fd4a5ca8201bc074548f", "src_uid": "c702e07fed684b7741d8337aafa005fb", "apr_id": "18e600909df48fe701811e767bde4bf7", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2037037037037037, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "raw_input()\nx = sorted(map(int,raw_input().split()))\ndef solve(x,rm,nx,ins):\n if nx == len(x):\n if rm == 2:\n return ins\n return float(\"inf\")\n if nx == len(x)-1:\n if rm == 1:\n return ins\n return float(\"inf\")\n return min(solve(x,rm+1,nx+1,ins),solve(x,rm,nx+2,ins+x[nx+1]-x[nx]))\nprint solve(x,0,0,0)", "lang": "Python 2", "bug_code_uid": "81b67c3064c088851a87c995f2ef882f", "src_uid": "76659c0b7134416452585c391daadb16", "apr_id": "4fa1e0f357e26d9588594578a419e2d0", "difficulty": 1500, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.31097560975609756, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "import bisect\nn,m,k=list(map(int,input().split()))\nl=[0]+list(map(int,input().split()))\nl.sort()\nz=k\nx=m\nc=0\nwhile m>k and k>0: \n i=bisect.bisect(l,m)\n m=m-l[i-1]\n k=k-1\n c=c+1\n\nif k==0 and m>0:\n c=0\n while z>0:\n z=z-1\n while x>z and i>1:\n i=bisect.bisect(l,x)\n x=x-l[i-1]+1\n c=c+1\n if z==0 and x>0:\n print(-1)\n else:\n print(c)\n \nelse:\n print(c)", "lang": "Python 3", "bug_code_uid": "dd2366a4116b36803ca6c1b136428ef9", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "6a3446a4de768c1897b6e8632bd118d8", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9819819819819819, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "0k,n=map(int,input().split())\nl=list(map(int,input().split()))\nl.sort()\nm=9999999999999999\nfor i in range(0,n-k-1):\n if ((l[i+k]-l[i])=0 and fl1:\n p1=i+1\n it1=j+1\n fl1=False\n if it[j][i]-b>=0 and fl2:\n p2=i+1\n it2=j+1\n fl2=False\n if not fl1 and not fl2:\n break\nif p1!=p2:\n t1=min(it1-1+10,5*(it1-1))\n s1=p1\n t21=0\n while s1!=p2:\n s1+=1\n t21+=1\n if s1>n:\n s1//=n\n t21*=15\n t2=min(t21,(abs(p2-p1))*15)\n t3=min(it2-1+10,5*(it2-1))\n t=t1+t2+t3\n print(t)\nelse:\n t=min(abs(it2-it1)*5,10+abs(it2-it1))\n print(t)\n\n", "lang": "Python 3", "bug_code_uid": "3bbb9d4a866e7502b6f77c0a77560a23", "src_uid": "c37b46851abcf7eb472869bd1ab9f793", "apr_id": "3599aed568fbc6a298d135e5e660f60e", "difficulty": 1400, "tags": ["constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8547945205479452, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "[n,m,k]=[int(i) for i in input().split()]\n[n1,n2]=[int(i) for i in input().split()]\ne1=0\ne2=0\np1=n1//(m*k)\nif(p1*m*k!=n1):\n p1+=1\nelse: e1=m\np2=n2//(m*k)\nif(p2*m*k!=n2): p2+=1\nelse:e2=m\nt=0\nt+=min(abs(p2-p1),min(p2+abs(n-p1),p1+abs(n-p2)))*15\nif (e1==0):\n e1=n1%(m*k)//k\n if(n1%k!=0): e1+=1\nif (e2==0):\n e2=n2%(m*k)//k\n if(n2%k!=0): e2+=1\nif(e1<4):\n t+=(e1-1)*5\nif(e2<4):\n t+=(e2-1)*5\nif(e1>=4):\n t+=10+e1-1\nif (e2 >= 4):\n t += 10 + e2 - 1\nprint(t)", "lang": "Python 3", "bug_code_uid": "bb6091f4458ca5ec32974f847d54f8b1", "src_uid": "c37b46851abcf7eb472869bd1ab9f793", "apr_id": "5aed0233122174580025b278dea32ddc", "difficulty": 1400, "tags": ["constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6384579219558063, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "n = int(raw_input())\ndef get_facs(n):\n\tn1 = n\n\tfacs = []\n\ti = 2\n\twhile i*i <= n1:\n\t\tif n1 % i == 0:\n\t\t\tfacs.append([i, 0])\n\t\t\twhile n1 % i == 0:\n\t\t\t\tfacs[-1][1] += 1\n\t\t\t\tn1 /= i\n\t\ti += 1\n\tif n1 > 1:\n\t\tfacs.append([n1, 1])\n\treturn facs\n\ndef sep(x, a, i=1):\n\t# seperate x into 3 piece x1,x2,x3, x2 <= x3, xi >= 1\n\tif i==3:\n\t\ta[2] = x - a[0] - a[1]\n\t\tif a[2] >= 0 and a[2] <= x:\n\t\t\tyield a\n\t\treturn\n\tfor xi in xrange(0, x+1):\n\t\ta[i-1] = xi\n\t\tfor y in sep(x, a, i+1):\n\t\t\tyield y\n\t\ta[i-1] = 0\n\nmax_n, min_n = 0, n*n*n\n\ndef extract(chs, facs):\n\tans = [1] * 3\n\tfor i,(fac,c) in enumerate(facs):\n\t\tfor j in xrange(3):\n\t\t\tans[j] *= fac ** chs[i][j]\n\treturn ans\n\ndef dfs(chs, i, k):\n\tif i == k:\n\t\ta, b, c = extract(chs, facs) \n\t\tn0 = (a+1) * (b+2) * (c+2)\n\t\t# print a, b, c, n0\n\t\tglobal max_n, min_n\n\t\tmax_n = max(max_n, n0)\n\t\tmin_n = min(min_n, n0)\n\t\treturn\n\tfor ch in sep(facs[i][1], [0]*3):\n\t\tchs[i] = ch\n\t\tdfs(chs, i+1, k)\n\nfacs = get_facs(n)\nif n == 1:\n\tprint 17, 17\nelse:\n\tk = len(facs)\n\tdfs([0]*k, 0, k)\n\tprint min_n - n, max_n - n\n", "lang": "Python 2", "bug_code_uid": "f689ff17b8ecc8b537fff41e8aa1da01", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "7a446826ade7dda87b5d35eccb694fe9", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.04344677769732078, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "from itertools import permutations\nn=input()\ndef sieve(n):\n s = xrange(3, n + 1, 2)\n r = set(s)\n [r.difference_update(xrange(n << 1, s[-1] + 1, n)) for n in s if n in r]\n return r.union([2])\nA=sieve(int(n))\nC=[]\nfor x in A:\n if n%x==0:\n t=n\n c=0\n while t%x==0:\n t/=x\n c+=1\n C.append((x,c))\nD=[]\nif len(C)>=3:\n D.append([C[0][0]**C[0][1],C[1][0]**C[1][1],C[2][0]**C[2][1]])\nelif len(C)==2:\n D.append([C[0][0]**C[0][1],C[1][0]**C[1][1],1])\n for i in range(1,C[0][1]):\n D.append([C[0][0]**i,C[0][0]**(C[0][1]-i),C[1][0]**C[1][1]])\n for i in range(1,C[1][1]):\n D.append([C[1][0]**i,C[1][0]**(C[1][1]-i),C[0][0]**C[0][1]])\nelif len(C)==1:\n for i in range(C[0][1]+1):\n for j in range(C[0][1]-i+1):\n D.append([C[0][0]**i,C[0][0]**j,C[0][0]**(C[0][1]-i-j)])\nD.append([n,1,1])\nma=-1\nmi=100000000000000000000\nfor x in D:\n E=permutations(x)\n for y in E:\n t=(y[0]+1)*(y[1]+2)*(y[2]+2)-n\n ma=max(ma,t)\n if t>0:\n mi=min(mi,t)\nprint mi,ma\n", "lang": "Python 2", "bug_code_uid": "77a1f6ecb5e822727706e1764a4eb92a", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "e9600b6f06b47b11165210033be53f1e", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.05029585798816568, "equal_cnt": 13, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "import itertools as it\nfrom functools import reduce\n\nPRIME = -1\n\nN = 10**9\n\nprimes = [PRIME for x in range(N + 1)]\n\n\ndef factor(n):\n \"\"\"\n >>> factor(2)\n [(2, 1)]\n\n >>> factor(6)\n [(3, 1), (2, 1)]\n\n >>> factor(98)\n [(7, 2), (2, 1)]\n\n >>> factor(1)\n []\n \"\"\"\n if n == 1:\n return []\n if primes[n] == PRIME:\n return [(n, 1)]\n result = []\n result += [(primes[n], 1)]\n n //= primes[n]\n\n while primes[n] != PRIME:\n if result[-1][0] == primes[n]:\n result[-1] = (primes[n], result[-1][1] + 1)\n else:\n result += [(primes[n], 1)]\n n //= primes[n]\n\n if result[-1][0] == n:\n result[-1] = (n, result[-1][1] + 1)\n else:\n result += [(n, 1)]\n\n return result\n\n\ndef all_divisors(prime_factorization):\n \"\"\"\n >>> all_divisors(factor(6))\n [1, 2, 3, 6]\n\n >>> all_divisors(factor(12))\n [1, 2, 4, 3, 6, 12]\n\n >>> all_divisors(factor(7))\n [1, 7]\n\n >>> all_divisors(factor(1))\n [1]\n \"\"\"\n if len(prime_factorization) == 0:\n return [1]\n result = []\n factor_with_mult = []\n for pfactor in prime_factorization:\n factor_with_mult += [[1]]\n for _ in range(pfactor[1]):\n factor_with_mult[-1] += [factor_with_mult[-1][-1] * pfactor[0]]\n for divisor in it.product(*factor_with_mult):\n result += [reduce(lambda x, y: x * y, divisor)]\n return result\n\n\nif __name__ == '__main__':\n # sieve\n for i in range(2, N + 1):\n if primes[i] == PRIME:\n j = 2\n while j * i < N + 1:\n primes[j * i] = i\n j += 1\n primes[0] = primes[1] = 0\n\n n = int(input())\n\n min_result = 10**9\n max_result = 0\n\n for divisor in all_divisors(factor(n)):\n for div2 in all_divisors(factor(divisor)):\n if div2 * div2 > divisor:\n break\n a = n // divisor + 1\n b = divisor // div2 + 2\n c = div2 + 2\n min_result = min([min_result,\n c * b + (a - 1) * 2 *\n (b + c - 2)])\n max_result = max([max_result,\n c * b + (a - 1) * 2 *\n (b + c - 2)])\n print(str(min_result) + \" \" + str(max_result))\n", "lang": "PyPy 3", "bug_code_uid": "3767c338ddf1520462d7c603b61a9c9c", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "b055cfe9592eb0736e774c098913d4d0", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8259587020648967, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "import sys\nn, k = [ int(x) for x in input().split() ]\narr = list( map( int, input().split()) )\n\ncnt_2 = 2 * n\ncnt_4 = n\ncnt_1 = 0\n\ni = 0\nwhile(cnt_4 > 0 and i < n):\n tmp = arr[i] / 4\n if(tmp > 0 and tmp <= cnt_4):\n cnt_4 = cnt_4 - tmp\n arr[i] = arr[i] - tmp * 4\n i = i + 1\n\nif(cnt_4 > 0):\n cnt_2 = cnt_2 + cnt_4\n cnt_1 = cnt_1 + cnt_4\n cnt_4 = 0\n\ni = 0\nwhile(cnt_2 > 0 and i < n):\n tmp = arr[i] / 2\n if(tmp > 0 and tmp <= cnt_2):\n cnt_2 = cnt_2 - tmp\n arr[i] = arr[i] - tmp * 2\n i = i + 1\n\nif(cnt_2 > 0):\n cnt_1 = cnt_1 + cnt_2\n cnt_2 = 0\n\ni = 0\nwhile(i < n):\n tmp = arr[i]\n if(tmp > cnt_1):\n print(\"NO\")\n sys.exit(0)\n elif(tmp > 0 and tmp <= cnt_1):\n cnt_1 = cnt_1 - tmp\n arr[i] = arr[i] - tmp\n i = i + 1\n\nprint(\"YES\")\n\n", "lang": "Python 3", "bug_code_uid": "d96192b5f0318162b0eaba3d13bb2829", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "7bbe6c7d12ab52d6261de4375a18af58", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9806451612903225, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "for i in range(5):\n s=input();if'1'in s:print(abs(i-2)+abs(s.find('1')//2-2))", "lang": "Python 3", "bug_code_uid": "e4bb7783e59650e9ea02e97627e89cd3", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "19c0245e75f8674d6a9caaf89fcf7ef8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2525458248472505, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport time\n\nxy = []\n\nfor i in range(3):\n (x, y) = (int(i) for i in input().split())\n xy.append([x, y])\n\n\nstart = time.time()\n\nif (x[0] == x[1] and x[1] == x[2]) or (y[0] == y[1] and y[1] == y[2]):\n print(1)\nelif x[0] == x[1] or x[1] == x[2] or y[0] = y[1] or y[1] == y[2] :\n print(2)\nelse:\n print(3)\n\nfinish = time.time()\n#print(finish - start)\n", "lang": "Python 3", "bug_code_uid": "730b9cc264f05f9d57ba8c5c889ad011", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "ecf64e46baf0b7343dbe5e66c41cf670", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6873385012919897, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "n,m=list(map(int,input().split()))\nmin_isolated=0;\nmax_isolated=0;\nif n-m*2>0:\n min_isolated=n-m*2\nvertices=n\nwhile n*(n-1)/2>m:\n n--;\nmax_isloated=vertices-n;\nprint(min_isolated,max_isolated) \n ", "lang": "Python 3", "bug_code_uid": "3ceaab6aebf1cd4d1dfbc2f20c04ffd8", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "719f4be98739e22a3a6e2657b446a865", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9101620029455081, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import sys,math\nfrom collections import deque\nimport random\n#input = sys.stdin.buffer.readline\n\n\n# def solve():\t\n# \treturn;\n\n\n# for _ in range(int(input())):\n# \tsolve()\n\ns = input()\n\nl = [\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"]\n\ncnt = 0\nfor x in l:\n\tif s.find(x)>=0:\n\t\tcnt+=1\n\nif cnt==1:\n\tprint(\"YES\")\nelse:\n\tprint(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "e9eb62118728c21b673e5d055a77265d", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "f2abd488f842c4454442488ba70a0802", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2505643340857788, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "from sys import stdin, stdout\nimport math\n \nn = int(stdin.readline())\nans = n\nfor i in range(2, int(math.sqrt(n))+1):\n t = int(math.log(n, i))\n if t!=0:\n ans -= (t-1)\n \nif ans % 2 == 0:\n stdout.write(\"Petya\"+'\\n')\nelse:\n stdout.write(\"Vasya\"+\"\\n\")", "lang": "PyPy 3", "bug_code_uid": "65ad140d88bfccb2bbee0601229cc9c2", "src_uid": "0e22093668319217b7946e62afe32195", "apr_id": "75f3546d0bbe9dc6502fdef253a17102", "difficulty": 2300, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7439862542955327, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 11, "fix_ops_cnt": 18, "bug_source_code": "n= int(input())\nm=[]\nmm=n\nans=[]\ndef sc(i,j,k):\n xx=0\n for t in range(5):\n xx+=(m[i][t]-m[j][t])*(m[i][t]-m[k][t])\n return xx\n\nfor i in range(n):\n ans.append(1)\n a,b,c,d,e=map(int,input().split())\n m.append([a,b,c,d,e])\nfor i in range(n):\n for j in range(n):\n if (i != j):\n for k in range(n):\n if (i != k) and ( j != k):\n if sc(i,j,k) <=0:\n ans[i]=-1\nfor i in range(n):\n if ans[i]==1:\n mm+=-1\nprint(mm)\nfor i in range(n):\n if ans[i]==-1:\n print(i+1)\n ", "lang": "Python 3", "bug_code_uid": "fb0bfa2ae6b0e6db3045cb5d8815623f", "src_uid": "c1cfe1f67217afd4c3c30a6327e0add9", "apr_id": "f1f553f99e74c6e534b319da317eaba1", "difficulty": 1700, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9957203994293866, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from sys import exit\n\nfrom itertools import combinations\n\nclass Vector5D:\n def __init__(self, xs):\n if len(xs) != 5:\n raise Exception(\"pidor\")\n\n self.xs = xs\n\n def __sub__(self, other):\n return Vector5D([a - b for a, b in zip(self.xs, other.xs)])\n\n def __abs__(self):\n return sum(x ** 2 for x in self.xs)\n\n def dot(self, other):\n return sum(a * b for a, b in zip(self.xs, other.xs))\n\n def __repr__(self):\n return '(%s)' % (' '.join(str(x) for x in self.xs), )\n\nn = int(raw_input())\n\nif n > 2 * 5:\n print 0\n\n exit(0)\n\nvs = []\n\nfor _ in xrange(n):\n xs = map(int, raw_input().split(' '))\n\n vs.append(Vector5D(xs))\n\ngood_points = []\n\nfor i in xrange(len(vs)):\n for j, k in combinations(range(len(vs)), 2):\n if j == i or k == i or j > k:\n continue\n\n ab = vs[j] - vs[i]\n ac = vs[k] - vs[i]\n\n if ab.dot(ac) > 0:\n break\n else:\n good_points.append(i)\n\nprint len(good_points)\n\nfor i in good_points:\n print i + 1\n", "lang": "Python 2", "bug_code_uid": "4a3960dcd06ad0f8e184aac875b522cb", "src_uid": "c1cfe1f67217afd4c3c30a6327e0add9", "apr_id": "9bd49ebbc13fd5d494d17317e6d7f2c4", "difficulty": 1700, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4088235294117647, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n=int(raw_input());\nst=str(n);\nctr=0;\nfor i in range(1,n+1):\n\td=n%i;\n\tflag=0;\n\tif d==0:\n\t\ts=str(i);\n\t\tfor j in range(len(s)):\n\t\t\tif s[j] in st and flag==0:\n\t\t\t\tflag=1;\n\t\t\t\tctr=ctr+1;\n\t\t\t\t\nprint ctr;\n", "lang": "Python 2", "bug_code_uid": "014686f84624be1982f25485cb87b682", "src_uid": "ada94770281765f54ab264b4a1ef766e", "apr_id": "965dde75214b2437013bd0a3d569814c", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3629032258064516, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "d=input()\nprint sum( 1 for x in range(1, d+1) if d%x < 1 and len(set(str(d))&set(str(x)))>0 )", "lang": "Python 2", "bug_code_uid": "7b551a6210cdcdb3245da8f72d577313", "src_uid": "ada94770281765f54ab264b4a1ef766e", "apr_id": "9e2ea36aa7782b909e963918229cd483", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.975095785440613, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from sys import stdin,stdout\nii1 = lambda: int(stdin.readline().strip())\nis1 = lambda: stdin.readline().strip()\niia = lambda: list(map(int, stdin.readline().strip().split()))\nisa = lambda: stdin.readline().strip().split()\nmod = 1000000007\nfrom itertools import permutations as perm\n\npos = []\nn = 2\nwhile n <= 10:\n cur = '4' * (n // 2) + '7' * (n // 2)\n pos.extend(sorted([int(\"\".join(i)) for i in perm(cur)]))\n n += 2\nn = ii1()\nfor i in pos:\n if i >= n:\n print(i)\n break\n \n\n ", "lang": "PyPy 3", "bug_code_uid": "955783bc3b74741f1379c685e24fa88d", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "apr_id": "ae251340a5f3085a9e58d20f4b41d9c2", "difficulty": 1300, "tags": ["brute force", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9385113268608414, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "s = raw_input()\na = sorted([int(s[0]),int(s[1]),int(s[2])])\nb = sorted([int(s[3]),int(s[4]),int(s[5])])\nc = sum(a)-sum(b)\ndef solve(l1,l2):\n\tn = 0\n\twhile sum(l1)<>sum(l2):\n\t\tif sum(l1)>sum(l2):\n\t\t\tc1 = sum(l1)-sum(l2)\n\t\t\tif l1[2]>=c1 or (9-l2[0])>=c1:\n\t\t\t\tn+=1\n\t\t\t\treturn n\n\t\t\telse:\n\t\t\t\tif l1[2]>=(9-l2[0]):\n\t\t\t\t\tl1[2]=0\n\t\t\t\telse:\n\t\t\t\t\tl2[0]=9\n\t\t\t\tn+=1\n\treturn n\nif c==0:\n\tprint 0\nelif c>0:\n\tprint solve(a,b)\nelse:\n\tprint solve(b,a)\n\n\n", "lang": "Python 2", "bug_code_uid": "c2116213f02570b568b46c64c86286f6", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "739e6b214e442b488de5d7da42971e84", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.027692307692307693, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "r, g, b = input().split()\nr, g, b = int(r), int(g), int(b)\ns = 0\ns += min(r, g, b)\nr, g, b = r - min(r, g, b), g - min(r, g, b), b - min(r, g, b)\nwhile r+b+g >= 3:\n if r < b:\n t = r\n r = b\n b = t\n if r < g:\n t = r\n r = g\n g = t\n if b < g:\n t = b\n b = g\n g = t\n r = r - 2\n b = b - 1\n s += 1\n\nprint(s)\n", "lang": "Python 3", "bug_code_uid": "3467f533c9c281aad9e89e739cacef2b", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "f5b9975da2d0a7d8a72549d48a4c6c4d", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9536082474226805, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "h1,m1 = map(int,input().split(\":\"))\nh2,m2 = map(int,input().split(\":\"))\nm_m = ((h2-h1)*60 + (m2-m1))//2\nm = m1 + m_m % 60\nh = h1 + m_m // 60 + m // 60\nm = m % 60\nprint(h,\":\",m,sep = \"\")", "lang": "Python 3", "bug_code_uid": "d51c0f4603fc8a8e439d3589119b5512", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "b02847387aa477eb781690a8f4e56f14", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.07969843834141088, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "from math import factorial\nMOD = 10**9+7\n\ndef binom(n, k):\n if k > n-k: return binom(n, n-k)\n res = 1\n for i in range(k): res = res*(n-i)//(i+1)\n return res\n\ndef comp_ones_vecs(k, n):\n # k ones, n vectors\n if k < n: return 0\n ans = 0\n for Z in range(n):\n ans+= (-1)**Z * binom(n,Z) * (n-Z)**k\n return ans // factorial(n)\n\ndef comp_ones_frees_vecs(k, f, n):\n # k prefixed ones, f digits of freedom, n vectors\n ans = 0\n for i in range(f+1):\n ans+= comp_ones_vecs(k+i, n) * binom(f, i)\n return ans\n\ndef comp_ones_frees(k, f):\n # k prefixed ones, f digits of freedom\n ans = 0\n for n in range(1, k+f+1):\n ans+= comp_ones_frees_vecs(k, f, n)\n return ans\n\nk = int(input())\nbink = list(map(int, bin(k)[2:]))\nans = 1 + comp_ones_frees(sum(bink), 0)\nones = 0\nfor i in range(len(bink)):\n if bink[i] == 0: continue\n ans+= comp_ones_frees(ones, len(bink)-i-1)\n ones+= 1\nprint(ans % MOD)", "lang": "PyPy 3", "bug_code_uid": "7d9791c45a5f8a6e4cc5e65e176f4786", "src_uid": "ead64d8e3134fa8f29881cb487e52f60", "apr_id": "16870a19534c2b0e56c9ce140de25633", "difficulty": 2700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9622641509433962, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def is_subsequence(child, parent, i, j, c):\n if i >= len(child) or j >= len(parent):\n return c\n if child[i] == parent[j]:\n return is_subsequence(child, parent, i+1, j+1, c+1)\n else:\n return max(is_subsequence(child, parent, i+1, j, c),is_subsequence(child, parent, i, j+1, c))\n\ns = [c for c in input()]\nt = [c for c in input()]\ncopy_s = [c for c in s]\ncopy_t = [c for c in t]\n\nif len(s) < len(t):\n print(\"need tree\")\n exit()\n\nfor c in t:\n if c not in s:\n print(\"need tree\")\n exit()\n else:\n s.remove(c)\n\n# print(s)\n# print(t)\n\nif len(s) == 0:\n print(\"array\")\nelse:\n k = is_subsequence(copy_t, copy_s, 0, 0, 0)\n if k == len(copy_t):\n print(\"automaton\")\n else:\n print(\"both\")", "lang": "PyPy 3", "bug_code_uid": "40adfd475cd1dd1cd39368d0c858b83a", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "87613e210750f64a539b4e75e7191490", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.312, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "l = list(map(int, input().split()))\ns = set(l)\nif len(s) == 1:\n\tprint('Elephant')\nelif len(s) == 2:\n\tif l.count(l[0]) == 5 || l.count(l[0]) == 1:\n\t\tprint('Bear')\n\telse:\n\t\tprint('Elephant')\nelif len(s) == 3:\n\tprint('Bear')\nelse:\n\tprint('Alien')", "lang": "Python 3", "bug_code_uid": "bd94e508269c7a20dfd36cc4d64455b6", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "4326b33a49c29e0742af6e21570de716", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4395946999220577, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "\nimport sys\nimport Queue\nimport bisect\nimport fractions\nimport heapq\n\n\nn,k = map(int ,raw_input().split())\nans = 0\n\n\nLL = [[0]*(n+1) for i in range(n+1)]\nLL[0][0]=1\nLL = [\n[1],\n[1, 1],\n[1, 2, 1],\n[1, 3, 3, 1],\n[1, 4, 6, 4, 1],\n[1, 5, 10, 10, 5, 1],\n[1, 6, 15, 20, 15, 6, 1],\n[1, 7, 21, 35, 35, 21, 7, 1],\n[1, 8, 28, 56, 70, 56, 28, 8, 1],\n[1, 9, 36, 84, 126, 126, 84, 36, 9, 1]\n]\n\nmyLL =[[0]*(i+1) for i in range(100)]\n\n\ndef f(i,j,val):\n\n if myLL[i][j]+val>=1:\n rest = myLL[i][j]+val-1\n myLL[i][j]=1\n f(i+1,j,rest/2)\n f(i+1,j+1,rest/2)\n\n else:\n myLL[i][j] += val\nfor t in range(k):\n f(0,0,1.0)\nans =0\nfor i in myLL:\n for j in i:\n if j == 1:\n\n ans+=1\n\nprint ans\n\n\n\n\n", "lang": "PyPy 2", "bug_code_uid": "7dd580d5d4960505f5dc642d96cfb662", "src_uid": "b2b49b7f6e3279d435766085958fb69d", "apr_id": "5579bd84df6b7f9295b59518cf920d04", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7325, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 11, "bug_source_code": "n,m = map(int, input().split())\nl = list(map(int, input().split()))\nif n == 1:\n return 1\nans = []\nk = l\nc = {}\nfor i,v in enumerate(l):\n c[v] = i\n\nwhile len(l) != 0:\n if m >= l[0]:\n ans.append(k[0])\n l = l[1:]\n k = k[1:]\n else:\n l[0] -= m\n l = l[1:] + l[0:1]\n k = k[1:] + k[0:1]\n\nprint(c[ans[-1]] + 1)", "lang": "Python 3", "bug_code_uid": "b5749e3b3472c11b82ecb23eb545f581", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "648e91ed48e163fe39da0891ae2513de", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.781563126252505, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "x = int(input())\narr = []\nfor i in range(1, 300, 2):\n arr.append((i//2) * (i // 2) + (i //2+ 1) + (i // 2 + 1))\ncounter = 0\nind = 1\nwhile arr[counter] >= x:\n counter+=1\n ind += 2\ncounter-=1\nind -=2\nif (x == 3) print(5)\nelse:\nprint(ind)\n", "lang": "Python 3", "bug_code_uid": "18697f6666a46a02b001936733675026", "src_uid": "01eccb722b09a0474903b7e5abc4c47a", "apr_id": "e57c9edc84a16aef703cc53ed1eea4c4", "difficulty": 1700, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9960629921259843, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x = int(input())\narr = []\nfor i in range(1, 10000, 2):\n arr.append((i//2) * (i // 2) + (i //2+ 1) + (i // 2 + 1))\ncounter = 0\nind = 1\nwhile arr[counter] < x:\n counter += 1\n ind += 2\nif (x == 2): print(3)\nelif (x == 3): print(5)\nelse: print(ind)\n", "lang": "Python 3", "bug_code_uid": "5104e38fcd34a9af13202c43c08b5ddb", "src_uid": "01eccb722b09a0474903b7e5abc4c47a", "apr_id": "e57c9edc84a16aef703cc53ed1eea4c4", "difficulty": 1700, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9663182346109176, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "p=input();\nm=input();\nn='qwertyuiopasdfghjkl;zxcvbnm,./'\nif(p=='R'):\n i=0;\n while(i(-len(n)) or j==(-len(n))):\n if(m[i]==n[j]):\n print(n[j-1],end='');\n j=j-1;\n i=i+1;\nelse:\n i=0;\n while(i=5:\n print('Correct')\nelse:\n print('Too weak')", "lang": "Python 3", "bug_code_uid": "a89de972dfa063f3118adac6d640fba3", "src_uid": "42a964b01e269491975965860ec92be7", "apr_id": "1b7f3041e4d8e2e70eebb8c1bdc60318", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.44075829383886256, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "a,b,co=map(int,input().split())\nc=[]\nfor i in range(1,co+1):\n if(i==1):\n x=b*2+2*(a-2)\n c.append(x)\n else:\n if(a>0 and b>0)\n a=a-2*i\n b=b-2*i\n x=b*2+2*(a-2)\n c.append(x)\n else:\n break\nprint(sum(c))\n \n", "lang": "Python 3", "bug_code_uid": "ee3d3b0dd4cdb90059f6b2477e5ad617", "src_uid": "2c98d59917337cb321d76f72a1b3c057", "apr_id": "c51fb3042fc2ad7059c109dbd3c7634f", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9921649484536083, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from collections import defaultdict\nfrom typing import List\n\n\nclass Solution:\n @classmethod\n def calculate(cls, weight_combo: List[str]) -> str:\n mapping = defaultdict(int)\n for combo in weight_combo:\n [first_op, operator, second_op] = list(combo)\n if operator == \">\":\n mapping[first_op] += 1\n else:\n mapping[second_op] += 1\n if mapping[\"A\"] == 1 and mapping[\"B\"] == 1 and mapping[\"C\"] == 1:\n print(\"Impossible\")\n if mapping['A'] == 0:\n print(\"A\", end=\"\")\n elif mapping['B'] == 0:\n print(\"B\", end=\"\")\n elif mapping['C'] == 0:\n print(\"C\", end=\"\")\n\n if mapping['A'] == 1:\n print(\"A\", end=\"\")\n elif mapping['B'] == 1:\n print(\"B\", end=\"\")\n elif mapping['C'] == 1:\n print(\"C\", end=\"\")\n\n if mapping['A'] == 2:\n print(\"A\", end=\"\")\n elif mapping['B'] == 2:\n print(\"B\", end=\"\")\n elif mapping['C'] == 2:\n print(\"C\", end=\"\")\n\nif __name__ == \"__main__\":\n combo = []\n for _ in range(3):\n combo.append(input())\n Solution.calculate(combo)\n", "lang": "Python 3", "bug_code_uid": "ce5de6a9ce9ca6b6e2067b292a4e2a27", "src_uid": "97fd9123d0fb511da165b900afbde5dc", "apr_id": "2ccb1a0ecd3727ed28ec0b574a887a37", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9326765188834154, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "\n import math\na_x, a_y, b_x, b_y, c_x, c_y = map(int, input().split())\n\nif (b_x - a_x)*(c_y - a_y) == (c_x - a_x)*(b_y - a_y):\n print('No')\n exit()\n\nl_ab = math.sqrt(abs(b_x - a_x)**2 + abs(b_y - a_y)**2)\nl_bc = math.sqrt(abs(c_x - b_x)**2 + abs(c_y - b_y)**2)\nif l_ab != l_bc:\n print('No')\n exit()\n\nprint('Yes')", "lang": "Python 3", "bug_code_uid": "ead473a00caa807ae23b23832334353d", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "26172c2a01ee2075fed3c6d762865294", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8879310344827587, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "x, y = map(int, input().split())\n\nf = x*y\n\nif (f % 2 == 0):\n\tprint int(f / 2) \nelse:\n\tprint int((f - 1) / 2)\n\n", "lang": "Python 3", "bug_code_uid": "c5a2cc1aa7609a4c2b7a8591a3afa741", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "8b00dd0f47e478804dc2c17e24b904e6", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6642066420664207, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "l = input().split()\nn = int(l[0])\nm = int(l[1])\n\nmod = 10**9 + 7\nd = pow(2,n)\nd2 = pow(d,m)\n\np = pow(2,n-1)\np2 = pow(p,m)\n\nprint ((d2 - n*p2 + n - 1)%mod)", "lang": "PyPy 3", "bug_code_uid": "b11262fd7eb657586d78d997a85b3ad6", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "f3929c52d9931dd47c4c318406b812d1", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.98194370685077, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# ------------------- fast io --------------------\nimport os\nimport sys\nfrom io import BytesIO, IOBase\n \nBUFSIZE = 8192\n \nclass FastIO(IOBase):\n newlines = 0\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n \n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n \n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n \n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n \n \nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\n \n \nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n \n# ------------------- fast io --------------------\n\nn,m=map(int,input().split())\nprint((2**m -1)**n)", "lang": "PyPy 3", "bug_code_uid": "94df2866a8198f91d37ecec44b0ed969", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "65e5ce3ed594fabcf9b415c8f1384677", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4052532833020638, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import sys\ninput = sys.stdin.readline\n\n'''\n\n'''\n\nMOD = 10**9+7\n\nn, m = map(int, input().split())\nt = 2**m-1\nres = t\nwhile n > 1:\n res *= t\n res %= MOD\n n -= 1\n\nprint(res)", "lang": "PyPy 3", "bug_code_uid": "57c1ebb58fd6f01ee60dae647690f732", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "d39434e334e2515f6692c5824f36f97a", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7961165048543689, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "# Alice and the List of Presents (593.2)\n\nn,m=input().split()\nn,m=int(n),int(m)\na=2**m\nprint((a-1)**n)\n", "lang": "PyPy 3", "bug_code_uid": "008da007103b1ce53ad25cdadffbdac9", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "96b2ed12e1a3f03e86999b8821300688", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2110912343470483, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "x=10**9+7\nn,m=list(int(i) for i in input().split())\nprint(((2**m-1)**n)%x)", "lang": "PyPy 3", "bug_code_uid": "8db587eee781250b3c43ea9e3a33a220", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "04d57a8fd9820cda946155ec1e5281f6", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9311740890688259, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import sys\n\ninput = lambda: sys.stdin.readline().strip(\"\\r\\n\")\n\nn, m = map(int, input().split())\nprint((2**m - 1)**n)\n", "lang": "PyPy 3", "bug_code_uid": "4291ad83ff540fd401294ed6d8263668", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "c76b60569b1e06aa73d6b79f80eb0dba", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8784313725490196, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "n, m = list(map(int, input().split()))\n\nmod = int(10e9) + 7\n\na1 = pow(2, m) - 1\nans = pow(a1, n, mod)\n\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "434e4bb46faf8cd906b2fd4e145fb56d", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "0e151f59e81f4393e0180e5c4e39fe7c", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8870967741935484, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n, m = map(int,input().split())\nprint(((2**m-1)**n)%(10**9+7))", "lang": "PyPy 3", "bug_code_uid": "1a6ff5f91a23eb62c6471d86389d42ca", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "7f066480f80875f97b578d17cb2c52a1", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8640776699029126, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n,m=map(int,input().split())\ndef fun(x,y,m):\n res=1\n while y>0:\n if y%2==1:\n res=(res*x)%m\n y//=2\n x=(x*x)%m\n return res\ntot = 2**m-1\nprint(fun(tot,n,10**9+7))", "lang": "PyPy 3", "bug_code_uid": "f1348fe36822a54d415ac8fcc85733bc", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "4fd53187e9d4301a4649dd526a98fd97", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6065573770491803, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n,m = input().split(' ')\nn = int(n)\nm = int(m)\nprint((2**m-1)**n)", "lang": "PyPy 3", "bug_code_uid": "e6a3579cf15d4b5728d8e8d5ac922371", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "1863f905287c80ca5c09b5ec11d8e1d3", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6136363636363636, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import math\nn,m=map(int,input().split())\nt=2**m-1\ns=t**n\nprint(s%1000000007)", "lang": "PyPy 3", "bug_code_uid": "29435b0eb72c6be02326be7546755a30", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "2617254c815b1ebfd8b6f9e94255c652", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3958333333333333, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "from sys import *\nfrom math import *\nn,k=map(int,stdin.readline().split())\nf=[1]\nfor i in range(1,max(n,k)+1):\n f.append(i*f[i-1])\nans=0\nfor i in range(0,k):\n ans+=(f[k]//(f[k-i]*f[i]))\nprint(ans**n)", "lang": "PyPy 3", "bug_code_uid": "acc2bf8f527c68b3088b619d630889d5", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "3ff9ed29c06bf543c631124c42d99ce2", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.874296435272045, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import sys\n\n[n , m , k] = sys.stdin.readline().split()\n\nn = int(n)\nm = int(m)\nk = int(k)\n\n\ndef iseven(x):\n\n if x % 2 == 0:\n\n return True\n\n return False\n\n\n\n\nif iseven(n + m) == False and k ==-1: print(0)\n\nelse: print(2**((n-1)*(m-1)) % 1000000007)\n\n\n\n\n\n\n \n", "lang": "Python 3", "bug_code_uid": "76bedc126efd86df2bf88c7238a1a5a4", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "a9619f225244ec0216c9800711dc3407", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.10416666666666667, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "n, d = int(input().split())\ns = list(map(int, input.split())\nj = [list(s.index(n) for n in s if n == 1)]\nk = [list(j-i for i, j in zip(j[:-1], t[1:]) if j-i <= d)]\nif not k :\n print(-1)\nelse :\n print(len(k))", "lang": "Python 3", "bug_code_uid": "8000d3216a6d8d74bceff1ab9e976f3f", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "apr_id": "f2533276c37be96f27f68613989526e9", "difficulty": 800, "tags": ["dp", "greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7254901960784313, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "a=int(input())\nb=int(input())\nprint (a-1)/(b-1)+a\n", "lang": "Python 2", "bug_code_uid": "d256709a939f665c9f9bf8c6fe3384b8", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "c3c3f284bc3decac3a23e38123637f51", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9650122050447518, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "sn,sk = input().split(' ')\nn =int(sn)\nk=int(sk)\ns=input()\n# print(s[0])\n# exit(0)\nmx=0\nl=0\nwhile(lk):\n print('NO')\n exit(0)\nans = 'NO'\nfor l in range(n):\n can = 1\n if (l+k < n) and (s[l+k]=='N'):\n can =0\n if(l==0 or s[l-1]!='N'):\n if(l+k<=n):\n for i in range(k):\n if s[l+i]=='Y' :\n can=0\n else:\n can = 0\n if can ==1:\n ans = 'YES';\nprint(ans)\n ", "lang": "Python 3", "bug_code_uid": "74163044ccb5c3f201dd83282c9f7560", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "4ead5f517304508f165a14b04574105a", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9991742361684558, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "matrix = []\n\nfor i in range(8):\n line = input()\n matrix.append(line)\n \ntotal_count = 0\nt = 0\nfor i in range(8):\n row_count = 0\n for j in range(8):\n if matrix[i][j] = 'B':\n row_count += 1\n if row_count!=8:\n total_count = row_count\n t = 1\n break\nif t==0:\n print(8)\nelse:\n for col in range(8):\n col_count = 0\n for row in range(8):\n if matrix[row][col] == 'B':\n col_count += 1\n if col_count!=8:\n total_count += col_count\n break\n print(total_count)\n \n \n ", "lang": "Python 3", "bug_code_uid": "2652869cfa0f48f6af45022413e4346e", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "b4e2a99dbeea409b645bd94206d2a7db", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9955621301775148, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\narr = list(map(int, input().split()))\n\ndef solve(last):\n s = 0\n for i in range(1, n, 1):\n if last == 1 :\n if arr[i] == 2:\n s += 3\n else:\n s += 4\n last = arr[i]\n elif arr[i] == 1:\n if last == 2:\n s += 3\n else:\n s += 4\n last = arr[i]\n else:\n return \"Infinite\"\n if i-1 >= 0 or i+1 <= n:\n if arr[i-1] == 3 and arr[i] == 1 and arr[i+1] == 2:\n s -= 1\n return s\n\nl = arr[0]\nret = solve(l)\nif ret == \"Infinite\":\n print(ret)\nelse:\n print(\"Finite\")\n print(ret)", "lang": "Python 3", "bug_code_uid": "24554e8f69348dde7efef8833d134333", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "3db4facb01dea5c8d00cbb8cd9dedb30", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.025331030512377662, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "#pragma comment(linker,\"/STACK:100000000,100000000\")\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n\n/* Constants begin */\nconst long long inf = 1e18+7;\nconst long long mod = 1e9+7;\nconst double eps = 1e-9;\nconst double PI = 2*acos(0.0);\nconst double E = 2.71828;\n/* Constants end */\n\n/* Defines begin */\n#define pb push_back\n#define mp make_pair\n#define ll long long\n#define double long double\n#define F first\n#define S second\n#define all(a) (a).begin(), (a).end()\n#define forn(i,n) for (ll (i)=0;(i)<(ll)(n);(i)++)\n/* Defines end */\n\nll gcd(ll x, ll y){\n return !y ? x : gcd(y,x%y);\n}\n\nint main(void) {\n #ifndef ONLINE_JUDGE\n freopen(\"input.txt\",\"rt\",stdin);\n freopen(\"output.txt\",\"wt\",stdout);\n #endif\n ll n, ans = 0;\n cin >> n;\n ll to = sqrt(n+.0);\n for(ll i=1;i<=to;i++)\n for(ll j=i;j<=to;j++){\n ll c = i*i+j*j;\n if(c > n) break;\n if(gcd(i,j) != 1 || ~(j-i) & 1) continue;\n ans += n/c;\n }\n cout << ans << endl;\n return 0;\n}\n", "lang": "Python 3", "bug_code_uid": "8b7a913ea51ccbfbd4010568637c627f", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "c33948d790bcda608c1cf3a3ec6f8a51", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9990029910269193, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\ns=0\nw=0\nb=1\n\nif n==10000:\n print(12471)\nelif n=9999:\n print(12467)\nelse:\n while b(n)**2:\n break\n \n \n print(s)", "lang": "Python 3", "bug_code_uid": "7ac16dd76c0a2cedea1f5a58264d148a", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "7e77ac1f084fdbe39b2262e0bc4f38a7", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6917098445595855, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env python3\nimport sys\n\n(c,d) =raw_input()#sys.argv[1]\n#c = sys.argv[1][0]\n#d=sys.argv[1][1]\nmoves = [1 for i in range(8)]\n#012\n#7x3\n#654\nif c == 'a':\n\tmoves[0] =0\n\tmoves[7] =0\n\tmoves[6] =0\nelif c=='h':\n\tmoves[3] =0\n\tmoves[4] =0\n\tmoves[5] =0\nif d==1:\n\tmoves[0] =0\n\tmoves[1] =0\n\tmoves[2] =0\nelif d==8:\n\tmoves[4] =0\n\tmoves[5] =0\n\tmoves[6] =0\ncontador =0\n#for i in moves:\n\t#contdor +=i\nprint (sum(moves))", "lang": "Python 3", "bug_code_uid": "24abde6b81810c15bbee0258807c2ab3", "src_uid": "6994331ca6282669cbb7138eb7e55e01", "apr_id": "03bb748931b7b351e15c00ed7ee7742d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.46272493573264784, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n = int(input())\nif n%3==2:\n a = (str(\"2 1 \")*(n//3) + str(\"2\"))\n a = a.replace(\" \",\"\")\n print(len(a))\nelif n%3==1:\n b = (str(\"1 2 \")*(n//3) + str(\"1\"))\n b = b.replace(\" \",\"\")\n print(len(b))\nelse:\n c = (str(\"2 1 \")*(n//3))\n c = c.replace(\" \",\"\")\n print(len(c))", "lang": "Python 3", "bug_code_uid": "953aeb61fe203ba8a0a692ecf952e7fd", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "65043d8611f4bc5ccb8e8a17ab60394c", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4630541871921182, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "n = int(input())\nz = 1\ng = 0\nr = 0\nwhile g < n:\n g += z\n r += 1\n z = 3-z\nif g > n:\n r -= 1\nprint(r)\n", "lang": "Python 3", "bug_code_uid": "716bd01d32f125b51f38e67ca7190a6a", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "8a4a31d424ade9781eb2ef65fe549549", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5046979865771812, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def main(n, x, y):\n if (x == n and y == n):\n return \"YES\"\n if (x == n and y == n+1):\n return \"YES\"\n if (x == n+1 and y == n):\n return \"YES\"\n if (x == n+1 and y == n+1):\n return \"YES\"\n else:\n return \"NO\"\n\nline = raw_input()\nlst = line.split(\" \")\nn = int(lst[0]/2)\nx = int(lst[1])\ny = int(lst[2])\nprint main(n, x, y)\n \n", "lang": "Python 2", "bug_code_uid": "1358df2114c64322f93c0992c78d8e5f", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "59031f20181ca71b14551c3f62880598", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.75045759609518, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "for t in range(int(input())):\n n = int(input())\n if not n % 2:\n print(f'{n // 2} {n // 2}')\n else:\n ans = [True] * ((n // 2) + 1)\n idx = 1\n for i in range(3, (n // 2) + 1):\n if not ans[i] or not i % 2:\n continue\n if n % i > 0:\n ans[i] = False\n for j in range(2, ((n // 2) + 1) // i):\n ans[i * j] = False\n elif n % i == 0:\n idx = i\n break\n # print(ans, idx)\n if idx == 1:\n print(f'{1} {n - 1}')\n else:\n print(f'{n // idx} {n - n // idx}')\n\n\n# for t in range(int(input())):\n# n = int(input())\n# a = list(map(int, input().split()))\n# cnt = 0\n# i = 0\n# while i < n:\n# while i < n and a[i] == i + 1:\n# i += 1\n# j = i\n# while i < n and a[i] != i + 1:\n# i += 1\n# cnt += 1 if j - i else 0\n# print(cnt)\n", "lang": "PyPy 3", "bug_code_uid": "ec7f93bef76bde4921c6b544a7eeafef", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "ed133d829fd6d16d4c8d9d33cb4eb7ae", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.49193548387096775, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "def extend(l):\n for i in l[:]:\n l.append(i/2)\n l.append(i+1)\n return(l)\nm,n = map(int,input().split())\ns = [n]\nstep = 0\nwhile m not in s:\n s = extend(s)\n step+=1\nprint(step)", "lang": "Python 3", "bug_code_uid": "901693384a9fc727011fb231b162043b", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "a3747bfab6545883d76c110a03bfc900", "difficulty": 1400, "tags": ["dfs and similar", "greedy", "shortest paths", "math", "implementation", "graphs"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8481927710843373, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "# https://codeforces.com/problemset/problem/575/H\n\nimport sys\nimport math\n\nmod = pow(10, 9) + 7\n\n\ndef main():\n # sys.stdin = open('E:\\\\Sublime\\\\in.txt', 'r')\n # sys.stdout = open('E:\\\\Sublime\\\\out.txt', 'w')\n # sys.stderr = open('E:\\\\Sublime\\\\err.txt', 'w')\n\n n = int(sys.stdin.readline().strip())\n # a, b = map(int, sys.stdin.readline().strip().split()[:2])\n\n # C(n+1, 2n + 2) = (2n+2)! : (n+1)! : n+1!\n # = (n+2)(n+3)...(2n+2) /\n\n t = 1\n m = 1\n for i in range(1, n + 2):\n t *= (n + i + 1) % mod\n m *= i % mod\n print((t // m - 1) % mod)\n\n\nif __name__ == '__main__':\n main()\n\n# hajj\n# \u3000\u3000\u3000\u3000\u3000\u3000 \uff3f\uff3f\n# \u3000\u3000\u3000\u3000\u3000\uff0f\uff1e\u3000\u3000\u30d5\n# \u3000\u3000\u3000\u3000\u3000| \u3000_\u3000 _ l\n# \u3000 \u3000\u3000\u3000\uff0f` \u30df\uff3fx\u30ce\n# \u3000\u3000 \u3000 /\u3000\u3000\u3000 \u3000 |\n# \u3000\u3000\u3000 /\u3000 \u30fd\u3000\u3000 \uff89\n# \u3000 \u3000 \u2502\u3000\u3000|\u3000|\u3000|\n# \u3000\uff0f\uffe3|\u3000\u3000 |\u3000|\u3000|\n# \u3000| (\uffe3\u30fd\uff3f_\u30fd_)__)\n# \u3000\uff3c\u4e8c\u3064\n", "lang": "Python 3", "bug_code_uid": "48b77e3c49a0819fd1bb159415e5c92e", "src_uid": "a18833c987fd7743e8021196b5dcdd1b", "apr_id": "76ecf3c3c10c4c6242147fb0c4466b37", "difficulty": 1800, "tags": ["combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.515625, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n = int(raw_input())+1\naa=1\nfor i in xrange(1, 2*n):\n\taa *= i\nbb=1\nfor i in xrange(1, n+1):\n\tbb *= i\ncc = 1\nfor i in xrange(1, n):\n\tcc *= i\nprint (2 * aa / (bb * cc) - 1) % (10 ** 9 + 7)\n", "lang": "PyPy 2", "bug_code_uid": "4a841d1e81749e8ebefee09e6367e334", "src_uid": "a18833c987fd7743e8021196b5dcdd1b", "apr_id": "9ec09dd5291511e2bf7b9c47d6110219", "difficulty": 1800, "tags": ["combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9966996699669967, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def main():\n s = input()\n ans = 26\n for c in s:\n ans +=25\n \n print(ans)\n\nif __name__='__main__':\n main()\n \n ", "lang": "Python 3", "bug_code_uid": "a2d8b838e0b4d7ad2ab59ca11757ee48", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "apr_id": "9450b0e807d9584915fcdb344fae757c", "difficulty": 900, "tags": ["math", "brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.44299674267100975, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "rcp = raw_input()\nrcp = [rcp.count(c) for c in ['B', 'S', 'C']]\nn = map(int, raw_input().split())\np = map(int, raw_input().split())\nr, cnt = int(raw_input()), 0\nwhile True:\n\tif all([n[i] == rcp[i] for i in range(3)]):\n\t\tcnt += 1\n\t\tbreak\n\tfor i in range(3):\n\t\tif n[i] < rcp[i]:\n\t\t\tif p[i] * (rcp[i] - n[i]) <= r:\n\t\t\t\tr -= p[i] * (rcp[i] - n[i])\n\t\t\t\tn[i] = rcp[i]\n\t\t\telse:\n\t\t\t\tprint cnt\n\t\t\t\texit()\n\tfor i in range(3):\n\t\tn[i] -= rcp[i]\n\tcnt += 1\ncpb = 0\nfor i in range(3):\n\tcpb += rcp[i] * p[i]\ncnt += r / cpb\nprint cnt\n", "lang": "Python 2", "bug_code_uid": "994f2d3ebf7fb01ab03a418ed383d515", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "2f77d439790f84de6c9180e7ca17336f", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9979550102249489, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def getSum(n): \n sum = 0\n while (n != 0): \n sum = sum + int(n % 10) \n n = int(n/10) \n return sum\n\nn = int(input())\nif n<=9:\n print(n)\nelse:\n x=0\n while x*10+9<=n:\n x+=x*10+9\n print(getSum(x)+getSum(n-x))", "lang": "PyPy 3", "bug_code_uid": "cbb04138893167a83822430391568fe5", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "76112218c720cf9b85deafe7dbe8ecae", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9794608472400513, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/python\n\ndef mul(l,r,mod):\n c = [ (l[0] * r[0] + l[1] * r[1]) % mod,\n (l[0] * r[1] + l[1] * r[3]) % mod,\n (l[2] * r[0] + l[3] * r[2]) % mod,\n (l[2] * r[1] + l[3] * r[3]) % mod ]\n return c\n\ndef power(m,n,mod):\n b = [1,0,0,1]\n while n > 0:\n if (n & 1):\n n -= 1\n b = mul(b,m,mod)\n else:\n n >>= 1\n m = mul(m,m,mod)\n return b\n\ndef fibs(n,mod):\n if n == 0:\n return (0,1)\n else:\n m = [1,1,1,0]\n return power(m,n,mod)\n\ndef fib(n,mod):\n res = fibs(n,mod)\n return res[1]\n\ncheck_me = int (raw_input())\nperiods = { 10 : 60,\n 100 : 300,\n 1000 : 1500,\n 10000 : 15000,\n 100000 : 150000,\n 1000000 : 1500000,\n 10000000 : 15000000,\n 100000000 : 150000000,\n 1000000000 : 1500000000,\n 10000000000 : 15000000000,\n 100000000000 : 150000000000,\n 1000000000000 : 1500000000000,\n 10000000000000 : 15000000000000\n}\nmod = 10\nresnumbers = []\ni = 0\nwhile i < periods[mod]:\n if check_me % mod == fib(i,mod):\n resnumbers.append(i)\n i += 1\n \nmod = 100\nwhile mod <= 10000000000000:\n newres =[]\n per = periods[mod/10]\n for j in resnumbers:\n while j < periods[mod]:\n if check_me % mod == fib(j,mod):\n newres.append(j)\n j += per\n resnumbers = newres\n mod *= 10\n\nif resnumbers:\n print min(resnumbers)\nelse:\n print -1\n", "lang": "Python 2", "bug_code_uid": "9c565ffb56c525e3d95656ec67e27ab4", "src_uid": "cbf786abfceeb8df29732c8a872f7f8a", "apr_id": "0ec7ade0476da9de3f759c8e1ede59c2", "difficulty": 2900, "tags": ["matrices", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9990649836372136, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def mult_mod(a, b, m):\n c = [[a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1]],\n [a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1]]]\n for i in range(2):\n for j in range(2):\n c[i][j] %= m\n return c\n\ndef pow_mod(n, m):\n p = [[1, 1],\n [1, 0]]\n\n a = [[1, 0],\n [0, 1]]\n\n while n:\n if n % 2:\n a = mult_mod(a, p, m)\n p = mult_mod(p, p, m)\n n /= 2\n return a\n\ndef fib(n, m):\n return pow_mod(n, m)[0]\n\ndef egcd(a, b):\n if b == 0:\n return 1, 0, a\n x1, y1, c = egcd(b, a % b)\n return y1, x1 - (a / b) * y1, c\n\ndef crt(a0, n0, a1, n1):\n if min(n0, n1) < 0:\n return 0, -1\n x, y, g = egcd(n0, n1)\n if (a0 - a1) % g:\n return 0, -1\n x *= (a1 - a0) / g\n y *= (a1 - a0) / g\n k = n1 * n0 / g\n return (n0 * x + a0) % k, k\n\n\n# 2**13 -> 12288\n# 5**8 -> 1562500\n# 5**9 -> 7812500\n\n\ndef find(f, m, l):\n resp = []\n x0 = 0\n x1 = 1\n for i in range(l):\n if x0 == f % m:\n resp.append(i)\n x0, x1 = x1, (x0 + x1) % m\n return resp\n\nf = input()\na = find(f, 2**13, 12288)\nb = find(f, 5**9, 1562500)\n\nif len(a) == 0 or len(b) == 0:\n print('-1')\nelse:\n ans = 10 ** 30\n fm = pow_mod(4800000000, 10 ** 13)\n for i in a:\n for j in b:\n a0, n0 = crt(i, 12288, j, 1562500)\n if n0 != -1:\n x1, x0 = fib(a0, 10 ** 13)\n if x0 == f:\n ans = min(ans, a0)\n else:\n a0 += n0\n \n x3 = (x1 * fm[0][0] + x0 * fm[1][0]) % 10 ** 13\n x2 = (x1 * fm[0][1] + x0 * fm[1][1]) % 10 ** 13\n while (x2,x3) != (x0, x1):\n if x2 == f:\n ans = min(ans, a0)\n break\n a0 += n0\n x3, x2 = (x3 * fm[0][0] + x2 * fm[1][0]) % 10 ** 13, (x3 * fm[0][1] + x2 * fm[1][1]) % 10 ** 13\n if ans < 10 ** 30:\n print(ans)\n else:\n print(-1)", "lang": "PyPy 2", "bug_code_uid": "17f0b3b085d51cdd07f9a9b985e4e63f", "src_uid": "cbf786abfceeb8df29732c8a872f7f8a", "apr_id": "ace9d680306c6f1d9f355a0c00c3d23c", "difficulty": 2900, "tags": ["matrices", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7976878612716763, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#n , m = map(int , input().split())\nn = int(input())\nm = int(input())\nprint(pow(2 , n + m , 998244353 ))", "lang": "Python 3", "bug_code_uid": "7e176d219fdbb0bbf74dd001db5050b9", "src_uid": "8b2a9ae21740c89079a6011a30cd6aee", "apr_id": "0ab0941e779ad46f13f573114382eca4", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9738219895287958, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, front, back = [int(x) for x in input().split(' ')]\nprint(n - max(front + 1, n - back)+ 1)3 1 1\n", "lang": "Python 3", "bug_code_uid": "cca3b140f8c371e4e265438915b5a7df", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "85cb8a874bc981593146eeb906971601", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9842931937172775, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from math import sqrt\n\nr,h = map (int, input().split())\ncount = h // r * 2\nh -= h // r\nelif h >= sqrt(3) / 2 * r:\n count += 3\nelif h >= r / 2:\n count += 2\nelse:\n count += 1\nprint (count)\n", "lang": "Python 3", "bug_code_uid": "5ca1bfc25c3837b7d754e099efa75abc", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "55b36c097d389c7e3b93e0dd60243b3f", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9300833867864016, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def check(a,b):\n ansa=b[0]-a[0]\n ansb=b[1]-a[1]\n return [ansa,ansb] \nwhile True:\n try:\n n,m=map(int,input().split())\n if n!=m:\n print('No')\n else:\n a=list()\n b=list()\n for i in range(n):\n a.append(list(map(int,input().split())))\n for i in range(m):\n b.append(list(map(int,input().split())))\n flag=False\n for i in range(len(a)):\n for j in range(i+1,len(a)):\n for k in range(len(b)):\n for l in range(k+1,len(b)):\n ansa=check(a[i],a[j])\n ansb=check(a[i],b[k])\n ansc=check(a[i],b[l])\n if (ansa[0]==ansb[0] and ansa[0]==ansc[0] and ansa[0]==0) or (ansa[0]!=0 and ansb[0]!=0 and ansc[0]!=0 and ansa[1]/ansa[0]==ansb[1]/ansb[0] and ansa[1]/ansa[0]==ansc[1]/ansc[0]):\n print('No')\n flag=True\n break\n else:\n continue\n if flag==True:\n break\n if flag==True:\n break\n if flag==True:\n break\n if flag==False:\n print('Yes')\n except EOFError:\n break", "lang": "Python 3", "bug_code_uid": "6e80276c451b80aef12a9bd40bd8fad5", "src_uid": "65f81f621c228c09915adcb05256c634", "apr_id": "7e92c092e712d18a2f732d7a78a2c055", "difficulty": 1600, "tags": ["geometry", "math", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9680851063829787, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n, m, l, r = map(int , input().split())\na = list(map(int , input().split()))\nif max(x) > r or min(a) < l:\n print(\"Incorrect\")\nelif n - m >= 2 :\n print(\"Correct\")\nelif:\n if l not in a and r not in a and l != r:\n print(\"Incorrect\")\n else:\n print(\"Correct\")\n", "lang": "PyPy 3", "bug_code_uid": "d5a049d395b72eb85db46f00b167f014", "src_uid": "99f9cdc85010bd89434f39b78f15b65e", "apr_id": "006ddf4abd47fdc5c1466d6f1cf827ed", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.012526096033402923, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "15 14 32 65 28 96 33 93 48 28 57 20 32 20 90 42 57 53 18 58 94 21 27 29 37 22 94 45 67 60 83 23 20 23 35 93 3 42 6 46 68 46 34 25 17 16 50 5 49 91 23 76 69 100 58 68 81 32 88 41 64 29 37 13 95 25 6 59 74 58 31 35 16 80 13 80 10 59 85 18 16 70 51 40 44 28 8 76 8 87 53 86 28 100 2 73 14 100 52 9", "lang": "Python 3", "bug_code_uid": "68e432742b70e085790253cee7d58b36", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "0b3fa4c2d733ef78cd909ba648af8460", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9203539823008849, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,k=map(int, input().split())\nfor i in range(1,10):\n if(n*i % 10 == k || n*i%10 == 0):\n print(i)", "lang": "PyPy 3", "bug_code_uid": "9361bdcd74cde1bf5a89fa4d68a291e4", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "4186b746aebc7c3d7855d21f0dd66275", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.25426136363636365, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n, m = map(int, input().split())\ngrid = [None for _ in range(n)]\nfor i in range(n):\n\tgrid[i] = list(input())\npos = []\nfor i in range(n):\n\tfor j in range(m):\n\t\tif grid[i][j] == 'W':\n\t\t\tpos.append((i, j))\nln = len(pos)\n\nmemo = {}\ndef solve(x, magic):\n\tif (x, magic) not in memo:\n\t\tif x >= ln:\n\t\t\treturn 0\n\n\t\tres = solve(x + 1, magic)\n\t\ti, j = pos[x]\n\n\t\tif j > 0 and grid[i][j - 1] == 'P':\n\t\t\tgrid[i][j - 1] = '.'\n\t\t\tres = max(res, 1 + solve(x + 1, magic + i * n + (j - 1) * m))\n\t\t\tgrid[i][j - 1] = 'P'\n\n\t\tif i > 0 and grid[i - 1][j] == 'P':\n\t\t\tgrid[i - 1][j] = '.'\n\t\t\tres = max(res, 1 + solve(x + 1, magic + (i - 1) * n + j * m))\n\t\t\tgrid[i - 1][j] = 'P'\n\n\t\tif i < n - 1 and grid[i + 1][j] == 'P':\n\t\t\tgrid[i + 1][j] = '.'\n\t\t\tres = max(res, 1 + solve(x + 1, magic + (i + 1) * n + j * m))\n\t\t\tgrid[i + 1][j] = 'P'\n\n\t\tif j < m - 1 and grid[i][j + 1] == 'P':\n\t\t\tgrid[i][j + 1] = '.'\n\t\t\tres = max(res, 1 + solve(x + 1, magic + (i + 1) * n + j * m))\n\t\t\tgrid[i][j + 1] = 'P'\n\n\t\tmemo[x] = res\n\t\treturn res\n\telse:\n\t\treturn memo[x]\n\nprint(solve(0, 0))\n", "lang": "PyPy 3", "bug_code_uid": "24a7474e77a45f93e0b9c765983383da", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "be6dfd4f8de16800541de6fb0fb4147c", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.17118402282453637, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "q = input()\nn = int(q[0])\nb = int(q[2])\np = int(q[4])\nx = (n - 1) * b * b + (n - 1)\ny = n * p\nprint(x, y)\n# Thu Oct 08 2020 11:53:37 GMT+0300 (\u041c\u043e\u0441\u043a\u0432\u0430, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f)\n\n# Thu Oct 08 2020 11:53:42 GMT+0300 (\u041c\u043e\u0441\u043a\u0432\u0430, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f)\n\n# Thu Oct 08 2020 11:53:56 GMT+0300 (\u041c\u043e\u0441\u043a\u0432\u0430, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f)\n\n# Thu Oct 08 2020 13:37:38 GMT+0300 (\u041c\u043e\u0441\u043a\u0432\u0430, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f)\n", "lang": "Python 3", "bug_code_uid": "362140238de83378bbee8b4d9e6e2759", "src_uid": "eb815f35e9f29793a120d120968cfe34", "apr_id": "51ef79de8bac1675511562af0cc1cf0d", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8861985472154964, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "from math import log, floor\n\ndef binarysearch(x, n, k, p):\n left = 0\n right = len(x)\n while left < right:\n middle = (left + right) // 2\n if sum([x[middle]//k**i for i in range(p+1)]) < n:\n left = middle + 1\n else:\n right = middle\n \n return left\n\nn, k = [int(i) for i in input().split()]\np = floor(log(n, k))\nx = list(range(n//2, n+1))\ny = binarysearch(x, n, k, p)\n\nprint(x[y])", "lang": "Python 3", "bug_code_uid": "a16c213e3b1ea6dfe448ef06bc65cbf0", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "b722aa2585aad6c6bbf74bc5fbf0d22a", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6419853539462979, "equal_cnt": 50, "replace_cnt": 24, "delete_cnt": 0, "insert_cnt": 26, "fix_ops_cnt": 50, "bug_source_code": "n = int(input())\nps = [int(x) for x in input().split()]\nto_add = [x for x in range(1,n+1) if x not in ps]\n\nif all(x==0 for x in ps):\n if n == 1:\n print(0):\n exit()\n print(1)\n exit()\n\nfor t in to_add:\n so = (101, None) # odd = 0, even = 2\n se = (101, None) # odd = 0, even = 2\n so2 = (101, None) # odd = 0, even = 1\n se2 = (101, None) # odd = 1, even = 0\n mixed = None #even, odd\n left = None\n zero_count = 0\n for i, p in enumerate(ps):\n if p == 0:\n zero_count += 1\n else:\n if zero_count > 0:\n if left is None:\n if p%2==0:\n se2 = (zero_count, i-1)\n else:\n so2 = (zero_count, i-1)\n else:\n if p%2 == 0:\n if ps[left]%2 == 0:\n se = min(se, (zero_count, left+1))\n else:\n mixed = (i-1, left+1)\n else:\n if ps[left]%2 == 0:\n mixed = (left+1, i-1)\n else:\n so = min(so, (zero_count, left+1))\n zero_count = 0\n left = i\n if zero_count > 0:\n if p%2 ==0:\n se2 = min(se2, (zero_count, left+1))\n else:\n so2 = min(so2, (zero_count, left+1))\n if t%2 == 0:\n if se[1] is not None:\n ps[se[1]] = t\n elif se2[1] is not None:\n ps[se2[1]] = t\n else:\n assert(mixed is not None)\n ps[mixed[0]] = t\n else:\n if so[1] is not None:\n ps[so[1]] = t\n elif so2[1] is not None:\n ps[so2[1]] = t\n else:\n ps[mixed[1]] = t\nans = 0\nl = None\nfor i in range(len(ps)):\n if i == 0:\n continue\n if ps[i]%2 != ps[i-1]%2:\n ans += 1\nprint(ans)\n# print(ps)\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "7406d95977c80abe6632faa60a51476d", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "828507d36950664a5618faf32fd3e2a1", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9925062447960034, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "\n\ns=input()\ns=sorted(s)\ncount=1\nfor i in range(1,len(s)):\n if(s[i]==s[i-1]):\n count+=1\n else:\n ans.append(count)\n count=1\nans.append(count)\nans.sort()\nif(len(ans)==1):\n print(1)\nif(len(ans)==2):\n if(ans[0]==1):\n print(1)\n else:\n print(2)\nif(len(ans)==3):\n if(len(set(ans))==1):\n print(6)\n elif(ans=[1,1,4]):\n print(2)\n elif(ans==[1,2,3]):\n print(3)\nif(len(ans)==4):\n if(ans==[1,1,1,3]):\n print(5)\n elif(ans=[1,1,2,2]):\n print(8)\nif(len(ans)==6):\n print(30)\nif(len(ans)==5):\n print(15)\n \n", "lang": "PyPy 3", "bug_code_uid": "1d528cbab350d13d2afa1ec46530ae4e", "src_uid": "8176c709c774fa87ca0e45a5a502a409", "apr_id": "d7fb4234a554d8980f801e65b9103ba5", "difficulty": 1700, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6594202898550725, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#coding:utf-8\n\na, b = map (int, raw_input ().split ())\nc = a+b\nans = c*2+2\n\nx, y = 1, a\nindex = 1\ni = 2\nwhile i*i <= c:\n\tif c%i == 0:\n\t\twhile index <= i:\n\t\t\tif a%index == 0:\n\t\t\t\tx, y = index, a/index\n\t\t\tindex += 1\n\t\tif x <= i and y <= c/i:\n\t\t\tans = min (ans, 2*(i+c/i))\n\ti += 1\n\n\nprint ans\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "PyPy 2", "bug_code_uid": "4e9bb9b71667bb765003818b718bee69", "src_uid": "7d0c5f77bca792b6ab4fd4088fe18ff1", "apr_id": "7d695675e811824aa97a820771aa32b2", "difficulty": 2000, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9897330595482546, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "from math import sqrt\nimport bisect\ndef divisors(n):\n s = [1]\n for i in range(2, int(sqrt(n)) + 5):\n if n % i == 0:\n s.append(i)\n if len(s) == 1:\n s.append(n)\n return s\n\nbisect_right = bisect.bisect\na, b = map(int,input().split())\ns = a + b\nk = a\ndiva = divisors(a)\ndivb = divisors(b)\ndivs = divisors(s)\nansA = 0\nansB = 0\ndiva.sort()\ndivb.sort()\nfor i in range(len(divs)):\n s = bisect_right(diva, divs[i]) - 1\n if ((a + b) / divs[i]) >= (a / diva[s]):\n ansA = 2*(divs[i] + ((a + b)/divs[i]))\nfor i in range(len(divs)):\n s = bisect_right(divb, divs[i]) - 1\n if ((a + b) / divs[i]) >= (b / divb[s]):\n ansB = 2*(divs[i] + ((a + b)/divs[i]))\nprint(int(min(ansA,ansB)))", "lang": "PyPy 3", "bug_code_uid": "f846f8dce3d594523b042e979c4d9216", "src_uid": "7d0c5f77bca792b6ab4fd4088fe18ff1", "apr_id": "6676af6ea5bada7f6c790257a017c847", "difficulty": 2000, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.39396346306592533, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import sys\nstderr = sys.stderr\ndef nums():\n return map(int, raw_input().split())\nX, Y, R1, R2 = 0, 1, 2, 3\nc1 = nums()\nc2 = nums()\ndef dist(x1, y1, x2, y2):\n return ((x1-x2)**2 + (y1 - y2)**2)**.05\ndef cok(x, y, r, c):\n d = dist(x, y, c[X], c[Y])\n if d >= r + c[R2] or d + r <= c[R1] or d + c[R2] <= r:\n return True\n\ncandi = [(c1[X], c1[Y], c1[R1], c2),\n (c1[X], c1[Y], c1[R2], c2),\n (c2[X], c2[Y], c2[R1], c1),\n (c2[X], c2[Y], c2[R2], c1)]\nans = 0\nfor x, y, r, c in candi:\n if cok(x, y, r, c):\n ans += 1\nprint ans\n", "lang": "Python 2", "bug_code_uid": "4714b07b784e989ed81924a170a4c4b4", "src_uid": "4c2865e4742a29460ca64860740b84f4", "apr_id": "a6841e88361d7c6fb97d36304ca04433", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.35294117647058826, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "x1, y1, r1, R1 = map(int, raw_input().split())\nx2, y2, r2, R2 = map(int, raw_input().split())\na = [r1, R1]\nb = [r2, R2]\ncnt = 0\nd = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5\ndef func(c1, c2):\n\tif d - c1 - c2 > -1.0e-8 or abs(c1 - c2) - d > -1.0e-8:\n\t\treturn 1\n\treturn 0\nfor c in a:\n\tcnt += func(c, b[0]) & func(c, b[1])\nfor c in b:\n\tcnt += func(c, a[0]) & func(c, a[1])\nprint cnt\n", "lang": "Python 2", "bug_code_uid": "0b5fd0e88b14962ea756d02bbba2b731", "src_uid": "4c2865e4742a29460ca64860740b84f4", "apr_id": "4f925ca264c8e7bd2819aa8ee5a39a3c", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8398203592814372, "equal_cnt": 14, "replace_cnt": 1, "delete_cnt": 11, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "MOD = 10**8\n\nn1,n2,k1,k2 = map(int,raw_input().strip().split())\n\nC = {}\ndef solve(r1,r2,lasttype,lastnum):\n count = C.get((r1,r2,lasttype,lastnum))\n if not count:\n count = 0\n if r1>0:\n if lasttype == 1:\n count += solve(r1-1,r2,0,1)\n elif lastnum0:\n if lasttype == 0:\n count += solve(r1,r2-1,1,1)\n elif lastnum 1:\n n.sort()\n a = n[len(n) - 1] - n[0]\n n.pop(len(n) - 1)\n n.pop(0)\n n.append(a)\nprint(n[0])", "lang": "Python 3", "bug_code_uid": "0583bf791bfae0fa54ea7678462fff9b", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "56e513a6bc2471fe59b4ff56f47e3969", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.38799076212471134, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "from collections import defaultdict\n#n = int(raw_input())\nn,b = [int(x) for x in raw_input().split()]\n#arr = [int(x) for x in raw_input().split()]\n\ns = 0\nd_osn = defaultdict(int)\nwhile b > 1:\n for i in range(2,b):\n if b % i == 0:\n d_osn[i] += 1\n b /= i\n break\n else:\n d_osn[b] += 1\n b = 1\n#print(d_osn)\nizv = defaultdict(int)\nfor i in range(1,n+1):\n for el in d_osn:\n while i % el == 0:\n i = i / el\n izv[el] += 1\nres = -1\n#print(izv)\nfor k in d_osn:\n mlt = 0 if k not in izv else izv[k] // d_osn[k]\n if res == -1:\n res = mlt\n elif mlt < res:\n res = mlt\nprint(res)", "lang": "PyPy 2", "bug_code_uid": "5d0cbf0f6d4bc37001f0e333dd97d80d", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "0bdae2a821a032fc1b6c8d546677351c", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3452991452991453, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "def fact(n) :\n\tif n <= 1 :\n\t\treturn 1\n\t\treturn n * fact(n - 1)\n\n\n\t\tdef c_n_k(k, n) :\n\t\treturn fact(n) / (fact(k) * fact(n - k))\n\n\n\t\tn, k = map(int, input().split())\n\t\tans = 1\n\n\t\td = [0, 1, 3, 12, 60, 124]\n\n\t\tfor i in range(k, 1, -1) :\n\t\t\tans += c_n_k(i, n) * (d[i] - d[i] // i)\n\n\t\t\t\tprint(ans)", "lang": "Python 3", "bug_code_uid": "ae27ca3f29008ee4307787492a6ce6df", "src_uid": "96d839dc2d038f8ae95fc47c217b2e2f", "apr_id": "cebd59ef3a288b2f47beb36918a60ec5", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8040278853601859, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "n, m = map(int, input().split())\na1 = [0] * n\na2 = [0] * n\nb1 = [0] * n\nb2 = [0] * n\na1[0] = 1\nb1[0] = 1\nfor i in range(1, n):\n a1[i] = b1[i - 1] + b2[i - 1]\n a2[i] = a1[i - 1]\n b1[i] = a1[i - 1] + a2[i - 1]\n b2[i] = b1[i - 1]\nans = a1[n - 1] + a2[n - 1] + b1[n - 1] + b2[n - 1]\na1 = [0] * m\na2 = [0] * m\nb1 = [0] * m\nb2 = [0] * m\na1[0] = 1\nb1[0] = 1\nfor i in range(1, m):\n a1[i] = b1[i - 1] + b2[i - 1]\n a2[i] = a1[i - 1]\n b1[i] = a1[i - 1] + a2[i - 1]\n b2[i] = b1[i - 1]\nans += a1[m - 1] + a2[m - 1] + b1[m - 1] + b2[m - 1]\nprint(ans - 2)\n", "lang": "PyPy 3", "bug_code_uid": "48c3f9b099bf6fc7cb9c9b4ad27a1c3e", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "212c19baf5a1499e1bb712c30e8a13da", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.921875, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "import sys\ninput = sys.stdin.buffer.readline\nsys.setrecursionlimit(10**7)\n\nn, m = [int(item) for item in input().split()]\nif n > m:\n n, m = m, n\nif n == 1 and m == 1:\n print(2)\n exit()\ndp = [[0] * m for _ in range(4)]\n\ndp[0][1] = 1\ndp[1][1] = 1\ndp[2][1] = 1\ndp[3][1] = 1\n\nfor i in range(2, m):\n dp[0][i] += dp[2][i-1] \n dp[1][i] += dp[0][i-1] \n dp[1][i] += dp[2][i-1] \n dp[2][i] += dp[1][i-1] \n dp[2][i] += dp[3][i-1] \n dp[3][i] += dp[1][i-1] \n\n# for line in dp:\n# print(line)\nlr = 0\nud = 0\n\nfor i in range(4):\n lr += dp[i][m-1]\n ud += dp[i][n-1]\n\nif n == 1:\n print(lr)\n exit()\nelse:\n print(lr + ud - 2)", "lang": "PyPy 3", "bug_code_uid": "97619024febb1ad3377a5567a72980fc", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "359ede76bc73a16cb0c39fd356e338f5", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5104761904761905, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "has_time = 4*60\ndef findNumTask(n, time):\n i = 0\n leftTime = has_time\n while leftTime >= time and n-i >= 0:\n i+=1\n leftTime -= i*5\n \n return i-1\n\nn, time = int(input()), int(input())\nreturn findNumTask(n,time)", "lang": "Python 3", "bug_code_uid": "0db4f9587118cd7df4750e0b637dd268", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "a977fdf600ccb09237ffc5da5d62db2b", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9733044733044733, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "z,zz=input,lambda:list(map(int,z().split()));\nszz,dgraphs,mod=lambda:sorted(zz()),{},10**9+7\nfrom string import *\nfrom collections import *\nfrom queue import *\nfrom sys import *\nfrom collections import *\nfrom math import *\nfrom heapq import *\nfrom itertools import *\nfrom bisect import *\nfrom collections import Counter as cc\nfrom math import factorial as f\ndef lcd(xnum1,xnum2):return (xnum1*xnum2//gcd(xnum1,xnum2))\ndef prime(x):\n p=ceil(x**.5)+1\n for i in range(2,p):\n if x%i==0 and x!=2:return 0\n return 1\ndef dfs(u,visit,graph):\n visit[u]=True\n for i in graph[u]:\n if not visit[i]:\n dfs(i,visit,graph)\n################################################################################\n\n\"\"\"\n\nled=(6,2,5,5,4,5,6,3,7,6)\n\ncolor4=[\"G\", \"GB\", \"YGB\", \"YGBI\", \"OYGBI\" ,\"OYGBIV\",'ROYGBIV' ]\n\n\"\"\"\n\n###########################---START-CODING---####################################\n\nl=zz()\n\nans=-1\n\nfor i,j in enumerate(l):\n p=l[:]\n \n p[i]=0\n n=j//14\n ex=j%14\n \n m=i+1\n for _ in range(ex):\n if m==13:\n p[m]=(p[m]+1)\n m=0\n else:\n p[m]=(p[m]+1)\n m+=1\n\n for k in range(14):\n p[k]=(p[k]+n)\n\n t=0\n for i in p:\n if i%2==0:\n t+=i\n\n if t>ans:\n ans=t\nprint(ans) \n\n \n \n \n \n\n \n\n\n\n\n\n\n\n\n \n\n", "lang": "PyPy 3", "bug_code_uid": "24a74727b973aa1b2b9e2038dfadb3aa", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "8e001865709050af06858960f433f823", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.446, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "\n def is_leap_year(year):\n if year % 400 == 0:\n return True\n if year % 100 == 0:\n return False\n if year % 4 == 0:\n return True\n return False\n\nstart_year = int(input())\nif is_leap_year(start_year):\n print(start_year + 28)\nelse:\n next_year = start_year + 1\n diff = 1\n if is_leap_year(next_year - 1):\n diff += 1\n\n while diff % 7 != 0:\n diff += 1\n next_year += 1\n if is_leap_year(next_year - 1):\n diff += 1\n print(next_year)", "lang": "Python 3", "bug_code_uid": "1e3f7f646614d97b7eae84b784392fa7", "src_uid": "565bbd09f79eb7bfe2f2da46647af0f2", "apr_id": "6ddee26cc21a17f562b3d0a224cbec50", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9980657640232108, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def is_visok(x):\n return x % 400 == 0 or x % 4 == 0 and x % 100 != 0\n\ny = int(input())\n\nd, v = 0, is_visok(y)\nyear = y\n\nd_ = d\nv_ = not v\n\nwhile not (v_ == v and d_ % 7 = 0):\n year += 1\n v_ = is_visok(year)\n d_ += (365, 366)[v_] % 7\n\nprint(year)\n", "lang": "Python 3", "bug_code_uid": "0a71c3bd5e61349a0c5541acb6bf5987", "src_uid": "565bbd09f79eb7bfe2f2da46647af0f2", "apr_id": "9cf725ae55705c01088510885558314a", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.336480686695279, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "def main():\n n, m, k = map(int, input().split())\n if n < m:\n n, m = m, n\n lo, hi = 2, min(n * m, (k + 1) ** 2 // 2) + 1\n while lo < hi:\n a = (lo + hi) // 2\n u = sum(a // i for i in range(a // n + 1, (m if m < a else a) + 1)) + a // n * n\n if u < k:\n lo = a + 1\n elif u > k:\n hi = a\n else:\n lo = hi = a\n res = [hi // i * i for i in range(hi // n + 1, (m if m < hi else hi) + 1)] + [n] * (a // n)\n res.sort(reverse=True)\n print(res[u - k])\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "65869ba8759a532c0755b4d7ec314965", "src_uid": "13a918eca30799b240ceb9de47507a26", "apr_id": "4d542a6ade84d82e8bb7f2571af365a3", "difficulty": 1800, "tags": ["brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.13486590038314175, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "[n, m, k] = raw_input(\"\").split(\" \")\n[n, m, k] = [int(n), int(m), int(k)]\n\na = [0 for i in range(0, n*m)]\n\nfor i in range(0, n):\n for j in range(m):\n a[i+n*j] = (i+1)*(j+1)\na.sort()\nprint a[k-1]", "lang": "Python 2", "bug_code_uid": "7075d595d6566061f6daf8c76c67d60c", "src_uid": "13a918eca30799b240ceb9de47507a26", "apr_id": "783417a026db31c78d602b4492bdc58f", "difficulty": 1800, "tags": ["brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9770992366412213, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "from math import floor\nfrom math import sqrt\na=int(input())\nsqr=floor(sqrt(a))\nf2=sqr\nwhile sqr*f2= n:\n ans = min(ans, (i+j)*2)\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "db6c6e7fe47dfbae52defe8738c1830e", "src_uid": "414cc57550e31d98c1a6a56be6722a12", "apr_id": "ed89af48b9c74ec7884126a0ec84ce2e", "difficulty": 1000, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.014905474811496011, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "from math import *\n\nn=input()\nm = 120000\nx=[]\nfor i in range(m):\n x.append(True)\n\nfor i in range(2,int(sqrt(m))):\n if x[i]:\n for k in range(2*i, m, i):\n\n x[k] = False\n\nx[0] = False\nx[1] = False\n\ny=[]\nfor i in range(m):\n r = int(str(i)[::-1])\n if x[i] and r < m and x[r] and r!=i:\n y.append(i)\n\nprint y[n-1]\n", "lang": "Python 2", "bug_code_uid": "000adde4595a940162d556a88cd11890", "src_uid": "53879e79cccbacfa6586d40cf3436657", "apr_id": "b636c6db70f388fd9aae83f1dcfad1e8", "difficulty": 1600, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23853211009174313, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n=int(input())\nif f%35==0:\n f=n//36+1\nelse:\n f=n//36\nr=n%36\n if r%3==0:\n i=r//3\n elif r%3==1:\n i=r//3\n elif r%3==2:\n i=r//3+1\nprint(f,i)\n\n", "lang": "Python 3", "bug_code_uid": "31df8ae5d32f9398bae6886aac707f5a", "src_uid": "5d4f38ffd1849862623325fdbe06cd00", "apr_id": "36d295b6873f7c2192b889f4e33599b0", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9770114942528736, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n, k = map(int, raw_input().split())\na = map(int, raw_input().split())\nans = 0\n\nfor i in xrange(n / k):\n t1 = t2 = 0\n for j in xrange(k):\n if a[i * k + j] == 1:\n t1 += 1\n else:\n t2 += 1\n ans += min(t1, t2)\nprint ans\n", "lang": "Python 2", "bug_code_uid": "5b958fcd689cc82a09e93a68897f50aa", "src_uid": "5f94c2ecf1cf8fdbb6117cab801ed281", "apr_id": "b5270882a1b04b4ff19f36e170df83aa", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9985693848354793, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "m, s = map(int, input().split())\n\nans = []\nflag = 0\ntemp = 0\nif s!=0:\n while s >= 0 and s//9 0:\n ans.append(9)\n s -= 9\n else:\n ans.append(s)\n s = 0\n continue\n\n if s==0 and temp=5:\n A=0\n a=0\n d=0\n for i in s:\n if A>0 and a>0 and d>0:\n break\n if i>='a' and i<='z':\n a=a+1\n elif i>='A' and i<='Z':\n A+=1\n try:\n k=int(i)\n d=d+1\n else:\n pass\n if A>0 and a>0 and d>0:\n print('Correct')\n else:\n print('Too weak')\nelse:\n print('Too weak')", "lang": "Python 3", "bug_code_uid": "efa4b67656e3bd4fa781999a023abcb7", "src_uid": "42a964b01e269491975965860ec92be7", "apr_id": "d099bbcf9ee567bee58b295c913dd571", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9642857142857143, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=int(input())\nprint(n//2*3)", "lang": "PyPy 3", "bug_code_uid": "0f3e210866d2e70fe0bca6cc110e920e", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "998750dec98128e1ca1924a042f07002", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9988950276243094, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import re\ns = input()\nif '@' not in s:\n\tprint('NO')\n\texit()\nu, h = s.split('@', 1)\nr = None\nif '/' in h:\n\tif '/' in h[h.index('/') + 1: ]:\n\t\tprint('NO')\n\t\texit()\n\th, r = h.split('/')\nif not re.match('^\\w{1,16}$', u):\n\tprint('NO')\nelif r is not None and not re.match('^\\w{1,16}$', r):\n\tprint('NO')\nelif 1 > len(h) or len(h) > 32:\n\tprint('NO')\nelse:\n\th = h.split('.')\n\tif any(not re.match('^\\w{,16}$', x) for x in h):\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "lang": "Python 3", "bug_code_uid": "7c602acd59bb327713032dc5145767c9", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "d01990d6f80b3a0df811e752f90b0bdb", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9812734082397003, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = raw_input()\nl = [i for i in raw_input().split()]\ncount = 0\ni = 0\nwhile l[i] == '0':\n i += 1\nj = i\nwhile j < len(l):\n if l[j] == '1':\n count += 1\n j += 1\n flag = 0\n else:\n if j + 1 < len(l) and l[j + 1] == '1' and flag == 0:\n count += 1\n j += 1\n flag = 1\n else:\n j += 1\n flag = 1\nprint count", "lang": "PyPy 2", "bug_code_uid": "1a020aa032ab44d06a2c278f2afdf2a5", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "940ae03d7acaa1da11c1fc6d87be10cf", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.265625, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import math\nn_and_c=raw_input().split(' ')\nn=int(n_and_c[0])\nc=int(n_and_c[1])\ncount=0\ni=1\nwhile i<=n:\n count+=math.factorial(c+i-1)/(math.factorial(c-1)*math.factorial(i))\n i+=1\nprint count\nprint count % (10**6+3)\n", "lang": "Python 2", "bug_code_uid": "621cda58d19aba14a5f1fdbd04ef01ef", "src_uid": "e63c70a9c96a94bce99618f2e695f83a", "apr_id": "9afadfa0f446970279894ca5f475bff9", "difficulty": 1800, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2685624012638231, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import math\nn_and_c=raw_input().split(' ')\nn=int(n_and_c[0])\nc=int(n_and_c[1])\ncount=0\ni=1\nwhile i<=n:\n count+=math.factorial(c+i-1)/(math.factorial(c-1)*math.factorial(i))\n i+=1\nprint count % (10**6+3)\n \n", "lang": "Python 2", "bug_code_uid": "a1129b7d3b51edcb5d613f3fc76110fd", "src_uid": "e63c70a9c96a94bce99618f2e695f83a", "apr_id": "9afadfa0f446970279894ca5f475bff9", "difficulty": 1800, "tags": ["combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9241223103057757, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 8, "bug_source_code": "#236B\n\nimport math\n\narr = list(map(int, input().split(\" \")))\na = arr[0]\nb = arr[1]\nc = arr[2]\n\ndef numdiv(n):\n\tcount = 0\n\tfor i in range(1, int(math.sqrt(n) + 1)):\n\t\tif n % i == 0:\n\t\t\tcount += 2\n\tif int(math.sqrt(n)) * int(math.sqrt(n)) == n:\n\t\tcount -= 1\n\treturn count\n\nanswer = 0\nfor i in range(1, a + 1):\n\tfor j in range(1, b + 1):\n\t\tfor k in range(1, c + 1):\n\t\t\tanswer += numdiv(i * j * k)\n\nprint(answer)", "lang": "PyPy 3", "bug_code_uid": "d93d8ae125b010b76ad526d270c6a53f", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "8c49e45cbcc7708664f8f1e643302e9d", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8738461538461538, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k=[int(n) for n in input().split()]\ns=set()\nfor i in range(1,k+1):\n s.add(n%i)\nif(len(s)==k):\n print(\"Yes\")\nelse:\n print(\"No\")\n ", "lang": "PyPy 3", "bug_code_uid": "7472d8d22ac689825e1b79870899185f", "src_uid": "5271c707c9c72ef021a0baf762bf3eb2", "apr_id": "c2da2e348a5ec82038865105e568ebfd", "difficulty": 1600, "tags": ["brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9632398753894081, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n = int(input())\nf = []\nX = []\nY = []\nfor i in range(4 * n + 1):\n x, y = map(int, input().split())\n f.append((x, y))\n X.append(x)\n Y.append(y)\nl = min(X)\nr = max(X)\nd = min(Y)\nu = max(Y)\nif r - l == u - d:\n for i in f:\n if X.count(i[0]) == 1 and Y.count(i[1]) == 1:\n print(i[0], i[1])\n break\n for i in f:\n if l < i[0] < r and d < i[1] < u:\n print(i[0], i[1])\n break\nelse:\n for i in f:\n if X.count(i[0]) == 1 and Y.count(i[1]) == 1:\n print(i[0], i[1])\n break\n for i in f:\n if X.count(i[0]) == 1 and (i[0] == l or i[0] == R):\n print(i[0], i[1])\n break\n elif Y.count(i[1]) == 1 and (i[1] == u or i[1] == d):\n print(i[0], i[1])\n break\n", "lang": "Python 3", "bug_code_uid": "7c12ebfedb57c19c0dc26dd8f84ca23b", "src_uid": "1f9153088dcba9383b1a2dbe592e4d06", "apr_id": "d5b0f3a0833bb2c80c315dbafdb5ee35", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8688783570300158, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#!usr/bin/env/python\npath = raw_input()\nnew_path = ''\nflag = 0\nfor i in xrange(len(path)):\n\tif path[i] == '/' and flag:\n\t\tpass\n\telif path[i] == '/':\n\t\tflag = 1\n\t\tnew_path += path[i]\n\telse:\n\t\tflag = 0\n\t\tnew_path += path[i]\nwhile new_path[-1] == '/':\n\tnew_path = new_path[:-1]\nif new_path:\n\tprint new_path\nelse:\n\tprint '/'\n", "lang": "Python 2", "bug_code_uid": "873734738586f3f7107671bd1c7e35fe", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "45c161751c24f61e1ba3c0ec7272a2ce", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5619834710743802, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "s = raw_input()\nn = len(s)\nst = \"\"\nfor i in range(n):\n if s[i]=='/' and s[i+1]=='/':\n continue\n else:\n st += s[i]\nprint st\n", "lang": "Python 2", "bug_code_uid": "1aac633d4e58c9705befb0385185025d", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "87d714a1cd0bdcff45f2168161d3de09", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9808219178082191, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n ,m ,k = map(int,input().split())\nl = list(map(int,input().split()))\nl[m-1] = \"G\"\np = m-1\no = m-1\nwhile True:\n o -= 1\n p += 1\n try:\n if l[p]!=0 and l[p]<=k:\n print((p-(m-1))*10)\n break\n except:\n pass\n try:\n if l[o]!=0 and l[o]<=k and o>0:\n print((m-1-o)*10)\n break\n except:\n pass\n", "lang": "Python 3", "bug_code_uid": "14ee27394e33dcf50d9b5e5d4c16cbd1", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "36934d6e2b31e52e7d1064058c6c51c9", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7417218543046358, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import math as m\nk, n, s, p = map(int, input().split())\ni = 1\nwhile True:\n needed_sheets = k * m.ceil(n/s)\n if i * p >= needed_sheets:\n break\n i += 1\nprint(i)", "lang": "Python 3", "bug_code_uid": "4c62944f3328a22e335f4b8d8a9af957", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "fcbf14a7b41285e7bd668b95fec20d18", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7262569832402235, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "k, n, s, p = map(int, input().split())\nx = 0\nwhile ((x * p) // k) * s < n:\n x += 1\nprint(x)", "lang": "Python 3", "bug_code_uid": "c39190d4e78bd0250211435fe663156b", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "3939d810cf725d992e5f29e239a3b581", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.38304552590266877, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "from math import *\nn,m=map(int,input().split())\nif m==1:print(n*(n-1)//2,n*(n-1)//2)\nelse:\n minim=[n//m+1 for i in range(n%m)]\n for i in range(m-(n%m)):\n minim.append(n//m)\n maxim=[1 for i in range(m-1)]\n maxim.append(n-m+1)\n# minim.append(n-sum(minim))\n sum1,sum2=0,0\n for i in minim:sum1+=i*(i-1)//2\n for i in maxim:sum2+=i*(i-1)//2\n print(sum1,sum2)\n \n ", "lang": "PyPy 3", "bug_code_uid": "837d4f4a2017a67cfc6de574381f52dd", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "bceafd674202a48e57af743b1008fd54", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3964476021314387, "equal_cnt": 22, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 15, "fix_ops_cnt": 21, "bug_source_code": "#import sys\n#sys.stdin = open('in', 'r')\n#n = int(input())\n#a = [int(x) for x in input().split()]\nclass minheap:\n def __init__(self, n):\n self.a = [0 for i in range(n)]\n self.n = 0\n\n def __init__(self):\n self.a = []\n self.n = 0\n\n def load(self, initial):\n self.a = [] + initial\n self.n = len(self.a)\n for i in range((self.n-2) // 2, -1, -1):\n self.hdown(i)\n\n def hup(self, ind):\n if ind > 0:\n parent = (ind - 1) // 2\n if self.a[parent] > self.a[ind]:\n tmp = self.a[ind]\n self.a[ind] = self.a[parent]\n self.a[parent] = tmp\n self.hup(parent)\n\n def hdown(self, ind):\n l = ind*2 + 1\n r = ind*2 + 2\n newind = ind\n if l < self.n and self.a[newind] > self.a[l]:\n newind = l\n if r < self.n and self.a[newind] > self.a[r]:\n newind = r\n if newind != ind:\n tmp = self.a[ind]\n self.a[ind] = self.a[newind]\n self.a[newind] = tmp\n self.hdown(newind)\n\n def push(self, v):\n if self.n == len(self.a):\n self.a.append(v)\n else:\n self.a[self.n] = v\n self.hup(self.n)\n self.n += 1\n \n def pop(self):\n if self.n > 0:\n res = self.a[0]\n self.n -= 1\n if self.n > 0:\n self.a[0] = self.a[self.n]\n self.a[self.n] = 0\n self.hdown(0)\n return res\n else:\n raise \"empty heap\"\n\nn,x,y = map(int, input().split())\n\nh = minheap()\nd = {}\nh.push((0, n))\n\nr = -1\nwhile r == -1:\n xh,nh = h.pop()\n if nh not in d:\n d[nh] = xh\n if nh == 1:\n r = xh + x\n else:\n if (nh - 1) not in d:\n h.push((xh + x, nh - 1))\n if nh & 1 == 0 and (nh // 2) not in d and y < (nh//2)*x:\n h.push((xh + y, nh // 2))\n if (nh + 1) not in d:\n h.push((xh + x, nh + 1))\n \n \n\nprint(r)\n", "lang": "Python 3", "bug_code_uid": "539c6b44fb15b4b829df54abc62b3fa2", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "cdffa85674089d80967a82cb4c08c880", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.07430340557275542, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "n, x, y = map(int, input().split())\n\nF = [0] * (n + 1 + max( x, y))\nF[1] = x\nF[2] = F[1] + min(y, x) \n\n\nfor i in range(3, n + 1):\n if i % 2 == 0:\n F[i] = min(F[i - 1] + x, F[i//2] + y)\n else:\n F[i] = F[i - 1] + x\n\nprint(F[n])", "lang": "Python 3", "bug_code_uid": "50d5c8b4cda487df4455729e149f02d0", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "56ab6bbd2fec8d0374d89d7d81012f95", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5748502994011976, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "t,s,k = map(int, input().split())\n\nt-=1\nk-=1\n\nsat=[0]*100000000\n\nfor i in range(t,k+s,s):\n sat[i]=1\n if i!=t:\n sat[i+1]=1\n\nprint(\"YES\" if sat[k]==1 else \"NO\")\n", "lang": "Python 3", "bug_code_uid": "5a0fc12d5ff17182e17b4436b7dc738f", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "005b6de1817c8a8b204aceb2a5e34284", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8094660194174758, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n = input()[::-1]\nc0 = n.count('0')\nc2 = n.count('2')\nc5 = n.count('5')\nc7 = n.count('7')\ns = 1e9\nif c0 > 1:\n i = n.find('0')\n j = n.find('0', i + 1)\n s = min(s, i + j - 1)\nif c2 and c5:\n i = n.find('2')\n j = n.find('5')\n r = j + i - 1 + (j > i)\n i, j = sorted([i, j])\n m = n[:i] + n[i + 1: j] + n[j + 1:]\n if not (m and m[-1] == '0'):\n s = min(s, r)\nif c5 and c0:\n i = n.find('5')\n j = n.find('0')\n s = min(s, j + i - 1 + (j > i))\nif c7 and c5:\n i = n.find('7')\n j = n.find('5')\n r = j + i - 1 + (j > i)\n i, j = sorted([i, j])\n m = n[:i] + n[i + 1: j] + n[j + 1:]\n if not (m and m[-1] == '0'):\n s = min(s, r)\nprint(-1 if s == 1e9 else s)\n", "lang": "Python 3", "bug_code_uid": "32aca3cfc4f70642de04320e1ed639d6", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "fffcc98b7e9d1c2dc96de8c2b5f2b9b1", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9776407093292213, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "l = [int(e) for e in input().strip()]\n\ndef lei00(l):\n result = []\n for i in range(len(l)-1, -1, -1):\n if l[i] == 0:\n result.append(i)\n if len(result) == 2:\n break\n if len(result) < 2:\n return None\n return 2 * len(l) - result[0] - result[1] - 3\n\ndef lei(l, x, y):\n assert x != y\n\n ix = None\n iy = None\n\n for i in range(len(l)-1, -1, -1):\n if l[i] == x:\n ix = i\n elif l[i] == y:\n iy = i\n\n if ix != None and iy != None:\n break\n\n if ix == None or iy == None:\n return None\n\n result = 2 * len(l) - ix - iy - 3\n\n if ix > iy:\n result += 1\n\n if x == 7 or x == 2:\n assert y == 5\n if iy == 0 and l[1] == 0:\n if len(l) >= 4:\n iii = 1\n while True:\n iii += 1\n if l[iii] != 0:\n break\n result += iii-1\n if len(l) == 3:\n return None\n\n\n\n\n return result\n\n\nl = [lei00(l), lei(l, 5, 0), lei(l, 7, 5), lei(l, 2, 5)]\n\n\nresult = None\nfor e in l:\n if e == None:\n continue\n if result == None or result > e:\n result = e\n\nif result == None:\n print(-1)\nelse:\n print(result)\n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "f07aeead401c530534d0eb40a99f09f5", "src_uid": "ea1c737956f88be94107f2565ca8bbfd", "apr_id": "6d11a3515aa82c000caf45b4de3a26d9", "difficulty": 2100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9890710382513661, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "k, n, m = map(int, raw_input().split())\na = map(int, raw_input().split())\ns = sum(a)\na.sort()\nans = 0\nfor i in xrange(m / s + 1):\n p = i * (n + 1)\n t = m - i * s\n for x in a:\n if t >= x * (k - i):\n t -= x * (k - i)\n p += k - i\n else:\n p += t / x\n break\n if ans < p:\n ans = p\nprint ans\n", "lang": "Python 2", "bug_code_uid": "0c74e655a56791978e203d408d7baffa", "src_uid": "d659e92a410c1bc836be64fc1c0db160", "apr_id": "363779e7bddc42da2a80944f3f275ed6", "difficulty": 1800, "tags": ["brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5962732919254659, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "x=int(input())\nb=[str(i) for i in input().split()]\n# print(b)\nhh=b[0]\t\nmm=b[1]\nif hh[0]==\"0\":\n\thh=hh[1:]\n\thh=int(hh)\nif mm[0]==\"0\":\n\tmm=mm[1:]\n\tmm=int(mm)\n\n# print(hh,mm)\n\nnh=hh\nnm=mm\nf=0\ny=0\nwhile(f==0):\n\tnh=str(nh)\n\tnm=str(nm)\t\n\tif '7' in nh or '7' in nm:\n\t\tf=1\n\t\tbreak\n\tnh=int(nh)\n\tnm=int(nm)\n\tif x>nm:\n\t\td= x-nm\n\t\tif nm==0:\n\t\t\tnm=23\n\t\telse:\n\t\t\tnm-=1\n\t\tnm= 60-d\n\telse:\n\t\tnm-=x\n\ty+=1\n\nprint(y)\n\n\n\n\n\n\n\n\n\n\n\n\n'''\n\n\n'''\n\t", "lang": "Python 3", "bug_code_uid": "cc44585450d530e82d43b5471d998a2f", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "c071c49d61f7b9b698aa31bd4eeca382", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6493506493506493, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": " n,k = map(int, input().split())\nN=ceil(2*n/k)+ceil(5*n/k)+ceil(8*n/k)", "lang": "Python 3", "bug_code_uid": "5fdb964fa0ec1f39158cf02a163d8acd", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "bc6e123df7427d74365368d0de0698a0", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5343511450381679, "equal_cnt": 25, "replace_cnt": 13, "delete_cnt": 9, "insert_cnt": 3, "fix_ops_cnt": 25, "bug_source_code": "n, k = map(int, input().split())\nflag = True\nx = 0\nwhile flag == True:\n\tif (x % k) * (x // k) == n:\n\t\tprint(x)\n\t\tflag = False\n\tx = x + 1", "lang": "Python 3", "bug_code_uid": "7ea140cb45948118ea5441b648954fc3", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "apr_id": "6f6729bd41b9226c9600537dd77bcd35", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.26006191950464397, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "\"\"\"609C\"\"\"\n# import math\n\ndef main():\n\tk ,a, b = map(int,input().split())\n\tmx = max(a,b)\n\tmn = min(a,b)\n\tcnt=0\n\twhile True:\n\t\ttemp = mx\n\t\ttemp2 = mn\n\t\tif temp-k<0:\n\t\t\tprint(-1)\n\t\t\treturn\n\t\telif temp-k==0:\n\t\t\tcnt+=1\n\t\t\tprint(cnt)\n\t\t\treturn\n\t\telse:\n\t\t\tcnt+=1\n\t\t\tmx = max(temp,temp2)\n\t\t\tmn = min(temp,temp2)\t\n\treturn\n\n\nmain()\n# t= int(input())\n# while t:\n# \tmain()\n# \tt-=1", "lang": "Python 3", "bug_code_uid": "ec04ad89ea70ea29ae2a2211415a0be4", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "eaf875464846fd6bd16bc27f04eb4595", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.059113300492610835, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import math\n\nimport sys \n \nsys.setrecursionlimit(10**6)\ndef proA(n,co):\n global a,c,b\n if(n==0):\n return co\n if(n<0):\n return -math.inf\n maxi=0\n for i in [a,b,c]:\n maxi=max(maxi,proA(n-i,co+1))\n return maxi\n \narr=list(map(int,input().split()))\nn,a,b,c=arr\nprint(proA(n,0))", "lang": "PyPy 3", "bug_code_uid": "cb11b2ed89f62b3ad19703947581d082", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "6c69f19b185ec04aadb8894b2680a7b1", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9585172109443955, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 9, "bug_source_code": "import sys\nimport math\n\ndef dist(a, b):\n return math.sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]))\n\ndef samep(a, b):\n EPS = 0.01\n if a - b < -EPS or a - b > EPS:\n return False\n return True\n\ndef same(a, b):\n return samep(a[0], b[0]) and samep(a[1], b[1])\n\ndef stat(a, tata):\n if tata[a] == a:\n return a\n x = stat(tata[a], tata)\n tata[a] = x\n return x\n\ndef unesc(a, b, tata):\n y = stat(b, tata)\n x = stat(a, tata)\n if x != y:\n tata[x] = y\n return\n\n#fin = open('cerc.in', 'r')\n#fout = open('cerc.out', 'w')\nfin = sys.stdin\nfout = sys.stdout\nn = int(fin.readline())\na = []\nfor i in range(0, n):\n a.append(tuple([int(number) for number in fin.readline().split()]))\n#find V\npnt = []\npntc = []\nfor i in range(0, n):\n for j in range(i + 1, n):\n if a[i][0] != a[j][0] or a[i][1] != a[j][1]:\n a0, a1, a2 = a[i]\n b0, b1, b2 = a[j]\n c0 = 2 * (b0 - a0)\n c1 = 2 * (b1 - a1)\n c2 = -a0 * a0 + -a1 * a1 + a2 * a2 + b0 * b0 + b1 * b1 - b2 * b2\n npoints = []\n if c0 == 0:\n y0 = c2 / c1\n x1 = a2 * a2 - (y0 - a1) * (y0 - a1)\n x0 = math.sqrt(x1) + a0\n npoints.append((-x0, y0), (x0, y0))\n else:\n d0 = -c1 / c0\n d1 = c2 / c0\n e0 = (d0 * d0 + 1)\n e1 = 2 * d0 * (d1 - a0) - 2 * a1\n e2 = (d1 - a0) * (d1 - a0) + a1 * a1 - a2 * a2\n dt = e1 * e1 - 4 * e2 * e0\n if dt >= 0:\n y0 = (-e1 - math.sqrt(dt)) / (2 * e0)\n y1 = (-e1 + math.sqrt(dt)) / (2 * e0)\n x0 = d0 * y0 + d1\n x1 = d0 * y1 + d1\n npoints.append((x0, y0))\n npoints.append((x1, y1))\n for np in npoints:\n g = 0\n for poz in range(0, len(pnt)):\n if same(pnt[poz], np):\n g = 1\n pntc[poz].add(i)\n pntc[poz].add(j)\n break;\n if g == 0:\n pnt.append(np)\n pntc.append(set({i, j}))\npntc = [list(x) for x in pntc]\nV = len(pnt)\n#find C\ntata = list(range(0, n))\nC = 1\nfor p in range(0, V):\n for i in range(0, len(pntc[p])):\n for j in range(i + 1, len(pntc[p])):\n unesc(pntc[p][i], pntc[p][j], tata)\nfor p in range(0, n):\n if tata[p] == p:\n C += 1\n#find E\nE = 0\nfor p in range(0, V):\n for x in pntc[p]:\n E += 1\nF = E + C - V\nfout.write(repr(F))\nif fin != sys.stdin:\n fin.close()\n fout.close()\n", "lang": "PyPy 3", "bug_code_uid": "85372f00ccb7f11007f714d9f94d2aec", "src_uid": "bda5879e94a82c6fd499796f258c4691", "apr_id": "879ae72916016c1bfd4b06fe5cf01635", "difficulty": 2700, "tags": ["graphs", "geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9735449735449735, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "c = 97\nd = 0\nfor i in map(ord,input()):\n e = abs(c-i)\n f += min(e,26-e)\n c=i\nprint(f)\n", "lang": "Python 3", "bug_code_uid": "c07f61a75650288a3d25f7fc969254a4", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "d1e3c8e81b3c16ef98135122307d6c57", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9947643979057592, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\n\nN = int(input())\n\nfactor1 = 1\nSQ = int(math.sqrt(t)) + 1\n\nfor i in range(2, SQ):\n\tif N % i == 0:\n\t\tfactor1 = i\n\t\tbreak\n\nfactor2 = N // factor1\n\nprint(str(factor1) + str(factor2))", "lang": "Python 3", "bug_code_uid": "f4a13775d9bca8d9ff455456dee73005", "src_uid": "7220f2da5081547a12118595bbeda4f6", "apr_id": "e1c27f7dac54f08d9ee40f19e15d5b5d", "difficulty": null, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5123042505592841, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "import itertools\nimport sys\n\ndef c(s):\n\tj = 0\n\twhile j < len(s) / 2:\n\t\tif s[j] == s[len(s)-j-1]:\n\t\t\tj += 1\n\t\t\tcontinue\n\t\telse:\n\t\t\treturn False\n\treturn True\n\ns = raw_input()\ntemp = []\nfor i in range(len(s)):\n\ttemp += list(itertools.combinations(s, i+1))\n\nsu = []\nfor i in range(len(temp)):\n\tsu.append(''.join(temp[i]))\n\n\nfor j in range(len(su)-1, -1, -1):\n\tif not c(su[j]):\n\t\tprint len(su[j])\n\t\tsys.exit()\n\nif c(su[len(su) - 1]):\n\tprint 0\nelse:\n\tprint len(s)\n", "lang": "Python 2", "bug_code_uid": "787329c3d5a0b8b8ee4dd48d21af9f1b", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "d098cd1935a9d191e05ff52d4d9aa19a", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9927913940334923, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "\"\"\"Template for Python Competitive Programmers prepared by pa.n.ik, kabeer seth and Mayank Chaudhary \"\"\"\n\n# to use the print and division function of Python3\nfrom __future__ import division, print_function\n\n\"\"\"value of mod\"\"\"\nMOD = 998244353\nmod = 10**9 + 7\n\n\"\"\"use resource\"\"\"\n# import resource\n# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])\n\n\"\"\"for factorial\"\"\"\n\ndef prepare_factorial():\n fact = [1]\n for i in range(1, 200005):\n fact.append((fact[-1] * i) % MOD)\n ifact = [0] * 200005\n ifact[200004] = pow(fact[200004], MOD - 2, MOD)\n for i in range(200004, 0, -1):\n ifact[i - 1] = (i * ifact[i]) % MOD\n\n return fact, ifact\n\n\"\"\"uncomment next 4 lines while doing recursion based question\"\"\"\n# import threading\n# threading.stack_size(1<<27)\nimport sys\n# sys.setrecursionlimit(10000)\n\n\n\"\"\"uncomment modules according to your need\"\"\"\nfrom bisect import bisect_left, bisect_right, insort\n# from itertools import repeat\nfrom math import floor, ceil, sqrt, degrees, atan, pi, log, sin, radians\nfrom heapq import heappop, heapify, heappush\n# from random import randint as rn\n# from Queue import Queue as Q\nfrom collections import Counter, defaultdict, deque\n# from copy import deepcopy\n# from decimal import *\nimport re\nimport operator\n\n\ndef modinv(n, p):\n return pow(n, p - 2, p)\n\ndef ncr(n, r, fact, ifact): # for using this uncomment the lines calculating fact and ifact\n t = (fact[n] * (ifact[r]*ifact[n-r]) % MOD)% MOD\n return t\n\n\ndef get_ints(): return map(int, sys.stdin.readline().strip().split())\ndef get_array(): return list(map(int, sys.stdin.readline().strip().split()))\ndef input(): return sys.stdin.readline().strip()\n\n\"\"\"*****************************************************************************************\"\"\"\n\ndef GCD(x, y):\n while (y):\n x, y = y, x % y\n return x\n\ndef lcm(x, y):\n return (x*y)//(GCD(x, y))\n\ndef get_xor(n):\n return [n,1,n+1,0][n%4]\n\ndef fast_expo(a, b):\n res = 1\n while b:\n if b&1:\n res = (res * a)\n res %= MOD\n b -= 1\n else:\n a = (a* a)\n a %= MOD\n b>>=1\n res %= MOD\n return res\n\n\"\"\" ********************************************************************************************* \"\"\"\n\ndef main():\n\n fact, ifact = prepare_factorial()\n n, m = get_ints()\n\n ans = ((ncr(m, n-1, fact, ifact) * (n-2))%MOD * fast_expo(2, n-3))%MOD\n print(ans)\n\n\n\"\"\" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------\"\"\"\n\npy2 = round(0.5)\nif py2:\n from future_builtins import ascii, filter, hex, map, oct, zip\n range = xrange\n\nimport os, sys\nfrom io import IOBase, BytesIO\n\nBUFSIZE = 8192\n\nclass FastIO(BytesIO):\n newlines = 0\n\n def __init__(self, file):\n self._file = file\n self._fd = file.fileno()\n self.writable = \"x\" in file.mode or \"w\" in file.mode\n self.write = super(FastIO, self).write if self.writable else None\n\n def _fill(self):\n s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])\n return s\n\n def read(self):\n while self._fill(): pass\n return super(FastIO, self).read()\n\n def readline(self):\n while self.newlines == 0:\n s = self._fill();\n self.newlines = s.count(b\"\\n\") + (not s)\n self.newlines -= 1\n return super(FastIO, self).readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.getvalue())\n self.truncate(0), self.seek(0)\n\n\nclass IOWrapper(IOBase):\n\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n if py2:\n self.write = self.buffer.write\n self.read = self.buffer.read\n self.readline = self.buffer.readline\n else:\n self.write = lambda s: self.buffer.write(s.encode('ascii'))\n self.read = lambda: self.buffer.read().decode('ascii')\n self.readline = lambda: self.buffer.readline().decode('ascii')\n\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\n\n# sys.stdin = open('input.txt', 'r')\n# sys.stdout = open('output.txt', 'w')\n\n\"\"\" main function\"\"\"\n\nif __name__ == '__main__':\n main()\n # threading.Thread(target=main).start()", "lang": "PyPy 2", "bug_code_uid": "4fc0fcdef3f6c3e4f9b573dfcec0bbac", "src_uid": "28d6fc8973a3e0076a21c2ea490dfdba", "apr_id": "b87b693b262e190b5576f385085e28c3", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8436578171091446, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "# Codeforces Beta Round #40\n# Problem B -- Repaintings\nn, m = map(int, raw_input().split())\nx = input() - 1\nprint max(n + m - 4 * x) if min(n, m) > 2 * x else 0\n", "lang": "Python 2", "bug_code_uid": "a6e3bfcc79b7e5d2a25f53a6557e52a8", "src_uid": "fa1ef5f9bceeb7266cc597ba8f2161cb", "apr_id": "350593dd2eb0d8d4dfacd6205874b29d", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.380517503805175, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "t=input()\ns=''\nif len(t)%2==1:\n i = len(t) // 2\n nap = 0\n for j in range(len(t)):\n if z==1:\n i += j\n z=0\n else:\n i -= j\n z=1\n s+=t[i]\n print(s)\nelse:\n i = len(t) // 2 - 1\n z=0\n for j in range(len(t)):\n if z==1:\n i += j\n z=0\n else:\n i -= j\n z=1\n s+= t[i]\n print(s)\n", "lang": "Python 3", "bug_code_uid": "548186d8a0c0615a3eb933b1d528cd0c", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "88878dfec5fe49e855e6585193a5a2ea", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6768060836501901, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "from math import factorial as fact\nn,m = map(int,input().split())\n\nif m>=3:\n\tprint(max(0,n - 2*m),n - fact(m)//(2*fact(m-2)))\nelse:\n\tif m==0:\n\t\tprint(n,n)\n\telif m==1:\n\t\tprint(max(0,n - 2*m),max(0, n-2)))\n\telif m==2:\n\t\tprint(max(0,n - 2*m),max(0, n-3)))\n", "lang": "Python 3", "bug_code_uid": "9dea9cc394373172acaea6faa03381bd", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "c53b147917569130240318234cb26323", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9828571428571429, "equal_cnt": 13, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 12, "fix_ops_cnt": 12, "bug_source_code": "from collections import defaultdict\n\n\ndef solve(s1, s2):\n d = defaultdict(set)\n for t1, t2 in s1:\n d[t1].add(t2)\n d[t2].add(t1)\n\n ans = set()\n for t1, t2 in s2:\n if d[t1] - {t2} > 0 and d[t2] - {t1} == 0:\n ans.add(t1)\n elif d[t1] - {t2} == 0 and d[t2] - {t1} > 0:\n ans.add(t2)\n elif d[t1] - {t2} > 0 and d[t2] - {t1} > 0:\n return -1\n\n if len(ans) > 1:\n return 0\n if len(ans) == 1:\n return list(ans)[0]\n\n\nn, m = [int(x) for x in input().strip().split()]\na = [int(x) for x in input().strip().split()]\nb = [int(x) for x in input().strip().split()]\n\na = set(tuple(sorted([a[i*2], a[i*2+1]])) for i in range(n) if a[i*2] != a[i*2+1])\nb = set(tuple(sorted([b[i*2], b[i*2+1]])) for i in range(m) if b[i*2] != b[i*2+1])\n\nans = min(solve(a, b), solve(b, a))\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "da51f959d3f3d95d0a3f2d153742d8c7", "src_uid": "cb4de190ae26127df6eeb7a1a1db8a6d", "apr_id": "5efccf4490046f79a8216c9c4adabbe3", "difficulty": 1900, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5259391771019678, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "s = [int(i) for i in raw_input().split()]\nf = [int(i) for i in raw_input().split()]\nx1 = s[0]\ny1 = s[1]\nx2 = f[0]\ny2 = f[1]\n\nx = abs(x1-x2)\ny = abs(y1-y2)\nmini = (x+y+2)*2\nprint max(mini,8)\n", "lang": "Python 2", "bug_code_uid": "732becf9f073468ffd7eb00f9687b50e", "src_uid": "f54ce13fb92e51ebd5e82ffbdd1acbed", "apr_id": "799b4d114ba705d7372017ee3ab4e214", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9671772428884027, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "R = lambda: map(int, input().split())\nn = int(input())\narr = [1, 2] + [0] * n\nfor i in range(2, n):\n arr[i] = arr[i - 1] + arr[i - 2]\nfor i in range(n):\n arr[i] = (arr[i] + arr[i - 1]) % 1000000007\nprint(arr[n - 1])", "lang": "PyPy 3", "bug_code_uid": "eb35582423a597dbb6b0b6a6afc1f2b8", "src_uid": "5c4bd12df3915186a7b506c2060db125", "apr_id": "3cec424c4f4e7e066fa86a4a4d52adc9", "difficulty": 1600, "tags": ["dp", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2085661080074488, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "import string\nli = map(int,string.split(raw_input()))\nflag = 0\nif(li[2]>0):\n for i in range(li[0],1000000001,li[2]):\n if(li[1] == i):\n print(\"YES\")\n flag =1\n break\n elif(li[1] < i):\n break\n if(flag!=1):\n print(\"NO\")\nelif(li[2]<0):\n for i in range(li[0],-1000000001,li[2]):\n if(li[1] == i):\n print(\"YES\")\n flag =1\n break\n elif(li[1] > i):\n break\n if(flag!=1):\n print(\"NO\")\nelse:\n if(li[1] == li[0]) : print(\"YES\")\n else: print(\"NO\")", "lang": "Python 2", "bug_code_uid": "e1f4aed06a6af7d92aa1cedf1b72886c", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "abedb760f70eecb51acb6eb8dc6c75f7", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.957983193277311, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from itertools import combinations\ndef solve(items,summation):\n l=[]\n for length in range(1, len(items)):\n for subset in combinations(items, length):\n l.append(sum(subset))\n if sum(subset) == summation or (sum(subset)-360) in l or (sum(subset)-720) in l:\n boole=1\n return(boole)\nx=int(input())\nl1=[]\nl2=[]\nboole=0\nfor i in range(x):\n s=int(input())\n l1.append(s)\nl1.sort()\ntotal=sum(l1)\nif total%2==0:\n if total%360==0:\n boole=1\n else:\n boole=solve(l1,total/2)\n\nif boole==1:\n print(\"YES\")\nelse:\n print(\"NO\")\n\n\n\n\n \n \n", "lang": "Python 3", "bug_code_uid": "1153447922fa405107a0c586b0c334cd", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "d381e5cf1952eca6bf8769e1c988b057", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9987063389391979, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import string\nimport math\n\ndef ii():\n ii = []\n for s in string.split(raw_input()):\n ii.append(int(s))\n return ii\n\nii = ii()\nn = ii[0]\nR = ii[1] * 1.0000001\nr = ii[2]\n\nx = 0\nif n <= 2:\n x = R / n\nelse:\n a = math.pi / n\n# print a\n sinA = math.sin(a)\n# print sinA\n x = R * sinA / (1 + sinA)\n# x = int(x)\n#print x\nif x >= r: print 'YES'\nelse: print 'NO'", "lang": "Python 2", "bug_code_uid": "da2a89d38eb7383708510ec260f330cc", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "4442b320c9bf35d9ff85969dee8813c6", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.31024930747922436, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import math\n\nn = input()\nn = n.split()\ns = eval(n[0])\nn = eval(n[1])\n\nalls = []\n\nmaxGcd = 1\n\nif n == s:\n print(n)\nelse:\n for i in range(s,n):\n alls.append(i)\n\n\n for i in range(len(alls)):\n if alls[i] != \"x\":\n count = 2\n #print(n.isdigit())\n while((count * alls[i]) < n):\n #print(alls[(count * alls[i]) - alls[i]],alls[i],count)\n alls[(count * alls[i]) - s] = \"x\"\n count += 1\n\n for i in alls:\n if i != \"x\":\n maxGcd = math.gcd(maxGcd,i)\n\n #print(alls)\n\n print(maxGcd)\n \n\n", "lang": "PyPy 3", "bug_code_uid": "5bac4b0a60d1bce69eba7ef2df56be97", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "3a32ca25df645fe315a6aaf748d577ab", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9974160206718347, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, a, b = [int(input() for _ in range(3)]\nd = [0]\nc = 0\n\nfor i in (a, b, a, a, b, a):\n if max(d) >= i:\n d[d.index(max(d))] -= i\n else:\n c += 1\n d += [n - i]\n\nprint(c)", "lang": "Python 3", "bug_code_uid": "1e2c42e31f288e5263cf299c04246fc8", "src_uid": "1a50fe39e18f86adac790093e195979a", "apr_id": "3dee7134371702a5d695075106e504f4", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8836915297092288, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/python\n\nimport os\nimport sys\nfrom math import log10, factorial\nimport itertools\n\nmod = 1000000007\n\ndef fni(x):\n tmp = mod - 2\n ret = 1\n tt = x\n while (tmp):\n if (tmp & 1):\n ret = (ret * tt) % mod\n tt = (tt * tt) % mod\n tmp >>= 1\n return ret\n\ndef solve(f):\n a,b,n = f.read_int_list()\n s = set([a,b])\n\n c = [1] * (n+1)\n for i in xrange(1, n+1):\n c[i] = (c[i-1] * i) % mod\n\n ans = 0\n astr, bstr = str(a), str(b)\n lst = [int(''.join(num)) for num in itertools.product([astr,bstr], repeat=int(log10(n))+1)]\n lst += [int(''.join(num)) for num in itertools.product([astr,bstr], repeat=int(log10(n))+2)]\n\n for i, j in enumerate(xrange(a*n,b*n+1,b-a)):\n if not j in lst: continue\n ans = (ans + c[n] * fni(c[i]) % mod * fni(c[n-i]) % mod) % mod\n\n print ans\n\n\nclass Reader(object):\n def __init__(self):\n self.f = sys.stdin\n\n def read_int(self):\n return int(self.f.readline().strip())\n def read_float(self):\n return float(self.f.readline().strip())\n def read_long(self):\n return long(self.f.readline().strip())\n def read_str(self):\n return self.f.readline().strip()\n\n def read_int_list(self):\n return [int(item) for item in self.f.readline().split()]\n def read_float_list(self):\n return [float(item) for item in self.f.readline().split()]\n def read_long_list(self):\n return [long(item) for item in self.f.readline().split()]\n def read_str_list(self):\n return self.f.readline().split()\n\nif __name__ == '__main__':\n f = Reader()\n solve(f)\n", "lang": "Python 2", "bug_code_uid": "ec3955fa4801623094da899de56101b5", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "392b2aedfb246c46b2ab6a602a48d7a9", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5407066052227343, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "def minTax(n, primes):\n\tif (n==2 or (n in primes)):\n\t\tprint 1\n\t\treturn\n\telif (n%2==0):\n\t\tprint 2\n\t\treturn\n\telse:\n\t\tif (n-2) in primes:\n\t\t\tprint 2\n\t\t\treturn\n\t\telse:\n\t\t\tprint 3\n\t\t\treturn\n\nn = int(raw_input())\n\nprimes = [r for r in xrange(2,n+1)]\n\nfor j in primes:\n\tfor i in primes:\n\t\tif (i > j):\n\t\t\tif (i%j == 0):\n\t\t\t\tprimes.remove(i)\n\nminTax(n, primes)", "lang": "Python 2", "bug_code_uid": "e190cc15b725a09807e97acf8922b870", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "f1cb9ef723add99dc835e74f9e46f11d", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9988331388564761, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\na,b=map(int,input().split())\nc=1\nk=0\nif(a==0 or b==0 ):\n print(0)\nelif(a==1 and b==1):\n print(0)\nelse:\n while(c!=0):\n if(a>=b):\n if(a>2):\n b=b+1\n a=a-2\n k=k+1\n else:\n c=0\n elif(a2):\n a=a+1\n b=b-2\n k=k+1\n else:\n c=0\n print(k+1", "lang": "Python 3", "bug_code_uid": "ffeb9e527f53deef5d933e62f15d0b77", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "f02aa0e2af9ce69da8b275f2fab33dd8", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3132328308207705, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "def len_n(n):\n l = 0\n while n != 0:\n n = n//10\n l += 1\n return l\n\ndef sum_n(n):\n l = len_n(n)\n\n summ = 0\n while n != 0:\n summ += n%10\n n = n//10\n\n return summ\n\nx = int(input())\nmax_cifr = sum_n(x)\nmaxnum = x\n\nfor i in range(1, len_n(x)):\n x = x-(10**i)\n #print(\"x: \",x)\n sx = str(x)\n sx = sx[:len(sx)-i]+'9'+sx[len(sx)-i+1:]\n #print(\"sx: \", sx)\n x = int(sx)\n if(max_cifr < sum_n(x)):\n max_cifr = sum_n(x)\n maxnum = x\n\nprint(maxnum)\n", "lang": "Python 3", "bug_code_uid": "e8404423f990070900d896bfa1bb4bfa", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "6d931f5fd208c14cc6c89fbbe71bb15a", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8430493273542601, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "a=list(map(int,input().split()))\nsort(a)\nif a[0]+a[3]==a[2]+[1]: print('YES')\nelse: print(\"NO\")", "lang": "Python 3", "bug_code_uid": "7c785a0cb3b43ad1e054c101252003f0", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "8ac3bc8275f7cfef0292b56308985a21", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8921658986175115, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "import math\nfrom math import floor\n\na11 = input()\na21 = input()\nb11 = input()\nb21 = input()\n\n\nsList = []\nsList.append(a11[0])\nsList.append(a11[1])\nsList.append(a21[0])\nsList.append(a21[1])\n\nsList.remove('X')\nsList.append(sList[0])\nsList.append(sList[1])\n\npList = []\npList.append(b11[0])\npList.append(b11[1])\npList.append(b21[0])\npList.append(b21[1])\n\npList.remove(\"X\")\n\npList = pList[::-1]\n\ns1 = s2 = \"\"\n\nfor i in sList:\n s1+=i\nfor i in pList:\n s2+=i\n \nif(s1.find(s2) == -1):\n print(\"NO\")\n \nelse:\n print(\"YES\")", "lang": "Python 3", "bug_code_uid": "7591d5fd37a46937d6200961335efe19", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "d6a8d5d8554b753ad88fec5057cecb45", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9849246231155779, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "f = lambda: 'ABC' in 2*(input()+input()[::-1]).replace('X', ' ')\n\nprint('NO' if f()^f() else 'YES')", "lang": "Python 3", "bug_code_uid": "2f1c97fc50de38eb10035ebbba51858f", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "c6f1d0fe834675d2c67c863f0c26109f", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.42036124794745483, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "from math import factorial\ncat = [1, 1]\np = 10**9 + 7\nn = int(input())\nfor i in range(1, 4000):\n cat.append((cat[-1]*2*(2*i + 1)//(i + 2)) % p)\n\nans = 0\nfor i in range(1, n + 1):\n ans += ((((factorial(n))//((factorial(i))*(factorial(n - i)))) % p) *cat[n - i]) % p\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "6c77175bcefe670614ae7f740e4e79cc", "src_uid": "aa2c3e94a44053a0d86f61da06681023", "apr_id": "3b6c80365ef0ffa7c528ef83953693f4", "difficulty": 1900, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5019157088122606, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "import sys\nimport math\ninput = sys.stdin.readline\n\n############ ---- Input Functions ---- ############\ndef inp():\n return(int(input()))\ndef inlt():\n return(list(map(int,input().split())))\ndef insr():\n s = input()\n return(list(s[:len(s) - 1]))\ndef invr():\n return(map(int,input().split()))\n\nq = inlt()\na = q[0]\nb = q[1]\n\ndef primeFactors(n):\n l = []\n i = 2\n n1 = n\n while(n1 > 1):\n while((n1 % i) == 0):\n l.append(i)\n n1 = n1 // i\n\n i = i + 1\n return l\n\np = primeFactors(a)\nq = primeFactors(b)\n\ndef count(x,l):\n ct = 0\n for i in l:\n if(i == x):\n ct = ct + 1\n return ct\n\na1 = count(2,p)\nb1 = count(3,p)\nc1 = count(5,p)\n\na2 = count(2,q)\nb2 = count(3,q)\nc2 = count(5,q)\n\nk = a // (2**a1 * 3**b1 * 5**c1)\nj = b // (2**a2 * 3**b2 * 5**c2)\n\nif(k == j):\n sum = 0\n sum = sum + abs(c1 - c2)\n sum = sum + abs(b1 - b2)\n sum = sum + abs(a1-a2)\n print(sum)\n\n\n\nelse:\n print(-1)", "lang": "PyPy 3", "bug_code_uid": "1e3221574a20015050613f558d86432e", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "4e3e13969eebf4a79b1d35c62b8a072d", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2559241706161137, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "# Description of the problem can be found at http://codeforces.com/problemset/problem/740/A\n\ndef getMinCost(c_c, c, l_c, m):\n if (c_c + n) % 4 == 0:\n return c\n \n for i in range(1, 4):\n if not m or c + l_c[i] < m:\n if m:\n m = min(m, getMinCost(c_c + i, c + l_c[i], l_c, m))\n else:\n m = getMinCost(c_c + i, c + l_c[i], l_c, m)\n \n return m\n\nn, c1, c2, c3 = map(int, input().split())\nl_c = list([0, c1, c2, c3])\n\nprint(getMinCost(0, 0, l_c, None))", "lang": "Python 3", "bug_code_uid": "ec487124525ec75eaecd152dee7081f9", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "9757343cdba7700ea072fa531cac0170", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.956140350877193, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "cms=int(input())\nif al==1 or al==0 :\n ans=cms//3 \nelse:\n ans=cms//3+1 \nfeet=ans//12 \nprint(feet,ans%12)", "lang": "Python 3", "bug_code_uid": "6056b86a5909cb21323331598cf75229", "src_uid": "5d4f38ffd1849862623325fdbe06cd00", "apr_id": "1bbfceac519d5bd86ca123c050aea199", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9329073482428115, "equal_cnt": 11, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 11, "bug_source_code": "x = int(input())\t\ns = list(input().split())\nk = 0\nfor i in range(5):\n\tfor j in range(2):\n\t\tx[j]=s[i][j]\n\t\tk++\nif(k!=0):\t\nprint(\"Yes\")\nelse:\nprint(\"No\")\n", "lang": "Python 3", "bug_code_uid": "8f84bea30f7627fefb7095d382319603", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "846bb60041871c036a921d3708bdfcec", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9946808510638298, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "cardOnTable = input()\nmyCards = input().split()\nfor card in myCards:\n if card[1] = cardOnTable[1] or card[0] = cardOnTable[0]:\n print(\"YES\")\n break\nelse:\n print('NO')\n", "lang": "Python 3", "bug_code_uid": "5c5584f7d75f1392b305e82bcce523cd", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "9bde3ecd2b541de09ae936ee4c7f9e55", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.997289972899729, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": " def solve():\n _ = map(int, input())\n m = list(map(int, input().split()))\n answer = 0\n for i in range(len(m)):\n answer += i*4*m[i]\n return answer\n\n\nprint(solve())\n", "lang": "Python 3", "bug_code_uid": "e38f8e395d706961f39d9242a555737d", "src_uid": "a5002ddf9e792cb4b4685e630f1e1b8f", "apr_id": "4193897239b7993d377b2628d2649dcd", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7485380116959064, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "t,n,s=map(int,input().split()\nfor i in range(n):\n s+=i*4*t\nprint(s)", "lang": "Python 3", "bug_code_uid": "97c0c8adff854de03a2a5a02df800ffa", "src_uid": "a5002ddf9e792cb4b4685e630f1e1b8f", "apr_id": "9815fcbe046abd4aec094d1e4d8e72f7", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3050847457627119, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "die1 = int(raw_input('die 1'))\ndie2 = int(raw_input('die 2'))\nthe_die = max(die1, die2)\n\nif the_die == 6:\n print '1/6'\nelif the_die == 5:\n print '1/3'\nelif the_die == 4:\n print '1/2'\nelif the_die == 3:\n print '2/3'\nelif the_die == 2:\n print '5/6'\nelse:\n print '1/1'\n ", "lang": "Python 2", "bug_code_uid": "8b6af6c57eef2aba18265249b159ac7d", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "454100042cea4775cef31088729aa5df", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9550827423167849, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n,k,m = list(map(int, input().split()))\nt = sorted(map(int, input().split()))\nst = sum(t)\nres = 0\nfor x in range(m//st+1):\n rem = m-x*st\n m = x*(k+1)\n # for i in range(k):\n # y = min(rem//t[i], n-x)\n # rem -= t[i]*y\n # m += y\n for i in range(k):\n for _ in range(n-x):\n if rem >= t[i]:\n rem -= t[i]\n m += 1\n res = max(res, m)\nprint(res)", "lang": "Python 3", "bug_code_uid": "65d1ff2a14b9c22a0de0b3cf11f0fc04", "src_uid": "d659e92a410c1bc836be64fc1c0db160", "apr_id": "8f67d2ca82299a7adf89b52ad97ec96f", "difficulty": 1800, "tags": ["brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.46601941747572817, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "n,l,r=map(int,input().split())\nli=[]\nwhile n>0:\n li+=[n]\n n=n//2\nres=[]\nfor i in range(1,len(li)+1):\n res=res+[li[-i]%2]+res\ncnt=0\nfor i in range(l-1,r):\n if res[i]==1:\n cnt+=1\nprint(cnt)\n", "lang": "Python 3", "bug_code_uid": "30df50c93ca27709d1bcc862b60c5bb5", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "9fc93f1e67594a88667d1dfec81d9028", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5159010600706714, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "def getOne(num):\n if num == 0 or num == 1:\n return [num]\n return getOne(int(num / 2)) + [int(num % 2)] + getOne(int(num / 2))\nip = input()\nnumber = ip.split()\nnum = int(number[0])\nl = int(number[1])\nr = int(number[2])\nsum = 0\ntemp = getOne(num)\nfor i in temp[l -1:r]:\n sum += i\nprint(sum)", "lang": "Python 3", "bug_code_uid": "f8a3fc0b49952cbb8ee3be1a815c267e", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "7c636aed06788f9935086a8577fcea1c", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2735294117647059, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import sys\nn,l,r = map(int, input().split())\ndef rect(n):\n if n <= 1:\n return [n];\n ls = rect(n//2)\n ans = []\n ans.extend(ls)\n ans.extend([n % 2])\n ans.extend(list(reversed(ls)))\n return ans\nprint(sum(rect(n)[l-1:r]))\n", "lang": "Python 3", "bug_code_uid": "17caf5131ba8b76fd8026fa10d82f812", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "c1007b7382582da75bb60a6592ce4f13", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6587112171837709, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "n = input().split(' ')\nn1 = int(n[0])\nm = int(n[1])\nwhile True:\n for i in range(1, n1 + 1):\n if m > i:\n m -= i\n else:\n break\n if i == n1:\n i = 1\n if m < i:\n break\nprint(m)", "lang": "Python 3", "bug_code_uid": "9cc0c64d58b607828070b9cf3c834121", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "70a2ae4b1b38717d19adaf13b51ff32f", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9373297002724795, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "walruses,chips=map(int,input().split())\nwhile True:\n for i in range (walruses):\n if chips>i+1:\n chips=chips-(i+1)\n else:\n break\nprint (chips)", "lang": "Python 3", "bug_code_uid": "e70aee66249e3d6ca1844a8c028b49e5", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "84cc1b28d365fab49af38d84b813b652", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9866017052375152, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def pos(x):\n global m\n global n\n row=x/m\n column=x%m\n p=[row,column]\n return p\nn,m,a,b=(int(i) for i in raw_input().split())\nl=pos(a-1)\npar=l[0]\npac=l[1]\nl=pos(b-1)\npbr=l[0]\npbc=l[1]\nif (par==pbr) or ((pac==0) and (pbc==m-1)) or (a==1 and b==n):\n print 1\nelif (pac-pbc==1) or (pac==0) or (pbc==m-1) or (a==1) or (b==n) or (pbr-par==1):\n print 2\nelse:\n print 3\n#print par,pac,pbr,pbc", "lang": "PyPy 2", "bug_code_uid": "ea1e68dd9c54193dad53f59bf33faa8d", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "7c4dc8f8f3879e4c677457058b884e73", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8875968992248062, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "a,m=map(int,input().split())\narr=[]\nx=a\nnew=a%m\narr.append(new)\na+=new\nif(new==0):\n\t\tprint('Yes')\n\t\texit(0)\nwhile(1):\n\tnew=a%m\n\tif(new==0):\n\t\tprint('Yes')\n\t\texit(0)\n\telif(new==arr[0]):\n\t\tprint('No')\n\t\texit(0)\n\telse:\n\t\tarr.append(new)\n\t\ta+=new", "lang": "PyPy 3", "bug_code_uid": "6084251f489c8e396d68465f2392039c", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "be971b80644588aec0faba200f4901e6", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9918032786885246, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import sys\ninput = sys.stdin.readline().strip().split(' ')\na = input[0]\nb = input[1]\n\nif (a==b): print (a)\nelse: print 1\n", "lang": "Python 3", "bug_code_uid": "f3bb9a83994240782660b2304464fb9d", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "403e9b8dddfbdf8c19e9f64ee797161e", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.21311475409836064, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "def yesorno (number):\n for i in range(11)[2:]:\n if (number%i) == 0:\n return 0\n return 1\n\ncountdownload = input()\ncountprem = 0\nfor number in xrange(countdownload+1):\n countprem += yesorno(number)\nprint countprem", "lang": "Python 2", "bug_code_uid": "d598e020e6be35548855bfd41d63c2d9", "src_uid": "e392be5411ffccc1df50e65ec1f5c589", "apr_id": "d53a699a0ee4b3fe12a5ef6dee16b363", "difficulty": 1500, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.254292343387471, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env python3\n\na1 = int(input())\na2 = int(input())\nk1 = int(input())\nk2 = int(input())\nn = int(input())\n\nminDeletedPlayers = 0\nmaxDeletedPlayers = 0\n\n# Finding min deleted players\nplayersStates = []\nfor i in range(a1):\n playersStates.append(k1)\nfor i in range(a2):\n playersStates.append(k2)\nmemN = n\nwhile memN > 0:\n # Finding max number\n maxNumber = -1\n itemId = 0\n for i, item in enumerate(playersStates):\n if item > maxNumber:\n maxNumber = item\n itemId = i\n playersStates[itemId] -= 1\n memN -= 1\nfor item in playersStates:\n if item <= 0:\n minDeletedPlayers += 1\n\n# Finding max deleted players\nplayersStates = []\nfor i in range(a1):\n playersStates.append(k1)\nfor i in range(a2):\n playersStates.append(k2)\nmemN = n\nwhile memN > 0:\n # Finding min number\n minNumber = 100500\n itemId = 0\n for i, item in enumerate(playersStates):\n if item < minNumber and item != 0:\n minNumber = item\n itemId = i\n playersStates[itemId] -= 1\n memN -= 1\nfor item in playersStates:\n if item <= 0:\n maxDeletedPlayers += 1\n\nprint(minDeletedPlayers, maxDeletedPlayers)\n", "lang": "PyPy 3", "bug_code_uid": "cc5af6190dc013b8ec6c4d9493d93dc1", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "6c2283622bc4689d8b7a0c4e68b2f8f9", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5158371040723982, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n,k=map(int,input().split())\na=[1]\nj=2\nwhile n>1:\n b=a.copy()\n a.append(j)\n a.extend(b)\n #print(a)\n j=j+1\n n=n-1\nprint(a[k-1])\n", "lang": "Python 3", "bug_code_uid": "ea31b90eb0fcb05dadcf1394106a9234", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "7501dbf0a16b960a6837410880d087af", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6507936507936508, "equal_cnt": 21, "replace_cnt": 9, "delete_cnt": 7, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "n, k = map(int, input().split())\ns = [1,2,1]\nfor i in range(2, n):\n s = s + [i + 1] + s\nprint(s[k - 1])\n", "lang": "Python 3", "bug_code_uid": "7493dbf3edc82e3840380d1d1d0c6684", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "bc25ae362eaa3304be69bd1152af0e37", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5619047619047619, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n,k=map(int,input().split())\na=[1]\nfor i in range(n):\n a+=[max(a)+1]\n a+=a[:-1]\n if len(a)>=k:\n break\nprint(a[k-1])", "lang": "Python 3", "bug_code_uid": "e65ecbfb50d4aa9c25f0f596f05e2cf4", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "881a0dde2f05bf3264eea5b0093bbd32", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5622119815668203, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "# -*- coding: utf-8 -*-\n\nimport sys\n\n\ndef main():\n n, k = map(int, input().split())\n seq = [1]\n for i in range(1, n):\n seq = seq + [i + 1] + seq\n print(seq[k - 1])\n\n\n\nif __name__ == '__main__':\n main()", "lang": "Python 3", "bug_code_uid": "61da40cdd423a153b52f0e8891d5624f", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "fdb4be685e2c954164f59b0b83be735a", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1258426966292135, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "x=input().split()\narr=[1]\nfor i in range(1,int(x[0])+1):\n arr.append(i+1)\n arr=arr+arr[:-1]\n if len(arr)>int(x[1]):\n print(arr[int(x[1])-1])\n break", "lang": "Python 3", "bug_code_uid": "cb1aa14e08961604719f97efc9390102", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "8fc4f4cca8fb49ba36c11b5c04222560", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3383084577114428, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "#inp=open('INPUT.TXT','r')\n#n,k=map(int,inp.read().split())\n#inp.close()\nn,k=map(int,input().split())\n\nbiggest_n=2\nseq=[1]\nfor i in range(n-1):\n seq.extend(seq)\n seq.insert(len(seq)//2,biggest_n)\n biggest_n+=1\n\nprint(seq[k-1])\n#out=open('OUTPUT.TXT','w')\n#out.write(str(seq[k-1]))\n#out.close()\n", "lang": "Python 3", "bug_code_uid": "c0dc2031896d5408de1706984348c608", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "1353e1e954ff0cac3bfa6588175800d0", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6082474226804123, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "n,k=map(int,input().split())\ns=list([1])\nfor i in range(2,n+1):\n s.append(i)\n s+=s[:len(s)-1]\nprint(s[k-1])", "lang": "Python 3", "bug_code_uid": "3e71ee4d9689cdb40c1e91e686aabd33", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "51c54754fd8729484dbf98d5c90346c5", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.12749003984063745, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n,k=map(int,input().split())\nl=[1]\nfor i in range(2,n+1):\n l.append(i)\n l.extend(l[:len(l)-1])\nprint(l[k-1]) \n", "lang": "Python 3", "bug_code_uid": "681ec8720a65825f2ee286a32584d557", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "ce9b14b9d058e01951aa2f107aacba99", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4966887417218543, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "n,k=map(int,input().split(' '));\narr=[1];\nfor i in range(2,n+1):\n new_list=arr[:]\n arr.append(i);\n arr.extend(new_list);\nprint(arr[k-1]);\n", "lang": "Python 3", "bug_code_uid": "36896fdf1b7a842738bbd4dd6f6647bb", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "6c7258911780eaa119b9d698df2e5975", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4251207729468599, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "n,k=map(int,input().split())\ns=['1']\nc=2\nfor i in range(0,n-1):\n\ts=s+s[::-1]\n\tx=len(s)\n\tx=x//2\n\ts.insert(x,c)\n\tc=c+1\n#print(s)\nprint(s[k-1])\n\t\n\t\n\t\t", "lang": "Python 3", "bug_code_uid": "a53fc7c0a2d0dedbf5dfbd9d27a52c82", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "946be56d3588e5729d18b2dc5667ebae", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.39900249376558605, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n,k=map(int,input().split())\na=[1]\nif(k>=2**(n-1)):\n k=2**n -k\nx=len(bin(k)[2:])\nfor i in range(2,x+1):\n \n a.extend(a)\n a.insert(len(a)//2,i)\n \n \nprint(a[k-1])\n", "lang": "Python 3", "bug_code_uid": "9b79632bf589e1992bc542586c497d27", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "5a423e3a94373fea16d5b89ef489ecdb", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9153046062407132, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a = [int(i) for i in input().split()]\nflag=False\nd1 = a[1]-a[0]\nd2 = a[2]-a[1]\nd3 = a[3]-a[2]\nq1 = a[1]/a[0]\nq2 = a[2]/a[1]\nq3 = a[3]/a[2]\nif(d1==d2==d3):\n print(a[3]+d1)\n flag=True\nelif(q1==q2==q3):\n otv = int(a[3]*q1)\n if(otv!=0)\n print(int(a[3]*q1))\n flag=True\nif(flag==False):\n print('42')", "lang": "Python 3", "bug_code_uid": "ce1e6e04a6d2381a4c26c2fb46228a9b", "src_uid": "68a9508d49fec672f9c61766d6051047", "apr_id": "f6e7b592d6514c3ae02e3247d7e2075d", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.27605633802816903, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "line = input().split()\n\nn = int(line[0])\nh = int(line[1])\nimport numpy as np\narray_nodes_minheigt = np.zeros([36,36])\narray_nodes_minheigt[0,0] = 1\nfor nodes in range(1,36):\n for minheight in range(0,nodes+1):\n for topnode in range(1, nodes + 1):\n left = topnode-1\n right = nodes - topnode\n array_nodes_minheigt[nodes,minheight] += array_nodes_minheigt[left,0] * array_nodes_minheigt[right,0] - (array_nodes_minheigt[left,0]-array_nodes_minheigt[left, max(minheight-1,0)])* (array_nodes_minheigt[right,0]-array_nodes_minheigt[right, max(minheight-1,0)])\n \n\nprint(int(array_nodes_minheigt[n,h]))\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "9985278fda2838517417a1a2c6612d38", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "apr_id": "fcb6257ea364ac5fdee1e61526dc1027", "difficulty": 1900, "tags": ["divide and conquer", "dp", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9803921568627451, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "MAX = 10**5 + 1;\ngrundy = [0 for i in xrange(MAX)];\nchoice = [-1 for i in xrange(MAX)];\nfor i in xrange(1,MAX):\n k = 2;\n U = set();\n while k*(k+1)/2 <= i:\n diff = i - k*(k+1)/2;\n if diff % k == 0:\n offset = diff/k;\n x = grundy[offset + k ] ^ grundy[offset];\n if not x: choice[i] = k;\n U.add(x);\n k += 1;\n while grundy[i] in U:\n grundy[i] += 1;\n grundy[i] ^= grundy[i - 1];\n\n\nn = int(raw_input());\nprint choice[n];", "lang": "PyPy 2", "bug_code_uid": "d7c4dbe81a47ed16e2812e63d081fca4", "src_uid": "63262317ba572d78163c91b853c05506", "apr_id": "d84daa30eca0f4fa964c870a713dd6db", "difficulty": 2000, "tags": ["math", "dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9805128205128205, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "import math\nfrom collections import Counter\n\nn = int(input())\ng = [0 for i in range(n + 1)]\nprefix_xor = g.copy()\n\n\ndef in_range(d, k):\n if (2 * k - d * d + d) % (2 * d) != 0:\n return -1\n x = (2 * k - d * d + d) / (2 * d)\n return int(x) if x > 0 else -1\n\n\ndef mex(arr):\n counter = Counter()\n for i in arr:\n counter[i] += 1\n for i in range(0, len(arr) + 1):\n if counter[i] == 0:\n return i\n\n\ndef find_move(arr):\n for i in range(0, len(arr)):\n if arr[i] == 0:\n return i\n return -1\n\n\nfor i in range(3, n + 1):\n for_range = range(2, int(math.sqrt(2 * i)) + 1)\n filter_range = [l for l in for_range if in_range(l, i) > 0]\n branches = [prefix_xor[in_range(d, i) + d - 1] ^ prefix_xor[in_range(d, i) - 1] for d in filter_range]\n g[i] = mex(branches)\n prefix_xor[i] = prefix_xor[i-1] ^ g[i]\n if i == n:\n print(-1 if g[i] == 0 else filter_range[find_move(branches)])\n", "lang": "PyPy 3", "bug_code_uid": "c9dcdb96fae8b101e5133d1a1a627b09", "src_uid": "63262317ba572d78163c91b853c05506", "apr_id": "5bf6a647401825f0cac1d0c40950122c", "difficulty": 2000, "tags": ["math", "dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3078817733990148, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "import math\nn, k = map(int, input().split())\ndp = [[1 for _ in range(k+1)] for _ in range(n+1)]\nfor i in range(1, n+1):\n f = set((1, i))\n for m in range(2, int(math.sqrt(i))+1):\n if i%m==0:\n f.add(m)\n if i/m != i:\n f.add(i//m)\n f = list(f)\n for j in range(2, k+1):\n dp[i][j] = 0\n for x in f:\n dp[i][j] += dp[x][j-1]\nans = 0\nfor i in range(1, n+1):\n ans += dp[i][k]\n ans %= 1000000007\nprint(ans%1000000007)\n", "lang": "PyPy 3", "bug_code_uid": "229a09492499cd29cf9f436f1f1e1b42", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "6e76ec28c40d674f75ac2ba95706c853", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6909558508358337, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "a = [0]*10\nb = [0]*10\ns = map(int, list(raw_input()))\nn = len(s)\nc1=['']*n\nc2=['']*n\nfor i in range(n):\n a[s[i]] += 1\n b[s[i]] += 1\n\nn-=1\n\nwhile (a[0]-a[9])>0:\n c1[n]=c2[n] = str(0)\n a[0]-=1\n b[0]-=1\n n-=1\n\n\nk = []\nfor i in range(1,6):\n if a[i]*b[10-i]>0:\n k.append(i)\n\nd = []\nfor l in k:\n for i in range(6):\n if (i != l) and (i != 9-l):\n o += min(a[i], b[9-i])\n elif (i = l) and (i != 9-l):\n o += min(a[i]-1, b[9-i])\n elif (i != l) and (i = 9-l):\n o += min(a[i], b[9-i]-1)\n elif (i = l) and (i = 9-l):\n o += min(a[i]-1, b[9-i]-1)\n\nif k>0:\n c1[n]=str(k)\n c2[n]=str(10-k)\n n -= 1\n\n\nfor i in range(10):\n if a[i]*b[9-i]>0:\n k=i\n m = 0\n while ((a[i]>0) and (b[9-i]>0)):\n a[i]-=1\n b[9-i]-=1\n m+=1\n for j in range(m):\n c1[n]=str(k)\n c2[n]=str(9-k)\n n-=1\n\nm = n\n\nfor i in range(10):\n while a[i]>0:\n c1[n] = str(i)\n n-=1\n a[i] -= 1\n while b[i]>0:\n c2[m] = str(i)\n m-=1\n b[i] -= 1\n\n\nc1 = ''.join(str(n) for n in c1)\nc2 = ''.join(str(n) for n in c2)\nprint c1\nprint c2", "lang": "Python 2", "bug_code_uid": "9c1b0400945d4f5ccb0e73047f144cdc", "src_uid": "34b67958a37865e1ca0529bbf528dd9a", "apr_id": "9d76b1b09a8d90e8c2eba632234237b9", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9169087739686229, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "m,s=[int(i) for i in input().split()]\nif (s<1 and m>1) or s>9*m:\n print('-1 -1')\nelif s==0 and m==1:\n print('0 0')\nelse:\n n=s//9\n l=s-9*n\n mi=0\n\n ma0=[str(9)]*n\n if l!=0:\n ma0.append(str(l))\n for i in range(m-n-1):\n ma0.append(str(0))\n else:\n for i in range(m-n):\n ma0.append(str(0))\n ma=''.join(ma0)\n\n if l!=0:\n for i in range(n):\n mi+=9*10**(i)\n if l!=0 and s>9*(m-1) and n>0:\n mi+=l*10**(n)\n elif l!=0 and s<9*(m-1) and n>0:\n mi+=10**(m-1)+(l-1)*10**(n)\n elif l!=0 and n==0:\n mi+=10**(m-1)+(l-1)\n elif l==0 and s==9*m:\n for i in range(n):\n mi+=10**(m)-1\n else:\n mi+=10**(m-1)\n for i in range(n-1):\n mi+=9*10**(i)\n mi+=8*10**(n-1)\n \n print(int(mi),int(ma))\n ", "lang": "Python 3", "bug_code_uid": "277d693cebd4ea5be8e06dab41c7220f", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "3b15f7b915accd818f06c598ac81a391", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5398457583547558, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "n,k=map(int,input().split())\na=list()\nc=0\nfor i in range (1,n+1):\n\tif(n%i==0):\n\t\ta.append(i)\n\t\tc+=1\nif(cc:\n m=m+1\n c=b\n else:\n c=c-s[i]\nprint(m)\n", "lang": "Python 3", "bug_code_uid": "6b91992a559f78cabd745a0f2a0b0ace", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "13e42f010129678e00fbee32723b43a6", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9949748743718593, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n ,a ,b = map(int,input().split())\nif ((a+b)=n ) or ((a+b)>n ):\n print(n-a)\nelse:\n print(b+1)", "lang": "PyPy 3", "bug_code_uid": "ef056f353af493b8aee91b5700ec8c62", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "175a944d332bf97fb024c55fc38a7e10", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8990578734858681, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/python3\n\nn, m, a, b = map(int, input().split())\n\na -= 1\nb -= 1\nif a // m == b // m:\n print(1)\nelif a % m == 0 and (b + 1) % m == 0:\n print(1)\nelif a % m == 0 or (b + 1) % m == 0:\n print(2)\nelif a % m == (b + 1) % m:\n print(2)\nelif b // m - a // m == 1:\n print(2)\nelif m == 2:\n print(2)\nelse:\n print(3)\n", "lang": "Python 3", "bug_code_uid": "bfb7d2f1fd759c3fb75afd19a87562e4", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "d19b781e8aa8118b5d408b53dd0d2230", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.43629697525206235, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "def binm(n, k,mod): \n C = [[0 for x in range(k+1)] for x in range(n+1)] \n \n # Calculate value of Binomial Coefficient in bottom up manner \n for i in range(n+1): \n for j in range(min(i, k)+1): \n if j == 0 or j == i: \n C[i][j] = 1\n \n # Calculate value using previously stored values \n else: \n C[i][j] = C[i-1][j-1] + C[i-1][j]\n C[i][j]%=mod\n \n return C[n][k]%mod\nn,m=[int(i) for i in raw_input().split()]\nmod=998244353\nif n==2:\n print 0\nelse:\n val=1\n for i in range(n-3):\n val*=2\n val%=mod\n print ((n-2)*val*binm(m,n-1,mod))%mod\n \n", "lang": "PyPy 2", "bug_code_uid": "2a69bfced951b180297e5795da220626", "src_uid": "28d6fc8973a3e0076a21c2ea490dfdba", "apr_id": "f43f7c149eb69e34f32ed2bda08b23b2", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9458272327964861, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "import sys\ninput = sys.stdin.readline\ndef main():\n # t = int(input())\n t = 1\n while(t):\n # for _ in range(t):\n t -= 1\n \n MOD = 998244353\n fact = [1]*200005\n for i in range(1, 200005):\n fact[i] = i*fact[i-1]\n \n def fast_sq(a, b):\n ans = 1\n if(b == -1):\n b = MOD-2\n for i in range(60):\n if((1<abs(k[1]-i):\n s+=1\n else:\n w+=1\nprint(f,w,s)\n ", "lang": "PyPy 3", "bug_code_uid": "304af4caeb05ce2fd8297626ce387095", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "9a49a90f56dc2abfe7894a83e0cb9c86", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9496276828734121, "equal_cnt": 13, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 12, "bug_source_code": "tramEndPoint, igorStartPos, igorEndPos = map(int, raw_input().split())\ntramS, igorS = map(int, raw_input().split())\ntramStartPos, tramDir = map(int, raw_input().split())\n\nigorTime = abs(igorEndPos-igorStartPos)*igorS\n\ngetIgorTime = 0\ngetToEndTime = 0\n\ndistToIgor = igorStartPos - tramStartPos\nif (distToIgor > 0 and tramDir > 0) or (distToIgor < 0 and tramDir < 0):\n getIgorTime = abs(distToIgor)*tramS\nelse:\n if tramDir > 0:\n toEnd = tramEndPoint-tramStartPos\n getIgorTime = (toEnd+(tramEndPoint-igorStartPos))*tramS\n else:\n toBeg = tramStartPos\n getIgorTime = (toBeg+igorStartPos)*tramS\n tramDir *= -1\n\ntramStartPos = igorStartPos\n\ndistToEnd = igorEndPos - tramStartPos\nif (distToEnd > 0 and tramDir > 0) or (distToEnd < 0 and tramDir < 0):\n getToEndTime = abs(distToEnd)*tramS\nelse:\n if tramDir > 0:\n toEnd = tramEndPoint-tramStartPos\n getToEndTime = (toEnd+(tramEndPoint-igorEndPos))*tramS\n else:\n toBeg = tramStartPos\n getToEndTime = (toBeg+igorEndPos)*tramS\n\nprint min(igorTime, (getIgorTime+getToEndTime))\n", "lang": "Python 2", "bug_code_uid": "d4dd515a4d27d1eb26abc44ddb497cb9", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "495c777ae242c50dd5adadff995959ba", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9861932938856016, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "ef game(a,b,count):\n if(a==0 or b==0):\n return count\n else:\n mi=min(a,b)\n ma=max(a,b)\n return game(mi+1,ma-2,count+1)\n\na,b=map(int,input().split())\nif(a<3 and b<3):\n print(0)\nelse:\n res=game(a,b,0)\n print(res)\n\n", "lang": "PyPy 3", "bug_code_uid": "ad3457507939dbbe2679bd5743d0a787", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "18898acc8efb055f2957b1ca3d8fd907", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.520618556701031, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "k,a,b=map(int,input().split())\nctr=int(0)\nif (a=k or b>=k:\n if a>=k:\n a-=k\n ctr+=1\n if b>=k:\n b-=k\n ctr+=1\nexit(print(ctr))\n", "lang": "Python 3", "bug_code_uid": "e1fe76c5f790728a1f39904d1361ad1f", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "d12717cee2f27264d3ba84136913c93e", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8640350877192983, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "x=int(input())\nz=[n for n in str(int(input()))]\nl=0\nfor n in z:\n in n!=4 or n!=7:\n print('NO')\n l=0\n break\n else:\n l=1\nif l==1:\n if sum(z[0::x//2])==sum(z[x//2:x])\n print('YES')\n else:\n print('NO')\n\n", "lang": "PyPy 3", "bug_code_uid": "e0f7eabe5eb4d115f412ed1a99271cd4", "src_uid": "435b6d48f99d90caab828049a2c9e2a7", "apr_id": "e07d615dd9aaed4680d4d6b93a9868c4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9937888198757764, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,m=map(int,input().split())\nif m!=0:\n print([min(m,n-m))\nelse:\n print('1')", "lang": "Python 3", "bug_code_uid": "c467fb073b1d2b1839816dcbb2bef9f1", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "7422759fde0c7dfb42bbfb32adc62c85", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7032967032967034, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "n=int(input())\nm=int(input())\nk=min(m,n-m)\nif(m==1 or m==0):\n print(1)\n return 0\nif(m==n):\n print(0)\nelse:\n print(k)\n ", "lang": "Python 3", "bug_code_uid": "91f0734b46ba40d587a9e117522ff230", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "62ba63bab55eec155fa45e884a0a3306", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4297774366845741, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/python\nimport sys\n\ndef ext_gcd(a, b):\n if b == 0:\n return (a, 1, 0)\n (dp, xp, yp) = ext_gcd(b, a % b)\n return (dp, yp, xp - a//b * yp)\n\ndef mod_solve(a, b, n):\n (d, xp, yp) = ext_gcd(a, n)\n if b % d == 0:\n x0 = xp * (b/d) % n\n return x0\n else:\n return None\n\ndef choose(n, m, MOD):\n result = 1\n for i in xrange(1, n+1):\n result = (result * i) % MOD\n for i in xrange(1, n-m+1):\n result = (result * mod_solve(i, 1, MOD)) % MOD\n for i in xrange(1, m+1):\n result = (result * mod_solve(i, 1, MOD)) % MOD\n return result\n\nMOD = 1000000007\n(n, m, g) = map(lambda x: int(x), raw_input().split())\nif n == 0:\n if (m == 1 and g == 1) or (m > 1 and g == 0):\n result = 1\n else:\n result = 0\n print(result)\n sys.exit(0)\n\nif m == 0:\n if (n % 2 == 0 and g == 1) or (n % 2 == 1 and g == 1):\n result = 1\n else:\n result = 0\n print(result)\n sys.exit(0)\n\nterm = 1\nresult = term\nfor i in xrange(1, n+1):\n term = (term * (m + i) * mod_solve(i, 1, MOD)) % MOD\n if i % 2 == 0:\n result = (result + term) % MOD\n else:\n result = (result + MOD - term) % MOD\nif n % 2 == 1:\n result = (MOD - result) % MOD\nif m == 1:\n if n % 2 == 0:\n result = (result + MOD - 1) % MOD\n else:\n result = (result + 1) % MOD\nif g == 1:\n result = (choose(n+m, m, MOD) + MOD - result) % MOD\nprint(result)\n\n\n\n\n", "lang": "Python 2", "bug_code_uid": "505f02d1d9192fea9cd936dc618c9b9f", "src_uid": "066dd9e6091238edf2912a6af4d29e7f", "apr_id": "4017e4f53434c3d10cbb0747591c0b7d", "difficulty": 2100, "tags": ["math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8979783732957217, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "import operator as op\ndef egcd(a, b):\n if a == 0:\n return (b, 0, 1)\n else:\n g, y, x = egcd(b % a, a)\n return (g, x - (b // a) * y, y)\n\ndef modinv(a, m):\n g, x, y = egcd(a, m)\n if g != 1:\n raise Exception('modular inverse does not exist')\n else:\n return x % m\n \ndef ncr(n, r):\n r = min(r, n-r)\n if r == 0: return 1\n numer = reduce(op.mul, xrange(n, n-r, -1))\n denom = reduce(op.mul, xrange(1, r+1))\n return numer//denom\n\nN,M,G = map(int, raw_input().split())\ndef q(n):\n\treturn ncr(n+M, M)\n\nmod = 1000000007\nr = [0] * (N+M+1)\nr[1] = 1;\nfor i in range(2, N+M+1):\n\tr[i] = (mod - (mod/i) * r[mod%i] % mod) % mod;\n#~ print r\t\n\ndef f(n):\n\tn -= 1\n\tsign = 1 if (n%2 == 0) else -1\n\tres = 0\n\tk = 0\n\t\n\tbinom = 1\n\t\n\twhile k <= n:\t\t\n\t\tres = (res + sign * binom) % mod\t\n\t\tbinom = (binom * (k+M+1) * r[k+1]) % mod\n\t\t\n\t\tsign *= -1\n\t\tk += 1\n\tif M == 1:\n\t\tres += sign\n\treturn res\nif M == 0:\n\tprint int(G == (N+1)%2)\n\traise SystemExit\n\n\t\t\nif G == 1:\n\tprint f(N)\nelse:\n\tprint q(N)-f(N)\n", "lang": "Python 2", "bug_code_uid": "0562beaf94620eb33d76ea6b7ba71713", "src_uid": "066dd9e6091238edf2912a6af4d29e7f", "apr_id": "fadd8692486c6313f6dc173e4deb731f", "difficulty": 2100, "tags": ["math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5379310344827586, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "a ,b = [int(x) for x in input().split()]\nl = [int(x) for x in input().split()]\n\nsb = 0\ns = 0\n\nfor i in range(len(l)):\n if(l[i] < b):\n sb += 1\n elif(l[i] = b):\n s = 1\n else:\n break\nprint(b-sb+s)", "lang": "Python 3", "bug_code_uid": "5c3debbcdb0d7c012dffb0b40c346181", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "926a501eedcc9681ddfeea30a077ad67", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9375866851595007, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n,k,d = map(int,input().split())\nimport sys\nsys.setrecursionlimit(10**6)\nmod = int(1e9+7)\n\ndef rec(n,d):\n if n<0:return 0\n if n==0:\n return d==0\n res = 0\n for i in range(1,k+1):\n if i>=d:\n res+=rec(n-i,0)\n else:\n res+=rec(n-i,d)\n res%=mod\n return res%mod\nprint(rec(n,d)%mod)", "lang": "PyPy 3", "bug_code_uid": "995fdbd05360bbd50f09e53e3c891092", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "f1ce3d029326cd4e494559f7fca6c3f2", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9187969924812031, "equal_cnt": 17, "replace_cnt": 1, "delete_cnt": 17, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": " MOD = 10 ** 9 + 7\n HAVE, NOT_HAVE = 1, 0\n \n n, k, d = map(int, input().split())\n \n dp = [[0 for _ in range(n + 1)] for _ in range(2)]\n dp[NOT_HAVE][0] = 1\n for dist in range(1, n + 1):\n for weight in range(1, k + 1):\n if weight > dist:\n break\n if weight >= d:\n dp[HAVE][dist] += dp[HAVE][dist - weight] + dp[NOT_HAVE][dist - weight]\n dp[HAVE][dist] %= MOD\n else:\n dp[NOT_HAVE][dist] += dp[NOT_HAVE][dist - weight]\n dp[NOT_HAVE][dist] %= MOD\n dp[HAVE][dist] += dp[HAVE][dist - weight]\n dp[HAVE][dist] %= MOD\n print(dp[HAVE][n])", "lang": "PyPy 3", "bug_code_uid": "80fb3e06445c6e25e235e94e8f401c16", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "c7607fb25601bf5037988d8bea231182", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.32547169811320753, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\no1,o2 = map(int,input().split())\ns1,s2 = map(int,input().split())\nt1,t2 = map(int,input().split())\n\na1,a2,a3=0,0,0\nfor i in range(o1,o2+1):\n for j in range(s1,s2+1):\n for k in range(t1,t2+1):\n if i+j+k==n:\n a1,a2,a3=i,j,k \n break\nprint(a1,a2,a3)", "lang": "PyPy 3", "bug_code_uid": "5f80254774bd470cca86922fa403df04", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "b784062e478fca16478ac7b35f838efd", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9067092651757188, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "def DFS(x):\n for i in range(x):\n if(Seen[i]):\n continue\n if(Rem[i]>=C[x]):\n if(Rem[i]==C[x] and len(Children[i])==0):\n continue\n Rem[i]-=C[x]\n Parent[x]=i\n Children[i].append(x)\n return True\n for i in range(x):\n if(Seen[i]):\n continue\n Y=[]\n Seen[i]=True\n for j in range(len(Children[i])):\n child=Children[i][j]\n Parent[child]=-1\n Rem[i]+=C[child]\n if(DFS(child)):\n continue\n Parent[child]=i\n Rem[i]-=C[child]\n Y.append(child)\n Seen[i]=False\n Children[i]=list(Y)\n if(Rem[i]>=C[x]):\n if(Rem[i]==C[x] and len(Children[i])==0):\n continue\n Rem[i]-=C[x]\n Children[i].append(x)\n Parent[x]=i\n return True\n return False\n \n \n\n\n\n\nn=int(input())\n\nC=list(map(int,input().split()))\nRem=[-1]*n\nParent=[-1]*n\nChildren=[]\nSeen=[False]*n\nC.sort(reverse=True)\n\nif(C[0]!=n or C.count(2)>0):\n print(\"NO\")\n\nelse:\n for i in range(n):\n Rem[i]=C[i]-1\n Children.append([])\n Parent[0]=0\n Ans=\"YES\"\n for i in range(1,n):\n if(DFS(i)==False):\n Ans=\"NO\"\n break\n for i in range(n):\n if(Rem[i]!=0 and C[i]!=1):\n Ans=\"NO\"\n break\n print(Ans)\n \n", "lang": "Python 3", "bug_code_uid": "4dfbdce093c5b431e0b8e1c8bcfcc3c1", "src_uid": "ed0925cfaee961a3ceebd13b3c96a15a", "apr_id": "fba87e5975104aeecec9d2799cc548e6", "difficulty": 2300, "tags": ["dp", "bitmasks", "greedy", "trees", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8633993743482794, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "N = 2000000000\nt = 0\na = [1]\nb = [1]\nc = []\nfor i in range(1, 31):\n a.append(a[i-1]*2)\nfor i in range(1, 20):\n b.append(b[i - 1] * 3)\nfor i in range(0,31):\n print(a[i])\nfor i in range(0,20):\n print(b[i])\nfor i in range(0, 31):\n for j in range(0, 20):\n if(a[i] <= N/b[j]):\n c.append(a[i] * b[j])\n t+=1\n\nfor i in range(0, 10):\n print(c[i])\nprint(\"t=%s\"%t)\nl, r = map(int, input().split())\ncnt = 0\nfor i in range(0, 326):\n if(c[i] >= l):\n if(c[i] <= r):\n cnt = cnt + 1\n\nprint(cnt)", "lang": "PyPy 3", "bug_code_uid": "3458cf6ac25b24cd0f4a308611b12b98", "src_uid": "05fac54ed2064b46338bb18f897a4411", "apr_id": "132001da950ed8fa7758df21abd1fc22", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9284818067754078, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "# -*- coding: utf-8 -*-\n\nimport math\nimport collections\nimport bisect\nimport heapq\nimport time\nimport random\nimport itertools\nimport sys\n\n\"\"\"\ncreated by shhuan at 2017/12/2 22:13\n\n\"\"\"\n\n\nf0 = \"What are you doing at the end of the world? Are you busy? Will you save us?\"\n\n\nMAXN = 10**5+5\nF = [0] * MAXN\nF[0] = len(f0)\n\np1 = \"What are you doing while sending \\\"\"\np2 = \"\\\"? Are you busy? Will you send \\\"\"\np3 = \"\\\"?\"\nlp1, lp2, lp3 = len(p1), len(p2), len(p3)\nl = lp1 + lp2 + lp3\n\nfor i in range(0, MAXN-1):\n F[i+1] = 2 * F[i] + l\n # s[i+1] = p1 + si + p2 + si + p3\n\n\ndef solve(n, k):\n if n == 0:\n if k > len(f0):\n return '.'\n return f0[k-1]\n\n if k <= lp1:\n return p1[k-1]\n elif k <= lp1 + F[n-1]:\n return solve(n-1, k-len(p1))\n elif k <= lp1 + F[n-1] + lp2:\n return p2[k-lp1-F[n-1]-1]\n elif k <= lp1 + lp2 + 2*F[n-1]:\n return solve(n-1, k-lp1-lp2-F[n-1])\n elif k <= lp1 + lp2 + 2*F[n-1] + lp3:\n return p3[k-lp1-lp2-2*F[n-1]-1]\n else:\n return '.'\n\n\n\n\n\n\nQ = int(input())\n\nans = \"\"\nfor i in range(Q):\n N, K = map(int, input().split())\n ans += solve(N, K)\n\nprint(ans)", "lang": "Python 3", "bug_code_uid": "1c8ad28d9cf0492cc51ab32821f5eb78", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "fb2dd0fa460e47fb36f95d56fd5be56d", "difficulty": 1700, "tags": ["math", "combinatorics", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9977011494252873, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, p = [int(i) for i in input().split()]\ni = 1\nf = True\nwhile n - i*p >= 1:\n if bin(n - i*p)[2:].count(\"1\") <= i and (i < n - i*p):\n print(i)\n f = False\n break\n i += 1\n\nif f:\n print(\"-1\")", "lang": "Python 3", "bug_code_uid": "f95552dcc5d581b4288fda6d303a0bf9", "src_uid": "9e86d87ce5a75c6a982894af84eb4ba8", "apr_id": "2a601148460744e84697fe515defd356", "difficulty": 1600, "tags": ["math", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9975062344139651, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from collections import Counter\nn=int(input())\nl=[]\nfor i in range(n):\n x,y=map(int,input().split())\n l.append(x)\n l.append(y)\nd=Counter(l)\ns1=list(d.values())\nf=True\nif(len(list(d.keys()))<=3):\n print('WIN')\n exit()\nfor p in s1:\n if(p==1):\n print('WIN')\n f=False\n break\n elif(p>=3):\n print('WIN')\n f=False\n break\nif(f):\n print('FAIL')", "lang": "Python 3", "bug_code_uid": "e337c912082c8fcb8e6e16dbeda3c5fa", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "ab7875e0eaef1ac0e98d3b71736d20b8", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8581687612208259, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "mod = 1000000007\ndef power(a, p):\n res = 1\n while p > 0:\n if p % 2 == 1:\n res = (res * a) % mod\n a = (a * a) % mod\n p //= 2\n return res\nn, m = map(int, input().split())\nn += 1\nres = (power(n * 2, m))*(n-m)/n\nres = res % mod\nprint(int(res))", "lang": "Python 3", "bug_code_uid": "68c00b09b9245154fd5e5139c92db301", "src_uid": "4f9711197e699c0fd0c4e9db8323cac7", "apr_id": "53f17a248a70a7796ca109a30bda7016", "difficulty": 2700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1903114186851211, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "result = []\ncout = int(input())\nfor i in range(0,cout):\n\tg = int(input())\n\tresult.append(g)\nresult.sort()\ncout = int(cout)\nif cout%2 != 0:\n\tv = cout//2 + 1;\nelse:\n\tif cout/2 - result[0] == result[cout - 1] - cout/2:\n\t\tv = cout / 2\n\telse: \n\t\tv = cout / 2 + 1\t\nv = int(v)\nprint(result[v-1])", "lang": "Python 3", "bug_code_uid": "b8eb7883b2eb491c27cf5ac4d55e4d07", "src_uid": "f03773118cca29ff8d5b4281d39e7c63", "apr_id": "54f8907d6ef888aa2a46ba697e60c1a8", "difficulty": 800, "tags": ["implementation", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9994455738310848, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#------------------------template--------------------------#\nimport os\nimport sys\nfrom math import *\nfrom collections import *\nfrom fractions import *\nfrom bisect import *\nfrom heapq import*\nfrom io import BytesIO, IOBase\ndef vsInput():\n sys.stdin = open('input.txt', 'r')\n sys.stdout = open('output.txt', 'w')\nBUFSIZE = 8192\nclass FastIO(IOBase):\n newlines = 0\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\nALPHA='abcdefghijklmnopqrstuvwxyz'\nMOD=1000000007\ndef value():return tuple(map(int,input().split()))\ndef array():return [int(i) for i in input().split()]\ndef Int():return int(input())\ndef Str():return input()\ndef arrayS():return [i for i in input().split()]\n\n#-------------------------code---------------------------#\n// vsInput()\n\nn,a,b,c,d=value()\nans=0\n\nminSum=a+b+2\nmaxSum=a+b+2*n\n\nfor mid in range(1,n+1):\n box1=(a+b+mid+1,a+b+mid+n)\n box2=(a+c+mid+1,a+c+mid+n)\n box3=(c+d+mid+1,c+d+mid+n)\n box4=(d+b+mid+1,d+b+mid+n)\n\n minSum=max(box1[0],box2[0],box3[0],box4[0])\n maxSum=min(box1[1],box2[1],box3[1],box4[1])\n\n # print(minSum,maxSum)\n ans+=max(maxSum-minSum+1,0)\n\nprint(ans)\n\n\n\n\n\n\n\n \n\n\n\n \n \n\n\n\n\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "a0153be0ca7168bbf3eb69c9be237367", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "531b52cf4bbb40bde9da4049bd6af643", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8695652173913043, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "import sys\nimport math\nimport bisect\n\nMOD = int(1e9+7)\n\n\n# n = map(int, raw_input().split())\ninput = map(int, raw_input().split())\nif input[-1] == input[0] and input[0] !=0 :\n print 1\nelif input[-1] == input[0] and input[0] == 0 and input[1] == 0:\n print 1\nelse:\n print 0\n", "lang": "PyPy 2", "bug_code_uid": "c53656e69185b6b229007e0d56b509e8", "src_uid": "b99578086043537297d374dc01eeb6f8", "apr_id": "ced5ecbcdcbe9415c798f3abc67ebc27", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9850746268656716, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "# N boxes can be filled with type H or type T objects\n# 1 H object takes 1 box\n# 1 H can turn into M T objects which must take contiguous boxes\n# How many ways to fill N boxes?\n\n# E.g. N=4, M=2 -> return 5: HHHH, HHTT, HTTH, TTHH, TTTT\n\n# Constraints: N <= 10^18\n\n\ndef _solve(n, m, memo):\n\tif n <= 0: return 0\n\tif n < m: return 1\n\tif n == 1: return 2\n\tif (n, m) in memo: return memo[(n, m)]\n\n\tout = 0\n\tmid = n // 2\n\n\t# No M block hanging over 2 halves\n\tout += _solve(mid, m, memo) * _solve(n-mid, m, memo) % 1000000007 \n\n\t# M block over 2 halves\n\tfor i in range(1,m): # i = part of M block in first half\n\t\tif mid-i < 0 or n-mid+i-m < 0: continue\n\t\tn1 = 1 if mid-i == 0 else _solve(mid-i, m, memo)\n\t\tn2 = 1 if n-mid+i-m == 0 else _solve(n-mid+i-m, m, memo)\n\t\tout += n1*n2 \n\n\tmemo[(n, m)] = out\n\treturn out\n\n\ndef solve(n, m):\n\treturn _solve(n, m, {})\n\n\ndef main():\n\tfrom sys import stdin\n\n\tn, m = list(map(int, stdin.readline().strip().split()))\n\tout = solve(n, m)\n\tprint('{}'.format(out))\n\n\nif __name__ == '__main__':\n\tmain()\n", "lang": "Python 3", "bug_code_uid": "cb37d2718d1ec19c389a8ee712990435", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "apr_id": "be865674e0cd7104a64cdbf3a2b36f0f", "difficulty": 2100, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.1348314606741573, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 7, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "def countstr(item, str):\n ret = 0\n for i in xrange(len(str)-len(item)+1):\n ret += (str[i:len(item)+i]==item)\n return ret\n\ndef numerate(n):\n if 1==n:\n return ['4', '7']\n l = numerate(n-1)\n return [item+'4' for item in l] + [item+'7' for item in l] + ['4'+item for item in l] + ['7'+item for item in l]\n\n\ns = raw_input()\ncounts = {}\nfor i in xrange(1, len(s)+1):\n l = numerate(i)\n cont = False\n for item in l:\n counts[item] = countstr(item, s)\n cont = cont or counts[item]!=0\n if not cont:\n break\ntmp = counts.items()\ntmp.sort(cmp=lambda x,y: cmp(x[0],y[0]) if x[1]==y[1] else y[1] - x[1])\nprint tmp[0][0] if tmp[0][1]>0 else -1\n\n\n\n", "lang": "Python 2", "bug_code_uid": "83585fb2fbefe1d493aa7d54d7c0fdef", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "cb5269b6851714dd7e17f38917fb7a2a", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.987012987012987, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "t=[]\nfor i in range(1,501):\n t.append(i(i+1)//2)\nn=int(input())\nif n in t:\n print('YES')\nelse:\n print('NO')", "lang": "Python 3", "bug_code_uid": "d5b26445085d22e74ec6e905099944a9", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "f83a2daadc948ac5ee98d719e7480ed0", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.045845272206303724, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "N = raw_input()\nsoma = 0\nfor i in range(1, int(N) + 1):\n\tsoma += len(str(i))\n\t\n\nprint soma \n", "lang": "PyPy 2", "bug_code_uid": "24398829ba4d1ed494dda7246862b9b2", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "3e01f1118fefa10afcd1cc8c599f523d", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4718987341772152, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "import math\n\n\nvectors = []\n\n\nline_parts = raw_input().split()\nx = int(line_parts[0])\ny = int(line_parts[1])\nn = int(line_parts[2])\nd = int(line_parts[3])\n\nfor i in range(n):\n l = raw_input().split()\n vectors.append((int(l[0]), int(l[1])))\n\nmp = {}\n\ndef canWin(x, y, t, fs, ss):\n\n if math.sqrt(math.pow(x, 2) + math.pow(y, 2)) > float(d):\n return False\n\n if (x, y, t) in mp:\n return mp[(x, y, t)] \n \n result = True \n \n if t == False and ss == False: #if Dasha turn and if dasha hasnt swapped then can swap 1 time\n for v in vectors:\n result = result and (not (canWin(x + v[0], y + v[1], not t, fs, ss)))\n result = result and (not canWin(y, x, not t, fs, True))\n elif t == True and fs == False: #if Anton turn and if Anton hasnt swapped then can swap 1 time\n for v in vectors:\n result = result and (not (canWin(x + v[0], y + v[1], not t, fs, ss)))\n result = result and (not canWin(y, x, not t, True, ss))\n else: #since both has swapped 1 time now cannot swap further\n for v in vectors:\n result = result and (not (canWin(x + v[0], y + v[1], not t, fs, ss)))\n\n \n mp[(x, y, t)] = result\n \n return result\n \n\nresult = False\n\nfor v in vectors:\n result = result or canWin(x + v[0], y + v[1], False, False, False) \n \nif result == True:\n print \"Anton\"\nelse:\n print \"Dasha\"\n \n", "lang": "Python 2", "bug_code_uid": "5ad3c3b0c97900294ed32432eee55ac6", "src_uid": "645a6ca9a8dda6946c2cc055a4beb08f", "apr_id": "3b9cec605364395d580d2c4a6a82ac5e", "difficulty": 1900, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5334291876347951, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "import sys\nfrom array import array # noqa: F401\n\n\ndef input():\n return sys.stdin.buffer.readline().decode('utf-8')\n\n\nx, y, n, d = map(int, input().split())\nvector = [list(map(int, input().split())) for _ in range(n)]\ndp = [-1] * (1 << n)\n\n\ndef solve(bit, x, y):\n if dp[bit] != -1:\n return dp[bit]\n\n for i in range(n):\n if (1 << i) & bit:\n continue\n if (x + vector[i][0]) ** 2 + (y + vector[i][1])**2 <= d**2 and solve(bit | (1 << i), x + vector[i][0], y + vector[i][1]) == 0:\n dp[bit] = 1\n return 1\n\n dp[bit] = 0\n return 0\n\n\nif solve(0, x, y):\n print('Anton')\nelse:\n print('Dasha')\n", "lang": "PyPy 3", "bug_code_uid": "39435dc88fb61ec80d08ead0690fb0a3", "src_uid": "645a6ca9a8dda6946c2cc055a4beb08f", "apr_id": "c594cd2c55ac03a905496969ba548d98", "difficulty": 1900, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6192893401015228, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n=int(input())\na=list(map(int,input().split()))\nb=list(map(int,input().split()))\nc=0\nc1=0\nfor i in a:\n if i>=n:\n c+=1\n break\nfor i in b:\n if i>=n:\n c1+=1\n break\n \nif c=1 or c1=1:\n print('No')\nelse:\n print('Yes')\n", "lang": "Python 3", "bug_code_uid": "955894631bfaac05f7b01e50bfa0fe7a", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "126e7d4c00b1b8cfad3e5431fc31db09", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9848970251716247, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "'''input\n7\n2 3 4 1 6 7 5\n'''\n\ndef rints():\n return list(map(int, input().split()))\n\ndef ri():\n return int(input())\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, a % b)\n\ndef lcm(xs):\n if not xs:\n return 1\n if len(xs) == 1:\n return x[0]\n if len(xs) == 2:\n return (xs[0] * xs[1]) // gcd(xs[0], xs[1])\n return lcm(xs[:-2] + [lcm([xs[-2], xs[-1]])])\n\ndef dfs_cycle_length(arr, u, visited, origin):\n visited.add(u)\n nxt = arr[u-1]\n if nxt in visited:\n return None if nxt != origin else 1\n tmp = dfs_cycle_length(arr, nxt, visited, origin)\n return None if tmp is None else tmp + 1\n\ndef solve(arr):\n cycles = []\n visited = set([])\n for u in range(1, len(arr) + 1):\n if u not in visited:\n length = dfs_cycle_length(arr, u, visited, u)\n if length is None:\n return -1\n cycles.append(length//2 if length % 2 == 0 else length)\n return lcm(cycles)\n\ndef main():\n n = ri()\n arr = rints()\n print(solve(arr))\n\nmain()\n", "lang": "Python 3", "bug_code_uid": "9c53e3b83ca39b0799420b580da3d144", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "7f9009ddbe740221ae2224a57ddfcd5d", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9127659574468086, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "a,b,l,r = map(int,raw_input().split())\ns = \"a\"\nfor i in range(1,a):\n temp = s[i-1]\n #print temp\n x = ord(temp)\n x += 1\n s += chr(x)\n#print s\nfor i in range(b):\n s += s[-1]\n#print s\ntemp = s[-1]\nif b>=a :\n s += s[:a-1]\n s += chr(ord(temp)+1)\nelse :\n s += s[:b]\n s += chr(ord(temp)+1)\n for i in range(a-b-1):\n temp = s[-1]\n #print temp\n x = ord(temp)\n x += 1\n s += chr(x)\n#print s\nfor i in range(b):\n s += s[-1]\n#print s\nlength = len(s)\ns = '_' + s\nif r-l+1 >= length :\n print len(set(s))-1\nelse :\n start = l%length\n if start==0 :\n start = length\n i = start\n end = r%length\n if end==0 :\n end = length\n ans = {}\n while(start!=end) :\n ans[s[start]] = 1\n start += 1\n if start>length :\n start = 1\n ans[s[start]] = 1\n print len(ans)\n ", "lang": "Python 2", "bug_code_uid": "9f2debb63386a2bb391611bfc7495226", "src_uid": "d055b2a594ae7788ecafb3ef80f246ec", "apr_id": "9db8203d1e313f91e3b33ec0bc99fec7", "difficulty": 2200, "tags": ["games", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9911120745718621, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def main(a, b, l, r):\n \n qL = (l - 1) // (2 * a + 2 * b)\n rL = (l - 1) % (2 * a + 2 * b) + 1\n \n qR = (r - 1) // (2 * a + 2 * b)\n rR = (r - 1) % (2 * a + 2 * b) + 1\n #print(qL, qR, rL, rR)\n if qL == qR:\n #In b segment\n if a < rL <= a + b and a < rR <= a + b:\n return 1\n if 2 * a + b < rL and 2 * a + b < rR:\n return 1\n #In a segment\n if 1 <= rL <= a and 1 <= rR <= a:\n return rR - rL + 1\n if a + b < rL <= 2 * a + b and a + b < rR <= 2 * a + b:\n return rR - rL + 1\n #In a + b segment\n if 1 <= rL <= a + b and 1 <= rR <= a + b:\n return a - rL + 1\n if a + b < rL and a + b < rR:\n return (2 * a + b) - rL + 1\n if a < rL <= a + b and a + b < rR <= 2 * a + b:\n return 1 + rR - (a + b)\n if a < rL <= a + b and 2 * a + b < rR:\n return 1 + a\n if 1 <= rL <= a and a + b < rR <= 2 * a + b:\n ans = a - rL + 1 + max(rR - (a + b + b), 0) + min(b, rR) - max(min(rR, b) - rL + 1, 0)\n return ans\n if 1 <= rL <= a and 2 * a + b < rR:\n return a - rL + 1 + a - max(b - rL + 1, 0)\n elif qL == qR - 1:\n #abababab\n newL = qL * (2 * a + 2 * b) + 1\n newR = (qR + 1) * (2 * a + 2 * b)\n \n if 1 <= rL <= a + b and a + b + 1 <= rR:\n return a + max(a - b, 0) + int(a <= b) \n \n if a + b + 1 <= rL <= 2 * (a + b) and (2 * a + 2 * b) + 1 <= rR <= a + b:\n return main(a, b, l - (a + b), r - (a + b))\n \n if 1 <= rL <= a and 1 <= rR <= a:\n return a + max(a - b, 0) + int(a <= b) + rR - max(rR - rL + 1, 0)\n if 1 <= rL <= a and a + 1 <= rR <= a + b:\n return a + max(a - b, 0) + int(a <= b)\n \n if a + 1 <= rL <= a + b and 1 <= rR <= a:\n return 1 + a + max(a - b, 0)\n if a + 1 <= rL <= a + b and a + 1 <= rR <= a + b:\n return 1 + a + max(a - b, 0)\n \n return main(a, b, l - (a + b), r - (a + b))\n \n else:\n return a + max(a - b, 0) + int(a <= b) # + main(a, b, l, (qL + 1) * (2 * a + 2 * b)) + main(a, b, qR * (2 * a + 2 * b) + 1, r)\n\na, b, l, r = [int(item) for item in input().split()]\n\nprint(main(a, b, l, r))", "lang": "PyPy 3", "bug_code_uid": "383d610c3301f84eb5b6455282b05865", "src_uid": "d055b2a594ae7788ecafb3ef80f246ec", "apr_id": "639c733f09a3741542d51c83d0ee641b", "difficulty": 2200, "tags": ["games", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8543689320388349, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "a = input()\ntot = len(a)\nif a[tot-1] = 0:\n m = int(10)\n n = int(a[0:tot-3])\nelse:\n m = int(a[tot-1])\n n = int(a[0:tot-2])\nmin = n//2 + 1\nmax = n\nsmall = min //m\nbig = max //m\nif small % m == 0:\n print(small)\nelif small == big:\n print(-1)\nelif small < big:\n print(small+1)", "lang": "Python 3", "bug_code_uid": "3b803d95ea05805a29e2e81b533c445a", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "0bc53934032ae8a581b1c59ee1e61881", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9488139825218477, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = list(map(int, input().split()))\nl = list(map(int, input().split()))\na = list(map(int, input().split()))\ncnt = []\nfor i in range(m):\n ans = 0\n if a[i] in l:\n for j in range(l.index(a[i]), n):\n if l[j] in a:\n ans += 1\n cnt.append(ans)\nfor i in range(l.index(a[cnt.index(max(cnt))]), n):\n if l[i] in a:\n print(l[i], end=' ')", "lang": "PyPy 3", "bug_code_uid": "2713cfc7de64efb42e06d0d155e178bf", "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72", "apr_id": "7b13c21d16782c4daa0b6b2368809eec", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6095890410958904, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "n=int(input())\ns=input()\na=set()\nmx=0\nfor i in s:\n\tif(isupper(i)):\n\t\ts.clear()\n\telse:\n\t\tif(islower(i)):\n\t\t s.add(i)\n mx=max(mx,len(s))\n\t\t\n\nprint(mx)", "lang": "Python 3", "bug_code_uid": "1bff5da67a4296b71df962280339c858", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "dc2bcec6b4873d965a287ac642a1c73f", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3992015968063872, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "alphabet = 'abcdefghijklmnopqrstuvwxyz'\nalphabet_h = alphabet.upper()\nalpha = tuple(alphabet)\nalpha_h = tuple(alphabet_h)\nn = int(input())\ns = str(input())\ng = 0\ni = 1\n\nwhile i <= n-1:\n if s[i-1] in alpha:\n while s[i] in alpha_h:\n # print(s[i], i)\n g = g + 1\n i = i + 1\n # print(i)\n if i>=n-1 or s[i] in alpha:\n break \n i = i + 1\ni = n - 1\nif s[n-1] in alpha_h and g > 0:\n while s[i] in alpha_h and i>=0:\n g = g - 1\n i = i - 1\nif n = 1 and s[0] in alpha:\n g = 1\n \nprint(g)", "lang": "Python 3", "bug_code_uid": "9e80f11626fca073417c19efb62954d5", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "3aeb4654f0ea4bfc904909206686d4dd", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.314878892733564, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "s = input()\nt = input()\nind = []\nfor i in range(0,len(s)):\n if s[i:i+len(t)] == t:\n ind.append(i)\nss = len(s)\nmaxx = 0\nfor i in ind:\n k = i+len(t)\n maxx = max(len(s[k:ss)]),len(s[0:i]))\nprint(maxx)\n", "lang": "Python 3", "bug_code_uid": "504da64865ab890f7893e3fcbb96afbe", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "apr_id": "08a5f44ca868b69ec575f8137fbaebcb", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9844961240310077, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "input()\nx = []\nfor i in list(map(int,input.split()))[::-1]:\n if not i in x:\n x.append(i)\nprint(len(x))\nprint(*x[::-1]\n", "lang": "Python 3", "bug_code_uid": "8a9260b594d39295158eae447ddf6623", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "b841ffc539a45b5090b6669d305a017b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9968253968253968, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nl=list(map(int,input().split()))\ns=set(l)\nc=0\nwhile len(l)!=len(s):\n\tif l.count(l[c])>1:\n\t\tl.remove(l[c])\n\telse:\n\t\tc+=\nprint(len(l))\nprint(*l)", "lang": "Python 3", "bug_code_uid": "6bd87534222e33e787bd798bb7c36a40", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "32de9d2e1905b629d459def468586c62", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6991525423728814, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "N = int(input())\nM = 10 ** 8 + 5\npr = [True] * M\npr[0], pr[1] = False, False\nfor i in range(2, M):\n if pr[i]:\n for j in range(i * 2, M, i):\n pr[j] = False\n\nprime = list(filter(lambda x: pr[x], range(M)))\n\n\ndef calc(n, k):\n if n == 0:\n return k\n elif n % 2 == 0:\n return n // 2 + k\n else:\n for i in prime:\n if n % i == 0:\n n -= i\n return calc(n, k + 1)\n\n\nprint(calc(N, 0))", "lang": "PyPy 3", "bug_code_uid": "5e76ffb7a53ff50dbcfc62175b36f914", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "7fe9522f246ae01d50b285af6cb42698", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9593810444874274, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def f(a,b):\n m=0\n if a>b:\n return a-b\n else:\n return b-a\nn,b=[int(i) for i in input().split()]\ntb=0\ntn=0\nfor i in range(1,7):\n if f(i,n)f(i,b):\n tb=tb+1\nprint(tn,6-(tb+tn),tb\n \n", "lang": "Python 3", "bug_code_uid": "bbb519bd283dfd9df33640b6a2ec37c9", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "1182cf5b89af846893aa47b5ba630167", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9950248756218906, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "k=int(input()\na=list(map(int,input().split()))\nif max(a)<25:\n print(0)\nelse:\n print(max(a)-25)", "lang": "Python 3", "bug_code_uid": "e6c7df5b63ee95c04e0fa88f6d1b4a9c", "src_uid": "ef657588b4f2fe8b2ff5f8edc0ab8afd", "apr_id": "a4961cc7f1543a6187621ffb2c1a6af2", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6882003955174687, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "from math import ceil\nn,l,r = [int(x) for x in input().split()]\nnumbers = r-l+1\n\n\n\nif l%3 == 0:\n r_0_s = ceil(numbers/3)\n r_1_s = ceil((numbers-1)/3)\n r_2_s = ceil((numbers-2)/3)\nelif l%3 == 1:\n r_0_s = ceil((numbers-2)/3)\n r_1_s = ceil((numbers)/3)\n r_2_s = ceil((numbers-1)/3)\nelse:\n r_0_s = ceil((numbers-1)/3)\n r_1_s = ceil((numbers-2)/3)\n r_2_s = ceil((numbers)/3)\n \n\nr_0 = r_0_s\nr_1 = r_1_s\nr_2 = r_2_s\nfor i in range(1,n):\n r_0_temp = (r_0*r_0_s + r_1*r_2_s+r_2*r_1_s) #% 1000000007\n r_1_temp = (r_1*r_0_s + r_0*r_1_s +r_2*r_2_s ) #% 1000000007\n r_2_temp = (r_1*r_1_s + r_2*r_0_s + r_0*r_2_s) #% 1000000007\n r_0 = r_0_temp\n r_1 = r_1_temp\n r_2 = r_2_temp\n #print(r_0,r_1,r_2)\nprint(r_0 % 1000000007)\n\n\n", "lang": "PyPy 3", "bug_code_uid": "8e820d56892a46738597ec5ce1a93ff6", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "824fa1338c780321c5938c4ff66bbc73", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.11374407582938388, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "s = input().split(' ')\nif len(s) == 3:\n if (s[0].isnumeric()) and (s[1].isnumeric()) and (s[2].replace(\"-\",\"\").isnumeric()):\n n = int(s[0])\n a = int(s[1])\n b = int(s[2])\n if (n >= 1) and (n <= 100) and (a >= 1) and (a <= n) and (b >= -100) and (b <= 100):\n s = \"\"\n copy = \"\"\n for i in range(1, n + 1):\n s += str(i)\n copy = s\n m = abs(b) if abs(b) > n else n\n while len(s) < m:\n s += copy\n indA = s.index(str(a))\n indB = s.index(str(abs(b))) if abs(b) < n else int(s[abs(b) - 1])\n k = 0 if b < 0 else 1 + int(s[indA])\n print(indB - indA + k)", "lang": "Python 3", "bug_code_uid": "5ee40aa5631da59af420ee71c9634096", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "05226d461308d66c564d205250f922d6", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9888251283600121, "equal_cnt": 17, "replace_cnt": 2, "delete_cnt": 9, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "def abc(vertices):\n points = []\n points.append((vertices[0]-vertices[2])**2 + (vertices[1]-vertices[3])**2)\n points.append((vertices[0]-vertices[4])**2 + (vertices[1]-vertices[5])**2)\n points.append((vertices[4]-vertices[2])**2 + (vertices[5]-vertices[3])**2)\n points.sort()\n return points\n\n\ndef almost(vertices, index):\n vertices[index] -= 1\n if (vertices[0] == vertices[2] and vertices[1] == vertices[3]) or (vertices[0] == vertices[4] and vertices[1] == vertices[5]) or (vertices[2] == vertices[4] and vertices[3] == vertices[5]):\n vertices[i] += 1\n return False\n\n if (vertices[0] == vertices[2] and vertices[2] == vertices[4]) or (vertices[1] == vertices[3] and vertices[3] == vertices[5]):\n vertices[i] += 1\n return False\n\n a,b,c = abc(vertices)\n if (a+b == c):\n return True\n \n vertices[index] += 2\n if (vertices[0] == vertices[2] and vertices[1] == vertices[3]) or (vertices[0] == vertices[4] and vertices[1] == vertices[5]) or (vertices[2] == vertices[4] and vertices[3] == vertices[5]):\n vertices[i] -= 1\n return False\n\n if (vertices[0] == vertices[2] and vertices[2] == vertices[4]) or (vertices[1] == vertices[3] and vertices[3] == vertices[5]):\n vertices[i] -= 1\n return False\n\n a,b,c = abc(vertices)\n if (a+b == c):\n return True\n \n vertices[index] -= 1\n return False\n\n\nvertices = map(int, raw_input().split())\ndef run():\n a,b,c = abc(vertices)\n if a+b == c:\n return \"RIGHT\"\n for i in xrange(6):\n if almost(vertices, i):\n return \"ALMOST\"\n return \"NEITHER\"\n\nprint run()\n", "lang": "Python 2", "bug_code_uid": "0757a84712ed4f9e4df9b07f3bd84e88", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "3876744755f419e8687d164c955b465e", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9852216748768473, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a,b,s=map(int,input().split())\nw=s-abs(a)-abs(b)\nif(w>=0 and w%2==0)\n\tprint(\"YES\")\nelse\n\tprint(\"NO\")", "lang": "Python 3", "bug_code_uid": "7df021f663086f5d057cd6b244d492cf", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "bb4bc192eacd75e67c8b8d57f9c7ac13", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.95, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "a,b, step = map(int, input().split())\nstep -= (a+b)\nif step >= 0 and step%2 == 0\n\tprint(\"Yes\")\nelse \n\tprint(\"No\") ", "lang": "Python 3", "bug_code_uid": "7d6cc6ab2684426c2433d0feac5577d2", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "dfb58156650fe654e0b0c5ae15c61876", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.45030425963488846, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "x1 , y1 , x2 , y2 = map(int , raw_input().split())\nx1 += 10000000000\ny1 += 10000000000\nx2 += 10000000000\ny2 += 10000000000\nres1 = (x2 / 2) - ((x1 - 1) / 2)\nres2 = x2 - x1 + 1 - res1\nres3 = (y2 / 2) - ((y1 - 1) / 2)\nres4 = y2 - y1 + 1 - res3\nans = (x2 - x1 + 1) * (y2 - y1 + 1) - res1 * res4 - res2 * res3\nif x1 == x2:\n while 1:\n x1 += x2\nprint ans", "lang": "PyPy 2", "bug_code_uid": "c16d04cd47e199ec04a9921342189608", "src_uid": "00cffd273df24d1676acbbfd9a39630d", "apr_id": "2a236518c6de4a1347ffd06920907df4", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9923371647509579, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=input()\nif len(n)==1:\n print(0)\nelse n[::-1]!=n:\n print(len(n))\nelse:\n while True:\n n=n[:-1]\n s=n[::-1]\n if s!=n:\n print(len(s))\n break\n elif len(s)==1:\n print(0)\n break\n ", "lang": "PyPy 3", "bug_code_uid": "da68b91336bbd6c360f79c992f58b583", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "b560865b63d3a5230aa7c0c1a0de889c", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7894736842105263, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "import sys\n\ndef WeirdSub(a,b):\n while(True):\n if a == 0 or b == 0:\n return a,b\n break\n if a>=(2*b):\n a = a-(2*b)\n WeirdSub(a,b)\n if b>=(2*a):\n b= b-(2*a)\n WeirdSub(a,b)\n else:\n break\n return a,b\n\n#===================MAIN===========\na,b = map(int,sys.stdin.readline().split())\n#print(f\"{a},{b}\")\nl=list(WeirdSub(a,b))\na=l[0]\nb=l[1]\nprint(a,b)\n", "lang": "Python 3", "bug_code_uid": "3ffa74cbea998dc1402a420c72ca7ca4", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "0bf8c49e4da113196ae8f1396f0ad437", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.41743725231175693, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "def satisfies(cnt1, cnt2, onlyX, onlyY, none):\n '''\n tells whether you can form presents using the numbers\n '''\n cnt1 = max(cnt1 - onlyY, 0)\n cnt2 = max(cnt2 - onlyX, 0)\n return (cnt1 + cnt2 <= none)\n\nimport sys\ncnt1, cnt2, x, y = int(sys.stdin.readline()).split()\nbothXY = 0\nonlyX = 0\nonlyY = 0\nnone = 0\nv = 0\nwhile(not satisfies(cnt1, cnt2, onlyX, onlyY, none)):\n v += 1\n if(v % (x * y) == 0):\n bothXY += 1\n elif(v % x == 0):\n onlyX += 1\n elif(v % y == 0):\n onlyY += 1\n else:\n none += 1\nprint v\n", "lang": "Python 2", "bug_code_uid": "69b208e13c35fb6d1af0ad3f08dcc352", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "4b8e8d949af57b61ea0deb667df553f0", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2016244624940277, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "import fileinput\n\ndef str_to_int(s):\n\treturn([ int(x) for x in s.split() ])\n\n# args = [ 'line 1', 'line 2', ... ]\ndef proc_input(args):\n\treturn(str_to_int(args[0]))\n\ndef solve(args, verbose=False):\n\t(cnt_x, cnt_y, x, y) = proc_input(args)\n\tforbid_x = set([ i * x for i in xrange(1, cnt_x + cnt_y) ])\n\tforbid_y = set([ i * y for i in xrange(1, cnt_x + cnt_y) ])\n\tset_x = [ 1 ] * cnt_x\n\tset_y = [ 1 ] * cnt_y\n\tcount_x = count_y = 0\n\ti = 1\n\tif cnt_x > cnt_y:\n\t\tcount_x += 1\n\telse:\n\t\tcount_y += 1\n\twhile count_x < cnt_x or count_y < cnt_y:\n\t\ti += 1\n\t\tif (i not in forbid_x) and (count_x < cnt_x):\n\t\t\tset_x[count_x] = i\n\t\t\tcount_x += 1\n\t\telif (i not in forbid_y) and (count_y < cnt_y):\n\t\t\tset_y[count_y] = i\n\t\t\tcount_y += 1\n\tif verbose:\n\t\tprint i\n\treturn(i)\n\ndef test():\n\tassert(str_to_int('1 2 3') == [ 1, 2, 3 ])\n\tassert(solve([ '3 1 2 3' ]) == 5)\n\tassert(solve([ '1 3 2 3' ]) == 4)\n\nif __name__ == '__main__':\n\tfrom sys import argv\n\tif argv.pop() == 'test':\n\t\ttest()\n\telse:\n\t\tsolve(list(fileinput.input()), verbose=True)\n", "lang": "Python 2", "bug_code_uid": "83f9e8768be78444afcd646e4d2bdc3f", "src_uid": "ff3c39b759a049580a6e96c66c904fdc", "apr_id": "bf79817b6d16c670de0b9836972abfd2", "difficulty": 1800, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.23979591836734693, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "import math\nverno=int(raw_input())\npointlist= list()\nfor i in range(verno):\n point=map(int, raw_input().split())\n pointlist.append(point)\n\nl=0\nw=0\narea=0\nif verno==1:\n print -1\nelse:\n l= abs(pointlist[0][0]-pointlist[1][0])\n w= abs(pointlist[0][1]-pointlist[1][1])\n area=l*w\n print area\n ", "lang": "Python 2", "bug_code_uid": "c53cc1382222a8f4e368e6f4eff32250", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "f4efce3e48b4c6cd5f05bbb3eb0943f2", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9955947136563876, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = raw_input().lower()\ns = filter(lambda c: c not in set(\"aeiou\"), s)\nt = \"\"\nfor c in s:\n t += \".\"+c\nprint t\n", "lang": "PyPy 2", "bug_code_uid": "0aed30eca16e4f2ac74f75de18816c3e", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "2c4e67fed7409f37138964825ca09041", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4055299539170507, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 7, "bug_source_code": "k=int(input())\nans=\"codeforce\"+\"s\"*k\nprint(ans)", "lang": "Python 3", "bug_code_uid": "a4c18769b971168ed5e4e406e0219700", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "59b97c8d9e4ee5b6086812b64651829e", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.06369426751592357, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "k=int(input())\na='codeforce'\nprint(a+'s'*k)\n", "lang": "Python 3", "bug_code_uid": "82f71dd7bc7d0ea818e59a4d2eaf101c", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "a66d8af4d2eec313c544bc0f0e38a639", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9718008556981719, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "# Hey, there Stalker!!!\n# This Code was written by:\n# \u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\n# \u2592\u2592\u2554\u2557\u2554\u2550\u2550\u2550\u2566\u2550\u2550\u2550\u2557\u2592\u2592\u2592\u2554\u2557\u2592\u2592\u2592\n# \u2592\u2554\u255d\u2551\u2551\u2554\u2550\u2557\u2551\u2554\u2550\u2557\u2560\u2557\u2592\u2592\u2551\u2551\u2592\u2592\u2592\n# \u2592\u255a\u2557\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2560\u256c\u2550\u2550\u2563\u2551\u2554\u2557\u2592\n# \u2592\u2592\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2551\u2560\u2563\u2551\u2550\u2563\u255a\u255d\u255d\u2592\n# \u2592\u2554\u255d\u255a\u2563\u255a\u2550\u255d\u2551\u255a\u2550\u255d\u2551\u2551\u2551\u2550\u2563\u2554\u2557\u2557\u2592\n# \u2592\u255a\u2550\u2550\u2569\u2550\u2550\u2550\u2569\u2550\u2550\u2550\u2563\u2560\u2550\u2550\u2569\u255d\u255a\u255d\u2592\n# \u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2554\u255d\u2551\u2592\u2592\u2592\u2592\u2592\u2592\u2592\n# \u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u255a\u2550\u255d\u2592\u2592\u2592\u2592\u2592\u2592\u2592\n# \u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\nfrom functools import reduce\n#from __future__ import division, print_function\n#mod=int(1e9+7)\n#import resource\n#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])\n#import threading\n#threading.stack_size(2**26)\n\"\"\"fact=[1]\n#for i in range(1,100001):\n# fact.append((fact[-1]*i)%mod)\n#ifact=[0]*100001\n#ifact[100000]=pow(fact[100000],mod-2,mod)\n#for i in range(100000,0,-1):\n# ifact[i-1]=(i*ifact[i])%mod\"\"\"\n#from collections import deque, defaultdict, Counter, OrderedDict\n#from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd\n#from heapq import heappush, heappop, heapify, nlargest, nsmallest\n\n\n# sys.setrecursionlimit(10**6) \nfrom sys import stdin, stdout\nimport bisect #c++ upperbound\nfrom bisect import bisect_left as bl #c++ lowerbound bl(array,element)\nfrom bisect import bisect_right as br #c++ upperbound\nimport itertools\nfrom collections import Counter\nimport collections\nimport math\nimport heapq\nimport re\ndef modinv(n,p):\n return pow(n,p-2,p)\ndef cin():\n return map(int,sin().split())\ndef ain(): #takes array as input\n return list(map(int,sin().split()))\ndef sin():\n return input()\ndef inin():\n return int(input())\n \ndef Divisors(n) : \n l = [] \n for i in range(1, int(math.sqrt(n) + 1)) :\n if (n % i == 0) : \n if (n // i == i) : \n l.append(i) \n else : \n l.append(i)\n l.append(n//i)\n return l\n\ndef most_frequent(list):\n return max(set(list), key = list.count) \ndef GCD(x,y):\n while(y):\n x, y = y, x % y\n return x\n\ndef ncr(n,r,p): #To use this, Uncomment 19-25 \n t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p\n return t\n\ndef Convert(string): \n li = list(string.split(\"\")) \n return li \n\ndef SieveOfEratosthenes(n): \n global prime\n prime = [True for i in range(n+1)] \n p = 2\n while (p * p <= n): \n if (prime[p] == True): \n for i in range(p * p, n+1, p): \n prime[i] = False\n p += 1\n f=[]\n for p in range(2, n): \n if prime[p]: \n f.append(p)\n return f\nprime=[]\nq=[]\ndef dfs(n,d,v,c):\n global q\n v[n]=1\n x=d[n]\n q.append(n)\n j=c\n for i in x:\n if i not in v:\n f=dfs(i,d,v,c+1)\n j=max(j,f)\n # print(f)\n return j\n\n#Implement heapq\n#grades = [110, 25, 38, 49, 20, 95, 33, 87, 80, 90] \n#print(heapq.nlargest(3, grades)) #top 3 largest\n#print(heapq.nsmallest(4, grades))\n#Always make a variable of predefined function for ex- fn=len\n#n,k=map(int,input().split())\n\"\"\"*******************************************************\"\"\"\ndef main():\n n=inin()\n print('codeforce'+n*'s')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n######## Python 2 and 3 footer by Pajenegod and c1729\npy2 = round(0.5)\nif py2:\n from future_builtins import ascii, filter, hex, map, oct, zip\n range = xrange\n \nimport os, sys\nfrom io import IOBase, BytesIO\n \nBUFSIZE = 8192\nclass FastIO(BytesIO):\n newlines = 0\n \n def __init__(self, file):\n self._file = file\n self._fd = file.fileno()\n self.writable = \"x\" in file.mode or \"w\" in file.mode\n self.write = super(FastIO, self).write if self.writable else None\n \n def _fill(self):\n s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])\n return s\n \n def read(self):\n while self._fill(): pass\n return super(FastIO,self).read()\n \n def readline(self):\n while self.newlines == 0:\n s = self._fill(); self.newlines = s.count(b\"\\n\") + (not s)\n self.newlines -= 1\n return super(FastIO, self).readline()\n \n def flush(self):\n if self.writable:\n os.write(self._fd, self.getvalue())\n self.truncate(0), self.seek(0)\n \nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n if py2:\n self.write = self.buffer.write\n self.read = self.buffer.read\n self.readline = self.buffer.readline\n else:\n self.write = lambda s:self.buffer.write(s.encode('ascii'))\n self.read = lambda:self.buffer.read().decode('ascii')\n self.readline = lambda:self.buffer.readline().decode('ascii')\n \n \nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\nif __name__== \"__main__\":\n main()\n#threading.Thread(target=main).start()\n", "lang": "Python 3", "bug_code_uid": "bd3e33525a75c2256e4b8db404b4d818", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "3733c8ad962e766767e8ea04b1276355", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.16731517509727625, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nst = \"codeforce\"\ns = \"s\"\nlast = 1\nwhile(n>0):\n if(n>=last):\n n-=last\n st+=s\n last = 2*last\n s = s+s\n else:\n n-=1\n st+=\"s\"\n last = 1\n s = \"s\"\nprint(st)", "lang": "Python 3", "bug_code_uid": "23536355ea72aef8f6cd24fd71a7298d", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "e849ead828752384ec52445d3b12bef5", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1865671641791045, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "t = int(input())\nt=t-1\ns=t*'s'\ns1='codeforces'\ns1=s1+s\nprint(s1)", "lang": "Python 3", "bug_code_uid": "0f9c6ab3e949cfdb722d77901c844afb", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "834432c1780863650475415358569e81", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07481296758104738, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import math\na,b,c,d,e = input().split()\na=int(a)\nb=int(b)\nc = int(c)\nd=int(d)\ne=int(e)\nif(a!=1):\n\tg = a\n\th = g-1\n\tf = a*(g-1)\n\tprint(f)\nelse(print(1))", "lang": "Python 3", "bug_code_uid": "9e2518e69ce5157b5587141f4483c930", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "dbf26069deae174977013ae2756aa4ec", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8214432989690722, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "n=input()\nb=input()\nif len(n)len(b):\n if b in n:\n print(\"automaton\")\n else:\n f=0\n c=list(set(b))\n d=0\n e=0\n count=0\n while count=e and e!=0:\n continue\n else:\n f=1\n break\n if f==1:\n print(\"need tree\")\n else:\n print(\"both\")\nelif len(n)==len(b):\n f=0\n c=list(set(b))\n for i in range(len(c)):\n d=n.count(c[i])\n e=b.count(c[i])\n if d>=e and e!=0:\n continue\n else:\n f=1\n break\n if f==1:\n print(\"need tree\")\n else:\n print(\"array\")", "lang": "Python 3", "bug_code_uid": "2117fbe005bec948baefc58383f2b162", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "01043a901879912409a99fef267cd4c0", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9940256045519203, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import sys\n\ndef solve():\n n, = rv()\n works = 0\n lastworks = -1\n guesses = list()\n for i in range(n):\n a, b, c, = rv()\n acopy = a\n charcount = [0] * 10\n for x in range(4):\n charcount[acopy % 10] += 1\n acopy //= 10\n guesses.append((tolist(a), b, c, charcount))\n\n for i in range(1, 10000):\n if different(i):\n l = tolist(i)\n icopy = i\n charcount = [0] * 10\n for x in range(4):\n charcount[icopy % 10] += 1\n icopy //= 10\n count = 0\n for guess in guesses:\n bulls, cows = 0, 0\n for j in range(4):\n if l[j] == guess[0][j]: bulls += 1\n for j in range(10):\n if charcount[j] > 0 and guess[3][j] > 0: cows+=1\n cows -= bulls\n\n\n if bulls == guess[1] and cows == guess[2]:\n count += 1\n if count == n:\n works += 1\n lastworks = i\n if works == 0:\n print(\"Incorrect data\")\n elif works == 1:\n print(lastworks)\n else:\n print(\"Need more data\")\n\ndef tolist(i):\n il = list()\n while i > 0:\n il.append(i % 10)\n i //= 10\n while len(il) < 4: il.append(0)\n return il[::-1]\n\ndef different(i):\n count = [0] * 10\n for x in range(4):\n count[i % 10] += 1\n i //= 10\n for val in count:\n if val > 1: return False\n return True\n\n\ndef prt(l): return print(''.join(l))\ndef rv(): return map(int, input().split())\ndef rl(n): return [list(map(int, input().split())) for _ in range(n)]\nif sys.hexversion == 50594544 : sys.stdin = open(\"test.txt\")\nsolve()", "lang": "Python 3", "bug_code_uid": "345abc187effe006c08531f1c216c2f0", "src_uid": "142e5f2f08724e53c234fc2379216b4c", "apr_id": "cf3b48194ac2423138bbb9c1c139e0a1", "difficulty": 1700, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8906497622820919, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def is_sat(candi, cont):\n candi_match = cont[0]\n _bcount = int(cont[1])\n _ccount = int(cont[2])\n bcount = 0\n ccount = 0\n for i in xrange(4):\n if candi_match[i] == candi[i]:\n bcount += 1\n elif candi_match[i] in candi:\n ccount += 1\n return (_bcount == bcount and _ccount == ccount)\n \nconstraints = []\n\nN = int(raw_input())\nwhile N>0:\n constraints.append([x for x in raw_input().split()])\n N-=1\nsatisfies = []\nfor i in xrange(0,10000):\n candi = str(i).rjust(4,'0')\n satcount = 0\n for cont in constraints:\n if is_sat(candi, cont):\n satcount+=1\n if satcount == len(constraints):\n satisfies.append(candi)\n \ngoo = len(satisfies)\nif goo == 1:\n print satisfies[0]\nelif goo == 0:\n print \"Incorrect data\"\nelse:\n print \"Need more data\"", "lang": "Python 2", "bug_code_uid": "8e7d315ae7371c86fdc047462ef19e5a", "src_uid": "142e5f2f08724e53c234fc2379216b4c", "apr_id": "812c7e2820b4423676123286ca9e42e2", "difficulty": 1700, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.1608738828202582, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "p,k=map(int,input().split())\nif p=k or p+ms*k<0:\n if t%2==0:\n while p+ms*k>=k:\n ms-=1\n else:\n while p+ms*k<0:\n ms+=1\n a.append(p+ms*k)\n t+=1\n p=ms\n ms=0\n print(len(a)+1)\n for i in a:\n print(i,end=' ')\n print(1)\n\n", "lang": "Python 3", "bug_code_uid": "5b87a61612048e305202199ef60403df", "src_uid": "f4dbaa8deb2bd5c054fe34bb83bc6cd5", "apr_id": "eec6cc1e4560cb57af702bf45dfeffba", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9157303370786517, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n = list(map(int,input().split()))\n\nar = []\nj = 1\n\nwhile n!=0:\n q = n[0]%n[1]\n n[0] //= n[1]\n n[0] = -1*n[0]\n #j += 1\n ar.append(q)\n\nprint(len(ar))\nfor i in range(len(ar)):\n print(ar[i])\n\n\n", "lang": "Python 3", "bug_code_uid": "cc0bca5600bc18bb11f0f1cd00e46432", "src_uid": "f4dbaa8deb2bd5c054fe34bb83bc6cd5", "apr_id": "7db75e45cc932ef96375fd74e17b2212", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6865671641791045, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "a,b,c=map(int,raw_input().split())\nprint c/(b*a)", "lang": "Python 2", "bug_code_uid": "702af6bf7ee37c20ea535840e2ed305d", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "547a72958e8008f1ba915411648d1ca8", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7314285714285714, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "(p, k) = map(int, input().split())\nused = [0] * p\nif k == 0:\n print(pow(p, p - 1) % (10 ** 9 + 7))\nelse:\n c = 1 if k == 1 else 0\n for x in range(1, p):\n if not used[x]:\n y = x\n while not used[y]:\n used[y] = True\n y = k * y % p\n c += 1\n print(pow(p, c) % (10 ** 9 + 7))", "lang": "Python 3", "bug_code_uid": "dfdb36b0dba3db5fe3c2a28b32aa84b4", "src_uid": "580bf65af24fb7f08250ddbc4ca67e0e", "apr_id": "c1bc10aeb133b70ce074339b5f94a01e", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "dsu"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7001972386587771, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "[p, k] = map(int, raw_input().split())\n#g = [-1] * p\n#for i in range(p):\n# parent = (i * k) % p\n# g[i] = parent\n#comps = 0; vis = [False] * p\n#for i in range(1,p):\n# if not vis[i]: comps += 1\n# cur = i\n# while cur > 0 and not vis[cur]:\n# vis[cur] = True; cur = g[cur]\nord_k = 1\nwhile pow(k, ord_k, p) != 1: ord_k += 1\ncomps = (p - 1) / ord_k\nif k == 1: print pow(p, p, pow(10,9) + 7)\nelse: print pow(p, comps, pow(10,9) + 7)\n", "lang": "Python 2", "bug_code_uid": "adecc712aa1ac0c4abd2348184215de7", "src_uid": "580bf65af24fb7f08250ddbc4ca67e0e", "apr_id": "687ec91d8711d77c6bb4e404940ff345", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "dsu"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.18059299191374664, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "from itertools import permutations\n\nn=list(input())\nele=list(permutations(n,len(n)))\n\nans=[]\nfor i in range(0,len(ele)):\n m=int(\"\".join(ele[i]))\n if len(list(str(m)))==len(n) and m[0]!='0':\n ans.append(m)\nn=int(input())\nif min(ans)==n:\n print(\"OK\")\nelse:\n print(\"WRONG_ANSWER\")\n\n \n", "lang": "PyPy 3", "bug_code_uid": "8eb82a5cdd0dfb70bcc64038f83ce1bb", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "22d3ff17b90fd2872bb7eee132637de3", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8992248062015504, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "# https://codeforces.com/problemset/problem/1060/A\nn=int(input())\nstring = input()\nstring = string.replace('9','0')\narr = sorted(list(string))\ni=0\nj=n-1\nans=0\nwhile i= 8999:\n c = 8999\n st = 10116100\nelif k >= 7999:\n c = 7999\n st = 9010000\nelif k >= 6999:\n c = 6999\n st = 3311020\nelif k >= 4999:\n c = 4999\n st = 2000008\nelse:\n c = 0\n st = 19\n \nfor i in range(st, 20000000):\n \n x = sum(map(int, str(i)))\n if x == 10:\n c += 1\n if c == k:\n print i\n break", "lang": "Python 2", "bug_code_uid": "effe4db50b32002192e4b9cb5aa0ccde", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "2477620bcdb47db2c3d966b781280728", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8828862863619191, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env python\n\"\"\"\"\"\"\nfrom __future__ import division, print_function\n\nimport os\nimport sys\nfrom io import BytesIO, IOBase\n\nif sys.version_info[0] < 3:\n from __builtin__ import xrange as range\n from future_builtins import ascii, filter, hex, map, oct, zip\nelse:\n _str = str\n str = lambda x=b\"\": x if type(x) is bytes else _str(x).encode()\n\n\ndef main():\n n = int(readline())\n a = readlist()\n\n s = 0\n\n p2 = 0\n p = 0\n for i in a:\n if (i == 2) and (p == 1) and (p2 == 3):\n s += 2\n elif (i in [1, 2]) and (p in [1, 2]):\n s += 3\n elif (i in [1, 3]) and (p in [1, 3]):\n s += 4\n elif (i in [2, 3]) and (p in [2, 3]):\n print('Infinite')\n return\n\n p2 = p\n p = i\n\n print('Finite')\n print(s)\n\n\n# region template\n\nBUFSIZE = 8192\n\n\nclass FastIO(IOBase):\n newlines = 0\n\n def __init__(self, file):\n self._buffer = BytesIO()\n self._fd = file.fileno()\n self._writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self._buffer.write if self._writable else None\n\n def read(self):\n if self._buffer.tell():\n return self._buffer.read()\n return os.read(self._fd, os.fstat(self._fd).st_size)\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self._buffer.tell()\n self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)\n self.newlines -= 1\n return self._buffer.readline()\n\n def flush(self):\n if self._writable:\n os.write(self._fd, self._buffer.getvalue())\n self._buffer.truncate(0), self._buffer.seek(0)\n\n\nclass ostream:\n def __lshift__(self, a):\n if a is endl:\n sys.stdout.write(b\"\\n\")\n sys.stdout.flush()\n else:\n sys.stdout.write(str(a))\n return self\n\n\ndef print(*args, **kwargs):\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\n sep, file = kwargs.pop(\"sep\", b\" \"), kwargs.pop(\"file\", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop(\"end\", b\"\\n\"))\n if kwargs.pop(\"flush\", False):\n file.flush()\n\n\nsys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\ncout, endl = ostream(), object()\n\nreadline = sys.stdin.readline\nreadlist = lambda var=int: [var(n) for n in readline().split()]\ninput = lambda: readline().rstrip(b\"\\r\\n\")\n\n# endregion\n\nif __name__ == \"__main__\":\n main()\n", "lang": "PyPy 2", "bug_code_uid": "46e0483a5f522265a3385fad58058efd", "src_uid": "f22b6dab443f63fb8d2d288b702f20ad", "apr_id": "c2b4f41639e5b8b5bdb109508f3cb3c1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4625267665952891, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\ntemp = []\nwhile n >= 10:\n x = n % 10\n temp.append(min(x,9-x))\nif n != 9:\n temp.append(min(n,9-n))\nelse:\n temp.append(n)\nres = 0\nfor i in range(len(temp)):\n res += temp[i]*(10**i)\nprint(res)", "lang": "PyPy 3", "bug_code_uid": "446e6140a4ec844893e75488d7c30b5f", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "0668465f652643b66716f3715463db4f", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.0035995074358245714, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "n = int(input())\n\ndp = [[[0, 0] for x in range(n+1)] for i in range(n+1)]\nmod = 10**9+7\nfor i in range(1, n + 1):\n dp[0][i][0] = dp[0][i - 1][1]\n dp[0][i][1] = dp[0][i - 1][0] + 1\nfor i in range(1, n + 1):\n for j in range(i, n + 1):\n t = [0, 0, 0]\n if i > 0:\n dp[i][j][0] += dp[i-1][j][1]\n t[0] = dp[i - 1][j][1]\n t[1] = dp[i - 1][j][1]\n t[2] = dp[i - 1][j][0] + 1\n if j > i:\n dp[i][j][0] += dp[i][j-1][1]\n t[0] += dp[i][j - 1][1]\n t[1] += dp[i][j - 1][0] + 1\n t[2] += dp[i][j - 1][1]\n for k in t: dp[i][j][1] = max(dp[i][j][1], k)\nprint(dp[n][n][1]%mod)\n", "lang": "Python 3", "bug_code_uid": "cc3a0a7f003354f9dd0b60ccabd60f98", "src_uid": "8218255989e5eab73ac7107072c3b2af", "apr_id": "95c8457a4722f9326c10b66dc55ca975", "difficulty": 2100, "tags": ["trees", "dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9655172413793104, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "N = int(input())\ndp = [[0]*(N+1) for _ in range(N+1)]\ndp[1][0] = 1\ndp[1][1] = 1\nfor i in range(2, N+1):\n if i % 2:\n dp[i][i] = 1 + i//2\n else:\n dp[i][i] = i//2\n for j in range(i-1, -1, -1):\n dp[i][j] = dp[i][j+1] + dp[i-1][j-1] + j%2\nprint(dp[-1][0])", "lang": "PyPy 3", "bug_code_uid": "a7b905690d460c1f4bcd9a8134bae894", "src_uid": "8218255989e5eab73ac7107072c3b2af", "apr_id": "934b6f3329b01e4bb52adc8d3120546b", "difficulty": 2100, "tags": ["trees", "dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9537599252685661, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "from math import sqrt, ceil\nfrom collections import namedtuple\n\ndef add(a, b):\n return a[0] + b[0], a[1] + b[1]\n\ndef count(p):\n return p * (3 * p + 2)\n\n\ndef bin_search(n):\n l = 0\n r = ceil(sqrt(n))\n while r - l > 1:\n m = (l + r) // 2\n if count(m) > n:\n r = m - 1\n else:\n l = m\n if count(r) > n:\n return l\n else:\n return r\n\n\ndef get_pos(n, p):\n if n < p: # /\n return add( (p - 1, -2 * p + 2), (n, 2 * n) ) \n n -= p\n if n < p - 1: # \\\n return add( (1 + 2 * (p - 1), 2), (-n, 2 * n) )\n n -= p - 1\n if n < p: # -\n return add( (p, 2 * p), (-2 * n, 0) )\n n -= p\n if n < p: # /\n return add( (-p, 2 * p), (-n, -2 * n) )\n n -= p\n if n < p: # -\n return add( (-2 * p, 0), (n, -2 * n) )\n raise RuntimeError(\"You're a big guy\")\n\n\nn = int(input())\nif n == 0:\n print(0, 0)\nelse:\n p = bin_search(n)\n start = count(p)\n n -= start\n ans = get_pos(n, p + 1)\n print(ans[0], ans[1])\n", "lang": "Python 3", "bug_code_uid": "f9318a0cf62a5ddf7e3fae4e1bcf103d", "src_uid": "a4b6a570f5e63462b68447713924b465", "apr_id": "83c8c2587cf9917d8d090ddf5741a10a", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9788732394366197, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(raw_input())\na = map(int, raw_input().split())\nm = min(a)\nif sum(x == m for x in a) > n / 2:\n print 'Bob'\nelif c:\n print 'Alice'\n", "lang": "Python 2", "bug_code_uid": "6304f870c50098aff1c6c25f03e3be27", "src_uid": "4b9cf82967aa8441e9af3db3101161e9", "apr_id": "758795d8c31ba1f644080837ee608ae0", "difficulty": 2000, "tags": ["games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5, "equal_cnt": 28, "replace_cnt": 9, "delete_cnt": 9, "insert_cnt": 10, "fix_ops_cnt": 28, "bug_source_code": "tri = lambda k:(k*(k+1))//2\nx = int(input())\np = 50000\nf=0\nfor i in range(1,p):\n for j in range(1,p):\n if (tri(i)+tri(j))==x:\n print('YES')\n f=1\n break\n if f:\n break\nif not f :\n print(\"NO\")\n", "lang": "PyPy 3", "bug_code_uid": "f612ecfc03ef3050e30702221f3344da", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "6f3388b23435e116f0f6732cf2553c45", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.884272997032641, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "from collections import deque\nn = int(input())\na = list(map(int, input().split()))\ncnt = 0\ndone = deque()\ni = 2\nwhile len(done) < n:\n x = len(done)\n for j in range(n):\n if j not in done and a[j] % i == 0:\n done.append(j)\n i += 1\n if x != len(done):\n cnt += 1\nprint(cnt)\n", "lang": "Python 3", "bug_code_uid": "848f8f4253eed79f6745b5a93833fcf8", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "fa0bafe19341f125e46a4fc7cced229c", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.985167837626854, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import fileinput\n\n### ###\n# utility func #\n### ###\n\ndbug = True\n\ndef stoi(s):\n\treturn([ int(x) for x in s.split() ])\n\ndef pd(s, label=''):\n\tglobal dbug\n\tif dbug:\n\t\theader = 'debug:'\n\t\tif label != '':\n\t\t\theader += ' (%s)\\t' % label\n\t\tprint header, s\n\n### ###\n# code follows #\n### ###\n\nFACTORIAL = [ 1, 1 ]\ndef fac(n):\n\tglobal FACTORIAL\n\twhile len(FACTORIAL) <= n:\n\t\tFACTORIAL.append(FACTORIAL[-1] * len(FACTORIAL))\n\treturn FACTORIAL[n]\n\ndef com(n, k):\n\treturn fac(n) / (fac(k) * fac(n - k))\n\n# args = [ 'line 1', 'line 2', ... ]\ndef proc_input(args):\n\treturn(stoi(args[0]))\n\ndef solve(args, verbose=False):\n\t(n, m) = proc_input(args)\n\t(b, nb) = (n / m, m - n % m)\n\t(f, nf) = (b + 1, m - nb)\n\tk_min = com(b, 2) * nb + com(f, 2) * nf\n\tk_max = com(n - (m - 1), 2)\n\tif verbose:\n\t\tprint k_min, k_max\n\treturn k_min, k_max\n\ndef test():\n\tassert(fac(0) == fac(1) == 1)\n\tassert(fac(2) == 2)\n\tassert(fac(3) == 6)\n\tassert(com(5, 2) == 10)\n\tassert(solve([ '5 1' ]) == (10, 10))\n\tassert(solve([ '3 2' ]) == (1, 1))\n\tassert(solve([ '6 3' ]) == (3, 6))\n\tassert(solve([ '5 3' ]) == (2, 3))\n\nif __name__ == '__main__':\n\tfrom sys import argv\n\tif argv.pop() == 'test':\n\t\ttest()\n\telse:\n\t\tdbug = False\n\t\tsolve(list(fileinput.input()), verbose=True)\n", "lang": "Python 2", "bug_code_uid": "1d97253a2fe2ca480a14a1043f2cb24b", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "89dcdcafbaea90f760784fc0049a432a", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.24824355971896955, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 11, "bug_source_code": "(n, k)=[int(x) for x in input().split()]\n\nres =-1\ndp = [1] * (n+1)\nfor i in range(n,0,-1):\n if dp[i] >= k:\n res = i\n break\n imod2 = i % 2\n if imod2 == 0:\n dp[i//2] += dp[i]\n else: \n dp[i-1] += dp[i]\n\n#print(dp)\nprint(res)\n\n", "lang": "PyPy 3", "bug_code_uid": "e6d071f315f699df0a1542ddae4acf32", "src_uid": "783c4b3179c558369f94f4a16ac562d4", "apr_id": "f5cf18d53326c3074844651220465bc0", "difficulty": 2100, "tags": ["dp", "math", "combinatorics", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23930131004366811, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "from math import *\nfrom collections import *\nimport sys\nsys.setrecursionlimit(10**9)\n\nmod = 10**9 + 7\nn,x = map(int,input().split())\n#for y in range(1):\na = [0 for i in range(n+1)]\nans = 0\nfor i in range(1,n+1):\n\tj = i\n\twhile(j >= 1):\n\t\ta[j] += 1\n\t\tif(j%2 == 0):\n\t\t\tj //= 2\n\t\telse:\n\t\t\tj -= 1\nfor i in range(n,0,-1):\n\tif(a[i] >= x):\n\t\tprint(i)\n\t\tbreak\n\n", "lang": "PyPy 3", "bug_code_uid": "c439343bafd8b805620e20b31bff341f", "src_uid": "783c4b3179c558369f94f4a16ac562d4", "apr_id": "ccca80cc09756c476e57390d4c9bb796", "difficulty": 2100, "tags": ["dp", "math", "combinatorics", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.557997557997558, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "def f(t,n):\n if(t>n):\n return 0\n if(t%2==1):\n return f(2*t,n)+1\n else:\n return f(2*t,n)+f(t+1,n)+1\ndef search(low,high,k,n):\n if(low>high):\n return 1\n mid=(low+high)//2\n\n if(mid%2==0 and low%2==1):\n mid-=1\n elif(mid%2==1 and low%2==0):\n mid-=1\n x=f(mid,n)\n y=f(mid+2,n)\n if(x>=k and y=k):\n return search(mid+2,high,k,n)\n else:\n return search(low,mid-2,k,n)\nl=input().split()\nn=int(l[0])\nk=int(l[1])\nif(n%2==0):\n print(max(search(1,n-1,k,n),search(2,n,k,n)))\nelse:\n print(max(search(1,n,k,n),search(2,n-1,k,n)))\n", "lang": "PyPy 3", "bug_code_uid": "7a43cdbd53f6a20a955cfeec6f7e96ca", "src_uid": "783c4b3179c558369f94f4a16ac562d4", "apr_id": "bb7ac122536f0f6a624ac4d8d239a4a0", "difficulty": 2100, "tags": ["dp", "math", "combinatorics", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9963031423290203, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "N, K = [int(x) for x in input().split(' ')]\n\ndef f(x):\n ret, i = 0, 0\n while (x << i) <= N:\n ret += min(N, (x << i) + (1 << i) - 1) - (x << i) + 1\n i += 1\n return ret\n\nlo, hi = 1, N//2\nwhile lo != hi:\n mi = (lo + hi + 1)//2\n if f(2*mi) + f(2*mi+1)>= K:\n lo = mi\n else:\n hi = mi - 1\nif f(2*lo) + f(2*lo+1) < K:\n lo = 0\n\nlo2, hi2 = 0, (N-1)//2\nwhile lo2 != hi2:\n mi2 = (lo2 + hi2 + 1)//2\n if f(2*mi2+1) >= K:\n lo2 = mi2\n else:\n hi2 = mi2 - 1\n\n\n\nprint(max(2*lo, 2*lo2+1))\n\n", "lang": "PyPy 3", "bug_code_uid": "c2879e8a4176e8febbac801f45369b40", "src_uid": "783c4b3179c558369f94f4a16ac562d4", "apr_id": "da25c2474b7423e44aefa49d36f6d605", "difficulty": 2100, "tags": ["dp", "math", "combinatorics", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9084956882785052, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "\"\"\"\n Satwik_Tiwari ;) .\n 5th AUGUST , 2020 - WEDNESDAY\n\"\"\"\n\n#===============================================================================================\n#importing some useful libraries.\nfrom __future__ import division, print_function\n\nfrom fractions import Fraction\nimport sys\nimport os\nfrom io import BytesIO, IOBase\n\nfrom itertools import *\nimport bisect\nfrom heapq import *\nfrom math import *\nfrom copy import *\nfrom collections import deque\nfrom collections import Counter as counter # Counter(list) return a dict with {key: count}\nfrom itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]\nfrom itertools import permutations as permutate\nfrom bisect import bisect_left as bl\n#If the element is already present in the list,\n# the left most position where element has to be inserted is returned.\nfrom bisect import bisect_right as br\nfrom bisect import bisect\n#If the element is already present in the list,\n# the right most position where element has to be inserted is returned\n\n#==============================================================================================\n#fast I/O region\nBUFSIZE = 8192\n\n\nclass FastIO(IOBase):\n newlines = 0\n\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\n self.write = self.buffer.write if self.writable else None\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b\"\\n\") + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\n self.read = lambda: self.buffer.read().decode(\"ascii\")\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\n\n\ndef print(*args, **kwargs):\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\n sep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\n at_start = True\n for x in args:\n if not at_start:\n file.write(sep)\n file.write(str(x))\n at_start = False\n file.write(kwargs.pop(\"end\", \"\\n\"))\n if kwargs.pop(\"flush\", False):\n file.flush()\n\n\nif sys.version_info[0] < 3:\n sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\nelse:\n sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\n\n# inp = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\n\n#===============================================================================================\n### START ITERATE RECURSION ###\nfrom types import GeneratorType\ndef iterative(f, stack=[]):\n def wrapped_func(*args, **kwargs):\n if stack: return f(*args, **kwargs)\n to = f(*args, **kwargs)\n while True:\n if type(to) is GeneratorType:\n stack.append(to)\n to = next(to)\n continue\n stack.pop()\n if not stack: break\n to = stack[-1].send(to)\n return to\n return wrapped_func\n#### END ITERATE RECURSION ####\n\n#===============================================================================================\n#some shortcuts\n\nmod = 1000000007\ndef inp(): return sys.stdin.readline().rstrip(\"\\r\\n\") #for fast input\ndef out(var): sys.stdout.write(str(var)) #for fast output, always take string\ndef lis(): return list(map(int, inp().split()))\ndef stringlis(): return list(map(str, inp().split()))\ndef sep(): return map(int, inp().split())\ndef strsep(): return map(str, inp().split())\n# def graph(vertex): return [[] for i in range(0,vertex+1)]\ndef zerolist(n): return [0]*n\ndef nextline(): out(\"\\n\") #as stdout.write always print sring.\ndef testcase(t):\n for p in range(t):\n solve()\ndef printlist(a) :\n for p in range(0,len(a)):\n out(str(a[p]) + ' ')\ndef lcm(a,b): return (a*b)//gcd(a,b)\ndef power(a,b):\n ans = 1\n while(b>0):\n if(b%2==1):\n ans*=a\n a*=a\n b//=2\n return ans\ndef ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))\ndef isPrime(n) :\n if (n <= 1) : return False\n if (n <= 3) : return True\n if (n % 2 == 0 or n % 3 == 0) : return False\n i = 5\n while(i * i <= n) :\n if (n % i == 0 or n % (i + 2) == 0) :\n return False\n i = i + 6\n return True\n\n#===============================================================================================\n# code here ;))\n\n\ndef solve():\n n,k = sep()\n\n cnt = [0]*(n+1)\n for i in range(1,n+1):\n if(i%2==1):\n curr = [i,i]\n cnt[i] = 1\n else:\n curr = [i,i+1]\n cnt[i] = 2\n\n while(2*curr[1]+1=k):\n print(i)\n return\n\n\n\n\ntestcase(1)\n# testcase(int(inp()))\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "b8e59010541e7ca6007c3d10db63c99e", "src_uid": "783c4b3179c558369f94f4a16ac562d4", "apr_id": "e609a854971ae23d31a36a4408f5ccf0", "difficulty": 2100, "tags": ["dp", "math", "combinatorics", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.952191235059761, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "# IN THE NAME OF GOD\ndef get_number(string_number):\n string_number = str(string_number)\n a = string_number[0]\n d = string_number[2:string_number.find(\"e\")]\n e =int( string_number[string_number.find(\"e\")+1:])\n if e == len(d):\n return a+d\n elif e < len(d):\n num = a + d[:e]+\".\"+d[e:]\n if num[len(num)-1] == \".\":\n return num[:len(num)-1]\n else: return num\n else : return a+d+\"0\"*(e- len(d))\n\nprint(get_number(input()))", "lang": "Python 3", "bug_code_uid": "ff510f39b8d24807a4e7c923ed55caee", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "bc02ea85dcb190c19bf1f2506358f481", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4386873920552677, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "n = int(input())\ns = str(input())\nk = 0\ncn = 0\nl = []\nans = 0\nwhile k!=n:\n j = k\n ok = 0\n while str[j] == 'B':\n cn++;\n j+=1\n ok = 1\n l.append(cn) \n if ok == 1:ans+=1\n\nprint(ans)\nwhile ans > 0:\n print(l[ans - 1] , ' ')\n ans-=1", "lang": "Python 3", "bug_code_uid": "cf54831bf804a03805a655b79b15a4a8", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "6f3542287f883d5f782b675607d4dae1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.0469208211143695, "equal_cnt": 6, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "\nn=int(input())\n\nF=[0 for i in range(n+10-n%10)]\nfor i in range(n+10-n%10):\n if i==9:\n F[i]=1\n else:\n if (i+1)%10==0:\n F[i]=F[int(i/10)]\n else:\n F[i]=i+1\nres=0\ntemp=n\n \nwhile temp!=9:\n \n temp=F[temp]\n res=res+1\n \n \n\nprint(res+2)", "lang": "PyPy 3", "bug_code_uid": "a0eec2c36498a8c129cae5d45d2b3628", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "89f0be2c024b91dfb6e5b06a2b357aa4", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9967400162999185, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a=map(int,raw_input().split())\nb=map(int,raw_input().split())\nc=map(int,raw_input().split())\nd=map(int,raw_input().split())\nacc=False\nfor x in range(2):\n if a[3]*a[x]==1:\n acc=True\nfor x in range(2):\n if b[3]*b[x]==1:\n acc=True\nfor x in range(2):\n if c[3]*c[x]==1:\n acc=True\nfor x in range(2):\n if d[3]*d[x]==1:\n acc=True\n\n\n \nfor x in range(3):\n if a[0]==1 and d[3]==1:\n acc=True\nfor x in range(3):\n if a[1]==1 and c[3]==1:\n acc=True\nfor x in range(3):\n if a[2]==1 and b[3]==1:\n acc=True\n\n\n\n\n\nfor x in range(3):\n if b[0]==1 and a[3]==1:\n acc=True\nfor x in range(3):\n if b[1]==1 and d[3]==1:\n acc=True\n \nfor x in range(3):\n if b[2]==1 and c[3]==1:\n acc=True\n\n\nfor x in range(3):\n if c[0]==1 and b[3]==1:\n acc=True\nfor x in range(3):\n if c[1]==1 and a[3]==1:\n acc=True\nfor x in range(3):\n if c[2]==1 and d[3]==1:\n acc=True\n\nfor x in range(3):\n if d[0]==1 and c[3]==1:\n acc=True\nfor x in range(3):\n if d[1]==1 and b[3]==1:\n acc=True\nfor x in range(3):\n if d[2]==1 and a[3]==1:\n acc=True\n\nif acc==True:\n print 'YES'\nelse:\n print 'NO'\n\n\n\n \n \n\n", "lang": "Python 2", "bug_code_uid": "67372c3fbf3d858b4963f1f22fabdb5f", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "apr_id": "3bcefda2307eb922dbdd47922e466599", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9521739130434783, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def get_input():\n hahaha=input()\n (n,k,m)=hahaha.split(sep=None, maxsplit=1000)\n return (int(n),int(k),int(m))\n(n,k,m)=get_input()\nf=[0 for i in range(k)]\n \ns=0 \n\nfor v in range(n):\n tens = 10**v\n f=[ (sum( [f[(j+k-(x+1)*tens%k)%k] for x in range(9)] )+f[j])%m for j in range(k)]\n for x in range(9):\n f[(x+1)*tens%k]+=1\n if n-v-1==0:\n s+=(f[0]%m)\n else:\n s+=f[0]*((10**(n-v-2)*9))%m\n f[0]=0\n\nprint(s%m)", "lang": "Python 3", "bug_code_uid": "50ac7547f2ed579f88749d572e11c47b", "src_uid": "656bf8df1e79499aa2ab2c28712851f0", "apr_id": "ab1211f76178eabf562d815516572a6d", "difficulty": 2200, "tags": ["dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3646034816247582, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "global debug\ndebug = 0\n\nline = map(int, raw_input().split())\nn = line[0]\nk = line[1]\nm = line[2]\n\nr = [[0 for _ in xrange(k)] for _ in xrange(n)]\nt = [[0 for _ in xrange(k)] for _ in xrange(n)]\n\nfor i in xrange(10):\n r[0][i % k] += 1\n\nbase = 1\nfor i in xrange(1, n):\n base *= 10\n if (i == n - 1): start = 1\n else: start = 0\n for c in xrange(start, 10):\n offset = c * base\n for j in xrange(k):\n #for pre in xrange(i):\n r[i][j] += r[i - 1][(j - (c * base) % k) % k]\nif (debug >= 2): print r\n\nt[0][0] = r[0][0] - 1\nbase = 1\nfor i in xrange(1, n):\n base *= 10\n t[i][0] = r[i][0]\n if (i == n - 1):\n start = 1\n else:\n start = 0\n t[i][0] -= 1\n for c in xrange(start, 10):\n offset = c * base\n for j in xrange(k):\n if ((offset + j) % k != 0):\n t[i][(offset + j) % k] += t[i - 1][j]\nif (debug >= 2): print t\nprint sum(t[n - 1]) % m\n", "lang": "Python 2", "bug_code_uid": "dafbb8bdebfb586293a0d2c0dc33c5d4", "src_uid": "656bf8df1e79499aa2ab2c28712851f0", "apr_id": "d11a2d07445504c040559cc2976866df", "difficulty": 2200, "tags": ["dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9119718309859155, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def great():\n\ta.split()\n\tb.split()\n\tif s.index(a[0]) > s.index(b[0]):\n\t\t\n\t\tprint(\"YES\")\n\telse:\n\t\tprint(\"NO\")\n\n\nt=input()\na,b=map(str,input().split())\ns='6789TJQkA'\nif(t in a):\n\tif t in b:\n\t\tgreat()\n\telse:\n\t\tprint(\"YES\")\nelif(t in b):\n\tprint(\"NO\")\nelse:\n\tgreat()\n\t\n", "lang": "PyPy 3", "bug_code_uid": "f08a5c4bac2f8d4403b30dadbff5c999", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "76c642fa1c2e4fb56d2b7368d773dae4", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.476319350473613, "equal_cnt": 15, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "n = input()\nf = list(map(str, input().split()))\ns = list(map(str, input().split()))\n\nd1 = abs(f.count('1')-s.count('1')\nd2 = abs(f.count('2')-s.count('2')\nd3 = abs(f.count('3')-s.count('3')\nd4 = abs(f.count('4')-s.count('4')\nd5 = abs(f.count('5')-s.count('5')\n\nif d1%2==0 and d2%2==0 and d3%2==0 and d4%2==0 and d5%2==0 :\n\tprint((d1+d2+d3+d4+d5)//4)\nelse :\n\tprint(-1)", "lang": "Python 3", "bug_code_uid": "ff9523073d392fa127ff3951858bbca1", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3", "apr_id": "621cab51171d22f43cb74b4bc67807ed", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7770646127513907, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "from itertools import combinations\nfrom copy import copy\n\ndef variants(a):\n for i in range(6):\n for j in combinations(a, i):\n yield j\n\ndef main():\n input()\n \n cards = set((i[0], int(i[1])) for i in input().split())\n \n values = [0 for i in range(6)]\n masks = {i: 0 for i in \"RGBYW\"}\n \n for i in cards:\n values[i[1]] += 1\n masks[i[0]] += 1\n\n result = float(\"inf\")\n \n for i in variants(\"RGBYW\"):\n for j in variants(list(range(1, 6))):\n c = copy(cards)\n v, m = values[:], copy(masks)\n for k in copy(c):\n if k[0] in i and k[1] in j:\n v[k[1]] -= 1\n m[k[0]] -= 1\n c.remove(k)\n for l in range(11):\n for k in copy(c):\n if (v[k[1]] == 1 and m[k[0]] == 1 or\n v[k[1]] == 1 and k[1] in j or\n m[k[0]] == 1 and k[0] in i):\n v[k[1]] -= 1\n m[k[0]] -= 1\n c.remove(k)\n if not c:\n result = min(result, len(i) + len(j))\n \n print(result)\n\nmain()\n", "lang": "Python 3", "bug_code_uid": "53ce28a9aab1f9c8012536a49368320e", "src_uid": "3b12863997b377b47bae43566ec1a63b", "apr_id": "f41d8aa263e4f124a5d6c2b8851ed0e0", "difficulty": 1700, "tags": ["bitmasks", "brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9882352941176471, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "def main():\n p = [1]\n for i in range(1,11):\n p.append(p[i-1]*2)\n hr = '12345RGBYW'\n gt = {'1': 0,'2': 1,'3': 2,'4': 3,'5': 4,'R': 5,'G': 6,'B': 7,'Y': 8,'W': 9}\n \n def check(c,mask):\n tmp = gt[c]\n if (mask // p[tmp]) % 2 == 1:\n return True\n return False\n \n def count(mask):\n tmp = 0\n while mask>0:\n tmp+=mask % 2\n mask//=2\n return tmp\n \n n = int(input())\n a = list(input().split())\n ans = 10\n for mask in range(1024):\n f = True\n for i in range(n):\n for j in range(n):\n if a[i] == a[j]:\n pass\n elif (a[i][1] != a[j][1]) and (check(a[i][1],mask) or check(a[j][1],mask)):\n pass\n elif (a[i][0] != a[j][0]) and (check(a[i][0],mask) or check(a[j][0],mask)):\n pass\n else:\n f = False\n break\n if not f:\n break\n if f:\n ans = min(ans,count(mask))\n print(ans)\nmain()", "lang": "Python 3", "bug_code_uid": "5e8729ee5f3adf6329c30626bbd23797", "src_uid": "3b12863997b377b47bae43566ec1a63b", "apr_id": "fb9ac2ef6117f5a1e8d8d79435433de0", "difficulty": 1700, "tags": ["bitmasks", "brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.49592760180995477, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Codeforces Round #554 (Div. 2)\n\nProblem C. Neko does Maths\n\n:author: Kitchen Tong\n:mail: kctong529@gmail.com\n\nPlease feel free to contact me if you have any question\nregarding the implementation below.\n\"\"\"\n\n__version__ = '1.0'\n__date__ = '2019-04-24'\n\nimport sys\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\ndef prime_sieve(size):\n sieve = [0, 0] + [1] * (size - 1)\n primes = []\n for i in range(2, size+1):\n if sieve[i] == 1:\n for j in range(i**2, size+1, i):\n sieve[j] = 0\n primes.append(i)\n return (sieve, primes)\n\ndef memoize(func):\n memo = {}\n\n def wrapper(*args):\n n, p, s = args\n if n not in memo:\n memo[n] = func(n, p, s)\n return memo[n]\n return wrapper\n\n@memoize\ndef rec_fact(n, primes, sieve):\n if sieve[n] == 1:\n return [n]\n if n == 1:\n return []\n for p in primes:\n if n % p == 0:\n return [p] + rec_fact(n//p, primes, sieve)\n return -1\n\ndef factorize(n, primes, sieve):\n if sieve[n] == 1:\n return [n]\n p_factors = rec_fact(n, primes, sieve)\n p_dict = dict()\n for p in p_factors:\n if p not in p_dict:\n p_dict[p] = 1\n else:\n p_dict[p] += 1\n factors = [1]\n for p, k in p_dict.items():\n for f in list(factors):\n for exp in range(1, k+1):\n factors += [f * (p ** exp)]\n return sorted(factors)\n\ndef solve(a, b):\n a, b = min(a, b), max(a, b)\n if b % a == 0:\n return 0\n diff = b - a\n sieve, primes = prime_sieve(diff)\n factors = factorize(diff, primes, sieve)\n k, lcm = 0, a * b\n for f in factors:\n step = a % f\n if step > 0:\n step = f - step\n this_lcm = (a + step) * (b + step) // gcd(a+step, b+step)\n if this_lcm < lcm:\n lcm = this_lcm\n k = step\n return k\n\ndef main(argv=None):\n a, b = map(int, input().split())\n print(solve(a, b))\n return 0\n\nif __name__ == \"__main__\":\n STATUS = main()\n sys.exit(STATUS)\n\n", "lang": "Python 3", "bug_code_uid": "bcae166f10457d58259a618890163845", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "6f4bf3703d470c99f309ece6454a30f9", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8354978354978355, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import math \n\ndef gcd(x,y):\n while(y):\n x, y = y, x % y\n return x\n\ndef lcm(x,y):\n l = (x*y)//gcd(x,y)\n return l\n\na, b = map(int, input().split(\" \"))\nif a > b:\n a, b = b, a\nn = b - a\ndivisors = [1, n]\nk = []\nl = []\nfor i in range(2, int(math.sqrt(n) + 1)):\n if n % i == 0:\n if i * i != n:\n divisors.append(i)\n divisors.append(int(n/i))\n else:\n divisors.append(i)\nfor i in range(len(divisors)):\n for j in range(1, divisors[i]+1):\n if (j + b) % divisors[i] == 0:\n k.append(j)\n l.append(lcm(a+j, b+j))\n break\nmini = min(l)\nif lcm(a,b) <= mini:\n print(0)\nelse:\n idx = l.index(mini)\n print(k[idx])\n ", "lang": "Python 3", "bug_code_uid": "7b890d26150ea2a07d9143a191b29f43", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "54e468ad9a328c0eec5111ffe9a3185c", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.46397188049209137, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "x=[int(a) for a in input().split()]\ny=set(x)\nif len(y)==3:\n print(\"Bear\")\n quit()\nelif len(y)==1:\n print(\"Elephant\")\n quit()\nelif len(y)==2::\n c=x.count(y[0])\n if c==1:\n print(\"Bear\")\n else:\n print(\"Elephant\")\nelse:\n print(\"Alien\")", "lang": "PyPy 3", "bug_code_uid": "1aab7b62e1ec1fe38e0bd82f1affb6e1", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "7825fa690008059f85560b8ed5f30555", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5974955277280859, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import sys\ninput = sys.stdin.readline\nn, m, L, R = map(int, input().split())\nT = R-L+1\nif T%2 == 0:\n\tdi = 0\nelse:\n\tdi = 1\nmodulo = 998244353\nif n % 2 != 0 and m%2 != 0:\n\tprint(((n*m)**T)%modulo)\nelse:\n\tprint(int(((T)**(n*m) + di)/2)%modulo)", "lang": "PyPy 3", "bug_code_uid": "261ac19f4d8020955ef32c9c6a06724c", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "apr_id": "24ea2bf786a0e83956c7f9f0d702827a", "difficulty": 2100, "tags": ["matrices", "math", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7724867724867724, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "from sys import exit\n\nMOD = 998244353\n\nn, m, l, r = map(int, input().split())\nif l == r:\n print(1)\n exit(0)\nif n * m % 2 == 1:\n ans = pow(r - l + 1, n * m, MOD)\n print(ans)\n exit(0)\n\na = (r - l + 1) // 2\nb = a\nif (r - l + 1) % 2 == 1:\n b += 1\n\nx = n * m\n\nans = pow(2, x - 1, MOD)\nif a == b:\n ans *= pow(b, x, MOD)\n ans %= MOD\nelse:\n ans = pow(r - l + 1, n * m - 1, MOD)\n ans = (ans + 1) // 2\n ans %= MOD\n ans = (((r-l+1)**(n*m) - 1 ) // 2 + 1) % MOD\n\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "f785164dff18f526aef3179d24c3c31a", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "apr_id": "b116b73bbf85352001a7d07733c7857e", "difficulty": 2100, "tags": ["matrices", "math", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.25151148730350664, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "s=[]\nfor i in range(8):\n s[i]=input()\nw=-9\nb=0\nb=8\nfor i in range(8):\n for j in range(8):\n if s[i][j]=='W' and w==-9:\n w=i\n elif s[i][j]=='B':\n b=i\nb=7-b\nif w>b:\n print(\"A\")\nelse:\n print(\"B\")", "lang": "Python 3", "bug_code_uid": "5fe03ab1c044b17ab9ed075a04d87c58", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "a7e42343c02e025d04d03290e66f5a5f", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.934322033898305, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/python3\nfrom math import log2 as log\ndef gen(x,y,z):\n\treturn [\"{}^{}^{}\".format(x,y,z),\"{}^{}^{}\".format(x,z,y),\"({}^{})^{}\".format(x,y,z),\"({}^{})^{}\".format(x,z,y)]\n\n\ndef f(x):\n\treturn log(x)\n\ndef calc1(x,y,z):\n\treturn [z*f(y) + f(f(x)),y*f(z) + f(f(x)),f(y*z) + f(f(x)),f(z*y) + f(f(x))]\n\t\ndef calc2(x,y,z):\n\treturn [x**y**z,x**z**y,x**(y*z),x**(z*y)]\n\ndef build(x,y,z):\n\ts1,s2 = [],[]\n\tif x > 1:\n\t\ts1 += gen('x','y','z')\n\t\ts2 += calc1(x,y,z)\n\t\n\tif y > 1:\n\t\ts1 += gen('y','x','z')\n\t\ts2 += calc1(y,x,z)\n\t\n\tif z > 1:\n\t\ts1 += gen('z','x','y')\n\t\ts2 += calc1(z,x,y)\n\t\t\n\treturn s1,s2\n\t\ndef build2(x,y,z):\n\ts1,s2 = [],[]\n\tif x > 1:\n\t\ts1 += gen('x','y','z')\n\t\ts2 += calc2(x,y,z)\n\t\n\tif y > 1:\n\t\ts1 += gen('y','x','z')\n\t\ts2 += calc2(y,x,z)\n\t\n\tif z > 1:\n\t\ts1 += gen('z','x','y')\n\t\ts2 += calc2(z,x,y)\n\t\t\n\treturn s1,s2\n\t\nx,y,z = [float(t) for t in input().strip().split()]\n\ns1,s2 = build(x,y,z)\nif len(s1) == 0: s1,s2 = build2(x,y,z)\nprint(s1[s2.index(max(s2))])", "lang": "Python 3", "bug_code_uid": "f4433701d734d739e8163f52ffd9b0b5", "src_uid": "a71cb5cda754ad2bf479bc3b0164fc4c", "apr_id": "5d2f4b8797224d1e72c568f99d5b1508", "difficulty": 2400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9666666666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x=input()*3\nprint+(x^(x+5)>2*x)", "lang": "PyPy 2", "bug_code_uid": "5724367eb62d0c53408a01fed457e71c", "src_uid": "821409c1b9bdcd18c4dcf35dc5116501", "apr_id": "b0b11e32179d82e062ed9c9e4883e706", "difficulty": 2400, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9876923076923076, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "'''\n Author : thekushalghosh\n Team : CodeDiggers\n'''\nimport sys,math\ninput = sys.stdin.readline\nn = int(input())\nq = [1,2]\nfor i in range(100):\n if q[-1] % 2 == 0:\n q = q + [q[-1] + q[-2],q[-1] + q[-2] + 1]\n else:\n q = q + [(2 * q[-1]) + 1,(2 * q[-1]) + 2]\nif n in q:\n print(1)\nelse:\n print(0)", "lang": "PyPy 3", "bug_code_uid": "2a13be822c6021d601099efdd93506f8", "src_uid": "821409c1b9bdcd18c4dcf35dc5116501", "apr_id": "f9e5ef0d00e5fbb22be49d882bccbe1f", "difficulty": 2400, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9616252821670429, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\ns = input()\nf = 0\nfor i in range(n-1):\n c = s[i:i+2]\n cur = 0\n for j in range(i+1, n):\n if s[j:j+2] == c:\n cur = cur+1\n if cur > f:\n ans = c\n cur = f\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "a98e0990ca920d766029ba1b85ca8d3d", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1", "apr_id": "10c4f3843622312d0eb38f160786171f", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.21145374449339208, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "def rec_pie(pies):\n if len(pies) == 1:\n return pies[0]\n return max(rec_pie(pies[1:]), sum(pies) - rec_pie(pies[1:]))\n \nn = int(input())\npies = [int(x) for x in input().split()]\n\ns = sum(pies)\n\nres = rec_pie(pies)\n\nprint(s - res, res)", "lang": "Python 3", "bug_code_uid": "95c05ca4fb28a9514a53ba36275209de", "src_uid": "414540223db9d4cfcec6a973179a0216", "apr_id": "60dbea99bc0650ffd9157076708b5f55", "difficulty": 1500, "tags": ["dp", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5283018867924528, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "t = int(input())\nwhile(1<=t<=36):\n for i in range(t):\n x = int(input())\n while(1<=x<=9999):\n if(x==1):\n print(1)\n if(11<=x<=99):\n x = x%10\n print(((x-1)*10)+3)\n if(111<=x<=999):\n x = x%10\n print(((x-1)*10)+6)\n if(1111<=x<=9999):\n x = x%10\n print(x*10)", "lang": "Python 3", "bug_code_uid": "decf5d70e0a9ce886a645580cbdbdae4", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "7723d3f4fa945e40fbac9b0d72492ec9", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3754646840148699, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "w, m = map(int, input().split())\nif m % w != w - 1 and m % w != 1 and m % w != 0:\n print(\"NO\")\nelse:\n while m > 0:\n digit = m % w\n if digit == w - 1:\n m += 1\n elif digit == 1:\n m -= 1\n elif digit != 0:\n m = -1\n if m > 0:\n m //= w\n print(\"YES\" if m == 0 else \"NO\")", "lang": "Python 3", "bug_code_uid": "3c5d85dd444b0565a23972063b6ce5e9", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "cdec9967c1b2ce01494795396d7ca7e7", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.12128146453089245, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "def reverse(s):\n res = ''\n for i in range(n - 1):\n if s[i] == 'W': res += 'E'\n elif s[i] == 'E': res += 'W'\n elif s[i] == 'N': res += 'S'\n elif s[i] == 'S': res += 'N'\n return res\nn = int(input())\ns1 = input()\ns2 = input()\ns2 = reverse(s2)[::-1]\nf = 1\nfor i in range(1, n):\n if s2[0:i] == s1[n - i - 1:n - 1]:\n f = 0\n break\n \nprint ( 'YES' if f else 'NO')", "lang": "Python 3", "bug_code_uid": "399f0be3a37b75632b8e04421e3be116", "src_uid": "85f43628bec7e9b709273c34b894df6b", "apr_id": "f7efc08575a22544e7bb816e4279d5a5", "difficulty": 2500, "tags": ["strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9934640522875817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def prefix(s):\n v = [0]*len(s)\n for i in range(1,len(s)):\n k = v[i-1]\n while k > 0 and s[k] != s[i]:\n k = v[k-1]\n if s[k] == s[i]:\n k = k + 1\n v[i] = k\n return v\n\nn = int(input())\nn-=1\ns1 = input()\ns2 = input()\nopos = {'W':'E', 'E':'W', 'N':'S', 'S':'N'}\ns3 = ''\nfor elem in s2:\n s3 += opos[elem]\n \ns3[::-1]\ns = s3 + '$' + s1\n\na = prefix(s)[2 * n]\nif a == 0: print('YES')\nelse: print('NO')\n\n", "lang": "Python 3", "bug_code_uid": "6222d71c68e698d27aa1c8c83c679c60", "src_uid": "85f43628bec7e9b709273c34b894df6b", "apr_id": "f7efc08575a22544e7bb816e4279d5a5", "difficulty": 2500, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.20595533498759305, "equal_cnt": 23, "replace_cnt": 14, "delete_cnt": 9, "insert_cnt": 1, "fix_ops_cnt": 24, "bug_source_code": "import string\nU = string.ascii_uppercase\nk = string.ascii_lowercase\nz = input()\nt = input()\nindex1 = 0\nindex2 = 0\nindex3 = 0\nindex4 = 0\nzz = []\ntt = []\nfor i in z:\n if i in U:\n index1 = U.find(i)\n zz.append(index1)\n index1 = 0\n elif i in k:\n index2 = k.find(i)\n zz.append(index2)\n index2 = 0\nfor i in t:\n if i in U:\n index3 = U.find(i)\n tt.append(index3)\n index3 = 0\n elif i in k:\n index4 = k.find(i)\n tt.append(index4)\n index4 = 0\np = len(zz)\nfor i in range(p):\n if zz[i] == tt[i]:\n None\n elif zz[i] < tt[i]:\n w-=1\n elif zz[i] > tt[i]:\n w+=1\nprint(w) ", "lang": "Python 3", "bug_code_uid": "1faea68112aa60cf1c1479588dbb37c0", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "03926552606b103c5436283743ebdfae", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5720930232558139, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "# your code goes heren,v=[int(x) for x in raw_input().split()]\nn,v=[int(x) for x in raw_input().split()]\nif v==0:\n\tprint 0\nt=[(2**31-1)]*(v+1)\nt[0]=0\nfor i in range(1,v+1):\n\tfor j in range(0,n+1):\n\t\tif j>i:\n\t\t\tbreak\n\t\tif j<=i:\n\t\t\ts=t[i-j]\n\t\t\tif s+1 num_pillows:\n print(frodo_amt)\n break\n\n num_pillows -= this_round_amt\n frodo_amt += 1\n\n # XXFXXX left = 2, right = 3\n # round 1 => give frodo 1. total -= 1. cum = 1 x = 1. - x\n # round 2 => give frodo 1. give left 1, give right 1. total -= 3. cum = 4 x = 2. - 1 - 1(x - 1) - 1(x - 1)\n # round 3 => give frodo, l, r, lx2, rx2 1. total -= 5. cum = 9 x = 3. - 1 - 1(x - 1) - 1(x - 1)\n # round 4 => give frodo, l, r, lx2, rx2, rx3 1. total -= 6. cum = 15 x = 4. - 1 - 1 * min(x - 1, left) - 1(x - 1)\n # round 5 => give frodo, l, r, lx2, rx2, rx3 1. total -= 6. cum = 21 x = 5. - 1 - 1 * min(x - 1, left) - 1 * min(x - 1, right)", "lang": "PyPy 3", "bug_code_uid": "9d18a97810e76bae13d24aa54228535f", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "08f161ad2f7b8b07c71c578e21f551c4", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.992822966507177, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,a,x,b,y = map(int,input().split())\n\nt_a = [a]\ncurrent = a\nwhile current != x:\n current += 1\n if current == 6:\n current = 1\n t_a.append(current)\n\nt_b = [b]\ncurrent = b\nwhile current != y:\n current -= 1\n if current == 0:\n current = n\n t_b.append(current)\nsteps = min(len(t_a),len(t_b))\n\nfor i in range(steps):\n if t_a[i] == t_b[i]:\n print (\"YES\")\n exit()\nprint (\"NO\")", "lang": "PyPy 3", "bug_code_uid": "749e19afaaa0192fa2db9acc52c63309", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "43d93e72e6ff6a9d1064bd0934a2edf2", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4670967741935484, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "import itertools as it\n\nn, k = [int(i) for i in input().split()]\na = [list(map(int, input())) for i in range(n)]\nm = 99999999999999\nfor i in it.permutations(range(k)):\n p = [10 ** j for j in i][::-1]\n b = [sum([k * t for k, t in zip(p, j)]) for j in a]\n m = min(m, max(b) - min(b))\nprint(m)", "lang": "Python 3", "bug_code_uid": "ca169cca51969f382621dac3b1b53b60", "src_uid": "08f85cd4ffbd135f0b630235209273a4", "apr_id": "bb8040eb4e2296ed89e72e753a566277", "difficulty": 1400, "tags": ["brute force", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8122605363984674, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "n,a,b = map(int,input().split())\n\na,b,r=a-1,b-1,0\n\nwhile(a!=b):\n\ta//2\n\tb//2\n\tr+=1\n\n\nprint(r if 2**r 1 :\n for key in range (len(list)-1):\n if list[key+1]==list[key] :\n apperance += 1\n else:\n maxa = max(maxa,apperance)\n apperance = 1 \nelse:\n maxa=1\n\nprint (maxa", "lang": "Python 3", "bug_code_uid": "9767f9c0b4167511e2db5def564d718d", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "1c51423fc8acaac789dfb15b071b7eb0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9627363737486095, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n, m = map(int, raw_input().split())\na = map(int, raw_input().split())\nb = []\ncost = {}\nfor i in xrange(n):\n cost[1 << i] = a[i]\nfor i in xrange(n, 40):\n cost[1 << i] = 10**19\n\nfor i in xrange(n):\n for j in xrange(i, 40):\n cost[1 << j] = min(cost[1 << j], a[i] * (1 << (j - i)))\n\ndef solve(pos, rem):\n if(rem <= 0):\n return 0\n if(pos == 0):\n return cost[1] * rem\n res = solve(pos - 1, rem)\n if(1 << pos >= rem):\n res = min(res, cost[1 << pos])\n else:\n req = rem / (1 << pos)\n if(m % (1 << pos) != 0):\n res = min(res, (req + 1) * cost[1 << pos])\n res = min(res, (req * cost[1 << pos]) + solve(pos - 1, rem - (req * (1 << pos))))\n return res\n\nprint solve(39, m)\nexit(0)\ni = 39\nres = 1e19\nwhile(i >= 0):\n if(1 << i >= m):\n res = min(res, cost[1 << i])\n else:\n req = m / (1 << i)\n if(m % (1 << i) != 0):\n req += 1\n res = min(res, req * cost[1 << i])\n i -= 1\nprint res\n\nfor i in xrange(n):\n b.append([cost[1 << i], 1 << i])\nb.sort()\n\ndef check(ccost, v):\n i = len(b) - 1\n p = 0\n while(i >= 0):\n if(b[i][0] > ccost):\n i -= 1\n #elif(b[i][0] < ccost):\n # i -= 1\n else:\n q = ccost / b[i][0]\n assert(q * b[i][0] <= ccost)\n ccost -= (q * b[i][0])\n p += q * b[i][1]\n return p >= v\n\ns = 1\ne = 10**19\niter = 100\nmid = 0\nwhile(iter):\n iter-=1\n mid = (s + e) / 2\n if(check(mid, m)):\n e = mid\n else:\n s = mid\n\ns = mid - 5;\nif(s <= 1):\n s = 1;\ne = mid + 5;\nif(e >= (10**19)):\n e = 10**19;\n\n\nwhile(s <= e):\n if(check(s, m)):\n print min(res, s)\n exit(0)\n s += 1", "lang": "Python 2", "bug_code_uid": "f3f6b517664fe75fd872fd2b822ee630", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "ee66833745478715438ce04182875585", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4088717454194793, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "def f(l,c,n):\n if l==2**(n-1):\n e = c[n-1]\n else:\n e = 0\n for i in range(n - 1):\n if l % 2 == 1:\n e += c[i]\n l /= 2\n return e\nn,l = map(int,raw_input().split())\nc = map(int,raw_input().split())\nfor i in range(n):\n c[i]=min(c[j] for j in range(i,n))\nfor i in range(n-1,-1,-1):\n c[i]=min(c[j]*(2**(i-j)) for j in range(0,i+1))\nw = (l / (2 ** (n - 1))) * c[n - 1]\nl %= (2 ** (n - 1))\nprint w+min(f(i,c,n) for i in range(l,2**(n-1)+1))\n", "lang": "Python 2", "bug_code_uid": "509b674f8a27c3d56dc684389c6e83c5", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "593a59896f1c4e12fd17d59fa43894ac", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8762886597938144, "equal_cnt": 15, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 12, "fix_ops_cnt": 14, "bug_source_code": "n =int(input())\nif (n == 4):\nprint(1)\nelif (n==7):\nprint(2)\nelse:\ntemp = n/10\nfinal_count = 0\ncounter = 1\n\nwhile(temp != 0):\n final_count = final_count + (2**counter)\n temp = int(temp/10)\n counter += 1\n\nfor i in range(counter):\n mod_val = 10\n curr_val = n % mod_val\n n = int(n / 10)\n if(curr_val == 7):\n final_count = final_count + (2**i)\n\nprint(final_count+1)", "lang": "Python 3", "bug_code_uid": "4a511c2a86baef46a1452b859df5575b", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "b8fbe4539b3f30426f43a74ad588eaa3", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5101143359718557, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "\ndef getNum(x):\n return {\n 0: 6,\n 1: 2,\n 2: 5,\n 3: 5,\n 4: 4,\n 5: 5,\n 6: 6,\n 7: 3,\n 8: 7,\n 9: 6,\n }.get(x, 0)\n\n\ndef CallMyFunc():\n data = map(int, raw_input().split())\n i = data[0]\n seg = 0\n while i <= data[1]:\n current = i\n val = 0\n if current == 0:\n seg += getNum(0)\n while current > 0:\n val = current % 10\n seg += getNum(val)\n current /= 10\n i += 1\n\n\n\n print(seg)\n\n\n\n\n\n\nif __name__ == '__main__':\n CallMyFunc()\n", "lang": "Python 2", "bug_code_uid": "f9eb603313e5d84cc5266346075f9b3b", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "c45b878a64621a820433b153338870d1", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.20623501199040767, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "k = int(input())\ns = \"codeforces\"\nprint(s+\"s\"*(k-1))", "lang": "Python 3", "bug_code_uid": "4620aefa8f894e53ebb126bfa2bb2b18", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "6be322789ccdddca2fc84c29c53a61f7", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3373493975903614, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "n = int(input())\ns = \"codeforce\"\nprint(s+'s'*n)\n", "lang": "Python 3", "bug_code_uid": "d7cd6b9acabf0648d89f151e2599a34d", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "03795fd21c6ce8fe0c53458299668c8c", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.11956521739130435, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n=int(input())\nprint('codeforces'+'s'*(n-1))", "lang": "Python 3", "bug_code_uid": "caea3f00eb1903952a4add4f7620dc80", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "49cca6b469ccfa012a16ff231259834a", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9961977186311787, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "req_arr = [int(x) for x in input().strip()]\narr = [int(x) for x in input().strip()]\nrequired_list = [0]*10\nnum_list = [0]*10\nfor i in req_arr:\n if i == 5:\n required_list[2] += 1\n if i == 9:\n required_list[6] += 1\n else:\n required_list[i] += 1\n\nfor i in arr:\n if i == 5:\n num_list[2] += 1\n if i == 9:\n num_list[6] += 1\n else:\n num_list[i] += 1\nans = len(arr)\nfor i, j in enumerate(required_list):\n if j > 0:\n ans = min(ans, int(num_list[i]/j))\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "92cd97868125aa07f9ebcf4f8f7c69ab", "src_uid": "72a196044787cb8dbd8d350cb60ccc32", "apr_id": "4316641f2001e514a3612dc42e23ce24", "difficulty": 1500, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9971509971509972, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,p,l,r=map(int,input().split())\nif l==1 and r==n:print(0)\nelif l==1:\n print(abs(r-p)+1)\nelif r==n:\n print(abs(l-p)+1)\nelse:\n print(min(abs(l-p)+r-l+2,abs(r-p)+r-l+2)", "lang": "Python 3", "bug_code_uid": "72b63243a83ebedefd2d5348c7464c7d", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "ea3f55e63336916c0d1b6a10dc4d5bc8", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9556259904912837, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "import math\na = int(input())\nv = int(input())\nl = int(input())\nlist1 = [v,v,v,v,l,l]\nlist2 = sorted(list1)[::-1]\nw = 1\nif a = 165 and v = 59 and l = 40:\n print(2)\nelse:\n while True:\n if len(list2) <= 1:\n break\n list2[0] = a - list2[0]\n n = len(list2)-1\n for i in range(n):\n if list2[0] < list2[n-i]:\n w += 1\n del list2[0]\n break\n else:\n list2[0] = list2[0] - list2[n-i]\n del list2[n-i]\n if len(list2) == 0:\n break\n print(w)\n", "lang": "Python 3", "bug_code_uid": "ff6b7c018c7d8c889e18cbcb68f772ff", "src_uid": "1a50fe39e18f86adac790093e195979a", "apr_id": "b1e1911898bdb6460a413018342c0c23", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9985043374214777, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def main():\n n, k = map(int, input().split())\n s = list(input())\n t = list(input())\n ans = 0\n if t[0] == t[1]:\n #special case\n string = t[0]\n cnt = k\n for i in range(n):\n if cnt == 0:\n break\n if cnt > 0 and s[i] != string:\n s[i] = string\n cnt -= 1\n\n stringcnt = 0\n for i in range(n):\n if s[i] == string:\n ans += stringcnt\n stringcnt += 1\n else:\n continue\n\n print(ans)\n return\n else:\n #normal case\n dp = [[[-10**10]*(n+10) for i in range(n+10)] for j in range(n+10)]\n #dp[ind][stringcnt][leftchange] := max subcnt\n dp[0][0][0] = 0\n for i in range(1, n+1):\n now_string = s[i-1]\n for j in range(n+1):\n for m in range(n+1):\n # whether change to t[0],t[1],or not.\n if now_string == t[1]:\n dp[i][j][m] = max(dp[i-1][j-1][m-1],\n dp[i-1][j][m-1] + j, dp[i-1][j][m]+j)\n elif now_string == t[0]:\n dp[i][j][m] = max(dp[i-1][j-1][m-1],\n dp[i-1][j][m-1]+j, dp[i-1][j-1][m])\n else:\n dp[i][j][m] = max(dp[i-1][j-1][m-1],\n dp[i-1][j][m-1]+j, dp[i-1][j][m])\n\n ans = max(dp[n][cnt][changed] for cnt in range(n+1)\n for changed in range(k+1))\n\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n\n", "lang": "PyPy 3", "bug_code_uid": "d4e8227384b77cede13cd76b75d1e499", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "ee24029e36b24e3752f317d318544de0", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.08601177003168854, "equal_cnt": 24, "replace_cnt": 22, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 25, "bug_source_code": "from functools import lru_cache\n\nn,k=[int(x) for x in input().split()]\ns=input()\nt=input()\n\nif t[0]==t[1]:\n xx=min(s.count(t[0])+k,n)\n ans=(xx*(xx-1))//2\nelse:\n arr=[2 for _ in range(n)]\n for i in range(n):\n if s[i]==t[0]:arr[i]=0\n elif s[i]==t[1]:arr[i]=1\n @lru_cache(None)\n def dp(i,arri,zeroCntToLeft,k):\n k2=k\n if arri!=arr[i]:k2-=1\n if i==0:\n if zeroCntToLeft==0 and k2>=0:return 0\n else:return -float('inf')\n res=max(dp(i-1,0,zeroCntToLeft-1,k2),\n zeroCntToLeft+dp(i-1,1,zeroCntToLeft,k2),\n dp(i-1,2,zeroCntToLeft,k2))\n return res\n ans=-float('inf')\n for z in range(n+1):\n ans=max(ans,\n dp(n-1,0,z-1,k),\n z+dp(n-1,1,z,k),\n dp(n-1,2,z,k))\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "8e08f51b6a76ea3dfd9ca208a2ea9a81", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "96685d00ab710c1217e4b1211bfaf00a", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9985199802664035, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\nn , u = map(int,input().split())\n\n\ns = input()\nt = input()\ninf = 10**12\n\n\nif t[0]==t[1]:\n\n u = min(n, s.count(t[0])+u)\n print((u-1)*u//2)\nelse:\n l =[ [ [-inf]*(u+1 ) for i in range(n+1)] for j in range(n+1)]\n\n l[0][0][0] = 0\n\n for i in range(n):\n \n for j in range(n+1):\n\n for k in range(u+1):\n\n\n if s[i]==t[0]:\n\n if j+1 <=n:\n\n l[i+1][j+1][k]= max( l[i+1][j+1][k], l[i][j][k] )\n elif s[i]==t[1]:\n\n l[i+1][j][k] = max( l[i+1][j][k] , l[i][j][k]+j)\n else:\n l[i+1][j][k]= max(l[i+1][j][k],l[i][j][k])\n\n if k+1 <= u and j+1<=n:\n\n l[i+1][j+1][k+1]= max(l[i+1][j+1][k+1],l[i][j][k])\n\n if k+1 <= u:\n\n l[i+1][j][k+1] = max(l[i+1][j][k+1], l[i][j][k]+j)\n ans = -inf\n for j in range(n+1):\n for k in range(u+1):\n\n ans = max(ans, l[-1][j][k])\n\n print(ans)\n\n\n\n\n \n", "lang": "PyPy 3", "bug_code_uid": "ec6c95f8d6cde33e27d6d699e3a48e36", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "dfe2d50e1006ffafa21c0caff4514c59", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19642857142857142, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n= int(input())\nif(n%4==0):\n\tprint(0 \" \" D)\nelse:\n\tif(n%4==1):\n\t\tprint(0 \" \" \"A\")\n\telif(n%4==2):\n\t\tprint(1 \" \" \"B\")\n\telif(n%4==3):\n\t\tprint(0 \" \" \"C\")", "lang": "Python 3", "bug_code_uid": "5a5965c8b1a75b96979e906a1e58cd61", "src_uid": "488e809bd0c55531b0b47f577996627e", "apr_id": "6bf9c8a7d135e9f70ff9d2dd8b92f8fc", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7222222222222222, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "n = input()\nwhile n%3 == 0: n /= 3\nprint \uff08n/3+1\uff09", "lang": "Python 3", "bug_code_uid": "3d77e1805499026abb14ab6813fe57ff", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "2b736fd3a758caf56caf68489c32b4da", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8181818181818182, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n=int(raw_input())\ns=n\nwhile(s%3!=0):\n\ts+=1\nprint s/3", "lang": "Python 2", "bug_code_uid": "d60768c89bb8501c6b302fb21b360ae5", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "a164713308544103967e93a19ed0eaff", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7252747252747253, "equal_cnt": 18, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "MOD = 10 ** 9 + 7\nn = int(input())\nseven_degree = [0] * n\nseven_degree[0] = 1\nfor i in range(1, n):\n seven_degree[i] = seven_degree[i - 1] * 7\nd = [0] * n\nd[0] = 20\nfor i in range(1, n):\n d[i] = (d[i - 1] * 27 + seven_degree[i] * 20) % MOD\nprint(d[n - 1])\n", "lang": "Python 3", "bug_code_uid": "c597989e826bc57523e20cbbed16e353", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "e5168f9db495719fc9f20519e058dd8b", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6666666666666666, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\nprint(pow(3,3*n,1000000007)-pow(7,n,100000007))\n", "lang": "Python 3", "bug_code_uid": "f5c6b3150c9874f9ed10da52863b7c7e", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "84c2b7924ab70aae6f3749506c2745f6", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5050798258345428, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "hello = raw_input()\na,b,c = int(hello.split()[0]), int(hello.split()[1]), int(hello.split()[2])\n\n\n\nnumSol = 0\nsol = []\nfor i in range(1, 82):\n\tx = b*(i**a)+c\n\tif x in range(0, 10**8+1):\n\t\tnumSol+=1\n\t\tsol.append(x)\n\nsol.sort()\nprint numSol\nprint ' '.join(sol)\n", "lang": "Python 2", "bug_code_uid": "95578ee529b90e608c01dee78260c6db", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "392a6d21c94e1e0b5c00d2de95830f08", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3893653516295026, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import sys,math\ndef rec(now,numb,summ):\n if now2:\n z[now][numb]=2\n h=z[now][numb]-2\n rec(now+1,numb+1, summ/2)\n rec(now+1,numb, summ/2)\n\nres=[0]\nn,m=map(int,input().split())\nz=[]\nneed=0\nfor i in range(1,n+1):\n need+=i\nfor i in range(1,n+1):\n z.append([0]*i)\nfor i in range(1,m+1):\n rec(0,0,2)\n if res[0]==need:\n break\ns=0\nfor i in range(n):\n s+=z[i].count(2)\nprint(s)", "lang": "Python 3", "bug_code_uid": "70f12ef6b17f158ff856aa169a91fe6b", "src_uid": "b2b49b7f6e3279d435766085958fb69d", "apr_id": "f8dc6e4548f2fedeeeec972f8b59ff07", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6682986536107711, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "\npingnian = [31,28,31,30,31,30,31,31,30,31,30,31]\nrunnian = [31,29,31,30,31,30,31,31,30,31,30,31]\nsequence = pingnian + pingnian + runnian + runnian + pingnian\n\nn = input()\nmonths = list(map(int,input().split()))\nleft = 0, right = n\nexist = 0\nwhile right <= len(sequence):\n\tsub = sequence[left:right]\n\tif sub == months:\n\t\texist = 1\n\t\tbreak\n\tleft += 1\n\tright += 1\nif exist:\n\tprint(Yes)\nelse:\n\tprint(No)", "lang": "Python 3", "bug_code_uid": "21bebe37ec57b6700c10e3e7bb94e6be", "src_uid": "d60c8895cebcc5d0c6459238edbdb945", "apr_id": "42fce7511d2a130af5f0fc2b398ab637", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8197674418604651, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=input()\ns=len(a)\nans=-1\nif s>=3:\n\tfor i in range(s-2):\n\t\tfor j in range(i+1,s-1):\n\t\t\tif (i+1>0+1 and a[0]==\"0\") or (j+1>i+2 and a[i+1]==\"0\") or (s>j+2 and a[j+1]==\"0\"):\n\t\t\t\tcontinue\n\t\t\tif(int(a[0:i+1]>100000 or int(a[i+1:j+1]>1000000 or a[j+1:s]>1000000:\n\t\t\t\tcontinue\n\t\t\tans=max(ans,int(a[0:i+1])+int(a[i+1:j+1])+int(a[j+1:s]))\nprint(ans)", "lang": "Python 3", "bug_code_uid": "2f3229492620cfabcba8d9fb8d9dd37a", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "fa2649f200903f66a2b1d0755e5e06fb", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.04926108374384237, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "t = input()\na = int(t[0]) + int(t[1]) + int(t[2: ]) if t[2] else -1\nb = int(t[0]) + int(t[1: -1]) + int(t[-1]) if t[1] else -1\nc = int(t[: -2]) + int(t[-2]) + int(t[-1])) if t[0] else -1\nprint(max(a, b, c)", "lang": "Python 3", "bug_code_uid": "c8a33d668b8a2141793af7e55a0fc3d5", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "2f8bf242d9ca6040c9bac1637e4d5e9a", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9383490073145245, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a , b , c = map(int,raw_input().split())\n\nif a > b:\n a = a%b\n\nposition = 0\nremainders = set()\nf = 0\n\nwhile f==0 and a not in remainders:\n\n remainders.update({a})\n\n while a < b:\n a = a*10\n position += 1\n\n if a < b and c == 0:\n print position\n f = 1\n break\n\n\n if f == 0 and a/b == c:\n print position\n f = 1\n break\n else:\n a = a%b\n\n\nif f == 0:\n print -1\n", "lang": "Python 2", "bug_code_uid": "58591c0069753b5a12703905bcbd63cb", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "c8d6444eba2420f12af431ac789751ce", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8745519713261649, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "from math import sqrt\nr, h = map(int, raw_input().split())\nprint max(1+int(((2-sqrt(3)) * r + h)/r)*2, int((float(r)/2 + h)/r) * 2)\n", "lang": "Python 2", "bug_code_uid": "191d7e5aa4dbde8b745af33d61ab3858", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "1cdf939b1faa395cd8a6c920f8717122", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9987063389391979, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n , k = map(int , input().split())\nl = list(map(int , input().split()))\nk -= 1\ns = 0\ni,j = k,k\nwhile i > -1 and j < n:\n if l[i] == l[j] == 1:\n s += 2\n i -= 1\n j += 1\nif i == -1:\n while j < n:\n if l[j] == 1:\n s += 1\n j += 1\nif j == n:\n while i > -1:\n if l[i] == 1:\n s += 1\n 4 i -= 1\nif l[k] == 1:\n s -= 1\nprint(s)\n", "lang": "Python 3", "bug_code_uid": "1aab221280330f21fe0ef66872d50970", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "ca0b610eb82988e5faff3067a2ede0e2", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.75, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "import math\np=10**9+7\nn=int(input())\nk=int(math.log2(n))\nf=[[n//(2**i*3**j) for j in range(3)] for i in range(k+1)]\ndp=[[[0,0,0] for i in range(k+1)] for j in range(n+1)]\ndp[1][k][0]=1\nif n>=3*2**(k-1):\n dp[1][k-1][1]=1\nm=n//2+2\nfor i in range(2,m):\n for j in range(k):\n for l in range(2):\n dp[i][j][l]=(dp[i-1][j][l]*(f[j][l]-i+1)+dp[i-1][j+1][l]*(f[j][l]-f[j+1][l])+dp[i-1][j][l+1]*(f[j][l]-f[j][l+1]))%p\ncurr=dp[m-1][0][0]\nfor i in range(1,n-m+2):\n curr*=i\n curr%=p\nprint(curr)", "lang": "PyPy 3", "bug_code_uid": "c692d0b08053b17c32e16db696815dce", "src_uid": "b2d59b1279d891dba9372a52364bced2", "apr_id": "727e0bf528b29c3ebf558963157fdc51", "difficulty": 2500, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9976190476190476, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "p=10**9+7\nimport math\ndef inv(k,p):\n prod=1\n while k>1:\n prod*=(p//k+1)\n k=(k*(p//k+1))%p\n return prod%p\nn=int(input())\na=[]\nk=int(math.log2(n))\nx=n\nwhile x>0:\n y=x//2\n a.append(x-y)\n x=y\nc=[sum(a[i:]) for i in range(k+1)]\nb=[n//(3*2**i)-n//(6*2**i) for i in range(k+1)]\nd=[n//2**i-n//(3*2**i) for i in range(k+1)]\nfacs=[1]*(n+1)\nfor i in range(2,n+1):\n facs[i]=(i*facs[i-1])%p\nif n<3*(2**(k-1)):\n start=k\nelse:\n start=0\ntot=0\nfor j in range(start,k+1):\n prod=1\n for i in range(j,k):\n prod*=b[i]\n prod*=d[j]\n for i in range(j):\n prod*=a[i]\n prod%=p\n prod*=facs[n]\n e=[a[i] for i in range(j)]+[d[j]]+[b[i] for i in range(j,k)]\n f=[sum(e[:i+1]) for i in range(k+1)]\n g=1\n for guy in f:\n g*=guy\n prod*=inv(g,p)\n prod%=p\n tot+=prod\nprint(tot)", "lang": "PyPy 3", "bug_code_uid": "b5ea850ffc5fca39d01d6d4f871c4c24", "src_uid": "b2d59b1279d891dba9372a52364bced2", "apr_id": "727e0bf528b29c3ebf558963157fdc51", "difficulty": 2500, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6666666666666666, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\npat=input()\na=[]\nb=[]\nfor i in range(n):\n a.append(int(pat[i]))\nfor i in range(n):n=int(input())\npat=input()\na=[]\nb=[]\nfor i in range(n):\n a.append(int(pat[i]))\nfor i in range(n):\n l = i + n\n b.append(int(pat[l]))\na.sort()\nb.sort()\nk=0\nif a[0] > b[0]:\n for i in range(n):\n if a[i]<=b[i]:\n print(\"NO\")\n k=-1\n break\nelif a[0] < b[0]:\n for i in range(n):\n if a[i] >= b[i]:\n print(\"NO\")\n k = +1\n break\nelse:\n print(\"NO\")\n k=-5\nif k==0: print(\"YES\")\n\n l = i + n\n b.append(int(pat[l]))\na.sort()\nb.sort()\nk=0\nif a[0] > b[0]:\n for i in range(n):\n if a[i]<=b[i]:\n print(\"NO\")\n k=-1\n break\nelif a[0] < b[0]:\n for i in range(n):\n if a[i] >= b[i]:\n print(\"NO\")\n k = +1\n break\nelse:\n print(\"no\")\n k=-5\nif k==0: print(\"YES\")\n", "lang": "Python 3", "bug_code_uid": "9fe4c756ddae8f048d49cbcd178963f8", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "cea9ce45223e2df2cb17c783dd086ca8", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.952449567723343, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#!/usr/bin/python\n\nMOD = 10**9+7\nn = int(raw_input().strip())\na = map(int, raw_input().split())\n\nc = [[0 for j in xrange(101)] for i in xrange(101)]\nc[0][0] = 1;\nfor i in xrange(1, 101):\n\tc[i][i] = c[i][0] = 1\n\tfor j in xrange(0, i+1):\n\t\tc[i][j] = c[i-1][j-1] + c[i-1][j];\n\t\tc[i][j]%=MOD\n\ndp = [[0 for j in xrange(10)] for i in xrange(n+1)]\nfor i in xrange(a[9], n+1):\n\tdp[i][9] = 1\n\nfor d in xrange(8,0,-1):\n\tfor i in xrange(a[d], n+1):\n\t\tfor j in xrange(a[d], i+1):\n\t\t\tdp[i][d]+=dp[i-j][d+1]*c[i][j]\n\t\t\tdp[i][d]%=MOD\n\nfor i in xrange(a[d]+1, n+1):\n\tfor j in xrange(a[d], i):\n\t\tdp[i][0]+=dp[i-j][1]*c[i-1][j]\n\t\tdp[i][0]%=MOD\n\nret = 0\nfor i in xrange(1, n+1):\n\tret+=dp[i][0]\n\tret%=MOD\nprint ret", "lang": "Python 2", "bug_code_uid": "10cee8fc7b2ae5347fed4cccc80043b0", "src_uid": "c1b5169a5c3b1bd4a2f1df1069ee7755", "apr_id": "fca751a17eb92b606efda604d30005b7", "difficulty": 1900, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8307926829268293, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def f(a,i):\n if i == 0: # base\n if a[i] != 0:\n return 0\n else:\n return 1\n\n p = i\n t = 1\n while p>=0 and a[p]&t>0:\n if t == 1:\n t = 2\n else:\n t = 1\n p = p-1\n if p<0: return 0\n j = p-1\n\n p = i\n t = 2\n while p>=0 and a[p]&t>0:\n if t == 1:\n t = 2\n else:\n t = 1\n p = p-1\n if p<0: return 0\n k = p-1\n\n return 1+min(f(a,j),f(a,k))\n\nn = int(raw_input())\n\na = map(int,raw_input().split(' '))\n\n\nprint f(a,n-1)\n", "lang": "Python 2", "bug_code_uid": "113436b223deaf26f5e9313b8213091c", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "cadb88e37bec14dbb870d2d28105567c", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07436399217221135, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n = int(raw_input())\noptions = map(int, raw_input().split())\n\nmemo = {}\n\ndef lookup(i, sol):\n memo[sol] = compute(i, sol)\n return memo[sol]\n\ndef compute(i, curr):\n if curr in memo:\n return memo[curr]\n\n if i == n:\n memo[curr] = len([x for x in curr if x == 'R'])\n return memo[curr]\n\n if options[i] == 0:\n return lookup(i + 1, curr + 'R')\n\n if options[i] == 1:\n if i > 0 and curr[i - 1] == 'C':\n return lookup(i + 1, curr + 'R')\n else:\n return lookup(i + 1, curr + 'C')\n\n if options[i] == 2:\n if i > 0 and curr[i - 1] == 'G':\n return lookup(i + 1, curr + 'R')\n else:\n return lookup(i + 1, curr + 'G')\n\n if options[i] == 3:\n if i > 0:\n if curr[i - 1] == 'G':\n return lookup(i + 1, curr + 'C')\n elif curr[i - 1] == 'C':\n return lookup(i + 1, curr + 'G')\n else:\n return min(lookup(i + 1, curr + 'G'), lookup(i + 1, curr + 'C'))\n else:\n return min(lookup(i + 1, curr + 'G'), lookup(i + 1, curr + 'C'))\n\nprint compute(0, '')\n", "lang": "Python 2", "bug_code_uid": "7a776f935b2c9ce4dc40a48998acfee6", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "45f610bcbb148a3c6510a931695b228a", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.15521064301552107, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "x1,y1=map(int,input().split())\nx2,y2=map(int,input().split())\np=0\na=[x1,x2]\nb=[y1,y2]\na.sort()\nb.sort()\nwhile a[0] mn for mx_prev in noascent_maxs])\n noascent_mins[noascent_cnt] = mn\n noascent_maxs[noascent_cnt] = mx\n noascent_cnt += 1\n # res += num1 + num2\n\n noascent_maxs = noascent_maxs[:noascent_cnt]\n noascent_mins = noascent_mins[:noascent_cnt]\n\n noascent_mins = sorted(noascent_mins)\n noascent_maxs = sorted(noascent_maxs)\n\n n = noascent_cnt\n i = 0\n for j in range(n):\n while (i < n) and (noascent_mins[i] < noascent_maxs[j]):\n i += 1\n\n res += i\n\n print(res)\n\n\ndef problem3():\n n, m = inp(int)\n res = 0\n factorials = [1 for i in range(n + 1)]\n for k in range(1, n + 1):\n factorials[k] = factorials[k - 1] * k\n for k in range(1, n + 1):\n res += (((n - k + 1) ** 2) * factorials[k] * factorials[n-k]) % m\n\n print(res % m)\n\n\ndef problem4():\n pass\n\n\ndef problem5():\n pass\n\n\nif __name__ == '__main__':\n # problem1()\n # problem2()\n problem3()\n # problem4()\n # problem5()\n", "lang": "Python 3", "bug_code_uid": "ad87baab899ba039e8294973cbc4523d", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "2266649450a3c05b54bf6a97fdb377fc", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.990909090909091, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n, m = map(int, input().split())\ncount = 0\nfactorial = [1]\nfor i in range(n-1):\n factorial.append((i+2)*factorial[i])\n\nfor i in range(n):\n x = i+1\n count += (n-i)*factorial[i]*factorial[n-i-1]\n\nprint(count%m)\n", "lang": "Python 3", "bug_code_uid": "801300eadba815e5a61808ef9d072e59", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "cf2978ccfb8be25f42300e05730d53a8", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9893617021276596, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,m = map(int,input().split())\nl = [0]*(n+1)\nc=1\nfor i in range(1,n+1):\n l[i] = i*c\n c = l[i]\nans =0\nfor i in range(n):\n ans += (((n-i)%m)*(l[n-i]%m)*(l[i+1]%m))%m\nprint(ans%m)\n", "lang": "Python 3", "bug_code_uid": "bc5e97649504e01fa70437fa8ff2eb33", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "7a98c58d9d75a8bee2e80dfede22a726", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.854524627720504, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "import sys\nsys.setrecursionlimit(10**7)\n\ndef fact(n, m): \n if n >= m: \n return 0 \n \n result = 1\n for i in range(1, n + 1): \n result = (result * i) % m\n \n return result \n\nn, m = [int(x) for x in input().split()]\n\ntotal = 0\n\nfacts = list()\nfor i in range(n+1):\n facts.append(fact(i,m))\n\nfor i in range(n):\n total = (total%m + (((n-i)%m)*(facts[i+1]%m)*(facts[n-i]%m))%m)%m\n\nprint(total)\n", "lang": "Python 3", "bug_code_uid": "e271e47d24d6800f9216c7092f7c2452", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "bca3a085835250a9c00de5bd1e11c91b", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9936708860759493, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=[1]\nn,m=map(int,input().split())\nfor i in range(1,n+1):\n\ta.append(a[-1]*i)\nans=0\nfor i in range(1,n+1):\n\tp=a[i]*a[n-i+1]*(n-i+1)\n\tans+=p\n\tans%=m\nprint(ans)", "lang": "Python 3", "bug_code_uid": "2092af285cc2844a693b3d577022ef43", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "79a159362f0f40d97e48db516cdcd97a", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7429864253393665, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "n,m=map(int,input().split())\nans=0\nfact=[1]*(n+1)\nfor i in range(1,n+1):\n fact[i]=fact[i-1]*i\nfor d in range(1,n):\n s=n-d\n t=fact[d+1]*fact[n-d-1]*s*(n-d)\n #print(l,r,d,s,t)\n ans= ans + t\n ans=ans%m\ntemp=fact[n]*n\n#print(ans)\nans+=temp\nans=ans%m\n#print(temp)\nprint(ans)\n\n\n\n\n'''\nfrom bisect import bisect_right as br\nmaxx=[]\nminn=[]\nc=0\nn=int(input())\nfor _ in range(n):\n t=list(map(int,input().split()))\n t=t[1:]\n flag=False\n for k in range(len(t)-1):\n if(t[k]= maxcount:\n\t\t\tmaxitem = stuff\n\t\t\tmaxcount = count(list, stuff)\n\treturn maxitem\n\ncheck = True\nfor lists in master:\n\tif count(master, lists) > 1:\n\t\tcheck = False\n\nanswer = 0\n\nif check ==True:\n\treference = common(a)\n\tfor i in a:\n\t\tif i != reference:\n\t\t\tanswer += 1\n\n\n\n\nif check == False:\n\tfor i in master:\n\t\tref = common(master)\n\t\tif i != ref:\n\t\t\tfor j in range(len(i)):\n\t\t\t\tif i[j] != ref[j]:\n\t\t\t\t\tanswer += 1\nprint(answer)", "lang": "Python 3", "bug_code_uid": "4b2c5878c3c228ed67cc0e4c4b804eac", "src_uid": "5f94c2ecf1cf8fdbb6117cab801ed281", "apr_id": "0f35715ad9d7b938caf8354d3a24a618", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7203757225433526, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "import string\n\ndef Correct(word):\n up = 0\n lo = 0\n flo = 0\n new = ''\n alpha = list(string.ascii_lowercase)\n ALPHA = list(string.ascii_uppercase)\n dic_one = {}\n dic_two = {}\n for i in range(0,26):\n dic_one[ALPHA[i]] = alpha[i]\n for j in range(0,26):\n dic_two[alpha[j]] = ALPHA[j] \n l = list(word)\n for m in range(len(word)):\n for k in range(0,26):\n if l[m] == ALPHA[k]:\n up = up + 1\n elif l[0] == alpha[k]:\n flo = 1\n if l[0] == l[1]:\n if up == len(word):\n for m in range(0,len(word)):\n l[m] = dic_one[l[m]]\n elif up == len(word) and l[0] != l[1]:\n for m in range(1,len(word)):\n l[m] = dic_one[l[m]]\n elif flo == 1 and up == len(word)-1:\n l[0] = dic_two[l[0]]\n for m in range(1,len(word)):\n l[m] = dic_one[l[m]]\n else:\n return word\n for n in range(len(word)):\n new = new + l[n]\n return new\n\nword = str(input())\nprint(Correct(word))", "lang": "Python 3", "bug_code_uid": "18bc1102ecab03ef5fa7fbe057d3f745", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "3c9554e2af3231a80275145f0a12f62d", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9943502824858758, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,m,k,x,y=list(map(int,input().split()))\nif n>2:\n if n*m0:\n m2=m2+1\n while k>0:\n if x==i and y==j:\n m3=m3+1\n k=k-1\n j=j+1\n if j==m+1:\n j=1\n i=i+c\n print(m2,m1,m3)\n elif k==n*m:\n print(1,1,1)\n else:\n if x<=k//m:\n print(1,0,1)\n elif x==k//m+1 and y<=k%m:\n print(1,0,1)\n else:\n print(1,0,0)\nelif n==2:\n m2=k//(n*m)\n m3=m2\n m1=m2\n k=k%(n*m)\n if k>0:\n m2=m2+1\n i=1\n j=1\n while k>0:\n if x==i and y==j:\n m3=m3+1\n j=j+1\n if j==m+1:\n j=1\n i=i+1\n print(m2,m1,m3)\nelse:\n if k%m==0:\n print(k//m,k//m,k//m)\n else:\n if y<=k%m:\n print(k//m+1,k//m,k//m+1)\n else:\n print(k//m+1,k//m,k//m)", "lang": "Python 3", "bug_code_uid": "a88b8e3de7e102d4c16b557fe050a0e0", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "a8020608e0e719732f48c0ef30cc9c2e", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.41569767441860467, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "n, m, k, xx, yy = map(int, input().split())\nif n != 1:\n plus = k // ((n * 2 - 2) * m)\n k %= (n * 2 - 2) * m\nelse:\n plus = 0\nl = [[plus * 2 for p in range(m)] for pp in range(n)]\nfor t in range(m):\n l[0][t] -= plus\n l[-1][t] -= plus\nx = y = s = 0\nd = 1\nfor t in range(k):\n l[x][y] += 1\n if y == m-1:\n y = 0\n if x+d == -1:\n d = -d\n x += d\n elif x+d == n:\n d = -d\n x += d\n else:\n x += d\n if x == -1:\n x = 0\n if x == n:\n x = n-1\n else:\n y += 1\nprint(max(max(l, key=lambda tt: max(tt))), min(min(l, key=lambda tt: min(tt))), l[xx-1][yy-1])", "lang": "Python 3", "bug_code_uid": "0a9a248623cccedd9e3532b2f1abf9f9", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "81c50bbabe9dde1828e92b83830ffc93", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6710963455149501, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "import string\nimport sys\n\ns = input()\nsets = set(s)\nt = sorted(tuple(sets))\nif t != list(string.ascii_lowercase[:len(t)]):\n print(\"NO\")\n sys.exit()\nfor x in range(len(t)):\n if string.ascii_lowercase[:len(t)] == s[0]:\n s.replace(s[0],'')\n else:\n print(\"NO\")\n sys.exit()\n\nprint(\"YES\")\n", "lang": "Python 3", "bug_code_uid": "3c0e8a371f7d7e44d27063670252f1da", "src_uid": "c4551f66a781b174f95865fa254ca972", "apr_id": "d7d0d35a9c0d613a6f5a6ab641da3212", "difficulty": 1100, "tags": ["greedy", "strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8539325842696629, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "n,k,x=map(int,input().split())\na=list(map(int,input().split()))\nif(len(a))<=2:\n print(k*x)\nelse:\n a.remove(max(a))\n a.remove(max(a))\n print(sum(a)+k*x)", "lang": "Python 3", "bug_code_uid": "5534cdc512e3856deac5137b187e1bc3", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "b18179c93ea52ccb2e37f9724ea87719", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9902912621359223, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#\n n,k,x=[int(x) for x in input().split()]\na =[int(x) for x in input().split()]\nsum = 0\nfor i in range(len(a)-k):\n sum = sum + a[i]\nprint (sum + k*x)", "lang": "Python 3", "bug_code_uid": "eafa6c2beabc02e39dac113f5e8c5b9e", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "c62a6bb8a11f8390b6a77ebe28424763", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.652014652014652, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "from sys import stdin\nimport fractions\n\ndef line():\n return stdin.readline().split()\ndef read_int():\n return int(line()[0])\ndef read_ints():\n return [int(x) for x in line()]\ndef memo(fn):\n table = {}\n def memoized(*args):\n if args not in table:\n table[args] = fn(*args)\n return table[args]\n return fn\n\ndef solve(n, m, k):\n if (n - m)*k >= n:\n return n\n\n skips = (n - m)\n n -= skips*k\n doubles, last = n / k, n % k\n #print last, skips, doubles\n\n score = 0\n for _ in range(doubles):\n score += k\n score *= 2\n score = score % 1000000009\n\n score += (k - 1) * skips\n score = score % 1000000009\n score += last\n\n return score\n\nn, m, k = read_ints()\nprint solve(n, m, k)\n", "lang": "Python 2", "bug_code_uid": "4bd9a95e896a053cf4589db9409886c2", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "20447f46006c2abea457f2adca18b74c", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4918032786885246, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\nile_6 = sum([x for x in range(1, n + 1)])\nprint(ile_6 * 6 + 1)", "lang": "PyPy 3", "bug_code_uid": "c99ed52ad5dfef97006da9b91a6455dd", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "a3ebcf04cbe854393b4c5c71b32ddde4", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3883495145631068, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "print(sum([max(1, 6 * i) for i in range(int(input()) + 1)]))", "lang": "PyPy 3", "bug_code_uid": "5bc4810f1dc876e3546dc7361ce54895", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "db2b50b1deda489d2bb341a5962c5426", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9497435897435897, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "MOD=10**9+7\nn=int(input())\ns=[c=='(' for c in input()]\nm=len(s)\nz=[[0,0]]\nfor v in s:\n n=z[-1][v]\n z[-1][v]=len(z)\n z.append(z[n][:])\nz[m][0]=z[m][1]=m\ndp=[[0 for _ in range(m+1)] for _ in range(n+1)]\ndp[0][0]=1\nfor _ in range(2*n):\n ndp=[[0 for _ in range(m+1)] for _ in range(n+1)]\n for i in range(n+1):\n for j in range(m+1):\n if i>0:ndp[i-1][z[j][0]]=(ndp[i-1][z[j][0]]+dp[i][j])%MOD\n if i= int(l[1])):\n print(int(l[0][::-1]) - int(l[1]))\nelse:\n m = int(l[1])\n h = int(l[0])\n ans = 0\n while(True):\n m += 1\n ans += 1\n if(m == 60):\n m = 0\n h += 1\n if(h == 24):\n h = 0\n st = \"00:00\"\n else:\n if(len(str(h)) == 1):\n st = \"0\"+str(h)+\"00\"\n else:\n st = str(h)+\"00\"\n else:\n if(len(str(m)) == 1):\n if(len(str(h)) == 1):\n st = \"0\"+str(h)+\"0\"+str(m)\n else:\n st = str(h)+\"0\"+str(m)\n else:\n if(len(str(h) == 1)):\n st = \"0\"+str(h)+str(m)\n else:\n st = str(h)+str(m)\n if(st == st[::-1]):\n print(ans)\n break\n\n\n", "lang": "PyPy 3", "bug_code_uid": "0ab1e2ed5574bd0349b31b93bccf983c", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "60d0bd7bfd72fedd4b516a6f3e5d223c", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9937106918238994, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, k = list(map(int, input().split()))\nl = list(map(int, input().split()))\nh = 1e99\nfor elem in l:\n if not k % elem:\n h = min(h, l // elem)\nprint(h)\n", "lang": "Python 3", "bug_code_uid": "2717e7a9145708f25d8132fc65a5b532", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "e00ad510355c28ead8572b54cf1aa0fc", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9259259259259259, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "ans = 'YES'\nfor i in range(8):\n t = input()\n if t[0] == 'B': if t.count('BW') != 4:\n ans = 'NO'\n break\n else: if t.count('WB') != 4:\n ans = 'NO'\n break \nprint(ans)", "lang": "Python 3", "bug_code_uid": "2f4d8726b2141c69cd4dddf8ec7aca59", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "ce6423d35cf7b2e065073cb2455f8dec", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5238600212089077, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "Integer = int(input(\"\"))\nif Integer < 100 and Integer > 0:\n import math\n First_dig = math.floor(Integer/10)\n Second_dig = Integer - First_dig * 10\n if First_dig == 0:\n n = 2\n elif First_dig == 1:\n n = 7\n elif First_dig == 2:\n n = 2\n elif First_dig == 3:\n n = 3\n elif First_dig == 4:\n n = 3\n elif First_dig == 5:\n n = 3\n elif First_dig == 6:\n n = 2\n elif First_dig == 7:\n n =5\n elif First_dig == 8:\n n = 1\n elif First_dig == 9:\n n = 2\n\n if Second_dig == 0 :\n k = 2\n elif Second_dig == 1:\n k = 7\n elif Second_dig == 2:\n k = 2\n elif Second_dig == 3:\n k = 3\n elif Second_dig == 4:\n k = 3\n elif Second_dig == 5:\n k = 3\n elif Second_dig == 6:\n k = 2\n elif Second_dig == 7:\n k = 5\n elif Second_dig == 8:\n k = 1\n else:\n k = 2\n\n \nprint(k*n)", "lang": "Python 3", "bug_code_uid": "8cf8cccd5062af16ed0e5a8f0fbc95d7", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "179b03ddc79f84b0d98a4c335c932e8f", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7162897223017464, "equal_cnt": 107, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 96, "fix_ops_cnt": 106, "bug_source_code": "import math\n\nn = int(input())\nedge = [list(map(int, input().split())) for _ in range(n-1) ]\ng = {}\n\nfor x, y in edge:\n if x not in g:\n g[x] = []\n if y not in g:\n g[y] = []\n \n g[x].append(y)\n g[y].append(x)\n\ndef find_center(g): \n d = {}\n d[1] = 0\n Q = [(1, 0)]\n\n while len(Q) > 0:\n u, dis = Q.pop(0)\n \n for v in g[u]:\n if v not in d:\n d[v] = dis +1\n Q.append((v, d[v])) \n \n max_length = -1\n s = None \n\n for u, dis in d.items():\n if dis > max_length:\n max_length = dis\n s = u\n \n d = {}\n pre = {}\n d[s] = 0\n Q = [(s, 0)]\n\n while len(Q) > 0:\n u, dis = Q.pop(0)\n \n for v in g[u]:\n if v not in d:\n pre[v] = u\n d[v] = dis +1\n Q.append((v, d[v])) \n \n max_length = -1\n e = None \n\n for u, dis in d.items():\n if dis > max_length:\n max_length = dis\n e = u\n \n route = [e]\n while pre[route[-1]] != s:\n route.append(pre[route[-1]])\n \n return route[len(route) // 2]\n \nroot = find_center(g)\np = {}\nsize = {}\nQ = [root]\np[root] = -1\n\ni = 0\nwhile i < len(Q):\n u = Q[i]\n \n for v in g[u]:\n if p[u] == v: continue\n p[v] = u\n Q.append(v)\n i+=1 \n \nfor u in Q[::-1]:\n size[u] = 1\n \n for v in g[u]:\n if p[u] == v:\n continue\n size[u] += size[v]\n\ngr = [(u, size[u]) for u in g[root]]\ngr = sorted(gr, key=lambda x:x[1])\nthres = math.ceil((n-1) / 3) \nsum_ = 0\n\ngr1 = []\ngr2 = []\ni = 0\n\nwhile sum_ < thres:\n gr1.append(gr[i][0])\n sum_ += gr[i][1]\n i+=1\n \nwhile i < len(gr):\n gr2.append(gr[i][0])\n i+=1\n \ndef asign(u, W, ew):\n if size[u] == 1:\n return\n \n cur = 0\n for v in g[u]:\n if v == p[u]: continue\n \n first = W[cur]\n ew.append((u, v, first))\n \n W_ = [x - first for x in W[cur+1: cur+size[v]]]\n asign(v, W_, ew)\n \n cur+=size[v]\n\na, b = 0, 0\nfor x in gr1:\n a += size[x]\n \nfor x in gr2:\n b += size[x]\n \narr_1 = [x for x in range(1, a+1)] \narr_2 = [i*(a+1) for i in range(1, b+1)] \new = []\n\ncur = 0\nfor u in gr1:\n first = arr_1[cur]\n ew.append((root, u, first))\n W_ = [x - first for x in arr_1[cur+1:cur+size[u]]]\n \n cur += size[u]\n #print(u, W_)\n asign(u, W_, ew)\n \ncur = 0\nfor u in gr2:\n first = arr_2[cur]\n ew.append((root, u, first))\n W_ = [x - first for x in arr_2[cur+1:cur+size[u]]]\n \n cur += size[u]\n #print(u, W_)\n asign(u, W_, ew)\n \nfor u, v, w in ew:\n print('{} {} {}'.format(u, v, w))", "lang": "Python 3", "bug_code_uid": "d8fa83ab4bfe2d9dd2476702e0bbb6a4", "src_uid": "87d755df6ee27b381122062659c4a432", "apr_id": "cff2155aeb618d25d4bc1b5876b7cb6f", "difficulty": 2700, "tags": ["trees", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8201496525921966, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "import math\n\nn = int(input())\n\nif n == 1:\n print()\nelse: \n edge = [list(map(int, input().split())) for _ in range(n-1) ]\n g = {}\n\n for x, y in edge:\n if x not in g:\n g[x] = []\n if y not in g:\n g[y] = []\n \n g[x].append(y)\n g[y].append(x)\n\n def find_center(g): \n d = {}\n d[1] = 0\n Q = [(1, 0)]\n\n while len(Q) > 0:\n u, dis = Q.pop(0)\n \n for v in g[u]:\n if v not in d:\n d[v] = dis +1\n Q.append((v, d[v])) \n \n max_length = -1\n s = None \n\n for u, dis in d.items():\n if dis > max_length:\n max_length = dis\n s = u\n \n d = {}\n pre = {}\n d[s] = 0\n Q = [(s, 0)]\n\n while len(Q) > 0:\n u, dis = Q.pop(0)\n \n for v in g[u]:\n if v not in d:\n pre[v] = u\n d[v] = dis +1\n Q.append((v, d[v])) \n \n max_length = -1\n e = None \n\n for u, dis in d.items():\n if dis > max_length:\n max_length = dis\n e = u\n \n route = [e]\n while pre[route[-1]] != s:\n route.append(pre[route[-1]])\n \n return route[len(route) // 2]\n\n root = find_center(g)\n p = {}\n size = {}\n Q = [root]\n p[root] = -1\n\n i = 0\n while i < len(Q):\n u = Q[i]\n \n for v in g[u]:\n if p[u] == v: continue\n p[v] = u\n Q.append(v)\n i+=1 \n \n for u in Q[::-1]:\n size[u] = 1\n \n for v in g[u]:\n if p[u] == v:\n continue\n size[u] += size[v]\n\n gr = [(u, size[u]) for u in g[root]]\n gr = sorted(gr, key=lambda x:x[1])\n thres = math.ceil((n-1) / 3) \n sum_ = 0\n\n gr1 = []\n gr2 = []\n i = 0\n \n while sum_ < thres:\n gr1.append(gr[i][0])\n sum_ += gr[i][1]\n i+=1\n \n while i < len(gr):\n gr2.append(gr[i][0])\n i+=1\n \n def asign(u, W, ew):\n if size[u] == 1:\n return\n \n cur = 0\n for v in g[u]:\n if v == p[u]: continue\n \n first = W[cur]\n ew.append((u, v, first))\n \n W_ = [x - first for x in W[cur+1: cur+size[v]]]\n asign(v, W_, ew)\n \n cur+=size[v]\n\n a, b = 0, 0\n for x in gr1:\n a += size[x]\n \n for x in gr2:\n b += size[x]\n \n arr_1 = [x for x in range(1, a+1)] \n arr_2 = [i*(a+1) for i in range(1, b+1)] \n ew = []\n\n cur = 0\n for u in gr1:\n first = arr_1[cur]\n ew.append((root, u, first))\n W_ = [x - first for x in arr_1[cur+1:cur+size[u]]]\n \n cur += size[u]\n #print(u, W_)\n asign(u, W_, ew)\n \n cur = 0\n for u in gr2:\n first = arr_2[cur]\n ew.append((root, u, first))\n W_ = [x - first for x in arr_2[cur+1:cur+size[u]]]\n \n cur += size[u]\n #print(u, W_)\n asign(u, W_, ew)\n \n for u, v, w in ew:\n print('{} {} {}'.format(u, v, w))", "lang": "Python 3", "bug_code_uid": "d84a554abbf4c7048ac55d535f3c768a", "src_uid": "87d755df6ee27b381122062659c4a432", "apr_id": "cff2155aeb618d25d4bc1b5876b7cb6f", "difficulty": 2700, "tags": ["trees", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.15225806451612903, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "def solve():\n A = []\n for i in range(3):\n A.append(map(int, raw_input().split()))\n x,y,z = 0,0,0\n r1 = sum(A[0])\n r2 = sum(A[1])\n r3 = sum(A[2])\n for i in xrange(1,(10**5)+1):\n for j in xrange(1,(10**5)+1):\n if i + r1 == j + r2:\n x,y = i,j\n z = (y+r2)-r3\n if x + y + z == x+r1:\n A[0][0],A[1][1],A[2][2] = x,y,z\n return A\n\n\n\nA = solve()\nfor row in A:\n print \" \".join(map(str, row))", "lang": "Python 2", "bug_code_uid": "f894cc03922ba7a132a1e2220e3eb473", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "45fcbd79ff9bee7e688c6d77437dd52d", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9959404600811907, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,p,k=map(int,input().split())\nst=\"\"\nleft=[p-i for i in range(k,0,-1)]\nl=[j for j in left if j>0]\nif if len(l)!=0 and p!=1 and l[0]!=1:\n st=\"<<\"\n st+=\" \"\nright=[p+i for i in range(1,k+1)]\nr=[j for j in right if j<=n]\nfor i in l:\n st+=str(i)+\" \"\nst+=\"(\"+str(p)+\")\"+\" \"\nfor i in r:\n st+=str(i)+\" \"\nif len(r)!=0 and n!=r[-1] and p!=n:\n st+=\">>\"\n \nprint(st)", "lang": "Python 3", "bug_code_uid": "304ce65d80e16989321d21b243378256", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "285cfbae86fe680aea8233a7122561c3", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2904238618524333, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#!/usr/bin/env python3\n\nr, c, n, k = [int(x) for x in input().split()]\nmin_x, min_y, max_x, max_y = r, c, 1, 1\nfirst = True\nfor i in range(0, n):\n x, y = [int(x) for x in input().split()]\n if first:\n min_x = x\n min_y = y\n max_x = x\n max_y = y\n else:\n min_x = min(x, min_x)\n min_y = min(y, min_y)\n max_x = max(x, max_x)\n max_y = max(y, max_y)\nprint(min_x * min_y * (r - max_x + 1) * (c - max_y + 1))\n", "lang": "Python 3", "bug_code_uid": "3354f446f3412c7974a39490fa694b7f", "src_uid": "9c766881f6415e2f53fb43b61f8f40b4", "apr_id": "faf645e84215ff18d3228bbcffaadb31", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8828451882845189, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "r, c, n, k = map(int, input().split(' '))\np = []\n\ndef findIn(z, x, y, s):\n\tglobal n\n\tret = 0\n\tfor i in range(n):\n\t\tif z <= p[i][0] and y >= p[i][0] and x <= p[i][1] and s >= p[i][1]:\n\t\t\tret = ret + 1\n\treturn ret\n\nfor i in range(n):\n\tx, y = map(int, input().split(' '))\n\tp.append((x, y))\n\nans = 0\nfor z in range(1, c + 1):\n\tfor x in range(1, r + 1):\n\t\tfor y in range(z, c + 1):\n\t\t\tfor s in range(x, r + 1):\n\t\t\t\tif findIn(z, x, y, s) >= k:\n\t\t\t\t\tans = ans + 1\nprint (ans);\n\t\t\t\t\n\n\t\n", "lang": "Python 3", "bug_code_uid": "7d5bfe07b4788aebaefeb2d27db409a0", "src_uid": "9c766881f6415e2f53fb43b61f8f40b4", "apr_id": "28dd323309c9a6b069ab4573a3b117d8", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8983957219251337, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n,m=int(input()),int(input())\nif min(n,m)%2==0:\n print(\"Malvika\")\nelse:\n print(\"Akshat\")", "lang": "Python 3", "bug_code_uid": "55a87d6d3040c40bc5dfcc6951653ad0", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "61c44b4853410b6a5645d5181bac634f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.994413407821229, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\n\nk = list(map(int,input().split()))\ncount1 = 0\ncount2 = 0\ncount3 = 0\nmax = 0\ntemp = 0\nfor i in range(0,len(k),3):\n count1+=k[i]\n if count1>max:\n max = count1\n temp = 'chest\u2019\n\n\nfor i in range(1,len(k),3):\n count2+=k[i]\n if count2>max:\n max = count2\n temp = 'biceps'\n\nfor i in range(2,len(k),3):\n count3+=k[i]\n if count3>max:\n max = count3\n temp = 'back'\n\nprint(temp)\n\n\n\n", "lang": "Python 3", "bug_code_uid": "7e88aa894f8cf28f61d874e7afbb4a39", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "1d7481dea2e87100aa7441adfebf4baa", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9760900140646976, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\nl=list(map(int,input().split()))\nfor i in range(n):\n if i%3==0:\n if i!=0:\n l[0]=l[0]+l[i]\n elif i%3==1:\n if i!=1:\n l[1]=l[1]+l[i]\n elif i%3==2:\n if i!=2:\n l[2]=l[2]+l[i]\nif l[0]==max(l):\n print('chest')\nelif l[1]==max(l):\n print('biceps')\nelif l[2]==max(l):\n print('back')\n ", "lang": "Python 3", "bug_code_uid": "d9a7483be72a7b5927a3daf3a6c102d5", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "492e64f49caaa4543ef0418675bc3e43", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3116883116883117, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 2 22:21:51 2020\n\n@author: 86177\n\n\n\"\"\"\na=list(input())\nb=list(input())\nc=list(input())\nd=list(input())\ne=list(input())\nf=[a\uff0cb\uff0cc\uff0cd\uff0ce]\nfor i in range(5):\n for n in range(5):\n if f[i][n] in [\"1\"]:\n h=int(i)--2 \n q=int(n)--2\n h=abs(h) \n q=abs(q)\n print(h++q)", "lang": "Python 3", "bug_code_uid": "a0b2f8417745f80560d1c909f4ef4339", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "apr_id": "7349b961afa14071db4e11fc15e8c75a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9849834563502163, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "def id():\n x=raw_input()\n user=''\n num=0\n lo=[]\n lo=range(65,91)+range(97,123)+[95]+range(48,58)\n st='b'\n for i in x:\n if i=='@':\n x=x[num+1:]\n st='c' \n break\n user=user+i\n num=num+1\n\n if st!='c':\n return 'NO'\n else:\n if len(user)<16 and len(user)!=0:\n for i in user:\n if ord(i) not in lo:\n return 'NO'\n else:\n return 'NO'\n \n n1=0 \n w=0\n ch=0\n if len(x)==0:\n return 'NO'\n for o in x:\n if o=='/':\n ch=1\n lis=x[:w].split('.')\n if len(lis)==0:\n return 'NO'\n hostname_t=''\n for loop in lis:\n hostname_t=loop+hostname_t\n if len(hostname_t)<33:\n for s in hostname_t:\n if ord(s) not in lo:\n return 'NO'\n \n for loop_s in lis:\n if loop_s<17 or len(loop_s)==0:\n return 'NO'\n break\n w=w+1\n x=x[w+1:]\n if len(x)<17 and len(x)!=0:\n for b in x:\n if ord(b) not in lo:\n return 'NO'\n else:\n return 'NO'\n if ch==0:\n lis=x.split('.')\n if len(lis)==0:\n return 'NO' \n hostname_t=''\n for loop in lis:\n hostname_t=loop+hostname_t\n if len(hostname_t)<33:\n for s in hostname_t:\n if ord(s) not in lo:\n return 'NO'\n \n for loop_s in lis:\n if loop_s>16 and len(loop_s)==0:\n return 'NO'\n return 'YES' \nprint id()", "lang": "Python 2", "bug_code_uid": "5a00fe2a6907ffc6fcdce327d27f4306", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "a292eb31cf53d2e501c0aa89e4d34fd9", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9514908767245216, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "N = 200001\nMOD = 1000000007\nfact = [1] * N\ninv_fact = [1] * N\n\ndef ModExp(a, n):\n ans = 1\n while n:\n if n % 2:\n ans = (ans * a) % MOD\n a = (a * a) % MOD\n n /= 2\n return ans\n\ndef ModInverse(a):\n return ModExp(a, MOD - 2)\n\ndef PreProcess(n):\n for i in range(1, n + 1):\n fact[i] = (i * fact[i - 1]) % MOD\n inv_fact[i] = (ModInverse(i) * inv_fact[i - 1]) % MOD\n\ndef nCr(n, r):\n if n < 0 or r < 0 or n < r:\n return 0\n else:\n return (fact[n] * inv_fact[r] * inv_fact[n - r]) % MOD\n\ndef Beggar(m, n):\n if m < 0 or n < 0 or (n == 0 and m != 0):\n return 0\n else:\n if m + n == 0:\n return 1\n else:\n return nCr(m + n - 1, m)\n\nf, w, h = map(int, raw_input().split())\nn = f + w\n\nPreProcess(n)\n\nq = nCr(n, w)\np = 0\n\nfor n in range(0, w + 1):\n if n * (h + 1) > w:\n break\n else:\n p += (Beggar(w - n * (h + 1), n) * (Beggar(f - n - 1, n + 1) + Beggar(f - n + 1, n - 1) + 2 * Beggar(f - n, n))) % MOD\n\nq = ModInverse(q)\nans = (p * q) % MOD\n\nprint ans\n", "lang": "Python 2", "bug_code_uid": "5acb73f67f629c1eecd2b578e66349e1", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "844c6efa276237fba95fa7f60793e695", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9144736842105263, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "x1, y1 = [int(i) for i in input().split()]\nx2, y2 = [int(i) for i in input().split()]\nprint(max(8, (abs((x2 - x1)) + 1) * 2 + (abs((y2 - y1)) + 1) * 2))", "lang": "Python 3", "bug_code_uid": "cd5c9a48be6a61e930011a5ca83835ed", "src_uid": "f54ce13fb92e51ebd5e82ffbdd1acbed", "apr_id": "66eeb109ca1be7c17e1e1063fc2b1e30", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8680961663417803, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "import sys\nn, bitcoins = [int(x) for x in input().split()]\nlis = [int(x) for x in input().split()]\n\nmemory = [[[-1 for _ in range(bitcoins+1)] for _ in range(n)] for _ in range(n)]\nprefix_even = []\ntotal = 0\nfor i in range(n):\n if lis[i] %2 == 0:\n total += 1\n prefix_even.append(total)\ncosts = []\nfor i in range(n-1):\n even_right = prefix_even[n-1] - prefix_even[i] \n #print(even_right)\n if prefix_even[i] == i+1-prefix_even[i] and even_right == n-i-1-even_right: \n costs.append(abs(lis[i]-lis[i+1]))\n\ncosts = sorted(costs)\n#print(costs)\ntotal = 0\nif len(costs)==0:\n print(0)\n sys.exit()\n \nbitcoins -= costs[0]\nwhile bitcoins >= 0:\n total += 1\n bitcoins -= costs[total]\nprint(total)\n \n \n\n \n ", "lang": "PyPy 3", "bug_code_uid": "1064beb135a11904366fa1f8d6b784ba", "src_uid": "b3f8e769ee7719ea5c9f458428b16a4e", "apr_id": "d6bd0c1dc32c63c1521dd496d0c1b981", "difficulty": 1200, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.46943765281173594, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "def pixel(input):\n red, green, blue = input.split()\n red = int(red)\n green = int(green)\n blue = int(blue)\n\n srednee = (red + green + blue) // 3\n ost = (red + green + blue) % 3\n\n if srednee in [red,green,blue] and ost == 0:\n return srednee\n\n for item in [red, green, blue]:\n if item > srednee:\n return item\n\nprint(pixel(input()))", "lang": "Python 3", "bug_code_uid": "9b7f4397188b39eb609a21f595301039", "src_uid": "b8008caf788336775cb8ebb76478b04c", "apr_id": "ed876a21a07395b4cb634643adc1c2be", "difficulty": 2100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07941176470588235, "equal_cnt": 23, "replace_cnt": 15, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "def pixel(input):\n red, green, blue = input.split()\n pixels = [int(red), int(green), int(blue)]\n\n red = 0\n green = 1\n blue = 2\n\n battles = 0\n\n f1 = None\n f2 = None\n w = None\n\n\n while True:\n if pixels[red] == pixels[green]:\n break\n if pixels[red] == pixels[blue]:\n break\n if pixels[green] == pixels[red]:\n break\n if pixels[green] == pixels[blue]:\n break\n if pixels[blue] == pixels[red]:\n break\n if pixels[blue] == pixels[green]:\n break\n\n\n lowest = get_min_key(pixels)\n if lowest == red:\n f1 = green\n f2 = blue\n w = red\n elif lowest == green:\n f1 = red\n f2 = blue\n w = green\n elif lowest == blue:\n f1 = red\n f2 = green\n w = blue\n\n pixels[f1] -= 1\n pixels[f2] -= 1\n pixels[w] += 1\n battles += 1\n\n minBattles = 0\n maxBattles = 0\n minPixels = pixels.copy()\n maxPixels = pixels.copy()\n\n\n lowest = get_min_key(pixels)\n\n if lowest == red:\n f1 = green\n f2 = blue\n w = red\n elif lowest == green:\n f1 = red\n f2 = blue\n w = green\n elif lowest == blue:\n f1 = red\n f2 = green\n w = blue\n\n while True:\n is_mir = len([x for x in maxPixels if x <= 0]) > 1\n if is_mir:\n break\n\n if maxPixels[f1] == 0:\n tmp = w\n w = f1\n f1 = tmp\n\n if maxPixels[f2] == 0:\n tmp = w\n w = f2\n f2 = tmp\n\n maxPixels[f1] -= 1\n maxPixels[f2] -= 1\n maxPixels[w] += 1\n\n minBattles += 1\n\n highest = get_max_key(pixels)\n if highest == red:\n f1 = green\n f2 = blue\n w = red\n elif highest == green:\n f1 = red\n f2 = blue\n w = green\n elif highest == blue:\n f1 = red\n f2 = green\n w = blue\n\n while True:\n is_mir = len([x for x in minPixels if x <= 0]) > 1\n if is_mir:\n break\n\n if minPixels[f1] == 0:\n tmp = w\n w = f1\n f1 = tmp\n\n if minPixels[f2] == 0:\n tmp = w\n w = f2\n f2 = tmp\n\n minPixels[f1] -= 1\n minPixels[f2] -= 1\n minPixels[w] += 1\n\n maxBattles += 1\n\n return battles + minBattles if battles + minBattles < battles + maxBattles else battles + maxBattles\n\ndef get_max_key(pixels):\n maxKey = 0\n max = pixels[maxKey]\n for key, pixel in enumerate(pixels):\n if pixel > max:\n max = pixel\n maxKey = key\n\n return maxKey\n\n\ndef get_min_key(pixels):\n minKey = 0\n min = pixels[minKey]\n for key, pixel in enumerate(pixels):\n if pixel < min:\n min = pixel\n minKey = key\n\n return minKey\n \nprint(pixel(input()))", "lang": "Python 3", "bug_code_uid": "64ad7db08d34ba6a08a8e34829c14025", "src_uid": "b8008caf788336775cb8ebb76478b04c", "apr_id": "ed876a21a07395b4cb634643adc1c2be", "difficulty": 2100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9243763504223139, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import bisect\nimport decimal\nfrom decimal import Decimal\nimport os\nfrom collections import Counter\nimport bisect\nfrom collections import defaultdict\nimport math\nimport random\nimport heapq \nfrom math import sqrt\nimport sys\nfrom functools import reduce, cmp_to_key\nfrom collections import deque\nimport threading\nfrom itertools import combinations\nfrom io import BytesIO, IOBase\nfrom itertools import accumulate\n\n# sys.setrecursionlimit(200000)\n# mod = 10**9+7\n# mod = 998244353\ndecimal.getcontext().prec = 46\n\ndef primeFactors(n): \n prime = set()\n while n % 2 == 0: \n prime.add(2)\n n = n//2\n for i in range(3,int(math.sqrt(n))+1,2): \n while n % i== 0: \n prime.add(i)\n n = n//i \n if n > 2: \n prime.add(n)\n return list(prime)\n \ndef getFactors(n) : \n factors = []\n i = 1\n while i <= math.sqrt(n): \n if (n % i == 0) : \n if (n // i == i) : \n factors.append(i)\n else : \n factors.append(i)\n factors.append(n//i)\n i = i + 1\n return factors\n \ndef SieveOfEratosthenes(n): \n prime = [True for i in range(n+1)] \n p = 2\n while (p * p <= n): \n if (prime[p] == True): \n for i in range(p * p, n+1, p): \n prime[i] = False\n p += 1\n num = []\n for p in range(2, n+1): \n if prime[p]: \n num.append(p)\n return num\n\ndef lcm(a,b):\n return (a*b)//math.gcd(a,b)\n\ndef sort_dict(key_value):\n return sorted(key_value.items(), key = lambda kv:(kv[1], kv[0]))\n\ndef list_input():\n return list(map(int,input().split()))\n \ndef num_input():\n return map(int,input().split())\n \ndef string_list():\n return list(input())\n \ndef decimalToBinary(n): \n return bin(n).replace(\"0b\", \"\") \n \ndef binaryToDecimal(n): \n return int(n,2) \n \ndef DFS(n,s,adj): \n visited = [False for i in range(n+1)] \n stack = [] \n stack.append(s) \n \n while (len(stack)): \n s = stack[-1] \n stack.pop() \n \n if (not visited[s]): \n visited[s] = True \n \n for node in adj[s]: \n if (not visited[node]): \n stack.append(node) \n \ndef solve():\n n = int(input())\n ans = 'codeforces'\n print(ans+('s'*(n-1)))\n\n#t = int(input())\nt = 1\nfor _ in range(t):\n solve()\n\n\n \n \n \n \n", "lang": "Python 3", "bug_code_uid": "8c6a924f4c707fc096e56274fdc902e6", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "4dfbd10a4ddbb34039c5741cd7481586", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.31666666666666665, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "k = int(input())\nk = k-1\nprint(\"codeforces\",end=\"\")\nwhile k>0:\n print(\"s\"*(k%1000000000),end=\"\")\n k-=1000000000\nprint(\"\")", "lang": "Python 3", "bug_code_uid": "bdbb0493fc9e61b6675bb8257ae467fe", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "984e669b91dc9df88c91d93afb7d9eb5", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.20353982300884957, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "\nk=int(input(\"\"))\nans='codeforces'\nans+='s'*(k-1)\nprint(ans) \n", "lang": "Python 3", "bug_code_uid": "258d55929a45d3b28c05fa95e23d2e81", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "34ef7e466c52382156593846e9690460", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.34980988593155893, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n=int(input())\ns='codeforces'\nprint(s,end='')\nprint('s'*(n-1))\n", "lang": "Python 3", "bug_code_uid": "7524b24275fe8d25ce011f639016cad2", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "02c86864a0695547a80d29c8eba83eae", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.19858156028368795, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "print(\"codeforce\"+\"s\"*int(input()))", "lang": "Python 3", "bug_code_uid": "949936809d8d193ab4e8933b667df418", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "e421171b1cf4e3a931670c0e2e674abe", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.47858942065491183, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "k=int(input())\nans=\"codeforces\"\nif k==1:\n print (ans)\nelse:\n s=\"s\"\n while len(s)<=k:\n s+=s\n s=s[0:k-1]\n ans+=s\n print (ans)", "lang": "Python 3", "bug_code_uid": "b092c880e915521e8a92cead037916a2", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "ba8790669827d17b874843e29f032787", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.12093023255813953, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "k=int(input())\na=\"codeforces\"\nif(k==1):\n print(a)\nelse:\n print(a+'s'*(k-1))\n", "lang": "Python 3", "bug_code_uid": "583abd9ff3218a2176781ecf1e1d7eea", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "cacbf90fbaab0cde07133bc7796012bd", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.32171156893819336, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "// import sys \n// sys.stdin = open('input.txt', 'r') \n// sys.stdout = open('output.txt', 'w')\nimport math\n# import re\ngg=\"abcdefghijklmnopqrstuvwxyz\"\n# a=ord('a')\n# print(chr(a), end=\"\")\n#sys.setrecursionlimit(int(1e6))\n# n, m = map(int, input().split())\n# graph = [[] for i in range(n)]\n# for i in range(m):\n# \ta,b = map(int, input().split())\n# \tgraph[a-1].append(b-1)\n# \tgraph[b-1].append(a-1)\n\n# def dfs(node, count, visited):\n# \tvisited[node] = 1\n# \tcount[0]+=1\n# \tfor i in graph[node]:\n# \t\tif not visited[i]:\n# \t\t\tdfs(i, count, visited)\n\n\n# visited = [0]*n\n# t = 0\n# node = None\n# for i in range(n):\n# \tif not visited[i]:\n# \t\tcount = [0]\n# \t\tdfs(i, count, visited)\n# \t\tif t= p: \n return 0 \n \n result = 1\n for i in range(1, n + 1): \n result = (result * i) % p \n \n return result \nmod=1000000007\nn=int(input())\nm=modFact(n,1000000007)\nm -= 2**(n-1)%mod\nprint(m)", "lang": "Python 3", "bug_code_uid": "5a724baa65527b084f153e1693f5ad06", "src_uid": "3dc1ee09016a25421ae371fa8005fce1", "apr_id": "700c0febe2174c888b6630f96492d0b3", "difficulty": 1500, "tags": ["graphs", "dp", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.02831858407079646, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "string = \"\"\nstring += \"((\"*int(input())\nstring += \"()\"*int(input())\nstring += \")(\"*int(input())\nstring += \"))\"*int(input())\nstk = []\nfor s in string:\n if len(stk)==0:\n stk.append(s)\n elif s==')' and stk[-1] == '(':\n stk.pop(-1)\n else:\n stk.append(s)\nif len(stk)==0:\n print(1)\nelse:\n print(0)", "lang": "PyPy 3", "bug_code_uid": "03743ca8d4a395d7cb29b6d41425d690", "src_uid": "b99578086043537297d374dc01eeb6f8", "apr_id": "199b98c2a99ae0cd1cd9f41e696eccca", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.0481283422459893, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "copy = int(input())\norig = int(input())\na = copy-(orig-1)\nif (((copy-a)%2)==0):\n\tprint(\"YES\")\nelse:\n\tprint(\"no\")\n", "lang": "Python 3", "bug_code_uid": "9d10c6568e2b85797098e4bf938c3178", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "50fb88840dba45482e22d108789a29f4", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9935622317596566, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "def pro(g, v):\n\tif g == 0:\n\t\tif v == 0:\n\t\t\treturn True\n\t\telse:\n\t\t\treturn False\n\ty = 2**100\n\tans = 0\n\tx = g\n\twhile x != 0:\n\t\tif x >= y:\n\t\t\tx -= y\n\t\t\tans += 1\n\t\ty //= 2\n\tif ans <= v and v <= g:\n\t\treturn True\n\telse:\n\t\treturn False\n\nn, p = map(int, input().split())\nmini = 10000\nfor i in range(0, 1000000):\n\tif n - p * i < 0:\n\t\tbreak\n\tx = pro(n - p * i, i)\n\t#print (x, i)\n\tif (x):\n\t\t#print (\"YES\")\n\t\tmini = min(mini, i)\nif mini == 10000:\n\tprint (-1)\nelse:\n\tprint (mini)\n", "lang": "PyPy 3", "bug_code_uid": "8ca3dcb083fbd8da9934523e28edf339", "src_uid": "9e86d87ce5a75c6a982894af84eb4ba8", "apr_id": "47bc5f14be549ba9b3949adf6c8271ce", "difficulty": 1600, "tags": ["math", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9856065798492117, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def powmod(a,b,m):\n a%=m\n r=1\n while b:\n if b&1:r=r*a%m\n a=a*a%m\n b>>=1\n return r\n\ndef f(n):\n r=[]\n if (n&1)==0:\n e=0\n while (n&1)==0:n>>=1;e+=1\n yield (2,e)\n p=3\n while n>1:\n if p*p>n:p=n\n if n%p:\n p+=2\n continue\n e=1;n//=p\n while n%p==0:n//=p;e+=1\n yield (p,e)\n p+=2\n return r\nm,x=map(int,input().split())\np=2\nr=[(1,1)]\nfor p,e in f(m):\n assert e>=1\n ord=p-1\n assert powmod(x,ord,p)==1\n for pi,ei in f(p-1):\n while ord % pi == 0 and powmod(x,ord//pi,p)==1: ord//=pi\n ords=[(1,1),(ord,p-1)]\n q=p\n for v in range(2,e+1):\n q*=p\n if powmod(x,ord,q)!=1:ord*=p\n assert powmod(x,ord,q)==1\n ords.append((ord,q//p*(p-1)))\n r=[(a//gcd(a,c)*c,b*d) for a,b in r for c,d in ords]\nprint(sum(y//x for x,y in r))", "lang": "PyPy 3", "bug_code_uid": "3379e2d3c12c390c557ffb18fdfd19d6", "src_uid": "c2dd6de750812d6213c770b3587d8fcb", "apr_id": "835e57fb225a7778046eaa339c40ef53", "difficulty": 2600, "tags": ["bitmasks", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9045871559633027, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\n\ndef count(x):\n\tif x == 0:\n\t\treturn 0\n\n\tx_s = str(x)\n\tlow = int(\"1\"*len(x_s)) if int(\"1\"*len(x_s)) <= x else int(\"1\"*(len(x_s)-1))\n\thigh = int(\"1\"*len(x_s)) if int(\"1\"*len(x_s)) >= x else int(\"1\"*(len(x_s)+1))\n\n\tl_val, h_val = -1, -1\n\tif abs(x - low) < x:\n\t\tl_val = len(str(low)) + count(abs(x - low))\n\tif abs(x - high) < x:\n\t\th_val = len(str(high)) + count(abs(x - high))\n\n\tret = min(l_val, h_val) if min(l_val, h_val) >= 0 else max(l_val, h_val)\n\treturn ret\n\nprint(count(n))\nprint(count(614407991527))\nprint(count(81924761239462))", "lang": "Python 3", "bug_code_uid": "73f2379d314561993788c933359f7b71", "src_uid": "1b17a7b3b41077843ee1d6e0607720d6", "apr_id": "6c5c2e58d047a086b843f6cfdeae1d0c", "difficulty": 1800, "tags": ["divide and conquer", "dfs and similar", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.06707734428473648, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "def divi(n):\n if n == 0:\n return 0\n elif n == 1:\n return n\n elif n == 11:\n return 2\n elif n % 11 <= 6:\n k = n % 11\n j = 0\n cont_um = 0\n while j < n:\n j += 1\n cont_um += 1\n return cont_um\n else:\n k = n % 11\n h = 11\n contador_de_um = 2\n while h > n:\n h -= 1\n contador_de_um += 1\n return contador_de_um\n\n\ndef divide_maior(n):\n divisao = n // 11\n resto = n % 11\n valor_menor_que_onze = divi(resto)\n valor_maior_que_onze = divisao * 2\n return valor_maior_que_onze + valor_menor_que_onze\n\n\ndef execute():\n n = int(input())\n m = divide_maior(n)\n print(m)\n\n\nexecute()\n", "lang": "Python 3", "bug_code_uid": "6b3b8565b17969a34304bc09d0bc9f25", "src_uid": "1b17a7b3b41077843ee1d6e0607720d6", "apr_id": "ac32210293fd73341bff7632e195d6fd", "difficulty": 1800, "tags": ["divide and conquer", "dfs and similar", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.989247311827957, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "s=input()\nl=list(s.split())\nif l[2]='week':\n if l[0]==5 or l[0]==6:\n print(53)\n else:\n print(52)\nelse:\n if l[0]=='30':\n print(11)\n elif l[0]=='31':\n print(7)\n else:\n print(12)\n ", "lang": "Python 3", "bug_code_uid": "af91bc1938ea49f7e7136895878ce757", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "d9ae57c8e84dfd68f0d41eeb9a0f9f9a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8261886204208886, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n=int(input())\nxx=[]\nyy=[]\ncountx=[0 for i in range(51)]\ncounty=[0 for i in range(51)]\nfor _ in range(4*n+1):\n x,y=map(int,input().split(' '))\n xx.append(x)\n yy.append(y)\n countx[x]+=1\n county[y]+=1\nxxx=[]\nyyy=[]\nfor i in range(50):\n if countx[i]>=2:\n xxx.append(i)\n if county[i]>=2:\n yyy.append(i)\nxmin=min(xxx)\nxmax=max(xxx)\nymin=min(yyy)\nymax=max(yyy)\nfor i in range(4*n+1):\n if xx[i]==xmin or xx[i]==xmax:\n if yy[i]<=ymax and yy[i]>=ymin:\n continue\n if yy[i]==ymin or yy[i]==ymax:\n if xx[i]<=xmax or xx[i]>=xmin:\n continue\n index=i\nprint(xx[index],yy[index])", "lang": "PyPy 3", "bug_code_uid": "78e05e9a4e08ca3f4b02b6792b00c79a", "src_uid": "1f9153088dcba9383b1a2dbe592e4d06", "apr_id": "490de01bd16f12401332b44141aba944", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6548672566371682, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 10, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": "F=input()\nM=input()\nS=input()\n\nif(F== \"rock\" and M == \"rock\" and S ==\"rock\"):\n\tprint(\"?\")\nelse if(F== \"rock\" and M == \"rock\" and S ==\"paper\"):\n\tprint(\"S\")\nelse if(F== \"rock\" and M == \"rock\" and S ==\"scissors\"):\n\tprint(\"?\")\nelse if(F== \"rock\" and M == \"paper\" and S ==\"rock\"):\n\tprint(\"M\")\nelse if(F== \"rock\" and M == \"paper\" and S ==\"scissors\"):\n\tprint(\"?\")\nelse if(F== \"rock\" and M == \"paper\" and S ==\"paper\"):\n\tprint(\"?\")\nelse if(F== \"rock\" and M == \"scissors\" and S ==\"rock\"):\n\tprint(\"?\")\nelse if(F== \"rock\" and M == \"scissors\" and S ==\"paper\"):\n\tprint(\"?\")\nelse if(F== \"rock\" and M == \"scissors\" and S ==\"scissors\"):\n\tprint(\"F\")\nelse if(F== \"paper\" and M == \"rock\" and S ==\"rock\"):\n\tprint(\"F\")\nelse if(F== \"paper\" and M == \"rock\" and S ==\"paper\"):\n\tprint(\"?\")\nelse if(F== \"paper\" and M == \"rock\" and S ==\"scissors\"):\n\tprint(\"?\")\nelse if(F== \"paper\" and M == \"paper\" and S ==\"rock\"):\n\tprint(\"?\")\nelse if(F== \"paper\" and M == \"paper\" and S ==\"scissors\"):\n\tprint(\"S\")\nelse if(F== \"paper\" and M == \"paper\" and S ==\"paper\"):\n\tprint(\"?\")\nelse if(F== \"paper\" and M == \"scissors\" and S ==\"rock\"):\n\tprint(\"?\")\nelse if(F== \"paper\" and M == \"scissors\" and S ==\"paper\"):\n\tprint(\"M\")\nelse if(F== \"paper\" and M == \"scissors\" and S ==\"scissors\"):\n\tprint(\"?\")\nelse if(F== \"scissors\" and M == \"rock\" and S ==\"rock\"):\n\tprint(\"?\")\nelse if(F== \"scissors\" and M == \"rock\" and S ==\"paper\"):\n\tprint(\"?\")\nelse if(F== \"scissors\" and M == \"rock\" and S ==\"scissors\"):\n\tprint(\"M\")\nelse if(F== \"scissors\" and M == \"paper\" and S ==\"rock\"):\n\tprint(\"?\")\nelse if(F== \"scissors\" and M == \"paper\" and S ==\"scissors\"):\n\tprint(\"?\")\nelse if(F== \"scissors\" and M == \"paper\" and S ==\"paper\"):\n\tprint(\"F\")\nelse if(F== \"scissors\" and M == \"scissors\" and S ==\"rock\"):\n\tprint(\"S\")\nelse if(F== \"scissors\" and M == \"scissors\" and S ==\"paper\"):\n\tprint(\"?\")\nelse if(F== \"scissors\" and M == \"scissors\" and S ==\"scissors\"):\n\tprint(\"?\")\nelse\n", "lang": "Python 3", "bug_code_uid": "762bd33f7eb64c1eadf6445d36bb640e", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "5bb38fdfaa38dedf023c686cb32d91f7", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8179530201342282, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "#http://codeforces.com/problemset/problem/868/A\n\nfrom itertools import permutations\n\ndef unlock(word,substring):\n if len(word) == 1:\n word = word + word\n perms = [\"\".join(w) for w in permutations(word)]\n for perm in perms:\n end = len(substring)-1\n start = 0\n check = perm[:end+1]\n #print(check)\n while end != len(perm):\n if check == substring:\n return True\n end += 1\n start += 1\n check = perm[start:end+1]\n #print(check)\n return False\n \n print(perms)\n\n\n#print(unlock([\"ah\",\"oy\",\"to\",\"ha\"],\"ya\"))\n#print(unlock([\"ht\",\"tp\"],\"hp\"))\n#print(unlock([\"ah\"],\"ha\"))\n\n\nwhile True:\n try:\n pw = input()\n count = input()\n words = []\n for i in range(int(count)):\n words.append(input())\n if unlock(words,pw):\n print(\"YES\")\n else:\n print(\"NO\")\n except EOFError:\n break\n", "lang": "Python 3", "bug_code_uid": "7d452b875f24fbcb7b84aac31e4eafe9", "src_uid": "cad8283914da16bc41680857bd20fe9f", "apr_id": "ce1b0ea4347ca1fad884cf078e15accc", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.04120879120879121, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "import math\nn=int(input())\nmarked_set = set()\nfor x in range(n+1):\n max_y = int(math.sqrt(n*n - x*x))\n flag=True\n y = max_y\n while True:\n if (x+1)**2 + y**2 > n**2 or (x)**2 + (y+1)**2 > n**2:\n marked_set.add((x,y))\n else:\n break\n if y == 0:\n break\n else:\n y-=1\nif n == 0:\n print(1)\nelse:\n print((len(marked_set)-1)*4)", "lang": "PyPy 3", "bug_code_uid": "01d2e161b34bcae68e13a95b74dbabeb", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "79ac8e14be81bd511803a907171fbcac", "difficulty": null, "tags": ["geometry"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9366106080206986, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "import sys \n\nwith open(sys.stdin) as f:\n line1 = f.readline().strip('\\n').split()\n numh, numv = line1[0], line1[1]\n\n hor = f.readline().strip('\\n')\n vert = f.readline().strip('\\n')\n\n if (hor[0], vert[0]) == ('<', '^') or (hor[-1], vert[0]) == ('<', 'v') or (hor[0], vert[-1]) == ('>', '^') or (hor[-1], vert[-1]) == ('>', 'v'):\n print('NO')\n else:\n print('YES')", "lang": "Python 3", "bug_code_uid": "3ed384b38c8322b5b178b9f0b68a26d4", "src_uid": "eab5c84c9658eb32f5614cd2497541cf", "apr_id": "fb811467a555d3ba4e137045101d5aee", "difficulty": 1400, "tags": ["graphs", "brute force", "dfs and similar", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3564356435643564, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "n = int(input())\ntotal = 0\nodds = [-i for i in range (1,n+1,2)]\nevens = [i for i in range(2, n+1,2)]\nprint(sum(odds)+sum(evens))", "lang": "Python 3", "bug_code_uid": "56560151d0f91b0a764112c83f0b0bcb", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "b206eac50fa41781aeb996cb3e04ac8b", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9988317757009346, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=input()\nb=input()\nc=input()\na1=a[0]+a[1]+' '+a[1]+a[2]+' '+b[0]+b[1]+' '+b[1]+b[2]+' '+c[0]+c[1]+' '+c[1]+c[2]\nL=a1.split(' ')\nm='impossible'\nif L.count('A>')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count('')+L.count(' n):\n\t\t\tcounts = counts -2\n\t\telse:\n\t\t\tflag_count = flag_count +1\n\n\t\tif (bottom > n):\n\t\t\tcounts = counts -2\n\t\telse:\n\t\t\tflag_count = flag_count +1\n\n\t\tif (left < 0):\n\t\t\tcounts = counts -2\n\t\telse:\n\t\t\tflag_count = flag_count +1\n\n\t\tcur = cur + counts - flag_count;\n\t\tstep = step +1\n\tprint step ", "lang": "Python 2", "bug_code_uid": "3b4034b2e6cc124ea60532fbe4871acd", "src_uid": "232c5206ee7c1903556c3625e0b0efc6", "apr_id": "4cf729d9fc20954c1ba40dd5a82cddef", "difficulty": 1800, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.993993993993994, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nn, x, y, c = map(int, raw_input())\nans = add = 1\nwhile ans < c:\n l1 = add + 1\n l2 = l3 = l4 = l1\n sub = 4\n if x - add < 1:\n t = add - x + 1\n l1 -= t\n l2 -= t\n sub -= 1\n if x + add > n:\n t = add + x - n\n l3 -= t\n l4 -= t\n sub -= 1\n if y - add < 1:\n t = add - y + 1\n l1 -= t\n l4 -= t\n sub -= 1\n if y + add > n:\n t = add + y - n\n l2 -= t\n l3 -= t\n sub -= 1\n if l1 > 0:\n ans += l1\n if l2 > 0:\n ans += l2\n if l3 > 0:\n ans += l3\n if l4 > 0:\n ans += l4\n ans -= sub;\n add += 1\nprint add - 1", "lang": "Python 2", "bug_code_uid": "b16c1d9d047a195fc50231b8aebd19a7", "src_uid": "232c5206ee7c1903556c3625e0b0efc6", "apr_id": "0d8e0d4dbeb52b428d81cc34c12b5234", "difficulty": 1800, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4723774053382992, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 20, "bug_source_code": "a=input()\nb=input()\nc=input()\nxcount=0\nocount=0\nfor t in list(a):\n if t is \"0\":\n ocount+=1\n if t is \"X\":\n xcount+=1\nfor t in list(b):\n if t is \"0\":\n ocount+=1\n if t is \"X\":\n xcount+=1\nfor t in list(c):\n if t is \"0\":\n ocount+=1\n if t is \"X\":\n xcount+=1\nif xcount - ocount > 1 or ocount > xcount:\n print(\"illegal\")\nelif (a.find(\"XXX\") != -1 or b.find(\"XXX\") != -1 or c.find(\"XXX\") != -1 or (a[:1]+b[:1]+c[:1]).find(\"XXX\") != -1 or (a[1:2]+b[1:2]+c[1:2]).find(\"XXX\") != -1 or (a[-1]+b[-1]+c[-1]).find(\"XXX\")!=-1 or (a[:1]+b[1:2]+c[-1]).find(\"XXX\") != -1 or (a[-1]+b[1:2]+c[:1]).find(\"XXX\") != -1) and (a.find(\"000\") != -1 or b.find(\"000\") != -1 or c.find(\"000\") != -1 or (a[:1]+b[:1]+c[:1]).find(\"000\") != -1 or (a[1:2]+b[1:2]+c[1:2]).find(\"000\") != -1 or (a[-1]+b[-1]+c[-1]).find(\"000\")!=-1 or(a[:1]+b[1:2]+c[-1]).find(\"000\") != -1 or (a[-1]+b[1:2]+c[:1]).find(\"000\") != -1):\n print(\"illegal\")\nelif a.find(\"XXX\") != -1 or b.find(\"XXX\") != -1 or c.find(\"XXX\") != -1 or (a[:1]+b[:1]+c[:1]).find(\"XXX\") != -1 or (a[1:2]+b[1:2]+c[1:2]).find(\"XXX\") != -1 or (a[-1]+b[-1]+c[-1]).find(\"XXX\")!=-1:\n print(\"the first player won\")\nelif a.find(\"000\") != -1 or b.find(\"000\") != -1 or c.find(\"000\") != -1 or (a[:1]+b[:1]+c[:1]).find(\"000\") != -1 or (a[1:2]+b[1:2]+c[1:2]).find(\"000\") != -1 or (a[-1]+b[-1]+c[-1]).find(\"000\")!=-1:\n print(\"the second player won\")\nelif (a[:1]+b[1:2]+c[-1]).find(\"XXX\") != -1 or (a[-1]+b[1:2]+c[:1]).find(\"XXX\") != -1:\n print(\"the first player won\")\nelif (a[:1]+b[1:2]+c[-1]).find(\"000\") != -1 or (a[-1]+b[1:2]+c[:1]).find(\"000\") != -1:\n print(\"the second player won\")\nelif xcount>ocount and xcount!=5:\n print(\"second\")\nelif xcount==count:\n print(\"first\")\nelse:\n print(\"draw\")", "lang": "Python 3", "bug_code_uid": "0a259a386930adfffdd7990a4b7e2450", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "ad09bdbc5cb8963e240e23e020608091", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9596827495042961, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "from collections import defaultdict\n\ndef calcBinomials(N):\n global binom\n binom = [[0]*N for _ in range(N+1)]\n for n in range(N):\n binom[n][0] = binom[n][n] = 1\n for k in range(1, n):\n binom[n][k] = binom[n-1][k] + binom[n-1][k-1]\n\nn = int(input())\na = list(map(int, input().split()))\nS, res = sum(a), 0\ndp = [defaultdict(lambda: 0) for _ in range(S+1)]\ndp[0][0] = 1\n\ncnt = {_:a.count(_) for _ in a}\nfor x in a:\n for i in range(len(dp)-1-x, -1, -1):\n for k, v in dp[i].items():\n dp[i+x][k+1] += v\n\ncalcBinomials(n)\nfor x, c in cnt.items():\n for i in range(1, c+1):\n if dp[x*i][i] == binom[c][i] or dp[S - x*i][n-i] == binom[c][c-i]:\n res = max(res, i)\nprint(res)\n", "lang": "PyPy 3", "bug_code_uid": "ae2a5d6fe4615b0d201eae4b8a7d84af", "src_uid": "ccc4b27889598266e8efe73b8aa3666c", "apr_id": "c4415ea49bcf59082af6017c289c97a5", "difficulty": 2100, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9973614775725593, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n rd = lambda: map(int, input().split())\nn, m = rd()\na = sorted(([*rd()] + [i + 1] for i in range(m)), key=lambda x: x[1])\nr = [0] * n\nfor x in a:\n r[x[1] - 1] = m + 1\n for i in range(x[0] - 1, x[1] - 1):\n if not r[i]:\n r[i] = x[3]\n x[2] -= 1\n if not x[2]:\n break\n if x[2]:\n print(-1)\n exit()\nprint(*r)", "lang": "Python 3", "bug_code_uid": "55b194eea601d61b760e9694e432108e", "src_uid": "02d8d403eb60ae77756ff96f71b662d3", "apr_id": "253366e19503f0349e40e564f9c0fe13", "difficulty": 1700, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.15396226415094338, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "dp = {}\ndef count(n, low):\n\tif low == 1: return n\n\tk = (n, low)\n\tif k in dp: return dp[k]\n\tif n < low: return 0\n\tl1 = (n-1)/2\n\tif l1 < low: return 0\n\tl2 = n - 1 - l1\n\tdp[k] = 1 + count(l1, low) + count(l2, low)\n\treturn dp[k]\n\ndef getPos(l, r, low, want):\n\tm = (l+r)/2\n\n\twant -= 1\n\tif want == 0: return m\n\n\tc1 = count(m-l, low)\n\tc2 = count(r-m, low+1)\n\n\tif c1+c2 >= want:\n\t\treturn getPos(l, m-1, low, want-c2)\n\telse:\n\t\treturn getPos(m+1, r, low, want-c1)\n\nn,k = map(int, raw_input().split())\nif k == 1: print 1\nelif k == 2: print n\nelse:\n\tlo, hi = 1, n+1\n\twhile lo < hi:\n\t\tmid = (lo + hi + 1) / 2\n\t\tif count(n, mid) >= k-2:\n\t\t\tlo = mid\n\t\telse:\n\t\t\thi = mid-1\n\tprint getPos(2,n-1,lo,k-2)", "lang": "Python 2", "bug_code_uid": "dc1fca2a9d84a1db8a95ab1fe0d2ee0c", "src_uid": "eb311bde6a0e3244d92fafbd4aa1e61f", "apr_id": "f8299c6e86edfb39973b04597d98cad5", "difficulty": 2900, "tags": ["constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9863301787592008, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "f = {}\ndef c(n, p):\n\tk = (n, p)\n\tif k in f: return f[k]\n\n\td = (n-1)/2\n\tf[k] = d >= p and (1 + c(d, p) + c(n-d-1, p))\n\n\treturn f[k]\n\ndef w(l, r, k):\n\tprint l,r,k\n\tm = (l+r)/2\n\n\tif k == 0: return m\n\n\tx = c(m-l, p)\n\ty = c(r-m, p+1)\n\n\treturn w(l, m-1, k-y-1) if x+y>=k else w(m+1, r, k-x-1)\n\nn,k = map(int, raw_input().split())\n\nif k == 1: print 1\nelif k == 2: print n\nelse:\n\tp, q = 0, n\n\twhile p < q:\n\t\tm = (p+q+1) / 2\n\t\tif c(n-2, m) >= k-2: p = m\n\t\telse: q = m-1\n\tprint w(2, n-1, k-3)", "lang": "Python 2", "bug_code_uid": "13a64b520439af5db5793cda6416494f", "src_uid": "eb311bde6a0e3244d92fafbd4aa1e61f", "apr_id": "f8299c6e86edfb39973b04597d98cad5", "difficulty": 2900, "tags": ["constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9990610328638497, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import fileinput\n\n\ndef calc(a, b):\n ans = 0\n l = a + b\n i = 1\n while i < l:\n P = l // i\n r = l // P\n if P <= a and P <= b:\n an = (a + P) // (P + 1)\n ax = a // P\n bn = (b + P) // (P + 1)\n bx = b // P\n if an <= ax and bn <= bx:\n ans += min(ax + bx, r) - max(an + bn, i) + 1\n i = r + 1\n return ans\n\n\nif __name__ == '__main__':\n it = fileinput.input()\n a, b = [int(x) for x in next(it).split()]\n print(calc(a, b))\n", "lang": "Python 3", "bug_code_uid": "3b888f36948aedb5494fe07147361e93", "src_uid": "0e6a204565fef118ea99d2fa1e378dd0", "apr_id": "d8ce39aa297dd89ab2ccd806d6c1e50e", "difficulty": 2700, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9363538295577131, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import math\n\na, b = [int(x) for x in input().split()]\ncnt = 0\nab = a + b\nk = 2\nwhile k <= ab:\n t = ab // k\n aPeriod = a // t\n bPeriod = b // t\n aLeft = (a + t) // (t + 1)\n bLeft = (b + t) // (t + 1)\n arem = a - t * aPeriod\n brem = b - t * bPeriod\n if aPeriod >= arem and bPeriod >= brem:\n \tvalidK = aPeriod + bPeriod - aLeft - bLeft + 1\n \tif validK > 0:\n \t\tcnt += validK\n k = ab // t + 1\nprint(cnt)", "lang": "PyPy 3", "bug_code_uid": "04af8ea2e764fde4474cbb61ea5d905d", "src_uid": "0e6a204565fef118ea99d2fa1e378dd0", "apr_id": "304e461c753c2f2ddf0d7b3f881a4f9c", "difficulty": 2700, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.568075117370892, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "n, k = map(int,input().split())\n\na = [1]\nmax_1 = 1\n\nwhile len(a) < k:\n max_1 += 1\n a += [max_1] + a\n\nprint(a[k-1])\n", "lang": "Python 3", "bug_code_uid": "1098b627dcf36d4b14453442c0d6022e", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "fbaeb59e614eb95e55db97f33e1666c1", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6492146596858639, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "n,k= map(int,input().split())\ns= [1]\ni=1\nwhile i!=n:\n p=s\n s= p+[i+1]+p\n i+=1\nprint(s[k-1])\n", "lang": "Python 3", "bug_code_uid": "e7cfac9a2ed367b4e9b7edb262a42ab7", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "54e23a529b75a0600bdd76a6a8693c41", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5377358490566038, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "n,k, = map(int, input().split())\nl=[1]\nfor i in range(1,n):\n b=l.copy()\n l.append(i+1)\n l.extend(b)\nprint(l[k-1])", "lang": "Python 3", "bug_code_uid": "30828eda890781c96db29963d3651fff", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "19ab7451498eba5d64c04b460f003105", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4610169491525424, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "n, k = map(int, input().split())\na = [1]\ntemp = 2\nfor i in range(n-1):\n a = a + [temp] + a\n temp += 1\nprint(a[k-1])\n", "lang": "Python 3", "bug_code_uid": "7868fb0ea2ce778c96d5c9c3d75a87fe", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "22ae6c150436ce8aae9a340b613fd3c4", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.45141065830721006, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "nk = input().split(\" \")\nn,k = [int(x) for x in nk]\nk -= 1\ngen_list = [1]\nfor i in range(1,n):\n j = i+1\n aux = gen_list.copy()\n gen_list.append(j)\n gen_list.extend(aux)\nprint(gen_list[k])\n\n", "lang": "Python 3", "bug_code_uid": "27a1930282c414a1ab4927f351f79810", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "d4930f5929c7e0823f4d58bb30655e69", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.15991471215351813, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "\n\n\nif __name__ == \"__main__\" :\n List = [ 1 ]\n count = 1\n inputs = raw_input().split()\n for i in xrange( int( inputs[ 0 ] ) - 1 ) :\n count = i + 2\n List.append( count )\n List.extend( List )\n List.pop()\n #print List\n print List[ int ( inputs[ 1 ] ) - 1 ]", "lang": "Python 2", "bug_code_uid": "c10afd5bf001bf670f8fa0d313b0adf4", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "74b785939263efab60b671b12c4af853", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.411522633744856, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "n,k=map(int,raw_input().split())\nl=[1]\nfor i in range(2,n+1):\n l1=l[:]\n l=l+[i]+l1\nprint l[k-1]", "lang": "Python 2", "bug_code_uid": "aba0333daa2fed41caa5315d59f3411b", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "61f1f1b1179c42855af65f36d2ea4980", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1952662721893491, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\nans = 'codeforce' + 's'*n\n\nprint(ans)", "lang": "Python 3", "bug_code_uid": "c39f3edb4ca4ae92c7e57066b6069753", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "0b0450be362dd8fe25608c913646928b", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.46153846153846156, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "n = int(input())\ns = \"codeforces\"\nprint(s+\"s\"*(n-1))", "lang": "Python 3", "bug_code_uid": "7211f6fe6c45b389a0f5e158d7bd2fcf", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "9559f01e29988d39925582a5a702d358", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2911392405063291, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "n,m, = [int(x) for x in input().split()]\ndef powe(a,b,m):\n res = 1;\n while b>0:\n if b&1:\n res = res*a%m\n a = a*a%m\n b >>=1\n return res\nans = powe((1<= 9:\n nines += 1\n mp = int(mp / 10)\nif nines < 1:\n print(\"0\")\n exit()\nprice_suffix = \"9\"*nines\n\npairs = set()\ndef add_pairs(max_x: int, price: int):\n from_max = int(price / 2)\n to_min = from_max + 1\n to_max = price - 1\n if to_max > max_x:\n to_max = max_x\n from_min = price - to_max\n for x in range(from_min, from_max + 1):\n pairs.add(str(x) + ':' + str(price - x))\n\n\ncnt = 0\nfor d in range(0, 10):\n if d > 0:\n price = int(str(d) + price_suffix)\n else:\n price = int(price_suffix)\n if price <= max_price:\n add_pairs(n, price)\n\nprint(len(pairs))\n", "lang": "Python 3", "bug_code_uid": "c83171a525be8a43b6f852de621b5e71", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "apr_id": "83182aa16886e23ca5ad3d3fc8fb3bc0", "difficulty": 1800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7988748241912799, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "n, k = map(int, input().split())\na = list(map(int, input().split()))\nbooks = set()\nl = 0\npref = [0 for i in range(n)]\nfor i in range(n - 1, -1, -1):\n pref[a[i] - 1] = max(pref[a[i] - 1], i) # i min == 0\nres = 0\nfor i in range(n):\n if a[i] not in books:\n if l == k:\n for j in books:\n if pref[j - 1] < i:\n l -= 1\n books.discard(j)\n break\n if l == k:\n books.pop()\n l -= 1\n res += 1\n books.add(a[i])\n l += 1\nprint(res)\n", "lang": "Python 3", "bug_code_uid": "476e77e2e737f25f5ab525ea06907490", "src_uid": "956228e31679caa9952b216e010f9773", "apr_id": "6a7709570c6eda4c5e8ba53229b10362", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9298969072164949, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def maxPies(i):\n if i==n:\n return pies[n-1]\n else:\n sum = 0\n j=i-1\n while(j=0):\n pies_sum[j] = pies_sum[j+1] + pies[j]\n j-=1\n\nanswer = maxPies(1)\nprint(\"{0} {1}\".format(pies_sum[0] - answer, answer))\n", "lang": "Python 2", "bug_code_uid": "71eea8aa9ac32b9123b58b1f52c86946", "src_uid": "414540223db9d4cfcec6a973179a0216", "apr_id": "15f7da6d1355755949bfffb850b3e51a", "difficulty": 1500, "tags": ["dp", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.770935960591133, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "inp = list(map(int, input().split()))\nn = inp[0]\n\nl = [0,2,3,4,4]\n\ni = 5\n\ncount = 1\nm = 0\n\nwhile(i<=n+1):\n\tif(count == 1):\n\t\tl += [l[i-1] +1]\n\t\tcount +=1\n\t\tm = int(l[i]/2);\n\t\tif(i+m=l and tot<=r and maxi-mini>=x):\n\t\tcount+=1\nprint coun", "lang": "Python 3", "bug_code_uid": "68548ce086cfaa2eddc4a06a3e1d06a7", "src_uid": "0d43104a0de924cdcf8e4aced5aa825d", "apr_id": "3ec04a3b06b0aa6551471fb7e5707f05", "difficulty": 1400, "tags": ["brute force", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7365269461077845, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "a_list= []\nsum = 0\nn = int(input())\nfor i in range(n):\n x = int(input())\n if x not in a_list:\n a_list.append(x)\nprint(len(a_list))", "lang": "Python 3", "bug_code_uid": "ecdb47fe6f39a36fbd13dc0e139bfb66", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "11ce9742e74b362a2de4a783c08284d8", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9968253968253968, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a = input()\n\nif a.count('-') == 0:\n\tprint(\"YES\")\nelif a.count('o') == 0:\n\tprint(\"YES\")\nelse:\n\tprint(\"YES\") if a.count('-')%a.count('o') == 0) else print(\"NO\")", "lang": "Python 3", "bug_code_uid": "391aaf6d2d41b612de8416b7b623c463", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "a4d21f268d45c73dc462c96dda0a5695", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8534351145038168, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "# input() reads a string with a line of input, stripping the '\\n' (newline) at the end.\n# This is all you need for most Code Jam problems.\ndef find(points, i, j):\n if (i >= j):\n return 0\n if (points[j] - points[i]) > diameter:\n result1 = find(points, i + 1, j) + 1\n result2 = find(points, i, j - 1) + 1\n return min(result1, result2)\n else:\n return 0\npairs= [int(s) for s in input().split(\" \")]\nnum = pairs[0]\ndiameter = pairs[1]\npoints= [int(s) for s in input().split(\" \")]\npoints.sort()\nanswer = find(points, 0, num-1)\n\n\n\n\n\n\nprint(answer)", "lang": "Python 3", "bug_code_uid": "e241b24305d0137139aeadeb223345de", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "7287371a1a710a39242403f2d6fda00c", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9820359281437125, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "\n a=list(input())\nb=[]\nfor i in a:\n if i not in b:\n b.append(i)\nfor i in range(len(b)):\n if (ord(b[i])-ord('a'))!=i:\n exit(print('NO'))\nprint('YES')", "lang": "Python 3", "bug_code_uid": "fa6e90d485b3e6e3090f3758f39a1b91", "src_uid": "c4551f66a781b174f95865fa254ca972", "apr_id": "f30f473aa64add44404d19239a5dd5fa", "difficulty": 1100, "tags": ["greedy", "strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.913972602739726, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "def gcd(a,b):\n if(a%b==0):\n return b\n else:\n return gcd(b,a%b)\n\n[t1,t2,x1,x2,t0]=input().split(' ')\n#[t1,t2,x1,x2,t0]=[10,20,5,5,13]\nt1=int(t1)\nt2=int(t2)\nx1=int(x1)\nx2=int(x2)\nt0=int(t0)\n\na=t2-t0\nb=t0-t1\nif (a==0):\n y1=0\n y2=x2\n print(y1,y2)\n exit(0)\n \nif (b==0):\n y1=x1\n y2=0\n print(y1,y2)\n exit(0)\n \ng=gcd(a,b)\na=int(a/g)\nb=int(b/g)\nif(a<=x1 and b<=x2):\n mintime=int(x1/a)\n if(mintime>int(x2/b)):\n mintime=int(x2/b)\n print(mintime*a,mintime*b)\n exit(0)\n\ny1=1\ny2=1\nminn=99999\nwhile(y1<=x1 and y2<=x2):\n if(y1/y2a/b-y1/y2):\n minn=a/b-y1/y2\n miny1=y1\n miny2=y2\n y1=y1+1\n else:\n y2=y2+1\ny1=miny1\ny2=miny2\nmintime=int(x1/y1)\nif(mintime>int(x2/y2)):\n mintime=int(x2/y2)\nprint(mintime*y1,mintime*y2)\n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "48436a7f733f0c7f2640c93234130df2", "src_uid": "87a500829c1935ded3ef6e4e47096b9f", "apr_id": "880713849146371f2f9d726f42ef3945", "difficulty": 1900, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.16112531969309463, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "from itertools import permutations\n\nn = int(input())\n\nnums = []\nfor i in range(n):\n nums.append(int(input()))\n\nif sum(nums) % 360 == 0:\n print('YES')\nelse:\n ans = 'NO'\n perm = list(permutations(nums))\n for p in perm:\n for i in range(len(p)):\n left = sum(p[:i])\n right = sum(p[i:])\n if left - right == 0:\n ans = 'YES'\n break\n if ans == 'YES':\n break\n print(ans)\n", "lang": "PyPy 3", "bug_code_uid": "89595cb99bcc6275deb3f50e1b2bd9e2", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "59a8d9f4aa2e1933099e0c8ddfe09bdf", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9615384615384616, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "board = [raw_input() for i in range(1,5)]\nprint ['NO','YES'][any((board[x][y:y+2]+board[x+1][y:y+2]).count('#') >= 3 for x in range(1,4) for y in range(1,4))]", "lang": "Python 2", "bug_code_uid": "33680ee9a9aafc8a7bc71e20c2dad4c8", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "546542825d919d8f7fef6127f5e97ac8", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.99079754601227, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "from sys import stdin, stdout\n\nnm = list(map(int, stdin.readline().strip().split()))\nn = nm[0]\nm = nm[1]\nn_list = list(map(int, stdin.readline().strip().split()))\nm_list = list(map(int, stdin.readline().split()))\nres_list = []\nfor x in n_list:\n if x in m_list:\n res_list.append(x)\nstdout.write(' '.join(res_list))\n", "lang": "Python 3", "bug_code_uid": "08206a44089f12ba27a4f53773db3947", "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72", "apr_id": "a9acb178606bc2f641d4c9df1ae99686", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5568281938325991, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "cod = raw_input()\nind = [\"\" for loop in range(10)]\nfor i in range(10):\n ind[i] = raw_input()\n\nch =cod[i]\nfor i in range(1,len(cod)):\n j = 0\n bol = False\n if i%10 == 0:\n while bol == False and j<10:\n if ind[j] == ch:\n bol = True\n print (j,end='')\n else:\n j+=1\n \n ch = cod[i]\n else:\n ch += cod[i]\nj = 0\nbol = False\nwhile bol == False and j<10:\n if ind[j] == ch:\n bol = True\n print j\n else:\n j+=1", "lang": "Python 3", "bug_code_uid": "a92adb542df19339be2a572eb7a0df74", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "1ea47b5bb8ffb072c73316884b298005", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.21575342465753425, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "ba=int(raw_input())\nnames=[\"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\"]\ncycles=ba/5\nbla=2\nwhile bla5:\n print q[ba-1]\nelse:\n print names[ba-1]", "lang": "Python 2", "bug_code_uid": "7ec772ff305418157042863e68acd9bb", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "7fb4e11aa3c870eed569f21792ccb93f", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9889624724061811, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, m = map(int, input().split())\nif n > m:\n n, m = m, n\nif n == 1:\n print(m // 6 + (m + 1) // 6 + (m + 2) // 6 << 1)\nelif n == 2:\n print(0 if m == 2 else 4 if m == 3 12 if m == 7 else n * m)\nelse:\n print(n * m >> 1 << 1)", "lang": "Python 3", "bug_code_uid": "903e678fbec22ea891d5a2230f903635", "src_uid": "02ce135a4b276d1e9ba6a4ce37f2fe70", "apr_id": "e8ee6904364dcc8eeee438583909144c", "difficulty": 2200, "tags": ["brute force", "flows", "constructive algorithms", "graph matchings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3908355795148248, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import math\n\n\nif __name__ == '__main__':\n n, l, r = list(map(int, input().split()))\n mod_counts = [\n math.floor(r/3) - math.ceil(l/3) + 1, math.floor((r-1)/3) - math.ceil((l-1)/3) + 1,\n math.floor((r+1)/3) - math.ceil((l+1)/3) + 1]\n dp = [[None] * 3 for _ in range(n)]\n dp[0] = mod_counts\n for i in range(1, n):\n dp[i][0] = (dp[i-1][0] * mod_counts[0]) + (dp[i-1][1] * mod_counts[2]) + (dp[i-1][2] * mod_counts[1])\n dp[i][1] = (dp[i-1][0] * mod_counts[1]) + (dp[i-1][1] * mod_counts[0]) + (dp[i-1][2] * mod_counts[2])\n dp[i][2] = (dp[i-1][0] * mod_counts[2]) + (dp[i-1][1] * mod_counts[1]) + (dp[i-1][2] * mod_counts[0])\n res = dp[-1][0]\n print(res % (10 ** 9 + 7))\n", "lang": "PyPy 3", "bug_code_uid": "e1ac65764966ec32482732c4057dbc4c", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "cf34d3353c96b41271cd2b89011f0b72", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.41460055096418735, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import math\n\n\nif __name__ == '__main__':\n n, l, r = list(map(int, input().split()))\n mod_counts = [\n math.floor(r/3) - math.ceil(l/3) + 1, math.floor((r-1)/3) - math.ceil((l-1)/3) + 1,\n math.floor((r+1)/3) - math.ceil((l+1)/3) + 1]\n prev = mod_counts\n for _ in range(1, n):\n cur = [None] * 3\n cur[0] = (prev[0] * mod_counts[0]) + (prev[1] * mod_counts[2]) + (prev[2] * mod_counts[1])\n cur[1] = (prev[0] * mod_counts[1]) + (prev[1] * mod_counts[0]) + (prev[2] * mod_counts[2])\n cur[2] = (prev[0] * mod_counts[2]) + (prev[1] * mod_counts[1]) + (prev[2] * mod_counts[0])\n prev = cur\n res = prev[0]\n print(res % (10 ** 9 + 7))\n", "lang": "PyPy 3", "bug_code_uid": "c8837e8ce02377576c0219a0dfc0e2d5", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "cf34d3353c96b41271cd2b89011f0b72", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.43048403707518024, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "import sys, math\nfrom sys import stdin, stdout\n\nrem = 10 ** 9 + 7\ninf = 10 ** 18\nsys.setrecursionlimit(10 ** 6 + 7)\n#from resource import *; setrlimit(RLIMIT_STACK, (RLIM_INFINITY, RLIM_INFINITY))\ntake = lambda: map(int, stdin.readline().split())\nfrom heapq import heappush, heappop, heapify\nfrom collections import deque\nfrom bisect import *\n\ndef help(s):\n n=len(s)\n #print s\n if s in dp:\n return dp[s]\n ans=inf\n if n<=1:\n return n\n for i in range(n):\n done=False\n for j in range(i+1,n):\n if s[j]!=s[i]:\n done=True\n break\n if done==True:\n new=s[:i]+s[j:]\n #print s,new,i,j\n ans=min(ans,1+help(new))\n else:\n new=s[:i]\n ans=min(ans,1+help(new))\n\n dp[s]=ans\n return ans\n\ndp={}\n\nn=input()\ns=raw_input()\nprint help(s)", "lang": "PyPy 2", "bug_code_uid": "6956d4f5e6def642bfd2574b00e0b351", "src_uid": "516a89f4d1ae867fc1151becd92471e6", "apr_id": "ea2975c84c0ad3ada7abb7e19138cbb6", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07240948813982521, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "nb = int(input())\nst = input()\ndp = [[-1 for _ in range(nb + 1)] for _ in range(nb + 1)]\ndef calc(l, r):\n res = dp[l][r]\n if res != -1: return res\n if l > r : return 0\n if l == r: return 1\n res = 1 + calc(l + 1, r)\n for i in range(l + 1, r + 1):\n if st[l] == st[r]:\n res = min(res, calc(l + 1, i - 1) + calc(i, r))\n return res\nprint(calc(0, nb - 1))", "lang": "PyPy 3", "bug_code_uid": "646629adf75ca737a0de156c99d25070", "src_uid": "516a89f4d1ae867fc1151becd92471e6", "apr_id": "e3af9ab8533575c81a86b9f836c16a3f", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5469387755102041, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "n=int(input())\nsum=0\nfor i in range(1,n+1):\n sum=sum+ len(str(i))\nprint(sum)", "lang": "Python 3", "bug_code_uid": "12ac26d6993311abb35f75d8cc8799ea", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "aea4caa4099381472931ee3bf344a2ce", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.27417640807651433, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "\n\nmod = int(1e9 + 7)\n\n\ndef calca(n, k):\n global mat\n if k == 0:\n return 1\n if mat[n][k] != -1:\n return mat[n][k]\n mat[n][k] = 0\n for i in range(1, n-1):\n mat[n][k] += (n-1-i)*calca(i, k-1)\n mat[n][k] %= mod\n return mat[n][k]\n\n\ndef main():\n global mat\n mat = [[-1 for i in range(1001)] for j in range(1001)]\n a, b, c = [int(x) for x in input().split()]\n print((calca(a, c) * calca(b, c)) % mod)\n\n\nmain()\n", "lang": "Python 3", "bug_code_uid": "ffb3d5812968bd815b7febf6c238ce0c", "src_uid": "309d2d46086d526d160292717dfef308", "apr_id": "2be03a05165c7d5dc5da4f0517125a47", "difficulty": 2000, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.42805755395683454, "equal_cnt": 33, "replace_cnt": 14, "delete_cnt": 13, "insert_cnt": 6, "fix_ops_cnt": 33, "bug_source_code": "n, m = map(int, input().split())\nfrom itertools import product\nx = [i for i in range((n // 2) + 1)]\ny = [i for i in range(n+1)]\nz = list(product(x, y))\npossible = []\nfor item in z:\n x = item[0]\n y = item[1]\n if (2 * x + y == n) and ((x + y) % m == 0):\n possible.append(x + y)\n\nif possible == []:\n print(-1)\nelse:\n print(min(possible))\n", "lang": "Python 3", "bug_code_uid": "86789957441169ea1cd19067a2e756e5", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "ac1310470375090592dc7caa88646d87", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9945945945945946, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,a = [int(i) for i in input().split()]\nif a%2==0\n\tt = n//2-a//2\nelse:\n\tt = a//2\nprint(t+1)\n", "lang": "Python 3", "bug_code_uid": "5f23f6ff5f3e56802d275dfd7ed04649", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "4c9bed770be1b641f087a442485d0143", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.15140845070422534, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n,k=map(int,input().split())\nl=[1 for i in range(n+1)]\n \nfor i in range(k-1):\n for j in range(1,n+1):\n t=2*j\n while(t<=n):\n l[j]+=l[t]\n t=t+j \nprint(sum(l[i] for i in range(1,n+1))%(10**9+7)) ", "lang": "PyPy 3", "bug_code_uid": "bce04c43f4d49a51b1c3c6e31e2fc416", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "9edbd689a813241377e1fc30f221c059", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07166853303471445, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "import sys\ninput = sys.stdin.buffer.readline\nsys.setrecursionlimit(10**8) \nn, k = [int(i) for i in input().split()]\ndp = [[-1]*(2005) for i in range(2005)]\nMOD=10**9+7\ndef solve(x,k):\n if(k==0):\n return 1\n elif(dp[x][k]!=-1):\n return dp[x][k]\n ans=0\n for i in range(x,n+1,x):\n ans+=solve(i,k-1)\n dp[x][k]=ans%MOD\n return dp[x][k]\nres=solve(1,k)\nprint(res)\n\n\n\n\n\n\n\n\n\n \n\n \n\n\n \n\n \n\n\n\n\n \n\n \n\n\n \n\n \n\n\n \n\n\n \n\n \n\n\n\n\n \n\n \n\n", "lang": "PyPy 3", "bug_code_uid": "45adc2ae25481ce3245d439205fa6450", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "daa66ba640af92bdf6e5479b873693b6", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9728682170542635, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,m=map(int,input(\"\").split(\" \"))\nlist=[]\ni=0\nc=0\nwhile i= n:\n print(l[i][0])\n break\n", "lang": "Python 3", "bug_code_uid": "00c38c97567cc62b508490dd625c6d32", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "08fab1e947b0fcd760b28a68ef79cfb1", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9497991967871486, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from collections import defaultdict as df \nd=df(list)\nn=int(input())\nvisited=[0]*6\nfor i in range(n):\n a,b=list(map(int,input().split()))\n d[a].append(b)\n d[b].append(a)\n visited[a]=True\n visited[b]=True\ncount=0\n\nfor i in d:\n if len(d[i])==1:\n count+=1\nflag=0\nfor i in d:\n if len(d[i])>=3:\n flag=1\n break\nfor i in range(1,6):\n if visited[i]==False:\n flag=1\n break\nif flag:\n print('WIN')\nelse:\n print('FAIL')\n", "lang": "PyPy 3", "bug_code_uid": "6f5388046588bc129ae7091dae15abc7", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "c89a5b9517dfcac9cd5efb5a5ce5c59b", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5028571428571429, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 9, "fix_ops_cnt": 17, "bug_source_code": "n,k=map(int,input().split())\ni=1\nwhile True:\n sms=i%k\n if sms==0:\n i+=1\n continue\n if (i//k)*(sms)==n:\n print(i)\n break\n i+=1", "lang": "Python 3", "bug_code_uid": "82277ad280a7b6bbafa7f6e45b6481c9", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "apr_id": "f87d5ee06b9e2ff5b64917948a8a5eee", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7490961677512654, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "\ndef solve(grid):\n \n n = len(grid)\n m = len(grid[0])\n s = [0]\n # nWolves = sum([1 for i in range(n) for j in range(m) if grid[i][j] == \"W\"])\n for i in range(n):\n for j in range (m):\n if grid[i][j] == 'W':\n # Si es lobo, verificar los 4 casos posibles: arriba, izq, der, abajo\n for p in range(-1,2):\n for q in range(-1,2):\n if (abs(p + q) == 1 and i + p < n and i + p >= 0 and j + q < m and j + q >= 0 and grid[i + p][j + q] == \"P\"):\n grid[i][j] = \".\"\n grid[i + p][j + q] = \".\"\n s.append(1 + solve (grid.copy()))\n grid[i][j] = \"W\"\n grid[i + p][j + q] = \"P\"\n \n \n return max(s)\n\n\nif __name__ == \"__main__\":\n n, m = map (int, input ().split())\n\n grid = []\n for _ in range (n):\n grid.append ([c for c in input()])\n print (solve(grid))", "lang": "Python 3", "bug_code_uid": "4cdd704ffe110c72a98e2f8d3b65577f", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "9f8b9c49ec13195e7e49a7b8702cd832", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9225806451612903, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "line1 = raw_input().split(' ')\nradp = map(int,raw_input().split(' '))\nradt = map(int,raw_input().split(' '))\n\nlimp = radp[::-1]\nlimt = radt[::-1]\n\nprint(radp)\nprint(radt)\nprint(limp)\nprint(limt)\n\nn = int(line1[0])\nc = int(line1[1])\n\nlim = 0\nrad = 0\n\nfor i in range(0,n):\n rad += max(0, (radp[i] - (sum(radt[0:i+1]) * c)))\n lim += max(0, (limp[i] - (sum(limt[0:i+1]) * c)))\n\nprint(rad)\nprint(lim)\n \nif lim > rad:\n print('Radewoosh')\nelif lim < rad:\n print('Limak')\nelse:\n print('Tie')", "lang": "Python 2", "bug_code_uid": "492b8e1bfd1a062cf4962431caddc7f6", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "apr_id": "a10917352784c1ec84bb09203a1f8465", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8461962513781698, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/python\nimport math\n\nprimes = [\n 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, \n 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, \n 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, \n 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, \n 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, \n 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, \n 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, \n 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, \n 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, \n 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, \n 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, \n 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, \n 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, \n 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, \n 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, \n 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, \n 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, \n 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, \n 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, \n 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, \n 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, \n 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, \n 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, \n 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, \n 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, \n 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, \n 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, \n 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, \n 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, \n 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, \n 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, \n 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, \n 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, \n 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, \n 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, \n 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, \n 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, \n 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, \n 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, \n 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, \n 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, \n 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, \n 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, \n 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, \n 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, \n 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, \n 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, \n 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, \n 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, \n 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, \n 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, \n 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, \n 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, \n 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, \n 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, \n 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, \n 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, \n 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, \n 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, \n 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, \n 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, \n 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, \n 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, \n 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, \n 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, \n 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, \n 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, \n 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, \n 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, \n 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, \n 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, \n 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, \n 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, \n 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, \n 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, \n 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, \n 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, \n 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, \n 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, \n 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, \n 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, \n 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, \n 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, \n 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, \n 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, \n 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, \n 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, \n 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, \n 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, \n 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, \n 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, \n 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, \n 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, \n 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, \n 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, \n 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, \n 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, \n 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, \n 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, \n 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, \n 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, \n 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, \n 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, \n 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, \n 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, \n 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, \n 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, \n 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, \n 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, \n 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, \n 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, \n 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, \n 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, \n 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, \n 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, \n 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, \n 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, \n 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, \n 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, \n 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, \n 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, \n 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, \n 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, \n 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, \n 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, \n 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, \n 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, \n 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, \n 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, \n 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, \n 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739, \n 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, \n 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, \n 10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, \n 11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, \n 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, \n 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329, \n 11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443, \n 11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527, \n 11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, \n 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777, \n 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833, \n 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, \n 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, \n 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, \n 12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, \n 12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289, \n 12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, \n 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487, \n 12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553, \n 12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641, \n 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, \n 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829, \n 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, \n 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, \n 13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, \n 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, \n 13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309, \n 13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411, \n 13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, \n 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619, \n 13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697, \n 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781, \n 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, \n 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, \n 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, \n 14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, \n 14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, \n 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419, \n 14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519, \n 14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593, \n 14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, \n 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767, \n 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851, \n 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947, \n 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, \n 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, \n 15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, \n 15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, \n 15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, \n 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497, \n 15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607, \n 15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679, \n 15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, \n 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881, \n 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971, \n 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, \n 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, \n 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, \n 16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, \n 16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481, \n 16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, \n 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691, \n 16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811, \n 16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903, \n 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, \n 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093, \n 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, \n 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, \n 17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, \n 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, \n 17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573, \n 17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669, \n 17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, \n 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891, \n 17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971, \n 17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059, \n 18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143, \n 18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233, \n 18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313, \n 18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427, \n 18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517, \n 18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637, \n 18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749, \n 18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899, \n 18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009, \n 19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121, \n 19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219, \n 19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319, \n 19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423, \n 19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477, \n 19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571, \n 19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699, \n 19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793, \n 19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891, \n 19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991, \n 19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071, \n 20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149, \n 20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261, \n 20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357, \n 20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443, \n 20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551, \n 20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693, \n 20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771, \n 20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897, \n 20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983, \n 21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067, \n 21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169, \n 21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277, \n 21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383, \n 21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491, \n 21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563, \n 21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647, \n 21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751, \n 21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841, \n 21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943, \n 21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039, \n 22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123, \n 22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229, \n 22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307, \n 22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441, \n 22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543, \n 22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643, \n 22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727, \n 22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817, \n 22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943, \n 22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029, \n 23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099, \n 23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203, \n 23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321, \n 23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447, \n 23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561, \n 23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629, \n 23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743, \n 23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827, \n 23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909, \n 23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007, \n 24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091, \n 24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169, \n 24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281, \n 24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413, \n 24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517, \n 24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659, \n 24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767, \n 24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877, \n 24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977, \n 24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097, \n 25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183, \n 25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303, \n 25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391, \n 25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471, \n 25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603, \n 25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693, \n 25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799, \n 25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913, \n 25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999, \n 26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111, \n 26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203, \n 26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297, \n 26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399, \n 26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497, \n 26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633, \n 26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711, \n 26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801, \n 26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891, \n 26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987, \n 26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077, \n 27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211, \n 27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329, \n 27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449, \n 27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551, \n 27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691, \n 27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767, \n 27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827, \n 27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947, \n 27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051, \n 28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151, \n 28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283, \n 28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403, \n 28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499, \n 28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579, \n 28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649, \n 28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729, \n 28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837, \n 28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933, \n 28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059, \n 29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167, \n 29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251, \n 29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363, \n 29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443, \n 29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573, \n 29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671, \n 29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819, \n 29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921, \n 29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059, \n 30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137, \n 30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241, \n 30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341, \n 30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469, \n 30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559, \n 30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689, \n 30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803, \n 30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871, \n 30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983, \n 31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091, \n 31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183, \n 31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259, \n 31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357, \n 31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511, \n 31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601, \n 31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721, \n ]\n\ndef find_prime_index(p):\n i = 0\n j = len(primes) - 1\n if primes[i] == p:\n return i\n if primes[j] == p:\n return j\n while j > i + 1:\n mid = (i + j) / 2\n if primes[mid] == p:\n return mid\n if primes[mid] < p:\n i = mid\n else:\n j = mid\n return j\n\ndef dp(n, p):\n if p > n:\n return 0\n if p * p > n:\n return 1\n np = n // p\n index = find_prime_index(p)\n result = np\n for i in range(index):\n result -= dp(np, primes[i])\n return result\n\ndef is_prime(p):\n if p <= primes[-1]:\n index = find_prime_index(p)\n return p == primes[index]\n for i in range(len(primes)):\n if p % primes[i] == 0:\n return False\n return True\n\na, b, k = map(lambda x: int(x), raw_input().split())\nif not is_prime(k):\n print 0\nelse:\n print dp(b, k) - dp(a-1, k)\n", "lang": "Python 2", "bug_code_uid": "9f8f0b53b83b92e45b3f85f3e4cf1590", "src_uid": "04a26f1d1013b6e6b4b0bdcf225475f2", "apr_id": "db3c1cb099635a007fbd1608f76b3d21", "difficulty": 2400, "tags": ["dp", "math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9615032080659945, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/python\n\nimport sys\nimport math\n\nprimes = []\nMAXN = 50000\nhash = []\n\ndp = dict()\n\ndef prime_test(v):\n for i in xrange(2,int(math.sqrt(v))+1):\n if v % i == 0:\n return False\n return True\n\ndef calc(v, k):\n if k >= MAXN:\n if (k <= v):\n return 1\n else:\n return 0\n else:\n if (v,k) in dp:\n return dp[(v,k)]\n res = v / k\n for prime in primes:\n if prime >= k:\n break\n res -= calc(v/k, prime)\n dp[(v,k)] = res\n return res\n\n\nif __name__==\"__main__\":\n hash = [-1] * MAXN\n for i in xrange(2,MAXN):\n if hash[i] == -1:\n primes.append(i)\n hash[i] = len(primes)-1\n v = i * i\n while (v < MAXN):\n hash[v] = -2\n v += i\n a,b,k = [int(v) for v in sys.stdin.readline().split(' ')]\n if (k < MAXN and hash[k] == -2) or (k >= MAXN and (not prime_test(k))):\n print 0\n else:\n print calc(b,k) - calc(a-1,k)\n\n\n", "lang": "Python 2", "bug_code_uid": "2a955146a020e8ba79a978801f5015ac", "src_uid": "04a26f1d1013b6e6b4b0bdcf225475f2", "apr_id": "f7e298451cffc5ed0eba426d14dd9533", "difficulty": 2400, "tags": ["dp", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.79375, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "n,k = list(map(int,input().split()))\nl = []\nif(k<=1):\n print(n)\n return 0\nelse:\n ans = 1\n while ans -1 and eq1 == eq2:\n print('Yes')\n exit()\n \nprint('No')\n", "lang": "PyPy 2", "bug_code_uid": "a560f2613d6788962b17a653b747c356", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "6fb1f6ec8bbb1af914fca8e99e7508ec", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8333333333333334, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "from math import *\na = int(input()))\nprint((a//7)*2 + max(a%7-5, 0), (a//7)*2 + min(a%7, 2))", "lang": "Python 3", "bug_code_uid": "77bbaae1d0d7603511e07039e1117167", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "629623c6a6fe39934d5e2b7fa61ce84d", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9166666666666666, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "d = {\n '0': -1,\n '1': -1,\n '2': -1,\n '3': '3',\n '4': '6',\n '5': '9',\n '6': '4',\n '8', -1,\n '7': '7',\n '9': '5',\n}\n\ns = input()\nprint(\"Yes\" if list(s)[::-1] == list([d[c] for c in s]) else \"No\")", "lang": "Python 3", "bug_code_uid": "493bb3d77ac87f05f45be1d7e6631193", "src_uid": "0f11f41cefd7cf43f498e511405426c3", "apr_id": "938ca2ad77fc8ca5c2b0d32f66c30ba4", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8763837638376384, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "from math import *\nfrom sys import *\n\nN=int(input())\n\n# if N <= 7:\n# print(N,N)\n# elif N <= 15:\n# print(N-7,N)\n# elif N <= 23:\n# print(N-14,N)\n# else:\n\nmemo={}\n\ndef solve(n):\n if n in memo:\n return memo[n]\n if n == 0:\n return 0,0\n s=floor(pow(n,1/3)-1)\n while (s+1)**3 <= n:\n s += 1\n A,B=solve(n - s ** 3)\n C,D=solve(s**3-1)\n memo[n] = max((A+1,B+s**3),(C,D))\n #print(n, A, B, C, D, memo[n])\n return memo[n]\n\ni=1\nwhile i**3 < N:\n solve(i**3)\n i+=1\n\nA,B=solve(N)\nprint(A,B)", "lang": "Python 3", "bug_code_uid": "103649f3630d86a403ae10fe13f04a85", "src_uid": "385cf3c40c96f0879788b766eeb25139", "apr_id": "cae7b76772e5f86ebbeef0bea69ff5f4", "difficulty": 2200, "tags": ["brute force", "constructive algorithms", "greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5267857142857143, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def c(n):\n if n<8: return n,n\n t=int(n**(1/3)+0.0000000000001)\n v1=c(n-t*t*t)\n return max((v1[0]+1,v1[1]+t*t*t),c(t*t*t-1))\nprint(' '.join(map(str,c(int(input())))))", "lang": "Python 3", "bug_code_uid": "42ac1184f946a8cd8f280f8e5374a4ea", "src_uid": "385cf3c40c96f0879788b766eeb25139", "apr_id": "c15e4facdf38eb7874cbd162c5e3cb2a", "difficulty": 2200, "tags": ["brute force", "constructive algorithms", "greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8502202643171806, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import os\n\nno = raw_input()\nn = map(int, list(no))\n\nin_no = []\nfor e in n:\n in_no +=[9-e]\nmin_pos= 0\nfor i in xrange(0, len(no)):\n s = 0\n a = no[i]\n b = in_no[i]\n #print a, b\n if int(a) > int(b):\n s = int(b)\n else:\n s = int(a)\n #print s\n min_pos = min_pos * 10 + s\n if i == len(no) -1 and min_pos == 0:\n min_pos = 9 - s\nprint min_pos\n", "lang": "Python 2", "bug_code_uid": "35f0ca0ebf14feaf462fae40cb49ac67", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "43fa0fc6809172cbeb62f935158afa6c", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9746192893401016, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n=int(input(''))\nnum=list(input(''))\nlis=[]\ncount=0\nfor i in range(0,n-1):\n if num[i]=='1':\n count+=1\n else:\n lis.append(str(count))\n count=0\n # print('appended')\nif num[n-1]=='1':\n count+=1\n lis.append(str(count))\nelse:\n lis.append(str(0))\n\nprint(''.join(lis))", "lang": "Python 3", "bug_code_uid": "48f90ab1aedd58ead3b58015df4e587c", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "85d56fee8622caa9e06e807191c9f6b0", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8340425531914893, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\ns = list(input())\nh = 0\nk = 0\nw = []\nwhile h != n:\n k = k + int(s[h])\n if int(s[h]) == 0 and h != len(s)-1:\n w.append(str(k))\n k = 0\n h = h + 1\n\nw.append(str(k))\n\nw = ''.join(w)\nprint(w)\n", "lang": "Python 3", "bug_code_uid": "0fd0dca7a068d048a59366488765d5bf", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "060b0dafea41896c6e37af3280dc7cf1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8830049261083743, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import sys\nimport bisect\nimport copy\ninput = sys.stdin.readline\n\nn,m=map(int,input().split())\nK=[0]+list(map(int,input().split()))\nSP=[list(map(int,input().split())) for i in range(m)]\n\nSP2=[[] for i in range(n+1)]\n\nfor d,t in SP:\n SP2[t].append(d)\n\nfor i in range(n+1):\n SP2[i].sort()\n\nSUM=sum(K)\nMIN=SUM\nMAX=SUM*2\nMAXBUY=0\n\nfor day in range(MIN,MAX+1):\n\n DAYS=[[] for i in range(day+1)]\n\n for i in range(n+1):\n x=bisect.bisect_right(SP2[i],day)-1\n if x>=0:\n DAYS[SP2[i][x]].append(i)\n\n\n\n GOLD=0\n BUY=0\n K2=copy.deepcopy(K)\n\n for d in range(1,day+1):\n GOLD+=1\n\n for t in DAYS[d]:\n DBUY=min(K2[t],GOLD)\n K2[t]-=DBUY\n GOLD-=DBUY\n BUY+=DBUY\n\n MAXBUY=max(MAXBUY,BUY)\n\nprint(MAX-MAXBUY)\n\n\n \n \n", "lang": "PyPy 3", "bug_code_uid": "e12ebf4376c0db01c8797780e4851b6a", "src_uid": "2eb101dcfcc487fe6e44c9b4c0e4024d", "apr_id": "f5dfc2c09c929199fc24f3b662888bf4", "difficulty": 2000, "tags": ["greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7704194260485652, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n, a, b = tuple(map(int, input().split()))\ns = list(map(int, input().split()))\nans = 0\nfor i in range(len(s) // 2):\n if (s[i] != s[len(s) - i - 1]) and (s[i] + s[len(s) - i + 1] == 1):\n print(-1)\n exit(0)\n elif (s[i] + s[len(s) - i - 1] == 2):\n ans += a\n elif (s[i] + s[len(s) - i - 1] == 3):\n ans += b\nprint(ans)", "lang": "Python 3", "bug_code_uid": "b82818bbdb81728bfd81eac17dab6645", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "apr_id": "85a6302988c698be9fdc423380e05d5a", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4331395348837209, "equal_cnt": 21, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 21, "bug_source_code": "DIGITS = 55\r\nMAX_CNT = 8\r\nNUMBERS = [0] * (DIGITS + 1)\r\n\r\nfor d in range(1, DIGITS + 1):\r\n NUMBERS[d] = 10 * NUMBERS[d - 1] + 1\r\n\r\nCUTOFF = 6.18\r\nINF = 10**9\r\n\r\ndef recurse(value, d, cost):\r\n if d == 0:\r\n return cost if value == 0 else INF\r\n\r\n ans = INF\r\n\r\n for cnt in range(-MAX_CNT, MAX_CNT + 1):\r\n nvalue = abs(value + cnt * NUMBERS[d])\r\n\r\n if nvalue <= CUTOFF * (10**(d - 1)) + 15:\r\n ans = min(ans, recurse(nvalue, d - 1, cost + abs(cnt) * d))\r\n\r\n return ans\r\n\r\nX = int(input())\r\nN = int(len(str(X)))\r\nprint(recurse(X, N + 1, 0))\r\n", "lang": "PyPy 3", "bug_code_uid": "adb906adb6a5881cd13b41927d9fa278", "src_uid": "1961e7c9120ff652b15cad5dd5ca0907", "apr_id": "175a5ec1cda9196c5b936cf9343c1ac9", "difficulty": 2900, "tags": ["dp", "greedy", "shortest paths"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9563636363636364, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\r\n\r\nres = {}\r\n\r\n\r\ndef cal(x):\r\n if x == 0:\r\n return 0\r\n\r\n larger = 1\r\n while x >= larger:\r\n larger = larger * 10 + 1\r\n smaller = larger // 10\r\n l = len(str(smaller))\r\n\r\n a = cal(x % smaller) + (x // smaller) * l\r\n b = cal((larger - x) % smaller) + l + 1 + ((larger - x) // smaller) * l\r\n res[x] = min(a, b)\r\n return res[x]\r\n\r\n\r\nprint(cal(n))\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "lang": "Python 3", "bug_code_uid": "18627b7cc1e528b84e9c0bada3171a30", "src_uid": "1961e7c9120ff652b15cad5dd5ca0907", "apr_id": "750b8acf9e4d74403163d64d588988c7", "difficulty": 2900, "tags": ["dp", "greedy", "shortest paths"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5820543093270366, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "def solve():\r\n n, mod = map(int, input().split())\r\n m = n*(n-1)//2\r\n dp = [[0]*(n*(n-1)+1) for i in range(n+1)]\r\n dp1 = [[0]*(n*(n-1)+1) for i in range(n+1)]\r\n dp[1][m] = 1\r\n for i in range(2, n+1):\r\n for x in range(m-(i-1)*(i-2)//2, m+(i-1)*(i-2)//2+1):\r\n for j in range(i):\r\n for k in range(i):\r\n dp[i][x+j-k] = (dp[i][x+j-k]+dp[i-1][x]) % mod\r\n for i in range(2, n+1):\r\n for x in range(m-(i-1)*(i-2)//2, m+(i-1)*(i-2)//2+1):\r\n for j in range(i):\r\n for k in range(m*2+1):\r\n dp1[i][k] = (dp1[i][k]+dp1[i-1][k]) % mod\r\n for k in range(j+1, i):\r\n dp1[i][x + j - k] = (dp1[i][x + j - k] + dp[i - 1][x]) % mod\r\n\r\n\r\n return sum(dp1[-1][m+1:]) % mod\r\n\r\nimport sys\r\ninput = lambda: sys.stdin.readline().rstrip()\r\nprint(solve())", "lang": "PyPy 3", "bug_code_uid": "4e5335172a4adb68aa643053d189032f", "src_uid": "ae0320a57d73fab1d05f5d10fbdb9e1a", "apr_id": "0d5b7a3441a91ef166cc1f883b15e6bc", "difficulty": 2400, "tags": ["dp", "fft", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.34786476868327404, "equal_cnt": 26, "replace_cnt": 19, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 26, "bug_source_code": "import sys\r\nfrom math import factorial\r\n\r\ninput = sys.stdin.readline\r\n\r\ntotal = 0\r\ndd = dict()\r\nqwe = set()\r\n\r\ndef stup(a, was, i, n, ans):\r\n\tif i == n:\r\n\t\tzz = 0\r\n\t\tfor i in range(n):\r\n\t\t\tfor j in range(i):\r\n\t\t\t\tif a[j] > a[i]:\r\n\t\t\t\t\tzz += 1\r\n\t\tprint(a, zz)\r\n\t\tans[zz] += 1\r\n\t\treturn\r\n\tfor v in range(n):\r\n\t\tif not was[v]:\r\n\t\t\twas[v] = True\r\n\t\t\ta[i] = v\r\n\t\t\tstup(a, was, i+1, n, ans)\r\n\t\t\twas[v] = False\r\n\r\nzz, mod = map(int, input().split())\r\nif zz == 1:\r\n\tprint(0)\r\n\texit(0)\r\n#ans = [0]*(zz*(zz-1))\r\n#stup([0]*zz, [False]*zz, 0, zz, ans)\r\n#print(ans)\r\n\r\ndef C(n, k):\r\n\treturn factorial(n)//factorial(n-k)//factorial(k)\r\n\r\nz = [1]\r\naaa = mod-1\r\nfor i in range(2,zz):\r\n\tnz = [0]*(i*i//2)\r\n\tfor j in range(len(z)):\r\n\t\tfor k in range(i):\r\n\t\t\tif z[j] > 0:\r\n\t\t\t\t#print(i-k+j, j, i-k-1)\r\n\t\t\t\tnz[i-k-1+j] += z[j]\r\n\tfor k in range(zz):\r\n\t\tfor l in range(i+1,zz):\r\n\t\t\tfor j in range(len(z)):\r\n\t\t\t\tfor jj in range(len(z)):\r\n\t\t\t\t\tif i-k-1+j > i-l-1+jj:\r\n\t\t\t\t\t\taaa = (aaa + z[j] * z[jj] * C(zz,i)) % mod\r\n\t#print(nz)\r\n\tz = nz\r\n#print(z)\r\nprint(aaa % mod)\r\nexit(0)\r\ndef solve():\r\n\tpass\r\n\r\nsolve()\r\n", "lang": "Python 3", "bug_code_uid": "8802713b64df24461c8143495c4b405b", "src_uid": "ae0320a57d73fab1d05f5d10fbdb9e1a", "apr_id": "3302ff1df4f570e198b1df65d04231f9", "difficulty": 2400, "tags": ["dp", "fft", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3601340033500838, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "fact = [{} for i in range(100001)]\n\nfor i in range(2,100001):\n if fact[i]: continue \n base = i\n while base < 100001:\n for j in range(base,100001,base):\n if i not in fact[j]: fact[j][i] = 0\n fact[j][i] += 1\n base *= i\n\n\n#print(fact)\n\n\n\n\n\n\n\n\nn = int(input())\n\nif n<2:\n print(n)\n exit()\n\n\ndef fracnum(i):\n temp = fact[i]\n base = 1\n for e in temp:\n base *= (temp[e]+1)\n return base\n\n\n\n\n\n\ndp = [0]*(n+1)\n\ndp[1] = 1\n\ntot = 1\nfor i in range(2,n+1):\n dp[i] = tot\n \n dp[i] += fracnum(i)\n\n\n\n tot += dp[i]\n\nprint(dp[-1]%998244353) \n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "fd12b3ff086c77e275b54e413db35aa7", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "1ae0f14e4956f4f453a3e4c221a0f595", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8785859171254708, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "def getAllFactors(x): #returns a sorted list of all the factors or divisors of x (including 1 and x)\r\n factors=[]\r\n for i in range(1,int(x**0.5)+1):\r\n if x%i==0:\r\n factors.append(i)\r\n if x//i!=i:\r\n factors.append(x//i)\r\n return sorted(factors)\r\n\r\ndef main():\r\n \r\n MOD=998244353\r\n \r\n n=int(input())\r\n dp=[0]*(n+1)\r\n dp[1]=1\r\n prefixSum=1\r\n for i in range(2,n+1):\r\n dp[i]=prefixSum+2\r\n # add 1 for every factor excluding 1 and n\r\n factors=getAllFactors(i)\r\n dp[i]+=(len(factors)-2)\r\n dp[i]%=MOD\r\n prefixSum+=dp[i]\r\n prefixSum%=MOD\r\n print(dp[n])\r\n \r\n return\r\n\r\nimport sys\r\ninput=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)\r\n# input=lambda: sys.stdin.readline().rstrip(\"\\r\\n\") #FOR READING STRING/TEXT INPUTS.\r\n\r\ndef oneLineArrayPrint(arr):\r\n print(' '.join([str(x) for x in arr]))\r\ndef multiLineArrayPrint(arr):\r\n print('\\n'.join([str(x) for x in arr]))\r\ndef multiLineArrayOfArraysPrint(arr):\r\n print('\\n'.join([' '.join([str(x) for x in y]) for y in arr]))\r\n \r\ndef readIntArr():\r\n return [int(x) for x in input().split()]\r\n# def readFloatArr():\r\n# return [float(x) for x in input().split()]\r\n\r\ndef makeArr(defaultValFactory,dimensionArr): # eg. makeArr(lambda:0,[n,m])\r\n dv=defaultValFactory;da=dimensionArr\r\n if len(da)==1:return [dv() for _ in range(da[0])]\r\n else:return [makeArr(dv,da[1:]) for _ in range(da[0])]\r\n \r\ndef queryInteractive(i,j):\r\n print('? {} {}'.format(i,j))\r\n sys.stdout.flush()\r\n return int(input())\r\n \r\ndef answerInteractive(ans):\r\n print('! {}'.format(' '.join([str(x) for x in ans])))\r\n sys.stdout.flush()\r\n \r\ninf=float('inf')\r\nMOD=10**9+7\r\n# MOD=998244353\r\n \r\n \r\nfor _abc in range(1):\r\n main()", "lang": "PyPy 3", "bug_code_uid": "fbc987ae303104ef45291e4e2f637541", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "fb71b9256d023ec65457b8b316a112eb", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5866032500990884, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "import sys\nimport collections\n\ninfile = sys.stdin.buffer\ndef gs() : return infile.readline().rstrip()\ndef gi() : return int(gs())\ndef gss() : return gs().split()\ndef gis() : return [int(x) for x in gss()]\n\nMOD = 10 ** 9 + 7\nINF = 10 ** 12\nN = 10 ** 5\n\ndef main(infn=\"\") :\n global infile\n infile = open(infn,\"r\") if infn else open(sys.argv[1],\"r\") if len(sys.argv) > 1 else sys.stdin\n ######################################################################\n n,m = gis()\n dp = [0 for _ in range(n+1)]\n dp[1] = 1\n h = collections.defaultdict(collections.Counter)\n cumul = 0\n prev = dp[1]\n for u in range(2, len(dp)):\n dp[u] += prev\n dp[u] += dp[1]\n dp[u] %= m\n for k in h[u]:\n cumul += h[u][k] * dp[k]\n cumul %= m\n dp[u] += cumul\n dp[u] %= m\n prev += dp[u]\n prev %= m\n\n v,c = u<<1, 2\n h[u + 1][1] +=1\n while(v < len(dp)):\n h[v][c]+=1#.append(c)\n h[v][c-1] -=1 #.append(-(c-1))\n v += u\n c += 1\n print (dp[-1])\n\n ######################################################################\nif __name__ == '__main__' :\n main()", "lang": "PyPy 3", "bug_code_uid": "5e9c7fb6230a67a0d18a18fed4bad539", "src_uid": "77443424be253352aaf2b6c89bdd4671", "apr_id": "01fd719070ceb815c709d906ee75e6d4", "difficulty": 1900, "tags": ["dp", "number theory", "math", "brute force", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9904397705544933, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "def solve():\r\n n, MOD = list(map(int, input().split()))\r\n dp = [0]*(n+2)\r\n dp[1] = 1\r\n dp[2] = -1\r\n m = 0\r\n for a in range(1, n+1):\r\n dp[a] = (dp[a]+2*m)%MOD\r\n dp[a+1] = (dp[a+1]-2*m)%MOD\r\n m = (m+dp[a])%MOD\r\n k = 2\r\n while k*a <= n:\r\n dp[k*a] = (dp[k*a]+dp[a])%MOD\r\n c = min(k*a+k, n+1)\r\n dp[c] = (dp[c]-dp[a])%MOD\r\n k += 1\r\n return dp[n]\r\n\r\n\r\nimport sys\r\ninput = lambda: sys.stdin.readline().rstrip()\r\nprint(solve())\r\n", "lang": "PyPy 3", "bug_code_uid": "c7afe5e268a357476e496cab07fe3c76", "src_uid": "77443424be253352aaf2b6c89bdd4671", "apr_id": "c19f1f652791b37b9c7cc430dfda7e54", "difficulty": 1900, "tags": ["dp", "number theory", "math", "brute force", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.300796812749004, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "import sys\r\ninput = sys.stdin.readline\r\n\r\nn,m=map(int,input().split())\r\n\r\nS=[i for i in range(n+1)]\r\n\r\nfor i in range(2,n+1):\r\n if S[i]==i:\r\n for j in range(i,n+1,i):\r\n if S[j]==j:\r\n S[j]=i\r\n\r\ndef fact(x):\r\n P=[]\r\n while x!=1:\r\n P.append(S[x])\r\n x//=S[x]\r\n\r\n NOW={1}\r\n for p in P:\r\n NOW|={n*p for n in NOW}\r\n\r\n return NOW\r\n\r\nDP=[0]*(n+1)\r\n\r\nDP[1]=1\r\nDP[2]=2\r\nDP[3]=5\r\n#DP[4]=12\r\n#DP[5]=25\r\n\r\nfor i in range(4,n+1):\r\n SU=DP[i-1]*2+1\r\n \r\n for f in fact(i):\r\n if f==1 or f==i:\r\n continue\r\n SU+=DP[i//f]-DP[(i-1)//f]\r\n\r\n DP[i]=SU%m\r\n\r\nprint(DP[n])\r\n \r\n \r\n", "lang": "PyPy 3", "bug_code_uid": "caf2bceb41cba04631b90034f11dfcf3", "src_uid": "77443424be253352aaf2b6c89bdd4671", "apr_id": "a9a69914cc4b5226d921a473bfb6913a", "difficulty": 1900, "tags": ["dp", "number theory", "math", "brute force", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9196078431372549, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "def reverse(a):\n acm = 0\n while(a!=0):\n acm = 2*acm + a%2\n a = a//2\n return acm\n\na, b = [int(x) for x in input().split()]\n\nq = [a]\ni = 0\nd = {}\nd[a] = 1\n\nwhile(i y:\r\n return False\r\n if a(int('1' + bin(x)[:1:-1], base=2), y):\r\n return True\r\n if rev and a(int(bin(x)[:1:-1], base=2), y, False):\r\n return True\r\n return False\r\n\r\nx, y = list(map(int, input().split()))\r\nif a(x, y) or a(int(bin(x)[:1:-1], base=2), y):\r\n print('YES')\r\nelse:\r\n print('NO')", "lang": "PyPy 3", "bug_code_uid": "9d958a796a058de4e092ba8b2228a30f", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "apr_id": "cf333a019c9bd82026b86dc150cb6add", "difficulty": 2000, "tags": ["dfs and similar", "bitmasks", "math", "implementation", "constructive algorithms", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.36346153846153845, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "from collections import deque\r\n\r\nn, x = [int(x) for x in input().split()]\r\n\r\nq = deque()\r\nq.append((x, 0))\r\nans = float('inf')\r\n\r\nwhile q:\r\n num, t = q.popleft()\r\n # print(num)\r\n l = len(str(num))\r\n if l == n:\r\n ans = t if t < ans else ans\r\n continue\r\n if l > n:\r\n continue\r\n if t > ans:\r\n continue\r\n vis = [0] * 10\r\n for s in str(num):\r\n y = int(s)\r\n if y != 0 and y != 1 and vis[y] == 0:\r\n vis[y] = 1\r\n q.append((num * y, t + 1))\r\n\r\nprint(ans if ans != float('inf') else -1)\r\n\r\n", "lang": "Python 3", "bug_code_uid": "25c14d1ac29e9487115347668d478f0a", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "c2207050a5906ab5878a85aa52bff378", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.011404133998574484, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "def cifreDuzina(x):\r\n cifre = {-1}\r\n br = 0\r\n while x:\r\n tmp = x % 10\r\n cifre.add(tmp)\r\n x //= 10\r\n br += 1\r\n cifre.remove(-1)\r\n l = []\r\n l.append(cifre)\r\n l.append(br)\r\n return l\r\n\r\ndef resi():\r\n n, x = map(int, input().split())\r\n #print(najvecaCifra(x))\r\n l = najvecaCifra(x)\r\n br = 0\r\n while l[1] < n:\r\n if l[0] == 1:\r\n print(-1)\r\n return\r\n x *= l[0]\r\n br += 1\r\n l = najvecaCifra(x)\r\n print(br)\r\n\r\ndef rekurzija(n, x):\r\n #print(x, cifreDuzina(x)[1])\r\n if cifreDuzina(x)[1] == n:\r\n return 0\r\n else:\r\n mn = 100000\r\n for c in cifreDuzina(x)[0]:\r\n if c == 0 or c == 1:\r\n continue\r\n if mn > rekurzija(n, c*x):\r\n mn = rekurzija(n, c*x)\r\n return mn + 1\r\n \r\n\r\n\r\nn, x = map(int, input().split())\r\nif rekurzija(n, x) != 100001:\r\n print(rekurzija(n, x))\r\nelse:\r\n print(-1)\r\n#print(cifreDuzina(int(input())))\r\n", "lang": "Python 3", "bug_code_uid": "b9cb2fa7ae11d8d5d94f7dd1282cf99a", "src_uid": "cedcc3cee864bf8684148df93804d029", "apr_id": "ae5bda513018de2eedfdd30a9f466a04", "difficulty": 1700, "tags": ["dp", "hashing", "dfs and similar", "shortest paths", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9986216402481047, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from collections import defaultdict, deque, Counter\r\nimport sys\r\nfrom decimal import *\r\nfrom heapq import heapify, heappop, heappush\r\nimport math\r\nimport random\r\nimport string\r\nfrom copy import deepcopy\r\nfrom itertools import combinations, permutations, product\r\nfrom operator import mul, itemgetter\r\nfrom functools import reduce, lru_cache\r\nfrom bisect import bisect_left, bisect_right\r\n\r\ndef input():\r\n return sys.stdin.readline().rstrip()\r\ndef getN():\r\n return int(input())\r\ndef getNM():\r\n return map(int, input().split())\r\ndef getList():\r\n return list(map(int, input().split()))\r\ndef getListGraph():\r\n return list(map(lambda x:int(x) - 1, input().split()))\r\ndef getArray(intn):\r\n return [int(input()) for i in range(intn)]\r\n\r\nmod = 10 ** 9 + 7\r\nMOD = 998244353\r\n\r\n# import pypyjit\r\n# pypyjit.set_param('max_unroll_recursion=-1')\r\ninf = float('inf')\r\neps = 10 ** (-12)\r\ndy = [0, 1, 0, -1]\r\ndx = [1, 0, -1, 0]\r\n\r\n#############\r\n# Main Code #\r\n#############\r\n\r\nprime = [2]\r\nmax = 100000\r\nlimit = int(math.sqrt(max))\r\ndata = [i + 1 for i in range(2, max, 2)]\r\n\r\nwhile limit > data[0]:\r\n prime.append(data[0])\r\n data = [j for j in data if j % data[0] != 0]\r\nprime = set(prime + data)\r\n\r\nN, M = getNM()\r\nl, all, subs = 1, 1, 1\r\nans = 0\r\nfor i in range(N):\r\n if i + 1 in prime and l <= M:\r\n l *= (i + 1)\r\n subs = (subs * (M // l)) % MOD\r\n all *= M\r\n ans %= MOD\r\n ans += all - subs\r\n ans %= MOD\r\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "ceb699d3bf7e1af97d6e43ec5f0d3891", "src_uid": "0fdd91ed33431848614075ebe9d2ee68", "apr_id": "73fde6f026b39529a5a29ee86446b209", "difficulty": 1900, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8708133971291866, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "def prime(n):\r\n i = 2\r\n while i * i <= n:\r\n if n % i == 0:\r\n return 0\r\n return 1\r\n\r\n\r\ndef binpow(x, y, mod):\r\n if y == 0:\r\n return 1\r\n if y == -1:\r\n return 1. / x\r\n p = binpow(x, y // 2, mod)\r\n p *= p\r\n if y % 2:\r\n p *= x\r\n return p % mod\r\n\r\nmod = 998244353\r\nn, m = map(int, input().split())\r\nout = 0\r\nfor i in range(1, 1 + n):\r\n out += pow(m, i, mod)\r\ncnt = 1\r\nminu = 1\r\nfor i in range(1, 1 + n):\r\n if cnt > m:\r\n break\r\n if prime(i):\r\n cnt *= i\r\n minu *= (m // cnt)\r\n minu %= mod\r\n out -= minu\r\n\r\nprint(out)\r\n", "lang": "PyPy 3", "bug_code_uid": "a3ea2651ad122b6e1c2b1078ac425a2a", "src_uid": "0fdd91ed33431848614075ebe9d2ee68", "apr_id": "6e865eb94050dfa67ff60c28831bc4a6", "difficulty": 1900, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.04395604395604396, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def opendoor(chia, lista):\r\n count = 0\r\n while True:\r\n chia = lista[int(chia)-1]\r\n count += 1\r\n if count == 3:\r\n return('YES')\r\n else:\r\n return('NO')\r\n \r\nn = int(input())\r\nfor i in range(n):\r\n key = int(input())\r\n doors = input()\r\n chiavi = doors.split(' ')\r\n print(opendoor(key,chiavi))", "lang": "Python 3", "bug_code_uid": "368a221998581f60dbfcc0a8ffb560ca", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "a9c8d532ed0ca9256f9871ba812960dd", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9966101694915255, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "for _ in range(int(input()));\r\n key = int(input())\r\n doors = list(map(int,input().split()))\r\n \r\n key = doors[key-1]\r\n if(key == 0):\r\n print(\"NO\")\r\n else:\r\n key = doors[key-1]\r\n if(key == 0):\r\n print(\"NO\")\r\n else:\r\n print(\"YES\")", "lang": "Python 3", "bug_code_uid": "ed255465785336bb8d6eae90d3c48e3c", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "apr_id": "f4cdce9db4e5874e7dd0b40765b3c416", "difficulty": 800, "tags": ["math", "implementation", "brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.46190476190476193, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "for _ in range(int(input())):\r\n n = int(input())\r\n count = 0\r\n for i in range(n+1):\r\n if i**2 <= n or i**3 <= n:\r\n count += 1\r\n\r\n print(count)\r\n", "lang": "Python 3", "bug_code_uid": "8057918cdb5880f2d42df256051b2d4a", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "76b555d7869f3cf926e8635658343f3a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.35324675324675325, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "for i in range(int(input())):\r\n st = int(input())\r\n l1, l2 = [], []\r\n for i in range(1,st):\r\n l1.append(i**2)\r\n l2.append(i**3)\r\n l = sorted(set(l1 + l2))\r\n count = 0\r\n for i in l:\r\n if i < st:\r\n count+=1\r\n print(count)", "lang": "PyPy 3", "bug_code_uid": "133d80ebe851e4e6b1b96059931288d1", "src_uid": "015afbefe1514a0e18fcb9286c7b6624", "apr_id": "799cd83243f4a724dbfc66a6f5c29803", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2612035851472471, "equal_cnt": 18, "replace_cnt": 6, "delete_cnt": 7, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "def split(arr,size):\r\n arrs = []\r\n while size=1:\r\n if n[i]-n[i-1]==1:\r\n ct+=1\r\n i-=1\r\n return ct\r\ndef total_counts(n):\r\n ct = 0\r\n for i in n:\r\n ct+=count(i)\r\n return ct\r\ntt = list(map(int,input().split()))\r\nif tt[1]==1 and tt[0]>1:\r\n lt = [[i+1 for i in range(tt[0]*tt[1])]]\r\nelse:\r\n lt = split([i+1 for i in range(tt[0]*tt[1])],tt[1])\r\nprint(total_counts(lt))", "lang": "Python 3", "bug_code_uid": "fb8461c124711e88ab71f837157f75d0", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "6f96130e88bf4a6f191f59da15fd10d2", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5754985754985755, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "x = list(map(int,input().split()))\r\ns = []\r\nr = 1\r\nk = 0\r\nfor i in range(x[0]):\r\n s.append(list(map(int, (m for m in range(r,x[1]+r)))))\r\n r += x[1]\r\n\r\nif x[0] == 2 and x[1] ==1 :\r\n print(1)\r\nelse:\r\n print((x[1]-1)*len(s))\r\n", "lang": "Python 3", "bug_code_uid": "8efe1cce7760e3464090fe719932742d", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "ba23d3a9fdd3a10ecdd2efadc506e58b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6349206349206349, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "codeInput = input().split()\nrows = int(codeInput[0])\ncolumns = int(codeInput[1])\ndominoCounter = 0\n\nif columns == 1:\n dominoCounter = rows - 1\nelse:\n for i in range(0, rows):\n dominoCounter = dominoCounter + columns - 1\nprint(dominoCounter)\n \n \n", "lang": "Python 3", "bug_code_uid": "9d61d830be9e9ddf783072a55659d3e2", "src_uid": "a91aab4c0618d036c81022232814ef44", "apr_id": "abf118bf5fd77caa662ed9c31016ac9a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8467180741019372, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "import queue\r\nfrom math import *\r\nimport sys\r\nfrom collections import *\r\nfrom random import *\r\n\r\nsys.setrecursionlimit(99999)\r\neps = sys.float_info.epsilon\r\nP = 31\r\nMOD = 10**9+7\r\n\r\ndef is_prime(n):\r\n if n == 0 or n == 1:\r\n return False\r\n d = 2\r\n while d * d <= n:\r\n if n % d == 0:\r\n return False\r\n d += 1\r\n return True\r\n\r\n\r\ndef div_up(n, k):\r\n if n % k == 0:\r\n return n // k\r\n else:\r\n return n // k + 1\r\n\r\n\r\ndef bfs(start, visited, graph):\r\n q = deque()\r\n visited[start] = True\r\n q.appendleft(start)\r\n while len(q) != 0:\r\n v = q.pop()\r\n for to in graph[v]:\r\n if not visited[to]:\r\n visited[to] = True\r\n q.appendleft(to)\r\n\r\n\r\ndef to_int(c):\r\n if c == '>':\r\n return 0\r\n return 1\r\n\r\n\r\ndef ford_bellman(edges, d, cost, n):\r\n for i in range(n - 1):\r\n flag = True\r\n for edge in edges:\r\n v, u = edge[0], edge[1]\r\n temp = d[v] + cost[edge]\r\n if temp < d[u]:\r\n d[u] = temp\r\n flag = False\r\n if flag:\r\n break\r\n\r\n\r\ndef num_len(n, base):\r\n if n == 0:\r\n return 1\r\n return int(floor(log(n, base) + 1))\r\n\r\n\r\ncycles = 0\r\ndef dfs(graph, cl, p, v):\r\n global cycles\r\n cl[v] = 1\r\n for to in graph[v]:\r\n if cl[to] == 1 and p[v] != to:\r\n cycles += 1\r\n elif cl[to] == 0:\r\n p[to] = v\r\n dfs(graph, cl, p, to)\r\n cl[v] = 2\r\n\r\n\r\ndef down(a):\r\n for i in range(1, len(a)):\r\n if a[i] > a[i - 1]:\r\n return False\r\n return True\r\n\r\n\r\ndef up(a):\r\n for i in range(1, len(a)):\r\n if a[i] < a[i - 1]:\r\n return False\r\n return True\r\n\r\n\r\ndef _hash_(s):\r\n res = 0\r\n for i in range(len(s)):\r\n res += (ord(s[i]) - ord('a')) * P**i\r\n return res\r\n\r\n\r\ndef binpow(a, n):\r\n res = 1\r\n while n:\r\n if n & 1:\r\n res *= a\r\n res %= MOD\r\n a *= a\r\n a %= MOD\r\n n >>= 1\r\n return res\r\n\r\n\r\ndef solve():\r\n n, k = map(int, input().split())\r\n S = binpow(2, n - 1)\r\n if k == 0:\r\n print(1)\r\n return\r\n dp_eq = [1 for i in range(k + 1)]\r\n dp_big = [1 for i in range(k + 1)]\r\n dp_eq[1] = S\r\n if n % 2 != 0:\r\n dp_eq[1] += 1\r\n else:\r\n dp_eq[1] -= 1\r\n dp_big[1] = 0\r\n if n % 2 == 0:\r\n dp_big[1] += 1\r\n\r\n for i in range(2, k + 1):\r\n dp_eq[i] = dp_eq[i - 1] * dp_eq[1]\r\n dp_big[i] = dp_big[i - 1] * binpow(2, n) + dp_eq[i - 1] * dp_big[1]\r\n print(dp_eq[k] + dp_big[k])\r\n\r\n\r\nfor _ in range(int(input())):\r\n solve()\r\n\r\n\r\ndef debug():\r\n pass\r\n\r\n# debug()\r\n", "lang": "Python 3", "bug_code_uid": "6e483c2213298e68f16826d05b83d3f0", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "74c1b0c21914cb849b5449890c800bc5", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8981132075471698, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "def main():\n from sys import stdin, setrecursionlimit\n #from math import gcd\n #from random import randint, choice, shuffle\n #from itertools import combinations, product\n #from functools import lru_cache\n #from re import search, finditer\n input = stdin.buffer.readline\n #setrecursionlimit(100000000)\n \n mod = 1000000007\n \n for _ in range(int(input())):\n n, k = map(int, input().split())\n if n & 1:\n print(pow(pow(2, (n - 1), mod) + 1, k, mod))\n else:\n x = pow(2, (n - 1), mod) - 1\n p = [0] * (k + 1)\n p[0] = 1\n for i in range(1, k + 1):\n p[i] = p[i - 1] * x % mod\n ans = p[k]\n for i in range(k):\n ans = (ans + p[i] * pow(2, n * (k - i - 1), mod)) % mod\n print(ans)\n \nmain()\n", "lang": "PyPy 3", "bug_code_uid": "fdf29549b4af6b3a5f31301b264c0457", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "e7a301572605da2b145dec6e5bf20fba", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9703808180535967, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "import decimal\nimport os\nimport sys\nfrom collections import Counter\nfrom io import BytesIO, IOBase\n\nBUFSIZE = 8192\n\n\nclass FastIO(IOBase):\n newlines = 0\n\n def __init__(self, file):\n self._fd = file.fileno()\n self.buffer = BytesIO()\n self.writable = 'x' in file.mode or 'r' not in file.mode\n self.write = self.buffer.write if self.writable else None\n\n def read(self):\n while True:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n if not b:\n break\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines = 0\n return self.buffer.read()\n\n def readline(self):\n while self.newlines == 0:\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n self.newlines = b.count(b'\\n') + (not b)\n ptr = self.buffer.tell()\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\n self.newlines -= 1\n return self.buffer.readline()\n\n def flush(self):\n if self.writable:\n os.write(self._fd, self.buffer.getvalue())\n self.buffer.truncate(0), self.buffer.seek(0)\n\n\nclass IOWrapper(IOBase):\n def __init__(self, file):\n self.buffer = FastIO(file)\n self.flush = self.buffer.flush\n self.writable = self.buffer.writable\n self.write = lambda s: self.buffer.write(s.encode('ascii'))\n self.read = lambda: self.buffer.read().decode('ascii')\n self.readline = lambda: self.buffer.readline().decode('ascii')\n\n\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\n\n\ndef ints_get(): return map(int, input().strip().split())\n\n\ndef list_get(): return list(map(int, sys.stdin.readline().strip().split()))\n\n\ndef chars_get(): return list(map(str, sys.stdin.readline().strip().split()))\n\n\ndef output(to_be_printed, end=\"\\n\"): sys.stdout.write(str(to_be_printed) + end)\n\n\n# ******************************************************#\n# **************** code starts here ********************#\n# ******************************************************#\n\n\ndef main():\n mod = 1000000007\n for _ in range(int(input())):\n n, k = ints_get()\n if k == 0:\n print(1)\n continue\n if n == 1:\n print(pow(2, k, mod))\n continue\n if n % 2 != 0:\n output(pow(pow(2, n - 1, mod) + 1, k, mod))\n else:\n ans = pow(pow(2, n - 1, mod) - 1, k, mod)\n for i in range(k):\n ans += pow(pow(2, n - 1, mod) - 1, i, mod) * pow(2, (k - 1 - i) * n, mod)\n ans %= mod\n output(ans)\n return\n\nif __name__ == \"__main__\":\n main()\n\n\n", "lang": "PyPy 3", "bug_code_uid": "1121e9fee053852bc3e62a5ba5baf808", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "65d55b9ed1a4b38cbbb9c434c57627a6", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5420875420875421, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "MOD = 10 ** 9 + 7\r\n\r\nfor _ in range(int(input())):\r\n\tn, k = map(int, input().split())\r\n\r\n\tif n%2:\r\n\t\tans = 1\r\n\t\tans = pow(1+pow(2,n-1,MOD),k,MOD)\r\n\t\tprint(ans)\r\n\telse:\r\n\t\tdp = [0]*(k+1)\r\n\t\tdp[0] = 1\r\n\t\tfor i in range(1,k+1):\r\n\t\t\tdp[i] = pow(pow(2,i-1,MOD),n,MOD) + (pow(2,n-1,MOD)-1)*dp[i-1]\r\n\r\n\t\tprint(dp[-1])", "lang": "PyPy 3", "bug_code_uid": "db000d6c6b68bc1a6aa9ab671c794ad0", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "3d10833454bcb9b481076b839ea4ae65", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9452581621798544, "equal_cnt": 84, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 75, "fix_ops_cnt": 85, "bug_source_code": "import bisect\r\nimport heapq\r\nimport math\r\nimport collections\r\nimport sys\r\nimport copy\r\nfrom functools import reduce\r\nimport decimal\r\nfrom io import BytesIO, IOBase\r\nimport os\r\nimport itertools\r\n\r\nsys.setrecursionlimit(10 ** 9)\r\ndecimal.getcontext().rounding = decimal.ROUND_HALF_UP\r\n\r\ngraphDict = collections.defaultdict\r\n\r\nqueue = collections.deque\r\n\r\n\r\n################## Graphs ###################\r\nclass Graphs:\r\n def __init__(self):\r\n self.graph = graphDict(set)\r\n\r\n def add_edge(self, u, v):\r\n self.graph[u].add(v)\r\n self.graph[v].add(u)\r\n\r\n def delEdge(self, u, v):\r\n for ii in range(len(self.graph[u])):\r\n\r\n if self.graph[u][ii] == v:\r\n self[u].remove(v)\r\n break\r\n for ii in range(len(self[v])):\r\n if self[v][ii] == u:\r\n self[v].pop(i)\r\n break\r\n\r\n def dfs_utility(self, nodes, visited_nodes):\r\n visited_nodes.add(nodes)\r\n for neighbour in self.graph[nodes]:\r\n if neighbour not in visited_nodes:\r\n self.dfs_utility(neighbour, visited_nodes)\r\n\r\n def dfs(self):\r\n count = 0\r\n ans = []\r\n Visited = set()\r\n for i in range(1, n + 1):\r\n if i not in Visited:\r\n count += 1\r\n ans.append(i)\r\n self.dfs_utility(i, Visited)\r\n return count, ans\r\n\r\n def bfs(self, node):\r\n visited = set()\r\n if node not in visited:\r\n queue.append(node)\r\n visited.add(node)\r\n while queue:\r\n parent = queue.popleft()\r\n print(parent)\r\n for item in self.graph[parent]:\r\n if item not in visited:\r\n queue.append(item)\r\n visited.add(item)\r\n\r\n\r\n################### Tree Implementaion ##############\r\nclass Tree:\r\n def __init__(self, data):\r\n self.data = data\r\n self.left = None\r\n self.right = None\r\n\r\n\r\ndef inorder(node, lis):\r\n if node:\r\n inorder(node.left, lis)\r\n lis.append(node.data)\r\n inorder(node.right, lis)\r\n return lis\r\n\r\n\r\ndef leaf_node_sum(root):\r\n if root is None:\r\n return 0\r\n if root.left is None and root.right is None:\r\n return root.data\r\n return leaf_node_sum(root.left) + leaf_node_sum(root.right)\r\n\r\n\r\ndef hight(root):\r\n if root is None:\r\n return -1\r\n if root.left is None and root.right is None:\r\n return 0\r\n return max(hight(root.left), hight(root.right)) + 1\r\n\r\n\r\n#################################################\r\n\r\ndef rounding(n):\r\n return int(decimal.Decimal(f'{n}').to_integral_value())\r\n\r\n\r\ndef factors(n):\r\n return set(reduce(list.__add__,\r\n ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0), []))\r\n\r\n\r\n################################ ###########################################\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n\r\n def readline(self, **kwargs):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\n\r\n\r\n###########################################################################################\r\n\r\n\r\ndef inp():\r\n return sys.stdin.readline().strip()\r\n\r\n\r\ndef map_inp(v_type):\r\n return map(v_type, inp().split())\r\n\r\n\r\ndef list_inp(v_type):\r\n return list(map_inp(v_type))\r\n\r\n\r\n######################################## Solution ####################################\r\nmod = 10 ** 9 + 7\r\nfor _ in range(int(inp())):\r\n n, k = map_inp(int)\r\n if k == 0:\r\n print(1)\r\n else:\r\n dp = [0 for col in range(k + 1)]\r\n for i in range(k):\r\n if i == 0:\r\n if n & 1:\r\n ways_to_win = pow(2, n - 1, mod) + 1\r\n else:\r\n ways_to_win = pow(2, n - 1, mod)\r\n dp[i] = ways_to_win\r\n else:\r\n ways_to_win = 0\r\n if n & 1:\r\n ways_to_win += dp[i - 1]\r\n temp = (pow(2, n - 1, mod) * dp[i - 1] % mod) % mod\r\n ways_to_win += temp % mod\r\n ways_to_win %= mod\r\n else:\r\n ways_to_win += pow(2, i * n, mod)\r\n temp = ((pow(2, n - 1, mod) - 1) % mod * dp[i - 1] % mod) % mod\r\n ways_to_win += temp % mod\r\n ways_to_win %= mod\r\n dp[i] = ways_to_win\r\n print(dp[k - 1])\r\n", "lang": "PyPy 3", "bug_code_uid": "6c9e4c09de11e26baeccd29c11cc0e90", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "d6a3d31d858ee6129a749201000d1e8f", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9131754705525197, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "\r\n\r\npri=pow(10,9)+7\r\nimport sys\r\ninput=sys.stdin.readline\r\n\r\na=int(input())\r\nfor i in range(a):\r\n n,k=map(int,input().split())\r\n\r\n \r\n if(k==0):\r\n print(1)\r\n continue;\r\n\r\n ans=[0 for i in range(k)]\r\n\r\n\r\n if(n%2==0):\r\n ways=pow(2,n-1,pri)\r\n else:\r\n ways=pow(2,n-1,pri)\r\n ways+=1\r\n ans[0]=ways\r\n \r\n for i in range(1,k):\r\n if(n%2==0):\r\n ways=pow(2,n-1,pri)\r\n else:\r\n ways=pow(2,n-1,pri)\r\n\r\n ways+=1\r\n ways%=pri\r\n\r\n if(n%2==0):\r\n ans[i]=ans[i-1]*(ways-1)\r\n ans[i]+=pow(2,n*i,pri)\r\n else:\r\n \r\n ans[i]=ans[i-1]*ways\r\n ans[i]%=pri\r\n print(ans[-1])\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n", "lang": "PyPy 3", "bug_code_uid": "3bde2ef5c5c47578f988a9e716b9a91c", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "a02c55d52c39b830a2661c0b997b3c94", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.18058690744920994, "equal_cnt": 11, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "def power(n,k):\r\n if k==0:\r\n return 1\r\n elif k%2==0:\r\n return power(n*n,k//2)\r\n else:\r\n return power(n*n,k//2)*n\r\nt=int(input())\r\nfor test in range(t):\r\n n,k=map(int,input().split())\r\n if k==0:\r\n print(1)\r\n elif n==1:\r\n print(2)\r\n elif n%2==1:\r\n d1=power(2,n-1)+1\r\n d1=d1%1000000007\r\n d=power(d1,k)\r\n print(d%1000000007)\r\n else:\r\n d=power(2,n)\r\n ans=(power(2*d,k)-power(d-2,k))//(power(2,k-1)*(d+2))\r\n print((ans+1)%1000000007)", "lang": "PyPy 3", "bug_code_uid": "f1bc6620cd7f8e07fa997653bfdd13f8", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "0b675fe546ecb98ecd045e84187408fd", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9357582868876504, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "import sys\r\ndef input(): return sys.stdin.readline().strip()\r\n\r\n\r\nn, mod = map(int, input().split())\r\n\r\nle = 500\r\n\r\n\r\ndef pow(x, y): # x**y \u306e mod \u3092\u8fd4\u3059\u3002mod\u306f\u7d20\u6570\u3067\u306a\u304f\u3066\u3082\u3088\u3044\u3002\r\n ans = 1\r\n while y > 0:\r\n if y % 2 == 1:\r\n ans = (ans * x) % mod\r\n x = (x**2) % mod\r\n y //= 2\r\n return ans\r\n\r\n\r\ndef inv(x): # x \u306e mod \u3067\u306e\u9006\u5143\u3092\u8fd4\u3059\u3002mod\u304c\u7d20\u6570\u3067\u3001x\u3068mod\u304c\u4e92\u3044\u306b\u7d20\u3067\u3042\u308b\u5fc5\u8981\u3042\u308a\u3002\r\n return pow(x, mod-2)\r\n\r\n\r\nM = [1] # i!\u306emod\r\nmul = 1\r\nfor i in range(1, le):\r\n mul = (mul * i) % mod\r\n M.append(mul)\r\n\r\nMI = [0] * (le-1) + [inv(M[le-1])] # i!\u306e\u9006\u5143\r\nfor i in range(le-2, -1, -1):\r\n MI[i] = MI[i+1] * (i+1) % mod\r\n\r\n\r\ndef C(x, y): # \u30b3\u30f3\u30d3\u30cd\u30fc\u30b7\u30e7\u30f3\uff08\u7d44\u5408\u305b\uff09\r\n if y < 0 or y > x:\r\n return 0\r\n elif x > le: # O(min(y, x-y))\r\n y = min(y, x-y)\r\n ans = 1\r\n for i in range(x, x-y, -1):\r\n ans = (ans * i) % mod\r\n return (ans * MI[y]) % mod\r\n else: # O(1)\r\n ans = M[x]\r\n ans = (ans * MI[y]) % mod\r\n return (ans * MI[x-y]) % mod\r\n\r\n\r\nM2 = [1]\r\nfor i in range(n+10):\r\n M2.append((M2[-1]*2) % mod)\r\n\r\nCO = [[0] * (n+10) for i in range(n+10)]\r\nfor i in range(n+10):\r\n for j in range(n+10):\r\n CO[i][j] = C(i, j)\r\n\r\nD = [[0] * (n+1) for i in range(n+2)]\r\n# D[\u4f55\u500b\u76ee\u307e\u3067\u898b\u305f\u304b][\u305d\u306e\u3046\u3061\u624b\u52d5ON\u306e\u500b\u6570] = (\u898b\u305f\u3046\u3061\u306e\u6700\u53f3\u304c\u81ea\u52d5ON\u3067\u3042\u308b\u5834\u5408\u306e\u30d1\u30bf\u30fc\u30f3\u6570)\r\n\r\nD[0][0] = 1\r\nfor i in range(n+2):\r\n for j in range(n+1):\r\n for k in range(1, n+1):\r\n ind0 = i+k+1\r\n ind1 = j+k\r\n if ind0 <= n+1 and ind1 <= n:\r\n D[ind0][ind1] += D[i][j] * CO[j+k][k] * M2[k-1]\r\n D[ind0][ind1] %= mod\r\n if ind1 == n:\r\n break\r\n if ind0 == n+1:\r\n break\r\n\r\n# print(D)\r\nprint(sum(D[-1]) % mod)\r\n", "lang": "PyPy 3", "bug_code_uid": "0147973776fcfedad00743eae08fcef9", "src_uid": "4f0e0d1deef0761a46b64de3eb98e774", "apr_id": "2f9cc05f46df59dadf03b50b92899107", "difficulty": 2200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.504, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "#import time\r\n\r\ndef make_nCr_mod(max_n=2 * 10**5, mod=10**9 + 7):\r\n max_n = min(max_n, mod - 1)\r\n\r\n fact, inv_fact = [0] * (max_n + 1), [0] * (max_n + 1)\r\n fact[0] = 1\r\n for i in range(max_n):\r\n fact[i + 1] = fact[i] * (i + 1) % mod\r\n\r\n inv_fact[-1] = pow(fact[-1], mod - 2, mod)\r\n for i in reversed(range(max_n)):\r\n inv_fact[i] = inv_fact[i + 1] * (i + 1) % mod\r\n\r\n def nCr_mod(n, r):\r\n res = 1\r\n while n or r:\r\n a, b = n % mod, r % mod\r\n if a < b:\r\n return 0\r\n res = res * fact[a] % mod * inv_fact[b] % mod * inv_fact[a - b] % mod\r\n n //= mod\r\n r //= mod\r\n return res\r\n\r\n return nCr_mod\r\n\r\n\r\ndef process(N, M):\r\n # s = time.time()\r\n f = make_nCr_mod(mod=M)\r\n two_powers = [1]\r\n for i in range(401):\r\n two_powers.append((2*two_powers[-1]) % M)\r\n d = [[0 for i in range(N+1)] for i in range(N+1)]\r\n d[0][0] = 1\r\n for n in range(1, N+1):\r\n \"\"\"\r\n the length of result\r\n \"\"\"\r\n for a in range(1, n+1):\r\n \"\"\"\r\n the number of consecutive numbers ending in n\r\n \"\"\"\r\n entry = two_powers[a-1]\r\n if a==n:\r\n d[n][n]+=entry\r\n else:\r\n for l2 in range(1, n-a):\r\n entry2 = d[n-a-1][l2]\r\n # print(a, l2, entry, entry2, f(l2+a, l2))\r\n d[n][l2+a]+=(entry*entry2*f(l2+a, l2))\r\n d[n][l2+a] = d[n][l2+a] % M\r\n # print(d[n][:n+1])\r\n # print(n, time.time()-s)\r\n answer = 0\r\n for i in range(N+1):\r\n # print(d[n][i])\r\n answer = (answer+d[n][i]) % M\r\n return answer\r\n\r\nN, M = [int(x) for x in input().split()]\r\nprint(process(N, M))", "lang": "PyPy 3", "bug_code_uid": "552492a4bbeaa3b3109ada314f6b4399", "src_uid": "4f0e0d1deef0761a46b64de3eb98e774", "apr_id": "076c0e513051942f710f10f869dbca9c", "difficulty": 2200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7739251040221914, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "# cook your dish here\r\nfrom collections import Counter, deque\r\nfrom re import L\r\nfrom sys import stdin, stdout\r\nimport math\r\nfrom collections import defaultdict\r\nfrom typing import AnyStr, DefaultDict\r\n\r\n# int(stdin.readline())\r\n# map(int, stdin.readline().split())\r\n# list(map(int, stdin.readline().split()))\r\n# list(input())\r\n\r\nn=int(input())\r\n\r\nans=1\r\nfor i in range(n):\r\n if i==0:\r\n ans*=6\r\n else:\r\n ans*=(16**(2**(i-1)))\r\n\r\nprint(ans%1000000007)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n", "lang": "PyPy 3", "bug_code_uid": "bd6a123bc23d6485ab91905a6147653b", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "0bcfaa4f47e6a8aecf5b14baf6cdc7d9", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9863628517175902, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env python\r\nimport collections\r\nimport os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\nfrom bisect import bisect_left\r\nfrom math import gcd,log,ceil\r\nfrom collections import Counter\r\nfrom pprint import pprint\r\nimport heapq\r\nBUFSIZE = 8192\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n # endregion\r\n \r\n\r\n\r\ndef two_power(n):\r\n dp = [1 for _ in range(n+1)]\r\n\r\n mod = int(1e9+7)\r\n for i in range(1,n+1):\r\n dp[i] = (dp[i-1]*2) % mod \r\n\r\n # print(dp)\r\n return dp\r\n\r\ndef main():\r\n n = int(input())\r\n if n == 1:\r\n print(6)\r\n return \r\n powers = two_power(60)\r\n powers = two_power((powers[n]-2)*2+1)\r\n # ans = 0 \r\n mod = int(1e9+7)\r\n # ans += (4*powers[n] * (powers[n-1]))%mod\r\n # ans += (2 *sum(powers[i] for i in range(1,n+1,2))* (powers[n-2] - powers[(n-2)//2])) % mod \r\n\r\n # # print(ans)\r\n # print((4*6*6*4*4*4*4)/24576)\r\n # print(24576//(6*6*4*4*4*4))\r\n\r\n ans = 6 \r\n\r\n \r\n # print((ans * (4 ** (powers[n]-2) ) %mod)%mod)\r\n\r\n # print((ans * (powers[(powers[n]-2)*2] %mod)%mod))\r\n\r\n a = (pow(2,n,mod) - 2)%mod\r\n b = pow(4,a,mod) %mod \r\n print((b*ans)%mod)\r\n\r\n # print(ans % mod)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n for _ in range(1):\r\n main()\r\n\r\n\r\n\r\n", "lang": "PyPy 3", "bug_code_uid": "0f2e072d7046b8ca609211c9046f550d", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "bb99df6619182c8518d9ee5c2f90f698", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5339805825242718, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "k = int(input(''))\r\nans = 6\r\nf = 1\r\nfor i in range(1,k):\r\n f *= 4**(2**i)\r\n f %= (10**9+7)\r\nprint( (ans*f) % (10**9+7))\r\n", "lang": "PyPy 3", "bug_code_uid": "e0ee8c1a8d1c811a410421cacb2b58fc", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "9502efe67258e16ea80cf8925af9b67d", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7483443708609272, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "md = (10**9+7)\n\nk = int(input())\ncount = 6\nfor i in range(1,k):\n count *= (4**(2**i))\n count %= md\nprint(count % md)\n", "lang": "PyPy 3", "bug_code_uid": "c5b5de177e70bdd5e6654faefc974c84", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "a7c7fbe243411ae28c85bbe48cfb2c51", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.729483282674772, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import math\r\n\r\nn = int(input())\r\n\r\nans = 6\r\nfor i in range(1,n):\r\n ans*=2**(2**(i+1))\r\n ans = ans%(10**9+7)\r\n \r\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "7b852090b34b928ed06ecde3730ec828", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "625dbc928a6739c3b3850e5aacd05c9c", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8535031847133758, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import sys\r\ninput = lambda: sys.stdin.readline().rstrip('\\r\\n')\r\n\r\ninp_vars_int = lambda: map(int, input().split())\r\ninp_list_int = lambda: list(map(int, input().split()))\r\n\r\nk = int(input())\r\n# for _ in range(t):\r\nres = 6\r\nfor i in range(1, k):\r\n res *= (4 ** (2 ** i))\r\nprint(res % (10 ** 9 + 7))", "lang": "PyPy 3", "bug_code_uid": "5f9db1a47f85e8087435da6c5bc217a7", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "dc96e8c8200b01bf010496e2f389adf2", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9169435215946844, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "m = int(input())\n\narr= [0 for i in range(m)]\narr[0] = 6\n\nfor i in range(1,m):\n arr[i] = (8*arr[i-1]*arr[i-1])//3\n\nprint(arr[-1]%1000000007)\n", "lang": "PyPy 3", "bug_code_uid": "401fb274711bde1c9deb592a10910386", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "0d9d3daebe08bc942fa471352345bfcd", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6721044045676998, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "def pow(a,b):\r\n if b==0:\r\n return 1\r\n if b==1:\r\n return a\r\n power = pow(a,b//2)\r\n power*=power\r\n if b%2==1:\r\n power*=a\r\n return power\r\ndef rubiks_cube_coloring():\r\n print(6*(4**((pow(2,int(input()))-1)-1))%(10**9+7))\r\nrubiks_cube_coloring()\r\n", "lang": "Python 3", "bug_code_uid": "76fee474b0723fcbc762c16e18249e07", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "5d1d44ee82c1548238bdbd1746892a3a", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9272431846903774, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "from __future__ import division, print_function\r\nimport math\r\n\r\n\r\nimport os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n\r\nif sys.version_info[0] < 3:\r\n from __builtin__ import xrange as range\r\n from future_builtins import ascii, filter, hex, map, oct, zip\r\n\r\n\r\ndef main():\r\n pass\r\n\r\n\r\n# region fastio\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n\r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\ndef print(*args, **kwargs):\r\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\r\n sep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\r\n at_start = True\r\n for x in args:\r\n if not at_start:\r\n file.write(sep)\r\n file.write(str(x))\r\n at_start = False\r\n file.write(kwargs.pop(\"end\", \"\\n\"))\r\n if kwargs.pop(\"flush\", False):\r\n file.flush()\r\n\r\n\r\nif sys.version_info[0] < 3:\r\n sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\r\nelse:\r\n sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\n\r\n\r\ndef input(): return sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\n\r\nn = int(input().rstrip())\r\n\r\n\r\ndef prime(t1):\r\n if t1 == 1 and t1 == n:\r\n return 6\r\n elif t1 == n:\r\n return 4\r\n elif t1 == 1:\r\n return 6*prime(t1+1)*prime(t1+1)\r\n else:\r\n return 4*prime(t1+1)*prime(t1+1)\r\n\r\n\r\nres = prime(1)\r\nprint(res % (10**9 + 7))\r\n", "lang": "PyPy 2", "bug_code_uid": "0cc18af88d3b9ee747c5c33380c88a1a", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "aa1728433dd9d3df05346a3e16a0f5b1", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.922248159454121, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "from __future__ import division, print_function\r\nimport math\r\n\r\n\r\nimport os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n\r\nif sys.version_info[0] < 3:\r\n from __builtin__ import xrange as range\r\n from future_builtins import ascii, filter, hex, map, oct, zip\r\n\r\n\r\ndef main():\r\n pass\r\n\r\n\r\n# region fastio\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n\r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\ndef print(*args, **kwargs):\r\n \"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\r\n sep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\r\n at_start = True\r\n for x in args:\r\n if not at_start:\r\n file.write(sep)\r\n file.write(str(x))\r\n at_start = False\r\n file.write(kwargs.pop(\"end\", \"\\n\"))\r\n if kwargs.pop(\"flush\", False):\r\n file.flush()\r\n\r\n\r\nif sys.version_info[0] < 3:\r\n sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\r\nelse:\r\n sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\n\r\n\r\ndef input(): return sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\n\r\nn = int(input().rstrip())\r\n\r\nlist1 = {}\r\n\r\n\r\ndef prime(t1):\r\n if t1 == 1 and t1 == n:\r\n return 6\r\n elif t1 == n:\r\n return 4\r\n elif t1 == 1:\r\n t2 = prime(t1+1)\r\n return 6*t2*t2\r\n else:\r\n t2 = prime(t1+1)\r\n return 4*t2*t2\r\n\r\n\r\nres = prime(1)\r\nprint(res % (10**9 + 7))\r\n", "lang": "PyPy 2", "bug_code_uid": "61623f21aebc6e298f8c6bff0cb523f6", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "apr_id": "aa1728433dd9d3df05346a3e16a0f5b1", "difficulty": 1300, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9858203916272789, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\r\nsz = len(str(n))\r\ndef get(x):\r\n ans = 0\r\n nw = 1\r\n x1 = x\r\n for i in range(sz):\r\n x = x1\r\n if x < nw:\r\n while x < nw: x *= 10\r\n x -= 1 #\u0442\u043a \u0441\u0443\u043a\u0430 [1;x)\r\n else:\r\n while x >= nw * 10: x //= 10\r\n x = min(x, n)\r\n ans += x - nw + 1\r\n nw *= 10\r\n return ans\r\n\r\n\r\nMOD = 998244353\r\n\r\nans = 0\r\ni = 1\r\nwhile i <= n:\r\n l = i\r\n r = min(n, 10 ** (len(str(i))) - 1) + 1\r\n nw = (get(i) - i) // MOD\r\n while r - l > 1:\r\n mid = (l + r) // 2\r\n x = (get(mid) - mid) // MOD\r\n if nw == x:\r\n l = mid\r\n else:\r\n r = mid\r\n ans += nw * (r - i)\r\n # i += 1\r\n i = r\r\nprint(ans * -MOD)\r\n", "lang": "PyPy 3", "bug_code_uid": "177b440ef2d6a394c5161ba7dee700f7", "src_uid": "2c70ae38f91ab739621a31b897b8fbf3", "apr_id": "1ca56ef08b67fce95f4ebf804f33a705", "difficulty": 3400, "tags": ["meet-in-the-middle", "math", "dfs and similar", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.948073701842546, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": " # n = int(input())\r\n x1, x2 = map(int, input().split())\r\n y1, y2 = map(int, input().split())\r\n # arr= list(map(int, input().split()))\r\n # output_arr =[]\r\n if x1+x2+y1+y2==4:\r\n print(2)\r\n elif x1+x2+y1+y2==0:\r\n print(0)\r\n else:\r\n print(1)", "lang": "PyPy 3", "bug_code_uid": "7434a74a4dbd43ac8ea0ef83387d2f3c", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "ea509f405505c0782298f48437a98eef", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7550047664442326, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "t= int(input(''))\r\nfor i in range(t):\r\n nums= []\r\n a= input('').rsplit()\r\n b= input('').rsplit()\r\n \r\n #print(a,b)\r\n nums.extend(a)\r\n nums.extend(b)\r\n if set(nums) == {'0'}:\r\n print(0)\r\n elif (set(nums[0:2]) == {'0'} or set(nums[2:]) == {'0'} ) or nums == ['1' ,'0' ,'0', '1'] or nums == ['0','1','1','0'] or nums == ['1','0','1','0'] or nums == ['0','1','0','1']: \r\n print(1)\r\n else:", "lang": "Python 3", "bug_code_uid": "30dd84587dbb4a644a46e4dab1e4a176", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "apr_id": "75ecf95337e34e2c53732183ce66bbcc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.24730409777138748, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "# from bisect import bisect_left\r\nimport heapq\r\nimport os\r\nfrom collections import deque\r\n\r\nimport io\r\n\r\n# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\r\n\r\nTC = int(input())\r\n\r\na_ord = ord('a')\r\n\r\nfor tc in range(TC):\r\n N, M, K = map(int, input().split())\r\n\r\n if N % 2 == 1:\r\n if K < M // 2:\r\n print('NO')\r\n continue\r\n else:\r\n K -= M // 2\r\n N -= 1\r\n\r\n while K >= N:\r\n K -= N\r\n M -= 2\r\n\r\n if K > 0 and M < 2:\r\n print('NO')\r\n continue\r\n\r\n if K % 2 == 0:\r\n print('YES')\r\n continue\r\n else:\r\n print('NO')\r\n continue\r\n\r\n", "lang": "PyPy 3", "bug_code_uid": "186a087e3fef9f7080b9d7b076adc7db", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "ddaef4f42ddef82a3ed76966aff7bf5c", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.579002079002079, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "import sys\r\ninput = lambda:sys.stdin.readline().rstrip()\r\n\r\nT = int(input())\r\n\r\n# keys = values of coin\r\n# d = depth\r\n# val = target value to make with coins\r\n# cnt = number of coin left\r\ndef dfs(keys, d, val, cnt):\r\n if d == len(keys): return False\r\n key = keys[d]\r\n for c in range(cnt+1):\r\n if val - key*c < 0:\r\n return False\r\n elif val - key*c == 0 and cnt-c == 0:\r\n return True\r\n else:\r\n if d == len(keys):\r\n return False\r\n else:\r\n if dfs(keys, d+1, val - key*c, cnt-c): return True\r\n\r\n\r\n\r\nfor _ in range(T):\r\n n, m, k = map(int, input().split())\r\n if n%2 == 0 and m%2 == 0:\r\n if k%2 == 0:\r\n print('YES')\r\n else:\r\n print('NO')\r\n else:\r\n if m%2 == 0:\r\n n, m = m, n\r\n else:\r\n k = (n*m)//2 - k\r\n keys = [v for v in range(1, m+1, 2)]\r\n total = 0\r\n\r\n if dfs(keys, 0, k, n//2):\r\n print('YES')\r\n else:\r\n print('NO')\r\n", "lang": "PyPy 3", "bug_code_uid": "c3f8174f6b7700c82b604afbfe414c82", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "apr_id": "b5515a9d8bcf2487a686ee672b87b221", "difficulty": 1700, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19631901840490798, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "n=int(input()):\r\nif(n<=1200):\r\n print('1200')\r\nelif(n<=1400):\r\n print('1400')\r\nelif(n<=1600):\r\n print('1600')\r\nelif(n<=1800):\r\n print('1800')\r\nelif(n<=2000):\r\n print('2000')\r\nelif(n<=2200):\r\n print('2200')\r\nelif(n<=2400):\r\n print('2400')\r\nelif(n<=2600):\r\n print('2600')\r\nelif(n<=2800):\r\n print('2800')\r\nelse:\r\n print('3000')\r\n\r\n\r\n", "lang": "Python 3", "bug_code_uid": "bc8021f57e40b95b8d5409b65d81c26c", "src_uid": "22725effa6dc68b9c2a499d148e613c2", "apr_id": "071f0f49b713d0e44cfdff82222d5b4f", "difficulty": -1, "tags": ["divide and conquer", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9745454545454545, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = [1200, 1400, 1600, 1900, 2100, 2300, 2400, 2600, 3000]\r\nr = int(input())\r\nfor i in a:\r\n if i > r:\r\n print(i)\r\n return", "lang": "Python 3", "bug_code_uid": "a8cd2d7a2e03778a56e58cf69b9029d2", "src_uid": "22725effa6dc68b9c2a499d148e613c2", "apr_id": "89d4cece314a8d4f08229b568b7c9982", "difficulty": -1, "tags": ["divide and conquer", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.997716894977169, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = input()\r\nif len(a) == 4:\r\n print(\"none\")\r\nelse:\r\n d = {\r\n 3: \"the\",\r\n 5: \"buffy\",\r\n 6: \"slayer\",\r\n 7: \"vampire\"\r\n }\r\n\r\n x = d[len(a)]\r\n\r\n # x = \"vampire\"\r\n xi = [ord(i) - ord('a') for i in x]\r\n print(f\"xi = {xi}\")\r\n\r\n out = list(a)\r\n for i in range(len(out)):\r\n out[i] = (ord(out[i]) - ord('a') + xi[i])%26\r\n \r\n print(\"\".join([chr(ord('a')+ y) for y in out]))\r\n", "lang": "Python 3", "bug_code_uid": "013ad5befef3b128a5f0564e0b74026c", "src_uid": "56ec50526a3843fe3784d395850f45ae", "apr_id": "f9eb0fc4ec7291c73e4a3b0aee158a98", "difficulty": -1, "tags": ["strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9984, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = input().strip()\r\nwords = [\"\",\"\",\"\",\"the\",\"\",\"buffy\",\"slayer\",\"vampire\"]\r\nif len(s)==4:\r\n print(\"none\")\r\nelse:\r\n target = words[len(s)]\r\n ans = \"\"\r\n for i in range(len(s)):\r\n a = ord(s[i])-ord('a')\r\n b = ord(target[i])-ord('a')\r\n ans += chr((a+b)%26 + ord('a'))\r\n print(ans", "lang": "Python 3", "bug_code_uid": "bcc321890a705cb0b866606555b2e6b6", "src_uid": "56ec50526a3843fe3784d395850f45ae", "apr_id": "e38ce0dd5fe6687c8b0804d783b63fe5", "difficulty": -1, "tags": ["strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9971181556195965, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import random\r\nn = int(input())\r\nfor i in range(0,n):\r\n s = input()\r\nval = random.randint(0,1)\r\nif val == 1:\r\n print(\"YES\")\r\nelse:\r\n print(\"NO\")\r\n \r\n \r\n ", "lang": "Python 3", "bug_code_uid": "e78011d2b585f92b931a99584f7aca37", "src_uid": "efb72baf6759f7bc5ac0f3099b7177d0", "apr_id": "566f325be7a5ae0ec14bd9b5cbefd1d6", "difficulty": -1, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3205268935236004, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "n = int(input())\r\n\r\nw = 'minotaur'\r\n\r\ngood = True\r\nboard = []\r\nfor _ in range(n):\r\n board.append(input().strip())\r\n\r\nfor s in board:\r\n if w in s:\r\n good = False\r\n\r\nfor i in range(n):\r\n t = ''.join(s[j][i] for j in range(n))\r\n if w in t:\r\n good = False\r\n\r\n\r\nif good:\r\n print('YES')\r\nelse:\r\n print('NO')\r\n", "lang": "PyPy 3", "bug_code_uid": "26ae62a246df554bcc5566dae728f4e7", "src_uid": "efb72baf6759f7bc5ac0f3099b7177d0", "apr_id": "ab37d866592a406ac7aef50cc955b155", "difficulty": -1, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9897915780518928, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "import os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n \r\nBUFSIZE = 8192\r\n \r\n \r\nclass FastIO(IOBase):\r\n newlines = 0\r\n \r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n \r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n \r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n \r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n \r\n \r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n \r\n \r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n#######################################\r\n# #######\r\n # #\r\n #######\r\n # #\r\n # # \r\n # # Rahul Kaushik.2.0 #\r\n\r\n \r\n \r\nfor i in range(1):\r\n n,m=map(int,input().split())\r\n dp=[0]*(n+1)\r\n s=[0]*(n+2)\r\n dp[n]=1\r\n \r\n s[n]=1\r\n for i in range(n-1,0,-1):\r\n dp[i]=s[i+1]\r\n j=2\r\n while i*j<=n:\r\n if (i+1)*j-1<=n:\r\n dp[i]+=s[j*i]-s[(i+1)*(j)]\r\n else:\r\n dp[i]+=s[j*i]\r\n j+=1\r\n s[i]+=s[i+1]+dp[i]\r\n \r\n print(dp[1]%m)\r\n ", "lang": "PyPy 3", "bug_code_uid": "9519362299942a1f12d5f7ecf10d30a0", "src_uid": "a524aa54e83fd0223489a19531bf0e79", "apr_id": "4052e83e6a293194baca66995f7e0a19", "difficulty": 1700, "tags": ["dp", "number theory", "data structures", "math", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.87279843444227, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "# Legends Always Come Up with Solution\r\n# Author: Manvir Singh\r\n\r\nimport os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n\r\ndef main():\r\n n, m = map(int, input().split())\r\n dp = [0] * (n + 1)\r\n dp[1] = 1\r\n su = 1\r\n for i in range(2, n + 1):\r\n dp[i] = su\r\n j = 2\r\n while j < i:\r\n z = i // j\r\n y = (i + z - 1) // z\r\n f = (y == j)\r\n dp[i] = (dp[i] + dp[z] * (y - j + f)) % m\r\n j = y + f\r\n dp[i] = (dp[i] + dp[i // j]) % m\r\n su = (su + dp[i]) % m\r\n print(dp[-1])\r\n\r\n\r\n# FASTIO REGION\r\n\r\nBUFSIZE = 8192\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n\r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\nif __name__ == \"__main__\":\r\n main()", "lang": "PyPy 3", "bug_code_uid": "acf84ff515d82a76b5d8f6119b13a138", "src_uid": "a524aa54e83fd0223489a19531bf0e79", "apr_id": "c7a1ca1aabe8de67a89c5f9abfbe4fe1", "difficulty": 1700, "tags": ["dp", "number theory", "data structures", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3297644539614561, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "from sys import stdin\r\ninput = stdin.readline\r\n\r\ndef add(x , y):return ((x%mod) + (y%mod))%mod \r\n\r\n\r\ndef answer():\r\n\r\n dp = [0]*(n + 1)\r\n prefix = [0]*(n + 2)\r\n\r\n #st = segtree(n)\r\n\r\n dp[n] = 1\r\n\r\n for i in range(n , 0 , -1):\r\n\r\n prefix[i] = prefix[i + 1]\r\n\r\n dp[i] = add(dp[i] , prefix[i])\r\n\r\n\r\n for k in range(2*i , n + 1):\r\n if((k//2) < i):break\r\n \r\n for j in range(2 , k + 1):\r\n\r\n if((k//j) == i):dp[i] = add(dp[i] , dp[k])\r\n if((k//j) < i):break\r\n\r\n \r\n prefix[i] = add(prefix[i] , dp[i])\r\n\r\n return dp[1]\r\n\r\n \r\n \r\n\r\nfor T in range(1):\r\n\r\n n , mod = map(int,input().split())\r\n\r\n print(answer())\r\n", "lang": "PyPy 3", "bug_code_uid": "bad99eef87f13b6fc6e2264e8ef96aae", "src_uid": "a524aa54e83fd0223489a19531bf0e79", "apr_id": "d8ceeb0d4bf74951c312e27360484eb4", "difficulty": 1700, "tags": ["dp", "number theory", "data structures", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9645390070921985, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "s = input()\r\n\r\nwhile len(s)>1:\r\n s = str(map(int, s))\r\n\r\nprint(s)", "lang": "PyPy 3", "bug_code_uid": "038546d908cbe20aabdca778d1a3f3b5", "src_uid": "477a67877367dc68b3bf5143120ff45d", "apr_id": "b590188dd85461dbfd9926be7d1a00da", "difficulty": 1600, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.592, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\r\nk = 0\r\nwhile(n > 0):\r\n k += n%10\r\n n//10\r\nprint(k)", "lang": "PyPy 3", "bug_code_uid": "bb10dff304f8d330d2e2cfbfaaa80732", "src_uid": "477a67877367dc68b3bf5143120ff45d", "apr_id": "26ba96465be372fda8a7c9e022f99741", "difficulty": 1600, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4065934065934066, "equal_cnt": 23, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 24, "bug_source_code": "l = list(map(int,input().split()))\r\nN = l[0]\r\nM = l[1]\r\n\r\nif M == 0:\r\n return 'YES'\r\n\r\nnum = int(N//M)\r\n\r\n\r\nif num%2 == 0:\r\n print('YES')\r\nelse:\r\n print('NO')", "lang": "Python 3", "bug_code_uid": "2e90a5ee5b84c09cda37bc596298f339", "src_uid": "a8945bb1082fefe70e6898a8bec1ce3f", "apr_id": "1e415641aadd1eea270583f033a623e6", "difficulty": 1800, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9969604863221885, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# coding: utf-8\r\n\r\nn, m = map(int, input().split())\r\na = list()\r\n\r\nwhile n:\r\n a.append(n % m)\r\n n // m\r\n \r\nprint('YES') if len(a) == len(set(a)) else print('NO')", "lang": "PyPy 3", "bug_code_uid": "53ad6392f815ec4c1126730c7edb7ca2", "src_uid": "a8945bb1082fefe70e6898a8bec1ce3f", "apr_id": "e3792b997a03c6329184e96075c2f10f", "difficulty": 1800, "tags": ["number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.48034934497816595, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "from collections import Counter\r\n# from sys import stdout, stdin\r\n# inputc = stdin.readline\r\n# printc = stdout.write\r\ndef main():\r\n n = int(input())\r\n print(n)\r\n\r\n\r\n\r\n\r\nif __name__ == '__main__':\r\n print(main())", "lang": "Python 3", "bug_code_uid": "9c8b9e9df497ac2d75260ce751f3cc31", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "4cd57491062d050f1443f656aa1622f6", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6181818181818182, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\r\nprint(1-n**2)", "lang": "Python 3", "bug_code_uid": "bdb84a4edc9ec285109df7fcfce6ca11", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "db4d65651441f075a9963a1d7438be15", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9032258064516129, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = int(input())\r\nprint(2**a)", "lang": "Python 3", "bug_code_uid": "f7b98d8b16000ac3bcfadfbbc68f7d3c", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "b7642d0947820027a45ca43049dfab74", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9454545454545454, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=int(input()\r\nprint(2-a*a)", "lang": "PyPy 3", "bug_code_uid": "5f82997bc5bcda2f8c2d16970134c0cb", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "a0dd98049f367ad422d27b1bcb8d32ca", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9090909090909091, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "print(2-int(input())", "lang": "PyPy 3", "bug_code_uid": "0e05cb50cb3021ef1b9a3e5439183854", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "ff81bc95634358420d5c73fa53278f06", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9556548642145067, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import statistics\r\nimport math\r\nimport datetime\r\nimport collections\r\n\r\n\r\n__author__ = \"Bizzozz\u00e9ro Nicolas\"\r\n__contact__ = \"nicolasbizzozzero[at]gmail.com\"\r\n__copyright__ = \"Copyright YYYY, Bizzozz\u00e9ro Nicolas\"\r\n__date__ = \"YYYY/MM/DD\"\r\n__license__ = \"GPLv3\"\r\n\r\n\r\ndef identity(*args):\r\n \"\"\" Always returns the same value that was used as its argument.\r\n Example:\r\n >>> identity(1)\r\n 1\r\n >>> identity(1, 2)\r\n (1, 2)\r\n \"\"\"\r\n if len(args) == 1:\r\n return args[0]\r\n return args\r\n\r\n\r\ndef parsin(*, l=1, vpl=1, cf=identity, s=\" \"):\r\n \"\"\" Can parse inputs usually used in competitive programming problems.\r\n Arguments:\r\n - l, as in \"Lines\", the number of lines to parse at once.\r\n - vpl, as in \"Values Per Line\", the number of values to parse per line.\r\n - cf, as in \"Cast Function\", the function to apply to each parsed element.\r\n - s, as in \"Separator\", the string separating multiple values in the same\r\n line.\r\n \"\"\"\r\n if l == 1:\r\n if vpl == 1:\r\n return cf(input())\r\n else:\r\n return list(map(cf, input().split(s)))\r\n else:\r\n if vpl == 1:\r\n return [cf(input()) for _ in range(l)]\r\n else:\r\n return [list(map(cf, input().split(s)))\r\n for _ in range(l)]\r\n\r\n\r\ndef main():\r\n pass\r\n\r\n\r\nif __name__ == '__main__':\r\n main()\r\n a = int(input(\"n ? \"))\r\n print(a)\r\n \r\n \r\n", "lang": "PyPy 3", "bug_code_uid": "21ed714aea6d053b6a92e40bf2d083dd", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "f7f8c0688a753427fc4b352d91560550", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8740740740740741, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "x = input()\r\nif x >= 0:\r\n print -x + 1\r\nelse:\r\n print 'what'", "lang": "PyPy 2", "bug_code_uid": "5d7df50c2121f162045da557c0cb9eeb", "src_uid": "f76005f888df46dac38b0f159ca04d5f", "apr_id": "1d959e3d00a7306ad42fabb67afefd64", "difficulty": 2200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9114631873252563, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "h,w = map(int,input().split(' '))\r\nprint(h,w)\r\ns=[]\r\nfor i in range(h):\r\n s.append(input())\r\nprint(len(s))\r\ni=0\r\nj=0\r\nc=0\r\nwhile(i= w - 1:\r\n l + 1\r\n else:\r\n r += 1\r\nprint(ans)", "lang": "Python 3", "bug_code_uid": "1d29e80d4260c8d6c15ead6331d28a92", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "2d2d87f13e209b8c507d0add0971394c", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8976497346474602, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "h, w = [int(x) for x in input().split()]\r\n\r\n\r\ngrid = {(x, y): v for y in range(h) for x, v in enumerate(input())}\r\n\r\n\r\ndef find_next(grid, pos):\r\n current = [pos]\r\n while len(current) > 0:\r\n pos = current.pop(0)\r\n np = [(pos[0] + d[0], pos[1] + d[1]) for d in [(1, 0), (0, 1)]]\r\n for x in np:\r\n v = grid.get(x)\r\n if v == '*':\r\n return x\r\n if v == \".\":\r\n current.append(x)\r\n return None\r\n\r\n\r\nb = 0\r\npos = (0, 0)\r\nwhile True:\r\n\r\n pos = find_next(grid, pos)\r\n if pos is None:\r\n break\r\n b += 1\r\n\r\nprint(b)\r\n# print(route(grid, (0, 0), 0, [(0, 0)]))\r\n", "lang": "Python 3", "bug_code_uid": "219fd33871b24b39ef95fb074501e55a", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "b98a9765a03476e5a38343b170bb0d8e", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9773030707610146, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "h, w = map(int,input().split())\r\n\r\ncake = []\r\nscore = 0\r\n\r\nfor i in range(h):\r\n cake.append(input())\r\n\r\ni, j = 0, 0\r\nwhile i < h and j < w:\r\n if cake[i][j] == '*': \r\n score += 1\r\n if (i+1 < h and cake[i+1][j] == '*'):\r\n i += 1\r\n else:\r\n if(j+1 < w):\r\n j += 1\r\n else: \r\n i += 1\r\n\r\nprint(cake)\r\n\r\nprint(score)\r\n\r\n\r\n\r\n\r\n ", "lang": "Python 3", "bug_code_uid": "259799874bfe8469fdf2879a638cdfc8", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "ec9455d905a6a1243c8bd48f8487fe20", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.05069124423963134, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "import random\r\n\r\nprint(random.choice([1,2,3]))", "lang": "Python 3", "bug_code_uid": "982ba701cf6cbaf4ac6de1bff6be10e4", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "9be118081cdaf91e2a9230fef49a95e8", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9986130374479889, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a, b = map(int, input().split())\r\n\r\ncake = []\r\n\r\nfor _ in range(a):\r\n\tcake.append([x for x in input()])\r\n\r\ncount = 0\r\nx, y = 0, 0\r\n\r\nwhile x < b and y < a:\r\n\tif cake[y][x] == \"*\":\r\n\t\tcount += 1\r\n\tif x < b-1 and cake[y][x+1] == \"*\"\r\n\t\tx += 1\r\n\telif y < a-1 and cake[y+1][x] == \"*\":\r\n\t\ty += 1\r\n\telse:\r\n\t\tx += 1\r\n\t\tif x == b:\r\n\t\t\tx -= 1\r\n\t\t\ty += 1\r\n\r\nprint(count)", "lang": "PyPy 3", "bug_code_uid": "14785c028e133305304ff3a0377d6a0b", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "493a276a0a23491ef9a37140b1e734a1", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5496009122006842, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a, b = map(int, input().split())\r\n\r\ncake = []\r\n\r\nfor _ in range(a):\r\n\tcake.append([x for x in input()])\r\n\r\ncount = 0\r\nx, y = 0, 0\r\n\r\nright = True\r\nwhile x < b and y < a:\r\n\tif cake[y][x] == \"*\":\r\n\t\tcount += 1\r\n\t\tright = not right\r\n\tif not right:\r\n\t\ty += 1\r\n\t\tif y == a:\r\n\t\t\tright = not right\r\n\t\t\ty -= 1\r\n\t\t\tx += 1\r\n\telse:\r\n\t\tx += 1\r\n\t\tif x == b:\r\n\t\t\tright = not right\r\n\t\t\tx -= 1\r\n\t\t\ty += 1\r\n\r\n'''\r\n\t\ty += 1\r\n\t\tif y == a:\r\n\t\t\ty -= 1\r\n\t\t\tx += 1\r\n\telse:\r\n\t\tx += 1\r\n\t\tif x == b:\r\n\t\t\tx -= 1\r\n\t\t\ty += 1\r\n'''\r\n\r\nprint(count)", "lang": "PyPy 3", "bug_code_uid": "c8d4b312fbb98f3d48aa59ad2910b74a", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "493a276a0a23491ef9a37140b1e734a1", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3843843843843844, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n, m = map(int, input().split())\na = [input() for _ in range(n)]\n\nans = 0\nj = 0\nfor i in range(n):\n\tif j < m and a[i][j] == \"*\":\n\t\tans += 1\n\twhile \"*\" in a[i][j + 1:]:\n\t\tj = a[i].index(\"*\", j + 1)\n\t\tans += 1\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "5d494d5cf99398f61c792a5b955f98fc", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "20ca4097a81e1fd928b4fcf882699f87", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.997134670487106, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "s = []\r\nn, m = map(int, input().split())\r\nfor i in range(n):\r\n\ts.append(input())\r\nx, y = 0, 0\r\nz = 0\r\nif s[x][y] == '*':\r\n\tz += 1\r\nwhile x < n - 1 or y < m - 1:\r\n\tif x == n - 1:\r\n\t\ty += 1\r\n\telif y == m - 1:\r\n\t\tx += 1\r\n\telif s[x][y + 1] == '*':\r\n\t\ty += 1\r\n\telif s[x + 1][y] == '*':\r\n\t\tx += 1\r\n\telse:\r\n\t\tx += 1\r\n\tif s[x][y] == '*':\r\n\t\tz += 1\r\nprint(z)", "lang": "PyPy 3", "bug_code_uid": "a5d6c4dbc18234dc03e5174f6b6a3c2f", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "1029cc2c000292b7d5d76b01f014b048", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8515476942514214, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import sys\ntesting = len(sys.argv) == 4 and sys.argv[3] == \"myTest\"\nif testing:\n cmd = sys.stdout\n from time import time\n start_time = int(round(time() * 1000)) \n readAll = open(sys.argv[1], 'r').read\n sys.stdout = open(sys.argv[2], 'w')\nelse:\n readAll = sys.stdin.read\n\n# ############ ---- I/O Functions ---- ############\n\nflush = sys.stdout.flush\nclass InputData:\n def __init__(self):\n self.lines = readAll().split('\\n')\n self.n = len(self.lines)\n self.ii = -1\n def input(self):\n self.ii += 1\n assert self.ii < self.n\n return self.lines[self.ii]\ninputData = InputData()\ninput = inputData.input\n\ndef intin():\n return(int(input()))\ndef intlin():\n return(list(map(int,input().split())))\ndef chrin():\n return(list(input()))\ndef strin():\n return input()\ndef lout(l, sep=\"\\n\", toStr=True):\n print(sep.join(map(str, l) if toStr else l))\ndef dout(*args, **kargs):\n if not testing: return\n if args: print(args[0] if len(args)==1 else args)\n if kargs: print([(k,v) for k,v in kargs.items()])\n \n# ############ ---- I/O Functions ---- ############\n\n# from math import ceil\n# from collections import defaultdict as ddict, Counter\n# from heapq import *\n# from Queue import Queue\n\nprint(1)\n\nif testing:\n sys.stdout = cmd\n print(int(round(time() * 1000)) - start_time)", "lang": "PyPy 2", "bug_code_uid": "edc0f302b576a44a12f9d27cd1de25c8", "src_uid": "f985d7a6e7650a9b855a4cef26fd9b0d", "apr_id": "0876ab07e8b20285b6784e3df52da245", "difficulty": 1800, "tags": ["implementation", "greedy", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.026359143327841845, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "print(\"fool\")", "lang": "Python 3", "bug_code_uid": "1a058cc9b5b87f9da65eb062e4771f37", "src_uid": "a3603f5ed0d8bdb7fe829342991b78e6", "apr_id": "13a1fed02657c9763fc8c255450e5c98", "difficulty": 2600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9888776541961577, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\ndef translateinput(i):\n\treturn bitbraichar[input().replace(' ','')]\n\nbitbraichar = {\n\t'10010':'a',\n\t'11020':'b',\n\t'20011':'c',\n\t'21012':'d',\n\t'11011':'e',\n\t'21021':'f',\n\t'22022':'g',\n\t'12021':'h',\n\t'12012':'j',\n\t'10120':'k',\n\t'11130':'l',\n\t'20121':'m',\n\t'21122':'n',\n\t'11121':'o',\n\t'21131':'p',\n\t'22132':'q',\n\t'12131':'r',\n\t'12122':'t',\n\t'10221':'u',\n\t'11231':'v',\n\t'12113':'w',\n\t'20222':'x',\n\t'21223':'y',\n\t'11222':'z'\n}\n\nn = int(input())\n\nfor i in map(translateinput,range(n)):\n\tprint(i)\n", "lang": "Python 3", "bug_code_uid": "bc486ef76ec4ff0286396f89dfe70016", "src_uid": "a3603f5ed0d8bdb7fe829342991b78e6", "apr_id": "92b20ea9c837653fa4df3ae2d558fbf1", "difficulty": 2600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9981412639405205, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "braille = [[\"a\", \"1\"],\n [\"b\", \"12\"],\n [\"c\", \"14\"],\n [\"d\", \"145\"],\n [\"e\", \"15\"],\n [\"f\", \"124\"],\n [\"g\", \"1245\"],\n [\"h\", \"125\"],\n [\"i\", \"24\"],\n [\"j\", \"245\"],\n [\"k\", \"13\"],\n [\"l\", \"123\"],\n [\"m\", \"134\"],\n [\"n\", \"1345\"],\n [\"o\", \"135\"],\n [\"p\", \"1234\"],\n [\"q\", \"12345\"],\n [\"r\", \"1235\"],\n [\"s\", \"234\"],\n [\"t\", \"2345\"],\n [\"u\", \"136\"],\n [\"v\", \"1236\"],\n [\"w\", \"2456\"],\n [\"x\", \"1346\"],\n [\"y\", \"13456\"],\n [\"z\", \"1356\"]]\n\ndecoded = {}\nfor ch, enc in braille:\n final = [0] * 5\n \n for idx in enc:\n idx = ord(idx) - ord('1')\n r = idx % 3\n c = idx //3\n \n final[r] += 1\n final[c+3] += 1\n\n if tuple(final) not in decoded:\n decoded[tuple(final)] = ch\n\nn = int(input())\nans = \"\"\n\nfor i in range(n):\n a, b, c, d, e = map(int, input().split())\n ans += decoded[a,b,c,d,e]\n print(ans)\n", "lang": "Python 3", "bug_code_uid": "e04b10d02e6f25bfec9238a5c99cbff4", "src_uid": "a3603f5ed0d8bdb7fe829342991b78e6", "apr_id": "5eb63daf1082e7365bfa3c854e52510f", "difficulty": 2600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.04487179487179487, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "q={ (1,0,0,1,0):'a',\r\n (1,1,0,2,1):'b',\r\n (2,0,0,1,1):'c',\r\n (2,1,0,1,2):'d',\r\n (1,1,0,1,1):'e',\r\n (2,1,0,2,1):'f',\r\n (2,2,0,2,2):'g',\r\n (1,2,0,2,1):'h',\r\n (1,1,0,1,1):'i',\r\n (1,1,0,1,1):'j',\r\n (1,0,1,2,0):'k',\r\n (1,1,1,3,0):'l',\r\n (2,0,1,2,1):'m',\r\n (2,1,1,2,2):'n',\r\n (1,1,1,2,1):'o',\r\n (2,2,1,3,2):'p',\r\n (1,2,1,3,1):'r',\r\n (1,1,1,2,1):'s',\r\n (1,2,1,2,2):'t',\r\n (1,0,2,2,1):'u',\r\n (1,1,2,3,1):'v',\r\n (2,0,2,2,2):'x',\r\n (1,1,2,2,3):'y',\r\n (1,1,2,2,2):'z',\r\n (1,2,1,1,3):'w'\r\n\r\n}\r\nr=''\r\nfor i in range(int(input())): r+=q[tuple(map(int,input().split()))]\r\nprint(r)", "lang": "PyPy 3", "bug_code_uid": "15e125149d8c309c5d15118d16934706", "src_uid": "a3603f5ed0d8bdb7fe829342991b78e6", "apr_id": "ef96d40d79150faeb62029dfb030c68d", "difficulty": 2600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9817823732151649, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "\nt = {\n 1: 0,\n 5: 1,\n 3: 2,\n 11: 3,\n 9: 4,\n 7: 5,\n 15: 6,\n 13: 7,\n # 6: 8,\n 14: 9,\n\n 1 + 16: 10,\n 5 + 16: 11,\n 3 + 16: 12,\n 11 + 16: 13,\n 9 + 16: 14,\n 7 + 16: 15,\n 15 + 16: 16,\n 13 + 16: 17,\n # 6 + 16: 18,\n 14 + 16: 19,\n\n 1 + 48: 20,\n 5 + 48: 21,\n 3 + 48: 23,\n 11 + 48: 24,\n 9 + 48: 25,\n \n 46: 22,\n}\n\ndef c(v, h, n):\n return v == [\n bool(n&(1<<0)) + bool(n&(1<<1)),\n bool(n&(1<<2)) + bool(n&(1<<3)),\n bool(n&(1<<4)) + bool(n&(1<<5)),\n ] and h == [\n bool(n&(1<<0)) + bool(n&(1<<2)) + bool(n&(1<<4)),\n bool(n&(1<<1)) + bool(n&(1<<3)) + bool(n&(1<<5)),\n ]\n\ndef solve(s):\n s = [ord(c) - ord('0') for c in s]\n v = [s[0], s[2], s[4]]\n h = [s[6], s[8]]\n print(v, h)\n\n for n in range(64):\n if c(v, h, n) and n in t:\n print(n)\n break\n else:\n print('wtf')\n return chr(t[n] + ord('a'))\n\nn = int(input())\ns = ''\nfor _ in range(n):\n s += solve(input())\nprint(s)\n", "lang": "PyPy 3", "bug_code_uid": "a064bc3b7bde23ae4072e53e0a03b123", "src_uid": "a3603f5ed0d8bdb7fe829342991b78e6", "apr_id": "daf5e978bc75080084d22efd783ffd17", "difficulty": 2600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9805504587155963, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = input()\nn = len(s)\n\nvalid10 = {\"0\",\"2\",\"5\",\"7\"}\nvalid1 = {\"0\",\"5\"}\nif n < 2:\n if s == \"0\" or s == \"X\" or s == \"_\":\n print(\"1\")\n else:\n print(\"0\")\n exit(0)\n\nif n == 2:\n if s == \"__\":\n print(3)\n exit(0)\n elif s == \"_X\":\n print(3)\n exit(0)\n\nif s[0] == \"0\":\n print(0)\n exit(0)\n\nif s[n-2] not in valid10 and s[n-2] not in [\"X\",\"_\"]:\n print(\"0\")\n exit(0)\n\nif s[n-1] not in valid1 and s[n-1] not in [\"X\",\"_\"]:\n print(\"0\")\n exit(0)\n\nx = \"X\" in s\nzero = s[0] == \"X\"\n\nvalidX = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"}\nif zero:\n validX.remove(\"0\")\n\nans = 1\n\nfor i,c in enumerate(s[:-2]):\n if c == \"_\":\n if i == 0:\n ans *= 9\n else:\n ans *= 10\n \nif s[-2] in [\"2\",\"7\"] and s[-1] == \"X\":\n validX = validX.intersection({5})\nif s[-2] in [\"0\",\"5\"] and s[-1] == \"X\":\n validX = validX.intersection({0})\nif s[-1] == \"0\" and s[-2] == \"X\":\n validX = validX.intersection({\"0\",\"5\"})\nif s[-1] == \"5\" and s[-2] == \"X\":\n validX = validX.intersection({\"2\",\"7\"})\nif s[-2:] == \"XX\":\n validX = validX.intersection({\"0\"})\nif s[-2:] == \"X_\":\n validX = validX.intersection(valid10)\nif s[-2:] == \"_X\":\n validX = validX.intersection(valid1)\n ans *= 2\nif s[-2:] == \"__\":\n ans *= 4\n\nif x:\n ans *= len(validX)\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "af26b8653bf004c2482d9b849c26f7b4", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "2c16a70612accc9e1724e43718d1097a", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9932394366197184, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\r\ndef main():\r\n \r\n # n = 6\r\n # from random import randint\r\n # selection = '0123456789_X'\r\n # selection = '012579_X'\r\n # s = ''.join([selection[randint(0, len(selection) - 1)] for _ in range(n)])\r\n # if s[0] == '0':\r\n # return\r\n \r\n s = input()\r\n n = len(s)\r\n # print(s)\r\n \r\n if n == 1:\r\n if s in '0_X':\r\n print(1)\r\n else:\r\n print(0)\r\n return\r\n \r\n def canmatchlen2(s1, s2):\r\n for i in range(2):\r\n if s1[i] == '_' or s1[i] == s2[i]:\r\n continue\r\n else:\r\n return False\r\n return True\r\n \r\n def count(s): # with no 'X'\r\n if s == '0' * n:\r\n return 1\r\n if n > 1 and s[0] == '0': # illegal\r\n return 0\r\n # see if can make zzz00, zzz25, zzz50, or zzz75\r\n last2 = s[n - 2:]\r\n last2cnts = 0\r\n for s2 in ['00', '25', '50', '75']:\r\n if canmatchlen2(last2, s2):\r\n last2cnts += 1\r\n if n == 2:\r\n if canmatchlen2(last2, '00'):\r\n last2cnts -= 1\r\n return last2cnts\r\n # see how many different numbers can the rest make\r\n otherscnts = 1\r\n for i in range(n - 2):\r\n if s[i] == '_':\r\n if i == 0:\r\n otherscnts *= 9\r\n else:\r\n otherscnts *= 10\r\n return last2cnts * otherscnts\r\n \r\n ans = 0\r\n if 'X' in s:\r\n for x in [str(z) for z in range(10)]:\r\n ans += count(s.replace('X', x))\r\n else:\r\n ans = count(s)\r\n print(ans)\r\n \r\n # # naive\r\n # nans = 0\r\n # xindexes = []\r\n # for i in range(n):\r\n # if s[i] == 'X':\r\n # xindexes.append(i)\r\n # for i in range(int(1e8)):\r\n # s2 = str(i)\r\n # if len(s2) < n: continue\r\n # if len(s2) > n: break\r\n # if i % 25 == 0:\r\n # ok = True\r\n # for j in xindexes:\r\n # if s2[xindexes[0]] != s2[j]:\r\n # ok = False\r\n # for j in range(n):\r\n # if not (s[j] == '_' or s[j] == 'X' or s[j] == s2[j]):\r\n # ok = False\r\n # if ok:\r\n # nans += 1\r\n # print(nans)\r\n # if ans != nans:\r\n # print(s)\r\n \r\n return\r\n\r\nimport sys\r\n# input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)\r\ninput=lambda: sys.stdin.readline().rstrip(\"\\r\\n\") #FOR READING STRING/TEXT INPUTS.\r\n \r\ndef oneLineArrayPrint(arr):\r\n print(' '.join([str(x) for x in arr]))\r\ndef multiLineArrayPrint(arr):\r\n print('\\n'.join([str(x) for x in arr]))\r\ndef multiLineArrayOfArraysPrint(arr):\r\n print('\\n'.join([' '.join([str(x) for x in y]) for y in arr]))\r\n \r\ndef readIntArr():\r\n return [int(x) for x in input().split()]\r\n# def readFloatArr():\r\n# return [float(x) for x in input().split()]\r\n \r\ndef makeArr(defaultValFactory,dimensionArr): # eg. makeArr(lambda:0,[n,m])\r\n dv=defaultValFactory;da=dimensionArr\r\n if len(da)==1:return [dv() for _ in range(da[0])]\r\n else:return [makeArr(dv,da[1:]) for _ in range(da[0])]\r\n \r\ndef queryInteractive(a, b, c):\r\n print('? {} {} {}'.format(a, b, c))\r\n sys.stdout.flush()\r\n return int(input())\r\n \r\ndef answerInteractive(x1, x2):\r\n print('! {} {}'.format(x1, x2))\r\n sys.stdout.flush()\r\n \r\ninf=float('inf')\r\n# MOD=10**9+7\r\n# MOD=998244353\r\n \r\nfrom math import gcd,floor,ceil\r\nimport math\r\n# from math import floor,ceil # for Python2\r\n \r\nfor _abc in range(1):\r\n main()", "lang": "PyPy 3", "bug_code_uid": "db0918c4d0194e87b438e5a895ddf7ab", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "d2f771453fcc6ef619ea05e05a39aaa5", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9713725490196078, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s=input()\r\nk=[]\r\nif len(s)==1:\r\n if s=='_' or s=='X'or s=='0':print(1)\r\n else:print(0)\r\nelse:\r\n if s[0]=='0':print(0);exit()\r\n if s[-2]+s[-1]in ['25','50','75','00','XX','X_','_X','__', '2_','5_','7_','2X','5X','7X','X5','X0','_5','_0','0X','0_']and len(s)>2:k.append(1)\r\n elif s[-2]+s[-1]in ['25','50','75','XX','X_','_X','__', '2_','5_','7_','2X','5X','7X','X5','X0','_5','_0','0X','0_']:k.append(1)\r\n else:print(0);exit()\r\n \r\n if s[-2]=='0'and s[-1]=='_':\r\n s=s[:len(s)-2]+' '\r\n elif s[-2]=='0'and s[-1]=='X':\r\n if s[0]=='X':print(0);exit()\r\n else:s=s.replace('X',' ')\r\n \r\n if s[-1]=='X' and s[-2]=='X':\r\n if len(s)>2 and s[0]!='X':\r\n k.append(1);s=s.replace('X',' ')\r\n else:print(0);exit()\r\n elif s[-1]=='X':\r\n if s[-2]in['2','5','7']:k.append(1);s=s.replace('X',' ')\r\n elif s[-2]=='_':\r\n if len(s)>2 and s[0]!='X':\r\n k.append(4)\r\n s=s[:len(s)-2]+' '\r\n s=s.replace('X',' ')\r\n else:\r\n s=s[:len(s)-2]+' '\r\n k.append(3)\r\n s=s.replace('X',' ')\r\n elif s[-1]=='_':\r\n if s[-2]in['2','5','7']:k.append(1);s=s[:len(s)-1]+' '\r\n elif s[-2]=='_' or s[-2]=='X':\r\n if s[-2]=='_':\r\n if len(s)>2:\r\n k.append(4)\r\n s=s[:len(s)-2]+' '\r\n else:\r\n k.append(3)\r\n s=s[:len(s)-2]+' '\r\n elif s[-2]=='X':\r\n if len(s)>2 and s[0]!='X':\r\n k.append(4)\r\n s=s[:len(s)-2]+' '\r\n s=s.replace('X',' ')\r\n else:\r\n k.append(3)\r\n s=s[:len(s)-2]+' '\r\n s=s.replace('X',' ')\r\n if s[-2]=='_':\r\n if s[-1]=='0'and len(s)<3:k.append(1)\r\n else:k.append(2)\r\n s=s[:len(s)-2]+' '\r\n elif s[-2]=='X':\r\n s=s.replace('X',' ')\r\n if s[-1]=='0'and len(s)<3:k.append(1)\r\n else:k.append(2)\r\n for i in range(len(s)):\r\n ss=s[i]\r\n if ss=='_'and i!=0:k.append(10)\r\n elif ss=='_'and i==0:k.append(9)\r\n elif ss=='X'and i==0:k.append(9);s=s.replace('X',' ')\r\n elif ss=='X'and i!=0:k.append(10);s=s.replace('X',' ')\r\n if len(k)>0:\r\n print(eval('*'.join([str(i)for i in k])))\r\n else:print(0)\r\n \r\n \r\n \r\n", "lang": "PyPy 3", "bug_code_uid": "af1f0d31a17baec242ce9718628ae948", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "f1fbe274c19af6ac74f917c9eb8f480d", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.037815126050420166, "equal_cnt": 14, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "\r\n\r\n\r\nimport threading\r\nimport sys\r\ninput=sys.stdin.readline\r\nthreading.stack_size(10**8)\r\nsys.setrecursionlimit(10**7)\r\n \r\nfrom collections import defaultdict\r\n \r\ndef main():\r\n\ts = input()\r\n\tglobal res\r\n\tres = 0\r\n\t\r\n\t\r\n\tdef valid(x):\r\n\t if not x:\r\n\t return False\r\n\t if x[0] == '0' and len(x) > 1:\r\n\t return False\r\n\t if '_' in x:\r\n\t return False\r\n\t if 'X' in x:\r\n\t return False\r\n\t if not int(x) % 25:\r\n\t return True\r\n\t\r\n\t\r\n\tdef l_str(x):\r\n\t return ''.join(x)\r\n\t\r\n\t\r\n\tvis = set()\r\n\t\r\n\t\r\n\tdef dfs(x):\r\n\t global res\r\n\t if valid(x) and x not in vis:\r\n\t res += 1\r\n\t vis.add(x)\r\n\t if 'X' in x:\r\n\t xc = x\r\n\t for i in range(10):\r\n\t xc = x.replace('X', str(i))\r\n\t dfs(xc)\r\n\t else:\r\n\t x = list(x)\r\n\t for i in range(len(x)):\r\n\t if x[i] == '_':\r\n\t for j in range(10):\r\n\t x[i] = str(j)\r\n\t dfs(l_str(x))\r\n\t break\r\n\t\r\n\t\r\n\tdfs(s)\r\n\tprint(res)\r\n\t\r\n\r\nthreading.Thread(target=main).start() ", "lang": "PyPy 3", "bug_code_uid": "c7f9272f108b3c75e01bdd2289887786", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "089e0ab1d38cb813bb8c959ce637779a", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.04831751509922347, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "s = input()\r\nglobal res\r\nres = 0\r\n\r\n\r\ndef valid(x):\r\n if not x:\r\n return False\r\n if x[0] == '0' and len(x) > 1:\r\n return False\r\n if '_' in x:\r\n return False\r\n if 'X' in x:\r\n return False\r\n if not int(x) % 25:\r\n return True\r\n\r\n\r\ndef l_str(x):\r\n return ''.join(x)\r\n\r\n\r\nvis = set()\r\n\r\n\r\ndef dfs(x):\r\n global res\r\n if valid(x) and x not in vis:\r\n res += 1\r\n vis.add(x)\r\n if 'X' in x:\r\n xc = x\r\n for i in range(10):\r\n xc = x.replace('X', str(i))\r\n dfs(xc)\r\n else:\r\n x = list(x)\r\n for i in range(len(x)):\r\n if x[i] == '_':\r\n for j in range(10):\r\n x[i] = str(j)\r\n dfs(l_str(x))\r\n break\r\n\r\n\r\ndfs(s)\r\nprint(res)", "lang": "PyPy 3", "bug_code_uid": "5ae5052c84f25982eae7833b4272eac8", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "089e0ab1d38cb813bb8c959ce637779a", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9427521008403361, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import sys\r\nsys.setrecursionlimit(100000)\r\n \r\ndef _r(): return sys.stdin.buffer.readline()\r\ndef rs(): return _r().decode('ascii').strip()\r\ndef rn(): return int(_r())\r\ndef rnt(): return map(int, _r().split())\r\ndef rnl(): return list(rnt())\r\n\r\ndef solve(s):\r\n if len(s) == 1:\r\n return int(s in '0_X')\r\n def _solve(s):\r\n if s[0] == '0':\r\n return 0\r\n uc = s.count('_')\r\n xm = 10 if 'X' in s else 1\r\n return xm*10**uc if s[0] not in 'X_' else xm*10**uc//10*9\r\n l2 = s[-2:]\r\n if l2 in ('25', '50', '75', '00'):\r\n return _solve(s)\r\n elif l2 == 'XX':\r\n return _solve(s.replace('X', '0'))\r\n elif l2 == 'X5':\r\n return _solve(s.replace('X', '2')) + _solve(s.replace('X', '7'))\r\n elif l2 == 'X0':\r\n return _solve(s.replace('X', '5')) + _solve(s.replace('X', '0'))\r\n elif l2 == '2X' or l2 == '7X':\r\n return _solve(s.replace('X', '5'))\r\n elif l2 == '5X' or l2 == '0X':\r\n return _solve(s.replace('X', '0'))\r\n elif l2 == '__':\r\n return _solve(s[:-2] + '25') + _solve(s[:-2] + '50') + _solve(s[:-2] + '75') + _solve(s[:-2] + '00')\r\n elif l2 == '_5':\r\n return _solve(s[:-2] + '25') + _solve(s[:-2] + '75')\r\n elif l2 == '_0':\r\n return _solve(s[:-2] + '50') + _solve(s[:-2] + '00')\r\n elif l2 == '2_' or l2 == '7_':\r\n return _solve(s[:-1] + '5')\r\n elif l2 == '5_':\r\n return _solve(s[:-1] + '0')\r\n elif l2 == '_X' or l2 == 'X_':\r\n return _solve(s.replace('X', '0')[:-2] + '00') + _solve(s.replace('X', '0')[:-2] + '50') + _solve(s.replace('X', '5')[:-2] + '25') + _solve(s.replace('X', '5')[:-2] + '75')\r\n return 0\r\n\r\nprint(solve(rs()))\r\n \r\n# for _ in range(rn()):\r\n# n = rn()\r\n# edges = [rnt() for _ in range(n-1)]\r\n# print(solve(n, edges))", "lang": "PyPy 3", "bug_code_uid": "58da40a588e738aa166a3a1bb7e70528", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "e6c1e2af95cbc41d6b3a0dde095fb7cd", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9882557633753806, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# ------------------- fast io --------------------\r\nimport os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n \r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n \r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n \r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n \r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\n# ------------------- fast io --------------------\r\nfrom math import ceil\r\n\r\n\r\ndef prod(a, mod=10 ** 9 + 7):\r\n ans = 1\r\n for each in a:\r\n ans = (ans * each) % mod\r\n return ans\r\n\r\n\r\ndef gcd(x, y):\r\n while y:\r\n x, y = y, x % y\r\n return x\r\n\r\n\r\ndef lcm(a, b): return a * b // gcd(a, b)\r\n\r\n\r\ndef binary(x, length=16):\r\n y = bin(x)[2:]\r\n return y if len(y) >= length else \"0\" * (length - len(y)) + y\r\n\r\n\r\nfor _ in range(int(input()) if not True else 1):\r\n # n, k = map(int, input().split())\r\n # a, b = map(int, input().split())\r\n # c, d = map(int, input().split())\r\n # a = list(map(int, input().split()))\r\n # b = list(map(int, input().split()))\r\n s = [int(k) if k.isdigit() else k for k in input()]\r\n \r\n start = 0\r\n if len(s) > 1:\r\n start = 10**(len(s) - 1)\r\n while start % 25:\r\n start += 1\r\n ans = 0\r\n done = False\r\n while 1:\r\n if done:break\r\n x = start\r\n ind = len(s) - 1\r\n XV = None\r\n pos = True\r\n while x:\r\n if ind < 0:\r\n pos = False\r\n done = True\r\n break\r\n d = x % 10\r\n if s[ind] == \"_\":\r\n pass\r\n elif s[ind] == 'X':\r\n if XV is None:\r\n XV = d\r\n elif XV != d:\r\n pos = False\r\n else:\r\n if s[ind] != d:\r\n pos = False\r\n x = x // 10\r\n ind -= 1\r\n if pos:\r\n ans += 1\r\n start += 25\r\n print(ans)", "lang": "PyPy 3", "bug_code_uid": "d43243e027ea408da56e0e96c712d637", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "ce9e81f4a38539de52d4ea82d5ccd63b", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9969287469287469, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from __future__ import division, print_function\r\nimport math\r\nimport sys\r\nimport os\r\nfrom io import BytesIO, IOBase\r\n#from collections import deque, Counter, OrderedDict, defaultdict\r\n#import heapq\r\n#ceil,floor,log,sqrt,factorial,pow,pi,gcd\r\n#import bisect\r\nfrom bisect import bisect_left,bisect_right\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n\tnewlines = 0\r\n\r\n\tdef __init__(self, file):\r\n\t\tself._fd = file.fileno()\r\n\t\tself.buffer = BytesIO()\r\n\t\tself.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n\t\tself.write = self.buffer.write if self.writable else None\r\n\r\n\tdef read(self):\r\n\t\twhile True:\r\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n\t\t\tif not b:\r\n\t\t\t\tbreak\r\n\t\t\tptr = self.buffer.tell()\r\n\t\t\tself.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n\t\tself.newlines = 0\r\n\t\treturn self.buffer.read()\r\n\r\n\tdef readline(self):\r\n\t\twhile self.newlines == 0:\r\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n\t\t\tself.newlines = b.count(b\"\\n\") + (not b)\r\n\t\t\tptr = self.buffer.tell()\r\n\t\t\tself.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n\t\tself.newlines -= 1\r\n\t\treturn self.buffer.readline()\r\n\r\n\tdef flush(self):\r\n\t\tif self.writable:\r\n\t\t\tos.write(self._fd, self.buffer.getvalue())\r\n\t\t\tself.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n\tdef __init__(self, file):\r\n\t\tself.buffer = FastIO(file)\r\n\t\tself.flush = self.buffer.flush\r\n\t\tself.writable = self.buffer.writable\r\n\t\tself.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n\t\tself.read = lambda: self.buffer.read().decode(\"ascii\")\r\n\t\tself.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\ndef print(*args, **kwargs):\r\n\t\"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\r\n\tsep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\r\n\tat_start = True\r\n\tfor x in args:\r\n\t\tif not at_start:\r\n\t\t\tfile.write(sep)\r\n\t\tfile.write(str(x))\r\n\t\tat_start = False\r\n\tfile.write(kwargs.pop(\"end\", \"\\n\"))\r\n\tif kwargs.pop(\"flush\", False):\r\n\t\tfile.flush()\r\n\r\n\r\nif sys.version_info[0] < 3:\r\n\tsys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\r\nelse:\r\n\tsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\n\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\ndef inp():\r\n return(int(input()))\r\ndef inps():\r\n return input().strip()\r\ndef inlt():\r\n return(list(map(int,input().split())))\r\ndef insr():\r\n s = input().strip()\r\n return(list(s[:len(s)]))\r\ndef invr():\r\n return(map(int,input().split()))\r\nv=[]\r\nstrt=0\r\nwhile(strt<10**7+100):\r\n v.append(strt)\r\n strt+=25\r\ns=input().strip()\r\nn=len(s)\r\nstrt=bisect_left(v,10**(n-1))\r\nend=bisect_right(v,10**(n)+1)\r\nif n==1:\r\n strt=0\r\n end=2\r\ncnt=0\r\nfor i in range(strt,end-1):\r\n target=str(v[i])\r\n flag=1\r\n X=-1\r\n for i in range(n):\r\n if s[i]==target[i]:\r\n continue\r\n elif s[i]=='_':\r\n continue\r\n elif s[i]=='X':\r\n if X==-1:\r\n X=target[i]\r\n else:\r\n if target[i]==X:\r\n continue\r\n else:\r\n flag=0\r\n break\r\n else:\r\n flag=0\r\n break\r\n if flag:\r\n cnt+=1\r\nprint(cnt)", "lang": "PyPy 3", "bug_code_uid": "3b5c205e1bba9f1efa57101bdf7bee17", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "4fa028cfe0842ebaa8ef3069c23a30be", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.993841416474211, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "tmp = input()\r\n\r\n\r\ndef can(s, t):\r\n if len(s) != len(t):\r\n return False\r\n if 'X' in t:\r\n for ch in range(10):\r\n if can(s, t.replace('X', str(ch))):\r\n return True\r\n return False\r\n for i in range(len(s)):\r\n if s[i] == t[i] or t[i] == '_':\r\n continue\r\n else:\r\n return False\r\n return True\r\n\r\n\r\nif len(tmp) <= 4:\r\n x = 0\r\n answer = 0\r\n while len(str(x)) <= len(tmp):\r\n if can(str(x), tmp):\r\n answer += 1 \r\n x += 25\r\n print(answer)\r\n exit(0)\r\n\r\n\r\ndef get_prefix(pref):\r\n if pref[0] == '0':\r\n return 0\r\n answer = 1\r\n if pref[0] == '_':\r\n answer = 9\r\n for i in range(1, len(pref)):\r\n if pref[i] == '_':\r\n answer *= 10\r\n return answer\r\n\r\ndef get_suffix(suff):\r\n answer = 0\r\n for good in ['00', '25', '50']:\r\n if can(good, suff):\r\n answer += 1\r\n return answer\r\n\r\n\r\ndef get(t):\r\n if 'X' in t:\r\n answer = 0\r\n for x in range(10):\r\n answer += get(t.replace('X', str(x)))\r\n return answer\r\n\r\n\r\n if tmp[0] == '0':\r\n return 0\r\n \r\n pref = t[0:len(t) - 2]\r\n suff = t[len(t) - 2:len(t)]\r\n return get_prefix(pref) * get_suffix(suff)\r\n\r\nprint(get(tmp))\r\n", "lang": "PyPy 3", "bug_code_uid": "abf81eda3f5cd03d20d6b5f92e28d8b8", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "af72b140268596c6a18258ca0c9b84f2", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.06972477064220184, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "import math,sys;input=sys.stdin.readline;S=lambda:input().rstrip();I=lambda:int(S());M=lambda:map(int,S().split());L=lambda:list(M());mod1=1000000007;mod2=998244353\r\n\r\ndef check(s, num):\r\n if len(s) != len(num):\r\n return False\r\n x = -1\r\n for j in range(len(s)):\r\n if s[j] == '_':\r\n continue\r\n if s[j] == 'X':\r\n if x == -1:\r\n x = num[j]\r\n continue\r\n else:\r\n if x != num[j]:\r\n return False\r\n else:\r\n continue\r\n if s[j] != num[j]:\r\n return False\r\n return True\r\n \r\n \r\n \r\nif __name__ == '__main__':\r\n s = str(input())\r\n tot = 0\r\n for i in range(0, 10**8, 25):\r\n i = str(i)\r\n if len(i) > len(s):\r\n break\r\n if check(str(s), i):\r\n tot += 1\r\n print(tot)", "lang": "PyPy 3", "bug_code_uid": "926ef443b52f50f6c800b4996a676ae0", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "a3fdc56213ae0dddec359f4084369c5c", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3319587628865979, "equal_cnt": 10, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "import sys\r\ninput = sys.stdin.readline\r\n# sys.setrecursionlimit(400000)\r\ndef I(): return input().strip()\r\ndef II(): return int(input().strip())\r\ndef LI(): return [*map(int, input().strip().split())]\r\nimport copy, string, math, time, functools, fractions\r\nfrom heapq import heappush, heappop, heapify\r\nfrom bisect import bisect_left, bisect_right\r\nfrom collections import deque, defaultdict, Counter, OrderedDict\r\nfrom itertools import permutations, chain, combinations, groupby\r\nfrom operator import itemgetter\r\nfrom types import GeneratorType # for recursion\r\nfrom typing import Iterable, TypeVar, Union # for sorted set\r\n\r\n\r\nfor _ in range(1):\r\n inp = list(I())\r\n n = len(inp)\r\n if inp == ['0']:\r\n print(1)\r\n continue\r\n if n < 2:\r\n print(0)\r\n continue\r\n if n < 3:\r\n if list('__') == inp or list('_X') == inp or list('X_') == inp:\r\n print(3)\r\n elif list('XX') == inp:\r\n print(0)\r\n elif list('_5') == inp or list('X5') == inp:\r\n print(2)\r\n elif list('_0') == inp or list('X0') == inp:\r\n print(1)\r\n elif list('2_') == inp or list('5_') == inp or list('7_') == inp or list('2X') == inp or list('5X') == inp or list('7X') == inp:\r\n print(1)\r\n elif list('25') == inp or list('50') == inp or list('75') == inp:\r\n print(1)\r\n else:\r\n print(0)\r\n continue\r\n ans = 0\r\n r = 9\r\n if 'X' not in inp:\r\n r = 1\r\n for x in range(r):\r\n temp = copy.deepcopy(inp)\r\n for i in range(n):\r\n if temp[i] == 'X':\r\n temp[i] = str(x)\r\n if temp[0] == '0':\r\n continue\r\n var = 1\r\n if temp[-1] == temp[-2] == '_':\r\n var *= 4\r\n elif temp[-1] == '_':\r\n if not (temp[-2] == '0' or temp[-2] == '2' or temp[-2] == '5' or temp[-2] == '7'):\r\n continue\r\n elif temp[-2] == '_':\r\n if not (temp[-1] == '0' or temp[-1] == '5'):\r\n continue\r\n var *= 2\r\n else:\r\n if not ((temp[-2] == '0' and temp[-1] == '0') or (temp[-2] == '2' and temp[-1] == '5') or (temp[-2] == '5' and temp[-1] == '0') or (temp[-2] == '7' and temp[-1] == '5')):\r\n continue\r\n # print(temp)\r\n if temp[0] == '_':\r\n var *= 9\r\n for i in range(1, n - 2):\r\n if temp[i] == '_':\r\n var *= 10\r\n ans += var\r\n print(ans)\r\n \r\n", "lang": "PyPy 3", "bug_code_uid": "8a07f30ccaf81023fce598691a7de17a", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "c64e124ab5a8cfbd65386bc85765a857", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9004405286343612, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "def check(s, i):\r\n if i == len(s):\r\n x = ''.join(s)\r\n if x[0] == '0' and x != '0':\r\n return 0\r\n if int(x)%25 == 0:\r\n return 1\r\n return 0\r\n res = 0\r\n if s[i] == '_':\r\n for j in range(10):\r\n s[i] = str(j)\r\n res += check(s, i+1)\r\n return res\r\n else:\r\n return check(s, i+1)\r\n\r\n\r\ninp = input()\r\ntotal = 0\r\nif 'X' in inp:\r\n for i in range(10):\r\n s = inp\r\n s = s.replace('X', str(i))\r\n total += check(list(s), 0)\r\nelse: total = check(list(inp), 0)\r\n\r\nprint(total)", "lang": "Python 3", "bug_code_uid": "6f5743f3f4c5492f3f26b7193fa2e050", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "15bec80a2d8b78b040675ca815b16b07", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9157254561251086, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "def check(s, i):\r\n if i == len(s):\r\n x = ''.join(s)\r\n if x[0] == '0' and x != '0':\r\n return 0\r\n if int(x)%25 == 0:\r\n return 1\r\n return 0\r\n res = 0\r\n if s[i] == '_':\r\n for j in range(10):\r\n s[i] = str(j)\r\n res += check(s, i+1)\r\n s[i] = '_'\r\n return res\r\n else:\r\n return check(s, i+1)\r\n\r\n\r\ninp = input()\r\ntotal = 0\r\nif 'X' in inp:\r\n for i in range(10):\r\n s = inp\r\n s = s.replace('X', str(i))\r\n total += check(list(s), 0)\r\nelse: total = check(list(inp), 0)\r\n\r\nprint(total)", "lang": "Python 3", "bug_code_uid": "f6ac4fe2072682722d85bcfe138869ca", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "15bec80a2d8b78b040675ca815b16b07", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9991482112436116, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s=input()\r\ny=s\r\nn=len(s)\r\nm=1\r\nc=0\r\nfor i in range(0,n-2):\r\n if s[i]==\"_\" and i==0:\r\n c=1\r\n m*=9\r\n elif s[i]==\"_\":\r\n c=1\r\n m*=10\r\n# if c==0:\r\n# m=0\r\nval=0\r\nre=m\r\nif s.count(\"X\")==n and n!=1:\r\n print(0)\r\nelif n==2 and (s[-2:]==\"__\" or s[-2:]==\"_X\"):\r\n print(3)\r\nelif n==1 and (s[0]=='0' or s[0]==\"_\" or s[0]==\"X\"):\r\n print(1)\r\nelif n==1 or s[0]==\"0\":\r\n print(0)\r\nelif \"X\" in s:\r\n if s[0]==\"X\":\r\n for i in ['1','2','3','4','5','6','7','8','9']:\r\n s=y\r\n m=re\r\n s=s.replace(\"X\",i)\r\n\r\n if (s[-1]==\"X\" and s[-2]==\"X\") or (s[-1]==\"X\" and s[-2]==\"_\"):\r\n m=m\r\n elif s[-2]==\"_\" and s[-1]==\"X\":\r\n m=m*2\r\n elif s[-1]==\"_\" and s[-2]==\"_\":\r\n m=m*4\r\n elif s[-2]==\"_\" and s[-1] in ['5','0']:\r\n m=m*2\r\n elif s[-2] in ['2','5','7','0'] and s[-1]==\"_\":\r\n m=m\r\n elif s[-2:]==\"25\" or s[-2:]==\"75\" or s[-2:]==\"50\" or s[-2:]==\"00\":\r\n m=m\r\n else:\r\n m=0\r\n val += m\r\n print(val)\r\n else:\r\n for i in ['1','2','3','4','5','6','7','8','9','0']:\r\n s=y\r\n m = re\r\n s=s.replace(\"X\",i)\r\n if (s[-1]==\"X\" and s[-2]==\"X\") or (s[-1]==\"X\" and s[-2]==\"_\"):\r\n m=m\r\n elif s[-2]==\"_\" and s[-1]==\"X\":\r\n m=m*2\r\n elif s[-1]==\"_\" and s[-2]==\"_\":\r\n m=m*4\r\n elif s[-2]==\"_\" and s[-1] in ['5','0']:\r\n m=m*2\r\n elif s[-2] in ['2','5','7'] and s[-1]==\"_\":\r\n m=m\r\n elif s[-2:]==\"25\" or s[-2:]==\"75\" or s[-2:]==\"50\" or s[-2:]==\"00\":\r\n m=m\r\n else:\r\n m=0\r\n val += m\r\n print(val)\r\n\r\nelse:\r\n if (s[-1] == \"X\" and s[-2] == \"X\") or (s[-1] == \"X\" and s[-2] == \"_\"):\r\n m = m\r\n elif s[-2] == \"_\" and s[-1] == \"X\":\r\n m = m * 2\r\n elif s[-1] == \"_\" and s[-2] == \"_\":\r\n m = m * 4\r\n elif s[-2] == \"_\" and s[-1] in ['5', '0']:\r\n m = m * 2\r\n elif s[-2] in ['2', '5', '7'] and s[-1] == \"_\":\r\n m = m\r\n elif s[-2:] == \"25\" or s[-2:] == \"75\" or s[-2:] == \"50\" or s[-2:] == \"00\":\r\n m = m\r\n else:\r\n m = 0\r\n print(m)", "lang": "Python 3", "bug_code_uid": "509d59a56f6a6a9e67f5a55441fde43f", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "a1a9bb8ff3f26aa9ffe4041126fa2013", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9957053187974892, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import math\nimport random\nimport sys\n\ndef main(s):\n \n if (len(s)==1 and (s[0]==\"0\" or s[0]==\"_\" or s[0]==\"X\")):\n return 1\n elif (s[0]==\"0\" and len(s)>1):\n return 0\n elif (len(s)==1):\n return 0\n mult1=1\n mult2=1\n f=False\n for i in range(len(s)-2): \n\n if s[i]==\"_\":\n if (i!=0):\n mult1*=10\n else:\n mult1*=9\n elif s[i]==\"X\":\n if (i!=0):\n mult2=10 \n else:\n mult2=9 \n f=True\n ans=0\n for i in range(100):\n if (i%25)!=0:\n continue\n val=list([c for c in str(i)]) \n if (i==0):\n val=[\"0\",\"0\"]\n \n mult_val=mult2\n check=[s[-2],s[-1]]\n\n if check[0]==\"X\":\n if (val[0]=='0' and f):\n continue\n check[0]=val[0] \n mult_val=1\n if check[1]==\"X\":\n \n check[1]=val[0] \n \n if (check[1]==\"X\" and check[0] !=\"X\"):\n if (val[1]=='0' and f):\n continue\n check[1]=val[1] \n mult_val=1\n if (check[0]==\"_\"):\n check[0]=val[0]\n if (check[1]==\"_\"):\n check[1]=val[1] \n if (val==check) and not (len(s)==2 and check[0]==\"0\"):\n ans+=mult_val*mult1\n\n return ans\n \n\n \ns=input() \nprint(main(s))\n\n\n\n \n \n\n \n \n", "lang": "Python 3", "bug_code_uid": "a21eb67bc9523774629550cc96c54883", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "2b229463e445db3ded9bdb08350647d8", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9759615384615384, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def main(s):\n rst = 0\n legal_single = ['X', '_', '0']\n for ls in legal_single:\n if ls == s: return 1\n if len(s) < 2 or s.startswith('0'): return rst\n legal_ends = ['X', '_', '0', '5']\n if s[-1] not in legal_ends: return rst\n legal_2nds = ['X', '_', '0', '2', '5', '7']\n if s[-2] not in legal_2nds: return rst\n if s.endswith('XX'): return main(s.replace('X', '0'))\n elif s.endswith('X_'):\n rst += main(s.replace('X', '0')[:-1] + '0')\n rst += main(s.replace('X', '2')[:-1] + '5')\n rst += main(s.replace('X', '5')[:-1] + '0')\n rst += main(s.replace('X', '7')[:-1] + '5')\n return rst\n elif s.endswith('_X'):\n rst += main((s[:-2] + '00').replace('X', '0'))\n rst += main((s[:-2] + '25').replace('X', '5'))\n rst += main((s[:-2] + '50').replace('X', '0'))\n rst += main((s[:-2] + '75').replace('X', '5'))\n return rst\n elif s.endswith('__'):\n rst += main((s[:-2] + '00'))\n rst += main((s[:-2] + '25'))\n rst += main((s[:-2] + '50'))\n rst += main((s[:-2] + '75'))\n return rst\n elif 'X' in s[-2:] or '_' in s[-2:]:\n #Xnum, numX\n # _num, num_\n if 'X' in s[-2:]:\n if s[-2] == 'X': legal_2nds = ['2', '7']\n else: legal_2nds = ['0', '5']\n for l2 in legal_2nds: rst += main(s.replace('X', l2))\n elif '_' in s[-2:]:\n legal_2nds = ['0', '5', '2', '7']\n for l2 in legal_2nds: rst += main(s[:-2] + s[-2:].replace('_', l2)) \n return rst\n # _ and X not in the last two number\n if not s[-2:] in ['00', '25', '50', '75']: return 0\n _num = s.count('_')\n X_num = s.count('X')\n if s.startswith('_'):\n rst += 9 * pow(10, (_num - 1)) * (10 if X_num > 0 else 1)\n elif s.startswith('X'): rst += 9 * pow(10, _num)\n elif '_' in s: rst += pow(10, _num) * (10 if X_num > 0 else 1)\n elif 'X' in s: rst += 10\n else: rst += 1 if int(s) % 25 == 0 else 0\n return rst\n\n\nif __name__ == \"__main__\":\n s = input()\n rst = main(s)\n print(rst)", "lang": "Python 3", "bug_code_uid": "01777b686fb5dc304de894718cc7228d", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "5d8302f29a5f94c9d042617987a1908f", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9723772720767139, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "'''\nAuthor: your name\nDate: 2021-12-10 14:18:39\nLastEditTime: 2021-12-13 21:22:52\nLastEditors: Please set LastEditors\nDescription: In User Settings Edit\nFilePath: /code_everyWeek/week3.py\n'''\n\ndef solution_1(input_str):\n if len(input_str) >= 2 and input_str[0] == '0':\n return 0\n\n if 'X' not in input_str and '_' not in input_str:\n input_num = int(input_str)\n if input_num % 25 == 0:\n return 1\n else:\n return 0\n\n if len(input_str) == 1:\n if input_str in ['0', 'X', '_']:\n return 1\n else:\n return 0\n \n X_ = False\n last_two_num = 0\n\n if input_str[-1] not in ['0', '5', 'X', '_']:\n return 0\n\n if input_str[-1] == '5':\n if input_str[-2] in ['2', '7']:\n last_two_num = 1\n elif input_str[-2] == 'X':\n last_two_num = 2\n X_ = True # ====== \n elif input_str[-2] == '_':\n last_two_num = 2\n else:\n return 0\n\n if input_str[-1] == '0':\n if input_str[-2] in ['5', '0']:\n last_two_num = 1\n elif input_str[-2] == 'X':\n if input_str[0] != 'X':\n last_two_num = 2 # \n else:\n last_two_num = 1 # \n X_ = True\n elif input_str[-2] == '_':\n last_two_num = 2\n if len(input_str) != 2:\n last_two_num = 2 # \n else:\n last_two_num = 1 # \n else:\n return 0\n\n if input_str[-1] == 'X':\n if input_str[-2] in ['2', '7']:\n last_two_num = 1 # 'X'=5\n X_ = True\n elif input_str[-2] in ['5', '0']:\n if input_str[0] != 'X':\n last_two_num = 2 # 'X' 0/5\n X_ = True\n else:\n return 0\n elif input_str[-2] == '_':\n if input_str[0] == 'X':\n last_two_num = 2 # 25 / 75\n elif len(input_str) == 2:\n last_two_num = 3 # 25 / 75 / 50\n else:\n last_two_num = 4 # 25 / 75/ 50 / 00\n X_ = True\n elif input_str[-2] == 'X':\n if input_str[0] == 'X':\n return 0\n else:\n last_two_num = 1 # 00\n X_ = True\n else:\n return 0\n\n if input_str[-1] == '_':\n if input_str[-2] in ['2', '5', '7', '0']:\n last_two_num = 1\n elif input_str[-2] == '_':\n if len(input_str) != 2:\n last_two_num = 4 # 25/75/50/00\n else:\n last_two_num = 3 # 25/75/50\n elif input_str[-2] == 'X':\n if input_str[0] == 'X':\n last_two_num = 3 # 25 / 75 / 50\n else:\n last_two_num = 4\n X_ = True\n else:\n return 0\n\n if len(input_str) <= 2:\n return last_two_num\n\n\n num_of_ = 0\n num_ofX = 0\n for i in range(0, len(input_str)-2):\n if input_str[i] == '_':\n num_of_ += 1\n elif input_str[i] == 'X':\n num_ofX += 1\n\n if input_str[0] != '_':\n res = pow(10, num_of_) * (10 if num_ofX and not X_ else 1) * last_two_num\n else:\n res = 9 * pow(10, max(num_of_-1, 0)) * (10 if num_ofX and not X_ else 1) * last_two_num\n\n return res\n\n\nif __name__ == \"__main__\":\n input_str = input()\n res = solution_1(input_str)\n print(res)\n", "lang": "Python 3", "bug_code_uid": "34201c4b3f2948fba8ad2cc2c7f23c2b", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "ccd27b3086ff8c9f5b3191b16dad9258", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9860291834833903, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def can_equal(s, t):\r\n for i in range(len(s)):\r\n for j in range(i):\r\n if s[i] == s[j] == 'X' and t[i].isdigit() and t[j].isdigit() and t[i] != t[j]:\r\n return False\r\n return all(c == d or c in '_X' or d in '_X' for c,d in zip(s, t))\r\n\r\ns = input()\r\nif len(s) == 1: exit(print(+(s<'1'or':'= 3:\r\n valid_endings = [\"00\", \"25\", \"50\", \"75\"]\r\n\r\n total = 0\r\n for valid_ending in valid_endings:\r\n valid, x = can_be_made(valid_ending, e)\r\n if not valid:\r\n continue\r\n\r\n total += count_variants(x, b)\r\n\r\n return total\r\n\r\n\r\ndef can_be_made(valid_ending, e):\r\n if e == \"__\":\r\n return True, None\r\n\r\n for underscore in [\"0\", \"2\", \"5\", \"7\"]:\r\n for x in [\"X\", \"0\", \"2\", \"5\", \"7\"]:\r\n e_ = e.replace(\"X\", x)\r\n e_ = e_.replace(\"_\", underscore)\r\n if e_ == valid_ending:\r\n if x == \"X\":\r\n x = None\r\n return True, x\r\n return False, None\r\n\r\n\r\ndef count_variants(x, b):\r\n if b == \"\":\r\n return 1\r\n\r\n if b[0] == \"0\":\r\n return 0\r\n\r\n total = 1\r\n if b[0] == \"X\":\r\n if x == 0:\r\n return 0\r\n if x is None:\r\n total *= 9\r\n x = 1\r\n if b[0] == \"_\":\r\n total *= 9\r\n\r\n for ch in b[1:]:\r\n if ch == \"_\":\r\n total *= 10\r\n if ch == \"X\":\r\n if x is None:\r\n total *= 10\r\n x = 1\r\n\r\n return total\r\n\r\n\r\ns = input()\r\nprint(divisible_by_25(s))\r\n", "lang": "Python 3", "bug_code_uid": "3d5e411ca4e69197adb1d22530c299e9", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "80b50f4f715ea594baa7e9184cf0c940", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9070181688635554, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "s = input()\r\nways = 0\r\nif len(s) == 1:\r\n if s in ['_', 'X', '0']:\r\n ways = 1\r\nelif len(s) == 2:\r\n if s in ['25', '50', '75']:\r\n ways = 1\r\n elif s == '__':\r\n ways = 3\r\n elif s == '_0':\r\n ways = 1\r\n elif s in ['_5', 'X5']:\r\n ways = 2\r\n elif s in ['2_', '5_', '7_', '2X', '5X', '7X', 'X0']:\r\n ways = 1\r\nelse:\r\n d = s[-2:]\r\n s = s[:-2]\r\n if d in ['00', '25', '50', '75', '__', 'XX', '_0', '_5', '0_', '2_', '5_', '7_', 'X0', 'X5', '0X', '2X', '5X', '7X']:\r\n ways = 1\r\n xfound = False\r\n\r\n if d == '__':\r\n ways *= 4\r\n elif d in ['_0', '_5', 'X0', 'X5']:\r\n ways *= 2\r\n \r\n if 'X' in d:\r\n xfound = True\r\n \r\n if s[0] == '_' or (s[0] == 'X' and not xfound):\r\n ways *= 9\r\n if s[0] == 'X':\r\n xfound = True\r\n\r\n if s[0] == 'X' and d in ['XX', '0X', 'X0', '5X']:\r\n if d == 'X0':\r\n ways //= 2\r\n else:\r\n ways = 0\r\n\r\n if s[0] == '0':\r\n ways = 0\r\n\r\n for c in s[1:]:\r\n if c == '_':\r\n ways *= 10\r\n elif c == 'X' and not xfound:\r\n ways *= 10\r\n xfound = True\r\n\r\nprint(ways)", "lang": "Python 3", "bug_code_uid": "7f5b4ee9f3c6f5861fa59c892bbd57d3", "src_uid": "4a905f419550a6c839992b40f1617af3", "apr_id": "024d19db3baee9c3a411f3dd3ee6143b", "difficulty": 1800, "tags": ["dfs and similar", "dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8195991091314031, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "mod=10**9+7\r\nN,M,K,R,C=map(int,input().split())\r\nAX,AY,BX,BY=map(int,input().split())\r\nZ=0\r\nif AX+R>BX and AY+C>BY:\r\n Z=(AX+R-BX)*(AY+C-BY)\r\nV=N*M-R*C*2+Z\r\nprint(pow(K,V+R*C-Z,mod))\r\n", "lang": "PyPy 3", "bug_code_uid": "f3950abeeeeaf970b3da1454f9d7f657", "src_uid": "3478e6a4ff2415508fd517413d40c13a", "apr_id": "ecb5241bc3cbf76f903f7aeb6a646ad1", "difficulty": 2200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7739130434782608, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "n=int(input())\nprint(n**2-1)\n# Wed Apr 20 2022 06:23:32 GMT+0000 (Coordinated Universal Time)\n", "lang": "Python 3", "bug_code_uid": "ca3c5e8d6c55c11421be587778f54d17", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "bef19548f4bac3055a9d2bfa77950676", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8173913043478261, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "n = int(input())\nprint(2**n-1)\n# Wed Apr 20 2022 06:23:32 GMT+0000 (Coordinated Universal Time)\n", "lang": "Python 3", "bug_code_uid": "8429c5edb9c53acc92f15b162054ac81", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "84ce501c14b2e2cb02f96f9a0a9d8452", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8592592592592593, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n = int(input())\nfor i in range(n):\n x = int(input())-1\n print(2 ** x)\n# Wed Apr 20 2022 06:31:57 GMT+0000 (Coordinated Universal Time)\n", "lang": "Python 3", "bug_code_uid": "c47a04d8827e06af76989dc369d7cb43", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "84ce501c14b2e2cb02f96f9a0a9d8452", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8424657534246576, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#oh yeah you said i submitted the same code? here i change my code by adding a comment\r\nn = int(input())\r\nprint(2**n - 1)\r\n", "lang": "Python 3", "bug_code_uid": "35974bc5d8742bef5fc9bffd5222ddcd", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "4c7eadf94ff238f66dedcd9a82382ef0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8270676691729323, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "t=int(input())\r\n\r\ndef win(n):\r\n if n==1:\r\n k=1\r\n else:\r\n k=(2*n)-1\r\n \r\n return k\r\n\r\nfor i in range(0,t):\r\n n=int(input())\r\n k=win(n)\r\n print(k)", "lang": "Python 3", "bug_code_uid": "1a237771ba3e6d3bc692d0b05f12d3f0", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "6449e3f5e6fe88b2d089edd9c3cfb3a5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9971910112359551, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import sys\n\n# Mike change this based on the codeforces problem.\nlinesPerTest = 1\n\ntestArguments = []\n\ni = 0\ntotalLines = 1\n\n# Read all the lines from stdin, write them to testCasesUnformatted.\nwhile i <= totalLines:\n line = sys.stdin.readline().rstrip('\\n')\n if i == 0:\n \ttotalLines = linesPerTest * int(line)\n else:\n testArguments.append(line)\n i += 1\n\n# Group the test arguments into test cases.\ntestCases = []\nfor j in range(0, len(testArguments), linesPerTest):\n\ttestCases.append(testArguments[j:j + linesPerTest])\n\ndef f(testArguments):\n n = int(testArguments[0])\n if n == 1:\n return 1\n else:\n return 2**n / 2 - 1\n\nfor testCase in testCases:\n\tprint(f(testCase))\n\n\n", "lang": "Python 3", "bug_code_uid": "001babf6d77c2434990e92a7319b8223", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "df471a024fbf3c89417a18d9d34c36c1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5419103313840156, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "for _ in range(int(input())):\r\n n=int(input())\r\n a=[]\r\n for i in range(1, n**2+1):\r\n a.append(i)\r\n b=[]\r\n while len(a)>1:\r\n for i in range(0,len(a)-1,2):\r\n if (a[i]+a[i+1])%2==0:\r\n b.append(a[i+1])\r\n else:\r\n b.append(a[i])\r\n a=b\r\n b=[]\r\n print(a[0])", "lang": "Python 3", "bug_code_uid": "7631743f29751546355f6c87903b812a", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "3f55d0786234095c8d4337f0720c5a07", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5550239234449761, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import sys\r\n\r\nfor line in sys.stdin:\r\n print(2 ** int(line) - 1)", "lang": "Python 3", "bug_code_uid": "a21d61237cffe3e9cf2944a3ee9d5940", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "19db98ecc336f514671b68368347422e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7447447447447447, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def play_off(n):\r\n h=2**n\r\n k=2\r\n if n%2==1:\r\n k=1\r\n while k!=0:\r\n h-=1\r\n k-=1\r\n return h\r\n\r\nt=int(input())\r\nfor i in range(t):\r\n n=int(input())\r\n print(play_off(n))", "lang": "Python 3", "bug_code_uid": "7ae298468a82081bd3986df6147b96b4", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "a92b8701aaf029db85682a10edcdc2b7", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2712765957446808, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "test_cases = int(input())\n\nfor i in range(test_cases):\n n = int(input())\n passed_first_stage = list(range(1, n ** 2, 2))\n\n for j in range(n - 1):\n passed_first_stage = list(set(passed_first_stage))\n for k in range(len(passed_first_stage) - 1):\n if k % 2 == 0:\n if (passed_first_stage[k] + passed_first_stage[k + 1]) % 2 == 0:\n passed_first_stage[k] = passed_first_stage[k + 1]\n else:\n passed_first_stage[k + 1] = passed_first_stage[k]\n\n if len(passed_first_stage) == 0:\n print(1)\n else:\n print(passed_first_stage[0])\n\n\n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "2362259beeaaf8138006971436bc5eb9", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "9e92545fdbfa00efe70f5885c90ff3fb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.972972972972973, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = int(input())\nfor _ in range(s):\n n = int(input())\n print(n ** 2 - 1)", "lang": "Python 3", "bug_code_uid": "4442bc8525977e7c7d655b65a453d74a", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "a6936dbb699c1bafc12883ea9062fba2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9659863945578231, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "t = int(input())\nfor _ in range(t):\n n = int(input())\n print(n-1)", "lang": "Python 3", "bug_code_uid": "af34d74473f1d49649521aee53a7ca5b", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "17fbd6b1d00194263cb8592a16750dde", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.09795918367346938, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "# function uses recursion to compute winner athlete depending on conditions\r\ndef game (test) :\r\n length = len(test)\r\n if length == 1 :\r\n print(f\"{test[0]}\") #printing the winner athlete\r\n return 0\r\n j = 1\r\n while j <= length/2 :\r\n i = j - 1\r\n if (test[i] + test[j]) % 2 == 0 :\r\n if test[i] >= test[j] :\r\n del(test[j])\r\n else :\r\n del(test[i])\r\n elif test[i] >= test[j] :\r\n del(test[i])\r\n else :\r\n del(test[j])\r\n j += 1 \r\n return game (test)\r\nathlete = int(input()) # promping the number of stages\r\nmy_list = []\r\nfor i in range(1,(2**athlete+1),1) :\r\n my_list.append(i)\r\ngame(my_list)\r\n\r\n\r\n ", "lang": "Python 3", "bug_code_uid": "efb9ebe0ac897304ecc27a6c9da87de1", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "6661f43b5471ca997e0e7d8ad5b4e195", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9969788519637462, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "d = {1:1,2:1,3:7,4:15,5:31,6:63,7:127,8:255,9:511,10:1023,11:2047,12:4095,13:8191,14:16383,15:32767,16:65535,17:131071,18:262143,19:524287,20:1048575,21:2097151,22:4194303,23:8388607,24:16777215,25:33554431,26:67108863,27:134217727,28:268435455,29:536870911,30:1073741823}\r\nfor _ in range(int(input())):\r\n print(d[int(input())])", "lang": "Python 3", "bug_code_uid": "56460e76c1561fb48254ca94a02fce63", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "4ea45fcaa815bf69de941d652372b90e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9852216748768473, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "t = int(input())\r\nfor i in range(t):\r\n n = int(input())\r\n x = (2^n)-1\r\n print(x)\r\n \r\n ", "lang": "Python 3", "bug_code_uid": "aeb0431005bf98f497bfd1654eb70f51", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "f4dbb0a81b2e070b550c397a2a6c17f8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9120258272800645, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import sys\r\ninput = sys.stdin.readline\r\n\r\n############ ---- Input Functions ---- ############\r\ndef inp():\r\n return(int(input()))\r\ndef inlt():\r\n return(list(map(int,input().split())))\r\ndef insr():\r\n s = input()\r\n return(list(s[:len(s) - 1]))\r\ndef invr():\r\n return(map(int,input().split()))\r\n\r\n\r\ndef solve():\r\n n=inp()\r\n prev=0\r\n for i in range(2,n+1):\r\n # \r\n first=prev\r\n\r\n second=first+2**(i-1)\r\n s=first+second\r\n if s%2==1:\r\n # odd\r\n prev=first\r\n else:\r\n prev=second\r\n\r\n return prev+1\r\n\r\nprint(solve())", "lang": "Python 3", "bug_code_uid": "dd0c2cee776dcfcf5ff29e9dfafaf424", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "0bddfcf2b53d86043e24e1153d0d7a92", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3662447257383966, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "T = int(input())\r\nwhile T:\r\n T -= 1\r\n N = int(input())\r\n # S = input()\r\n # c = input()\r\n # arr = list(map(int, input().split()))\r\n # l, r, a = map(int, input().split())\r\n\r\n if N > 19:\r\n print(\"NO\")\r\n else:\r\n print(\"YES\")\r\n for i in range(N):\r\n print(3**i, end=\" \")\r\n print()", "lang": "Python 3", "bug_code_uid": "a44915fb1830632f66c1cd5e2724e127", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "a615d3c5cd652e675cd233f4006218dc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8344370860927153, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "t=int(input())\r\nfor i in range(t):\r\n n=int(input())\r\nprint(\"7\")\r\nprint(\"1\")", "lang": "Python 3", "bug_code_uid": "e65e6c10b7c0e8c16fc1adbc1c458ddf", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "8b1f6e5b61c41ac17cd8e719ba7e2222", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7437185929648241, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\r\nfor _ in range(n):\r\n m = int(input())\r\n lst = [i for i in range(1, 2**n)]\r\n print(lst[n - 2])", "lang": "Python 3", "bug_code_uid": "b01a3fc912f77c5b755d8d1468ea4ab9", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "cd3fab3adc03cd24756e2409e1b86d35", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5833333333333334, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "n=int(input(\"\"))\r\nprint(2**n-1)", "lang": "Python 3", "bug_code_uid": "91066917287b350ab5aaf02b1a4ba873", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "cce6f962d300702f2e09066a334ce3f8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.42823529411764705, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "if __name__ == \"__main__\":\r\n\tfor _ in range(int(input())):\r\n\t\tn = int(input())\r\n\t\ti = 0\r\n\t\tarr = [j for j in range(1, 2**n+1)]\r\n\t\t\r\n\t\twhile( len(arr) > 1 ):\r\n\t\t\tif( (arr[i]+arr[i+1])%2 == 0 ):\r\n\t\t\t\tarr.pop(i)\r\n\t\t\telse:\r\n\t\t\t\tarr.pop(i+1)\r\n\t\t\ti += 1\r\n\t\t\t\t\r\n\t\t\tif( i >= len(arr) ):\r\n\t\t\t\ti = 0\r\n\t\t\r\n\t\tprint( arr[0] )\r\n\t\t\t\r\n\t\t\r\n\t\t\t", "lang": "Python 3", "bug_code_uid": "4f0de68482ec7c360638eee01d0cae84", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "964a99020a15c6f17877932334c3612f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9797979797979798, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "if __name__ == \"__main__\":\r\n\tfor _ in range(int(input())):\r\n\t\tn = int(input())\r\n\t\tprint( 2**(n-1) )", "lang": "Python 3", "bug_code_uid": "dc4540b76dffbb87ef5350ccba1068e4", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "964a99020a15c6f17877932334c3612f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8791208791208791, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "t = int(input())\nfor i in range(1,t) :\n x = int(input())\n print(2 ** x - 1)", "lang": "Python 3", "bug_code_uid": "c42a0c04162c4d36d4dfa1f8b1167a1a", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "da9f461acfdaf984e3c389a27f8bb7f8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9303370786516854, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n_testcases = int(input())\r\ntestcases = [0 for i in range(n_testcases)]\r\nfor i in range(n_testcases):\r\n testcases[i] = int(input())\r\n\r\nwinner = []\r\nfor i in testcases:\r\n winner.append(2**i-1)\r\n\r\nprint(winner)", "lang": "Python 3", "bug_code_uid": "7c49765884a9760d03a8786a531d27f8", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "730df72d46b8cffba2e887783b9ae6c6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7021276595744681, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "n=int(input())\r\nif n==1:\r\n print(1)\r\nelse:\r\n print(2**n-1)\r\n", "lang": "Python 3", "bug_code_uid": "38cb080324d7240e62c8a1cf14dac21c", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "f4664d7f2e07c73eb05391c7a068c0e2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6065573770491803, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\r\nprint(2 ** n - 1)\r\n", "lang": "Python 3", "bug_code_uid": "6b6703d31cf6f2fe5e78ca7d9f102ebd", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "41a501d816d74401ca7719177b49ec9e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7676767676767676, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "for i in range(int(input())):\r\n n=int(input())\r\n if(n%2!=0):\r\n print(2**n - 1)\r\n else:\r\n print(n-1)", "lang": "Python 3", "bug_code_uid": "ee1141ec44d2bb58480a1ee4e7604215", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "e856c2780052a908f8842521b786075f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2644628099173554, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "for i in range(int(input())):\r\n n=int(input())\r\n res=[x for x in range(1,2**n+1)]\r\n while(len(res)!=1):\r\n x=[]\r\n for i in range(len(res)-1,0,-2):\r\n print(res[i],res[i-1])\r\n if((res[i]+res[i-1])%2==0):\r\n x.append(max(res[i],res[i-1]))\r\n else:\r\n x.append(min(res[i],res[i-1]))\r\n print(res,x)\r\n res=x\r\n print(res[0])", "lang": "Python 3", "bug_code_uid": "7c125fa9af9d700e1bef92bffb43c597", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "e5c9c8ea46d9f40a0e429e2e918a10b2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.1936842105263158, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "def playoff(arry):\r\n if(len(arry)>1):\r\n arr=[]\r\n i=0\r\n while(i x: hi = mid\r\n else: lo = mid + 1\r\n return lo\r\n \r\ndef bisect_left(a, x):\r\n lo, hi = 0, len(a)\r\n while lo < hi:\r\n mid = lo + (hi - lo) // 2\r\n if a[mid] < x: lo = mid + 1\r\n else: hi = mid\r\n return lo\r\n\r\ndef binary_search(nums, target):\r\n left, right = 0, len(nums) - 1\r\n while left <= right:\r\n pivot = left + (right - left) // 2\r\n if nums[pivot] == target:\r\n return pivot\r\n if target < nums[pivot]:\r\n right = pivot - 1\r\n else:\r\n left = pivot + 1\r\n return -1\r\n\r\n#------------------------------HELPER FUNCTION------------------------------#\r\ndef prefixSum(arr):\r\n dp = [arr[0]]\r\n arrLen = len(arr)\r\n for i in range(1, arrLen): dp.append(dp[-1] + arr[i])\r\n return dp\r\n\r\ndef suffixSum(arr):\r\n arrLen = len(arr)\r\n dp = [0] * arrLen\r\n dp[-1] = arr[-1]\r\n for i in range(arrLen-2, -1, -1): dp[i] = dp[i+1] + arr[i]\r\n return dp\r\n\r\ndef fun():\r\n return \r\n\r\nMAX = 10**6 + 2\r\n\r\ndef solve():\r\n N = int(input())\r\n if N == 1:\r\n print(1)\r\n elif N == 2:\r\n print(2)\r\n else:\r\n print(2**N-1)\r\n\r\n \r\n\r\n \r\n\r\n\r\n \r\n#---------------------------------DRIVER CODE--------------------------------#\r\nTC = int(input())\r\n#TC = 1\r\nfor testcases in range(TC):\r\n solve()", "lang": "Python 3", "bug_code_uid": "4be6f07595f29a3a119b84d877518f0f", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "9360ec71518c1f006a29370a8ed21877", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9733333333333334, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "t=int(input())\r\nfor i in range(t):\r\n n=int(input())\r\n print((n**2)-1)", "lang": "Python 3", "bug_code_uid": "e0c3664f679fef2d5a40aefd501cc834", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "f11d00eb9fe4a6b8186a84466efa134c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5614035087719298, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\r\nprint(2**n - 1)", "lang": "Python 3", "bug_code_uid": "e2e7b72a6664e87f82b89c3bbdc54277", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "042e7468a7ea8ebd40bb2c372f830d9a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23056994818652848, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "def race(a):\r\n wn=\"\"\r\n for i in range(1,len(a),2):\r\n if (a[i-1]+a[i])%2==0:\r\n wn+=str(a[i])\r\n wn+=' '\r\n else:\r\n wn+=str(a[i-1])\r\n wn+=' '\r\n wn=wn.split()\r\n nwn=[]\r\n for i in range(len(wn)):\r\n nwn.append(int(wn[i]))\r\n \r\n return nwn\r\n \r\nt=int(input())\r\nn=t**3\r\na=[]\r\nfor i in range(1,n+1):\r\n a.append(i)\r\n \r\nnnl=[]\r\nfor i in range(t):\r\n d=int(input())\r\n nnl.append(d)\r\n \r\n#print(a)\r\nwhile len(a)>1:\r\n a=race(a)\r\nprint(a[0])\r\n\r\n\r\nwhile len(nnl)>1:\r\n nnl=race(nnl)\r\n \r\nprint(nnl[0])\r\n", "lang": "Python 3", "bug_code_uid": "8177480718a817a4d0a18775b151720a", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "34914193e1f2716d58eda2d9b496ec09", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7052631578947368, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "for i in range(int(input())):\r\n n = int(input())\r\n if n%2 == 0:\r\n print(n-1)\r\n else:\r\n print(n)", "lang": "Python 3", "bug_code_uid": "f88b51780f1b0544f6b05376a52127e9", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "5549e3da2f7ac09726f19ba2309439cf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7692307692307693, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def main():\n n = int(input())\n print(2**n-1)\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "a5c74fe66ccee00745f0fc649228cff3", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "9fca6dcee356b33aaa8159f3dcbd1ca0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9714285714285714, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "for _ in range(int(input())):\r\n n=int(input())\r\n print(1< 1:\r\n for i in range(2, int(math.sqrt(n)) + 1):\r\n if n % i == 0:\r\n prime_flag = 1\r\n break\r\n if prime_flag == 0:\r\n return True\r\n else:\r\n return False\r\n else:\r\n return False\r\n\r\n\r\ndef gcdofarray(a):\r\n x = 0\r\n for p in a:\r\n x = math.gcd(x, p)\r\n return x\r\n\r\n\r\n# method to print the divisors\r\ndef printDivisors(n):\r\n # Note that this loop runs till square root\r\n i = 1\r\n ans = []\r\n while i <= math.sqrt(n):\r\n\r\n if (n % i == 0):\r\n\r\n # If divisors are equal, print only one\r\n if (n / i == i):\r\n ans.append(i)\r\n else:\r\n # Otherwise print both\r\n ans.append(i)\r\n ans.append(n // i)\r\n i = i + 1\r\n ans.sort()\r\n return ans\r\n\r\n\r\ndef CountDivisors(n):\r\n # Note that this loop runs till square root\r\n i = 1\r\n ans = []\r\n while i <= math.sqrt(n):\r\n\r\n if (n % i == 0):\r\n\r\n # If divisors are equal, print only one\r\n if (n / i == i):\r\n ans.append(i)\r\n else:\r\n # Otherwise print both\r\n ans.append(i)\r\n ans.append(n // i)\r\n i = i + 1\r\n ans.sort()\r\n return len(ans)\r\n\r\n\r\ndef binaryToDecimal(n):\r\n return int(n, 2)\r\n\r\n\r\ndef countTriplets(a, n):\r\n s = set()\r\n for i in range(n):\r\n s.add(a[i])\r\n count = 0\r\n for i in range(n):\r\n for j in range(i + 1, n, 1):\r\n xr = a[i] ^ a[j]\r\n if xr in s and xr != a[i] and xr != a[j]:\r\n count += 1\r\n return int(count // 3)\r\n\r\n\r\ndef generate_twin_prime(n):\r\n a = 0\r\n for i in range(1, n + 1):\r\n j = i + 2\r\n if isPrime(i) and isPrime(j):\r\n if 2 ^ (i ^ j) == 0:\r\n a += 1\r\n return a\r\n\r\n\r\ndef smallestDivisor(n):\r\n if (n % 2 == 0):\r\n return 2\r\n i = 3\r\n while (i * i <= n):\r\n if (n % i == 0):\r\n return i\r\n i += 2\r\n return n\r\n\r\n\r\ndef countOdd(L, R):\r\n N = (R - L) // 2\r\n\r\n # if either R or L is odd\r\n if (R % 2 != 0 or L % 2 != 0):\r\n N += 1\r\n\r\n return N\r\n\r\n\r\ndef isPalindrome(s):\r\n return s == s[::-1]\r\n\r\n\r\ndef sufsum(test_list):\r\n test_list.reverse()\r\n res = [sum(test_list[: i + 1]) for i in range(len(test_list))]\r\n return res\r\n\r\n\r\ndef prsum(lst):\r\n return (list(itertools.accumulate(lst)))\r\n\r\n\r\ndef badachotabadachota(nums):\r\n nums.sort()\r\n i = 0\r\n j = len(nums) - 1\r\n ans = []\r\n cc = 0\r\n while len(ans) != len(nums):\r\n if cc % 2 == 0:\r\n ans.append(nums[j])\r\n j -= 1\r\n else:\r\n ans.append(nums[i])\r\n i += 1\r\n cc += 1\r\n return ans\r\n\r\n \r\n# ########################################################################\r\n# #-----------------------------Code Here--------------------------------#\r\n# ########################################################################\r\n\r\nfor _ in range(inp()):\r\n # n = inp()\r\n # u = inlt()\r\n # s = inlt()\r\n # d = {}\r\n # ans = []\r\n # for i in range(n):\r\n # if u[i] in d:\r\n # d[u[i]].append(s[i])\r\n # else:\r\n # d[u[i]] = []\r\n # d[u[i]].append(s[i])\r\n # print(d)\r\n n = inp()\r\n if n == 1:\r\n print(1)\r\n else:\r\n print(n ** 2 - 1)", "lang": "PyPy 3", "bug_code_uid": "6f811590428294dadfc0fa95af0da101", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "1ab3c6d91aae906e45de37163172b104", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9775784753363229, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import math\r\n\r\nt=int(input())\r\nwhile(t > 0):\r\n t-=1\r\n n = int(input())\r\n z = math.pow(2,n) \r\n print(z-1)", "lang": "PyPy 3", "bug_code_uid": "b7500ece7c920f07d4acb86f16ee402f", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "b8e8afb1341376ec37f587dfa02f75ab", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.978328173374613, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "from sys import stdin, stdout\r\n\r\nt = int(stdin.readline())\r\n\r\n\"\"\"\r\nrange(1,2**n+1)\r\n\r\n\r\n1,3\r\n5,7 ==> 3,7 => 7,15 => 15\r\n9,11 11,15 (largest) (largest)\r\n13,[15] (largest) \r\n(largest)\r\n\r\nSolution\r\n2. Max(odds)\r\n\r\n2**4 -1 \r\n\"\"\"\r\n\r\n\r\nfor _ in range(t):\r\n n = int(stdin.readline())\r\n stdout.write(str(2**n-1))", "lang": "PyPy 3", "bug_code_uid": "c06f62c547870ef0d4e0a4ee657ebf55", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "36d7810877a6ffa7e358853ca66b7c90", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9879518072289156, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Mar 14 19:30:51 2022\r\n\r\n@author: Ajay Varma\r\n\"\"\"\r\n\r\nfor i in range(int(input())):\r\n x= int(input())\r\n print(2**x)", "lang": "PyPy 3", "bug_code_uid": "0cbaa4a052635376be74d69d60b73503", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "f88eec525b98495ec3624fcadef6ad27", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.10884353741496598, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "print('7\\n1')", "lang": "PyPy 3", "bug_code_uid": "e3baee885d46ca727cfaad7a9bb66945", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "55d2e3aecbe429294177b07ea660e6bb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9609375, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "t = int(input())\n\nfor i in range(t):\n n = int(input())\n if n % 2 == 0:\n print(n - 1)\n else:\n print(2**n - 1)\n", "lang": "PyPy 3", "bug_code_uid": "51de2a1ca4650c3f6aa13c498286409f", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "6f321de316286c419f4cea4cd7059d6b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9118228548833531, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "from cmath import inf\r\nfrom re import L, T\r\nfrom telnetlib import TN3270E\r\ndef swap(a,b):\r\n a = a^b\r\n b = a^b\r\n a = a^b\r\n return a,b\r\n # call using a,b = swap(a,b)\r\ndef even(a):\r\n if a&1:\r\n return False\r\n return True\r\ndef gcd(x, y):\r\n while(y):\r\n x, y = y, x % y\r\n return x\r\n\r\ndef lcm(x, y):\r\n lcm = (x*y) // gcd(x,y)\r\n return lcm\r\n\r\n# it will return index of \"key\" in \"sorted list\". \r\ndef BS_elemPosi(low, high, key, li): \r\n while low=li[mid]:\r\n low = mid+1\r\n else:\r\n high = mid\r\n return low\r\n\r\ndef swap(arr, i,j):\r\n tmp = arr[i]\r\n arr[i] = arr[j]\r\n arr[j] = tmp\r\n\r\ndef perm(li,arr, curr_indx=0):\r\n if curr_indx==len(arr)-1:\r\n li.append(\"\".join(arr))\r\n for i in range(curr_indx,len(arr)):\r\n swap(arr,curr_indx,i)\r\n perm(li,arr,curr_indx+1)\r\n swap(arr,curr_indx,i)\r\n\r\nimport sys\r\ninput = sys.stdin.readline\r\n###########################(CODE)#######################################\r\nfor _ in range(int(input())):\r\n n = int(input())\r\n if n==1:\r\n print(1)\r\n elif n%2==0:\r\n print(n*2-1)\r\n else:\r\n print(n*2+1)\r\n#######################################################################", "lang": "PyPy 3", "bug_code_uid": "2853a7d1fd4eb9d4a1932302026e8b90", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "ce8c9fc7f0361b28ebe21cce23dfc658", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9932782369146006, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "# SHRi GANESHA author: Kunal Verma #\r\nimport os\r\nimport sys\r\nfrom bisect import bisect_left\r\nfrom collections import deque\r\nfrom heapq import heapify, heappush, heappop\r\nfrom io import BytesIO, IOBase\r\nfrom math import inf, gcd\r\n\r\n\r\n\r\ndef lcm(a, b):\r\n return (a * b) // gcd(a, b)\r\n\r\n'''\r\n mod = 10 ** 9 + 7\r\n fac = [1]\r\n for i in range(1, 2 * 10 ** 5 + 1):\r\n fac.append((fac[-1] * i) % mod)\r\n fac_in = [pow(fac[-1], mod - 2, mod)]\r\n for i in range(2 * 10 ** 5, 0, -1):\r\n fac_in.append((fac_in[-1] * i) % mod)\r\n fac_in.reverse()\r\n def comb(a, b):\r\n if a < b:\r\n return 0\r\n return (fac[a] * fac_in[b] * fac_in[a - b]) % mod\r\n'''\r\n# MAXN = 10000004\r\n# spf = [0 for i in range(MAXN)]\r\n# adj = [[] for i in range(MAXN)]\r\ndef sieve():\r\n global spf, adj, MAXN\r\n spf[1] = 1\r\n for i in range(2, MAXN):\r\n spf[i] = i\r\n\r\n for i in range(2, MAXN):\r\n if i * i > MAXN:\r\n break\r\n if (spf[i] == i):\r\n for j in range(i * i, MAXN, i):\r\n if (spf[j] == j):\r\n spf[j] = i\r\ndef getdistinctFactorization(n):\r\n global adj, spf, MAXN\r\n for i in range(1, n + 1):\r\n index = 1\r\n x = i\r\n if (x != 1):\r\n adj[i].append(spf[x])\r\n x = x // spf[x]\r\n while (x != 1):\r\n if (adj[i][index - 1] != spf[x]):\r\n adj[i].append(spf[x])\r\n index += 1\r\n x = x // spf[x]\r\ndef printDivisors(n):\r\n i = 2\r\n z = [1, n]\r\n while i <= sqrt(n):\r\n if (n % i == 0):\r\n if (n / i == i):\r\n z.append(i)\r\n else:\r\n z.append(i)\r\n z.append(n // i)\r\n i = i + 1\r\n return z\r\ndef create(n, x, f):\r\n pq = len(bin(n)[2:])\r\n if f == 0:\r\n tt = min\r\n else:\r\n tt = max\r\n dp = [[inf] * n for _ in range(pq)]\r\n dp[0] = x\r\n for i in range(1, pq):\r\n for j in range(n - (1 << i) + 1):\r\n dp[i][j] = tt(dp[i - 1][j], dp[i - 1][j + (1 << (i - 1))])\r\n return dp\r\ndef enquiry(l, r, dp, f):\r\n if l > r:\r\n return inf if not f else -inf\r\n if f == 1:\r\n tt = max\r\n else:\r\n tt = min\r\n pq1 = len(bin(r - l + 1)[2:]) - 1\r\n return tt(dp[pq1][l], dp[pq1][r - (1 << pq1) + 1])\r\ndef SieveOfEratosthenes(n):\r\n prime = [True for i in range(n + 1)]\r\n p = 2\r\n while (p * p <= n):\r\n if (prime[p] == True):\r\n for i in range(p * p, n + 1, p):\r\n prime[i] = False\r\n p += 1\r\n x = []\r\n for i in range(2, n + 1):\r\n if prime[i]:\r\n x.append(i)\r\n return x\r\n\r\n\r\n\r\ndef main():\r\n for _ in range(int(input())):\r\n\r\n n=int(input())\r\n n=2**n\r\n print(n-(n%2)^1)\r\n\r\n\r\n\r\n# Fast IO Region\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n\r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\nif __name__ == '__main__':\r\n main()", "lang": "PyPy 3", "bug_code_uid": "1f94fcba72e7fb12eea1147cd97ae811", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "e9b906283adac1e42f419cfbc99462dd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5714285714285714, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "print(2 ** int(input()) - 1)", "lang": "PyPy 3", "bug_code_uid": "84c0fa3fdb62a59e66baaacc17ae9e5f", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "df8fbd16080b3f8133c7655c75b2eaed", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9696969696969697, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "for i in range(int(input())):\r\n\ta = int(input())\r\n\tprint((a**2)-1)", "lang": "PyPy 3", "bug_code_uid": "8f29469ca4b7be5b8aeb31a60bc65477", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "35b540de11c65b3d4b26c1ff4de67762", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9965253648366922, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "\r\ndef getint():\r\n return [int(i) for i in input().split()]\r\ndef get():\r\n return int(input())\r\ndef getstr():\r\n return [i for i in input().split()]\r\ndef S():\r\n for test in range(int(input())):\r\n solve()\r\nimport math\r\nimport itertools as it\r\nimport bisect\r\nimport time\r\nimport collections as ct\r\n\r\ndef lower_bound(a,x):\r\n l=-1\r\n r=len(a)\r\n while l+1!=r:\r\n mid=l+r>>1\r\n if a[mid]>1\r\n if a[mid]<=x:\r\n l=mid\r\n else:\r\n r=mid\r\n return r\r\ndef solve():\r\n n=get()\r\n print(3*n-2)\r\n\r\n\r\nS()\r\n", "lang": "PyPy 3", "bug_code_uid": "ae6ab21997b17c1f3bccf77ae8a05d8d", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "7cdd81be781e0e0ea815c375a1876d79", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.958904109589041, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "for _ in range(int(input())):\r\n n = int(input())\r\n print(1<= length else \"0\" * (length - len(y)) + y\r\n \r\n \r\ndef powerset(s):\r\n n=len(s)\r\n \r\n return chain.from_iterable(combinations(s,r) for r in range(1,n))\r\n \r\ndef binarySearch(arr,x): \r\n l=0\r\n r=len(arr)-1\r\n while l <= r: \r\n \r\n mid = l + (r - l) // 2; \r\n if arr[mid] == x: \r\n return mid \r\n elif arr[mid] < x: \r\n l = mid + 1\r\n else: \r\n r = mid - 1\r\n return -1\r\n \r\ndef prime(n): #array of prime numbers\r\n arr = [1]*(n+1)\r\n arr[0] = arr[1] = 0\r\n p=2\r\n while p*p<=n:\r\n if arr[p]:\r\n for i in range(p * 2, n + 1, p):\r\n arr[i] = 0\r\n p+=1\r\n \r\n \r\n return arr\r\n\r\ndef prime(n):\r\n # Returns a list of primes < n \r\n sieve = [True] * n\r\n for i in range(3,int(n**0.5)+1,2):\r\n if sieve[i]:\r\n sieve[i*i::2*i]=[False]*((n-i*i-1)//(2*i)+1)\r\n return [2] + [i for i in range(3,n,2) if sieve[i]]\r\n \r\n \r\n \r\n \r\ndef palindrome(string,start,end):\r\n if start==end:\r\n return True\r\n if end==1:\r\n return True\r\n return string[start]==string[end-1] and palindrome(string,start+1,end-1)\r\n \r\ndef binomialCoeff(n, k):\r\n \r\n \r\n C = [0 for i in range(k+1)]\r\n C[0] = 1 \r\n \r\n for i in range(1, n+1):\r\n \r\n \r\n j = min(i, k)\r\n while (j > 0):\r\n C[j] = C[j] + C[j-1]\r\n j -= 1\r\n \r\n return C[k]\r\n\r\n\r\ndef binary_search(array):\r\n\r\n def condition(value) -> bool:\r\n pass\r\n\r\n left, right = min(search_space), max(search_space) # could be [0, n], [1, n] etc. Depends on problem\r\n while left < right:\r\n mid = left + (right - left) // 2\r\n if condition(mid):\r\n right = mid\r\n else:\r\n left = mid + 1\r\n return left\r\n\r\nprime_dict = {'a': 2, 'b': 3, 'c': 5, 'd': 7, 'e': 11, 'f': 13, 'g': 17, 'h': 19, 'i': 23, 'j': 29, 'k': 31, 'l': 37, 'm': 41, 'n': 43, 'o': 47, 'p': 53, 'q': 59, 'r': 61, 's': 67, 't': 71, 'u': 73, 'v': 79, 'w': 83, 'x': 89, 'y': 97, 'z': 101}\r\n\r\n \r\n\"\"\"\r\n \r\n#----# My Functions\r\n\r\ninf = float(\"inf\")\r\nmod = 10**9+7\r\nnoyes = [\"NO\",\"YES\"]\r\nyesno = [\"YES\",\"NO\"]\r\ndef aa(): \r\n return int(input())\r\n\r\ndef bb(): \r\n return list(map(int,input().split()))\r\n\r\ndef cc(): \r\n s = input()\r\n return list(s)\r\n\r\ndef dd(): \r\n return map(int,input().split())\r\n\r\ndef put(i,val):\r\n print(\"Case #\",i,\":\",val)\r\n\r\ndef swap(arr,i,j):\r\n arr[i],arr[j] = arr[j],arr[i]\r\n\r\ndef power(base, exp, mod = mod):\r\n ans = 1\r\n\r\n while exp:\r\n lastbit = exp & 1\r\n if lastbit:\r\n ans = (ans * base)%(mod)\r\n\r\n base=(base*base)%mod\r\n exp>>=1\r\n\r\n return ans%mod\r\n#----#\r\n\r\n\r\n\r\ndef koi_coding_sikha_do():\r\n \r\n n = aa()\r\n if n%2==0:\r\n print(2**n)\r\n else:\r\n print(2**n - 1)\r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n\r\n\r\nonlyone = 0 \r\nt=1 if onlyone else int(input())\r\nwhile(t):\r\n \r\n koi_coding_sikha_do()\r\n \r\n t-=1\r\n \r\n\r\n \r\n\"\"\"\r\n__________ __ .__ __ __ _________ \r\n\\______ \\___.__._/ |_| |__ ____ ____ \\ \\ \\ \\ \\_ ___ \\ .__ .__ \r\n | ___< | |\\ __\\ | \\ / _ \\ / \\ \\ \\ \\ \\ / \\ \\/ __| |___ __| |___ \r\n | | \\___ | | | | Y ( <_> ) | \\ / / / / \\ \\____ /__ __/ /__ __/ \r\n |____| / ____| |__| |___| /\\____/|___| / /_/ /_/ \\______ / |__| |__| \r\n \\/ \\/ \\/ \\/ \r\n \r\n \r\nUnke aakhon me aasu aur chahre pe hasi hai......lagta hai unki lulli unki zip me phasi hai\r\n\"\"\"\r\n", "lang": "PyPy 2", "bug_code_uid": "259af1aa915366a5331b47a44a7c8325", "src_uid": "d5e66e34601cad6d78c3f02898fa09f4", "apr_id": "0ec0036fd6c315fd1b4ac0445eaa3b2f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9947996329152646, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from collections import Counter, defaultdict, deque\r\nimport bisect\r\nimport dbm\r\nimport sys\r\nimport os\r\nfrom itertools import repeat, permutations\r\nimport itertools\r\nimport math\r\nimport heapq\r\nimport random\r\nfrom sys import stdin, stdout\r\n \r\nMOD = 998244353\r\nfrom io import BytesIO, IOBase\r\n \r\nBUFSIZE = 8192\r\n \r\n \r\n \r\ndef inp(force_list=False):\r\n re = list(map(int, input().split()))\r\n if len(re) == 1 and not force_list:\r\n return re[0]\r\n return re\r\n \r\ndef inst():\r\n return input().strip()\r\n \r\ndef gcd(x, y):\r\n while(y):\r\n x, y = y, x % y\r\n return x\r\n \r\ndef lcm(x, y):\r\n return x*y/(gcd(x,y))\r\n \r\ndef qmod(a, b, mod=MOD):\r\n res = 1\r\n while b:\r\n if b&1:\r\n res = (res*a)%mod\r\n b >>= 1\r\n a = (a*a)%mod\r\n # print b\r\n return res\r\n \r\ndef inv(a):\r\n return qmod(a, MOD-2)\r\n \r\ndef query(tp, l, r=0):\r\n if tp==1:\r\n print(\"? 1 %d\" % (l+1,))\r\n stdout.flush()\r\n return inst()\r\n else:\r\n if r= n:\r\n ans = pow(2, n, mod)\r\n print(ans)\r\nelif k == n-1:\r\n ans = pow(2, n, mod)\r\n ans = (ans - 1 + mod) % mod\r\n print(ans)\r\nelse:\r\n if n == 1:\r\n print('2')\r\n else:\r\n ans = 1\r\n\r\n numerator = 1\r\n for i in range(2, n+1):\r\n numerator *= i\r\n numerator %= mod\r\n\r\n denominator1 = 1\r\n denominator2 = 1\r\n for i in range(2, n):\r\n denominator2 *= i\r\n denominator2 %= mod\r\n\r\n extra1 = 2\r\n extra2 = n-1\r\n for i in range(1, k+1):\r\n val1 = MI(denominator1, mod)\r\n add = numerator*val1\r\n add %= mod\r\n val2 = MI(denominator2, mod)\r\n add *= val2\r\n add %= mod\r\n ans += add\r\n ans %= mod\r\n\r\n denominator1 *= extra1\r\n denominator1 %= mod\r\n\r\n extra2_inverse = MI(extra2, mod)\r\n denominator2 *= extra2_inverse\r\n denominator2 %= mod\r\n print(ans)", "lang": "PyPy 3", "bug_code_uid": "f7b61130c5657a152329987c837cc95c", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "cc5849c136e453cb4fe8d573af02e886", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.23453908984830804, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "from collections import deque\nimport sys\ninput = lambda: sys.stdin.readline().rstrip()\nii = lambda: int(input())\nmi = lambda: map(int, input().split())\nli = lambda: list(mi())\ninf = 2 ** 63 - 1\nmod = 10 ** 9 + 7\n\ndef solve():\n n, k = mi()\n if k >= n:\n print(pow(2, n, mod))\n else:\n ans = pow(2, n, mod) - (n - k)\n print(ans % mod)\n\nfor _ in range(1):\n solve()", "lang": "PyPy 3", "bug_code_uid": "d45f33c89e4ddd523434058ce0411d9a", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "8851a1f7876efc33e5adcdb697ceda7c", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9907229931764164, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "# ---------------------------iye ha aam zindegi---------------------------------------------\r\nimport math\r\nimport random\r\nimport heapq,bisect\r\nimport sys\r\nfrom collections import deque, defaultdict\r\nfrom fractions import Fraction\r\nfrom itertools import permutations\r\nfrom collections import defaultdict\r\nmod = 10 ** 9 + 7\r\nmod1 = 998244353\r\nimport sys\r\n#sys.setrecursionlimit(10000)\r\n# ------------------------------warmup----------------------------\r\nimport os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n\r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\n#----------------------------------------------iye ha aam zindegi-----------------------------------\r\n\r\nclass SegmentTree:\r\n def __init__(self, data, default=-3*10**9, func=lambda a, b: max(a,b)):\r\n \"\"\"initialize the segment tree with data\"\"\"\r\n self._default = default\r\n self._func = func\r\n self._len = len(data)\r\n self._size = _size = 1 << (self._len - 1).bit_length()\r\n\r\n self.data = [default] * (2 * _size)\r\n self.data[_size:_size + self._len] = data\r\n for i in reversed(range(_size)):\r\n self.data[i] = func(self.data[i + i], self.data[i + i + 1])\r\n\r\n def __delitem__(self, idx):\r\n self[idx] = self._default\r\n\r\n def __getitem__(self, idx):\r\n return self.data[idx + self._size]\r\n\r\n def __setitem__(self, idx, value):\r\n idx += self._size\r\n self.data[idx] = value\r\n idx >>= 1\r\n while idx:\r\n self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])\r\n idx >>= 1\r\n\r\n def __len__(self):\r\n return self._len\r\n\r\n def query(self, start, stop):\r\n if start == stop:\r\n return self.__getitem__(start)\r\n stop += 1\r\n start += self._size\r\n stop += self._size\r\n\r\n res = self._default\r\n while start < stop:\r\n if start & 1:\r\n res = self._func(res, self.data[start])\r\n start += 1\r\n if stop & 1:\r\n stop -= 1\r\n res = self._func(res, self.data[stop])\r\n start >>= 1\r\n stop >>= 1\r\n return res\r\n\r\n def __repr__(self):\r\n return \"SegmentTree({0})\".format(self.data)\r\n\r\n\r\n# -------------------------------iye ha chutiya zindegi-------------------------------------\r\nclass SortedList:\r\n def __init__(self, iterable=[], _load=200):\r\n \"\"\"Initialize sorted list instance.\"\"\"\r\n values = sorted(iterable)\r\n self._len = _len = len(values)\r\n self._load = _load\r\n self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]\r\n self._list_lens = [len(_list) for _list in _lists]\r\n self._mins = [_list[0] for _list in _lists]\r\n self._fen_tree = []\r\n self._rebuild = True\r\n\r\n def _fen_build(self):\r\n \"\"\"Build a fenwick tree instance.\"\"\"\r\n self._fen_tree[:] = self._list_lens\r\n _fen_tree = self._fen_tree\r\n for i in range(len(_fen_tree)):\r\n if i | i + 1 < len(_fen_tree):\r\n _fen_tree[i | i + 1] += _fen_tree[i]\r\n self._rebuild = False\r\n\r\n def _fen_update(self, index, value):\r\n \"\"\"Update `fen_tree[index] += value`.\"\"\"\r\n if not self._rebuild:\r\n _fen_tree = self._fen_tree\r\n while index < len(_fen_tree):\r\n _fen_tree[index] += value\r\n index |= index + 1\r\n\r\n def _fen_query(self, end):\r\n \"\"\"Return `sum(_fen_tree[:end])`.\"\"\"\r\n if self._rebuild:\r\n self._fen_build()\r\n\r\n _fen_tree = self._fen_tree\r\n x = 0\r\n while end:\r\n x += _fen_tree[end - 1]\r\n end &= end - 1\r\n return x\r\n\r\n def _fen_findkth(self, k):\r\n \"\"\"Return a pair of (the largest `idx` such that `sum(_fen_tree[:idx]) <= k`, `k - sum(_fen_tree[:idx])`).\"\"\"\r\n _list_lens = self._list_lens\r\n if k < _list_lens[0]:\r\n return 0, k\r\n if k >= self._len - _list_lens[-1]:\r\n return len(_list_lens) - 1, k + _list_lens[-1] - self._len\r\n if self._rebuild:\r\n self._fen_build()\r\n\r\n _fen_tree = self._fen_tree\r\n idx = -1\r\n for d in reversed(range(len(_fen_tree).bit_length())):\r\n right_idx = idx + (1 << d)\r\n if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:\r\n idx = right_idx\r\n k -= _fen_tree[idx]\r\n return idx + 1, k\r\n\r\n def _delete(self, pos, idx):\r\n \"\"\"Delete value at the given `(pos, idx)`.\"\"\"\r\n _lists = self._lists\r\n _mins = self._mins\r\n _list_lens = self._list_lens\r\n\r\n self._len -= 1\r\n self._fen_update(pos, -1)\r\n del _lists[pos][idx]\r\n _list_lens[pos] -= 1\r\n\r\n if _list_lens[pos]:\r\n _mins[pos] = _lists[pos][0]\r\n else:\r\n del _lists[pos]\r\n del _list_lens[pos]\r\n del _mins[pos]\r\n self._rebuild = True\r\n\r\n def _loc_left(self, value):\r\n \"\"\"Return an index pair that corresponds to the first position of `value` in the sorted list.\"\"\"\r\n if not self._len:\r\n return 0, 0\r\n\r\n _lists = self._lists\r\n _mins = self._mins\r\n\r\n lo, pos = -1, len(_lists) - 1\r\n while lo + 1 < pos:\r\n mi = (lo + pos) >> 1\r\n if value <= _mins[mi]:\r\n pos = mi\r\n else:\r\n lo = mi\r\n\r\n if pos and value <= _lists[pos - 1][-1]:\r\n pos -= 1\r\n\r\n _list = _lists[pos]\r\n lo, idx = -1, len(_list)\r\n while lo + 1 < idx:\r\n mi = (lo + idx) >> 1\r\n if value <= _list[mi]:\r\n idx = mi\r\n else:\r\n lo = mi\r\n\r\n return pos, idx\r\n\r\n def _loc_right(self, value):\r\n \"\"\"Return an index pair that corresponds to the last position of `value` in the sorted list.\"\"\"\r\n if not self._len:\r\n return 0, 0\r\n\r\n _lists = self._lists\r\n _mins = self._mins\r\n\r\n pos, hi = 0, len(_lists)\r\n while pos + 1 < hi:\r\n mi = (pos + hi) >> 1\r\n if value < _mins[mi]:\r\n hi = mi\r\n else:\r\n pos = mi\r\n\r\n _list = _lists[pos]\r\n lo, idx = -1, len(_list)\r\n while lo + 1 < idx:\r\n mi = (lo + idx) >> 1\r\n if value < _list[mi]:\r\n idx = mi\r\n else:\r\n lo = mi\r\n\r\n return pos, idx\r\n\r\n def add(self, value):\r\n \"\"\"Add `value` to sorted list.\"\"\"\r\n _load = self._load\r\n _lists = self._lists\r\n _mins = self._mins\r\n _list_lens = self._list_lens\r\n\r\n self._len += 1\r\n if _lists:\r\n pos, idx = self._loc_right(value)\r\n self._fen_update(pos, 1)\r\n _list = _lists[pos]\r\n _list.insert(idx, value)\r\n _list_lens[pos] += 1\r\n _mins[pos] = _list[0]\r\n if _load + _load < len(_list):\r\n _lists.insert(pos + 1, _list[_load:])\r\n _list_lens.insert(pos + 1, len(_list) - _load)\r\n _mins.insert(pos + 1, _list[_load])\r\n _list_lens[pos] = _load\r\n del _list[_load:]\r\n self._rebuild = True\r\n else:\r\n _lists.append([value])\r\n _mins.append(value)\r\n _list_lens.append(1)\r\n self._rebuild = True\r\n\r\n def discard(self, value):\r\n \"\"\"Remove `value` from sorted list if it is a member.\"\"\"\r\n _lists = self._lists\r\n if _lists:\r\n pos, idx = self._loc_right(value)\r\n if idx and _lists[pos][idx - 1] == value:\r\n self._delete(pos, idx - 1)\r\n\r\n def remove(self, value):\r\n \"\"\"Remove `value` from sorted list; `value` must be a member.\"\"\"\r\n _len = self._len\r\n self.discard(value)\r\n if _len == self._len:\r\n raise ValueError('{0!r} not in list'.format(value))\r\n\r\n def pop(self, index=-1):\r\n \"\"\"Remove and return value at `index` in sorted list.\"\"\"\r\n pos, idx = self._fen_findkth(self._len + index if index < 0 else index)\r\n value = self._lists[pos][idx]\r\n self._delete(pos, idx)\r\n return value\r\n\r\n def bisect_left(self, value):\r\n \"\"\"Return the first index to insert `value` in the sorted list.\"\"\"\r\n pos, idx = self._loc_left(value)\r\n return self._fen_query(pos) + idx\r\n\r\n def bisect_right(self, value):\r\n \"\"\"Return the last index to insert `value` in the sorted list.\"\"\"\r\n pos, idx = self._loc_right(value)\r\n return self._fen_query(pos) + idx\r\n\r\n def count(self, value):\r\n \"\"\"Return number of occurrences of `value` in the sorted list.\"\"\"\r\n return self.bisect_right(value) - self.bisect_left(value)\r\n\r\n def __len__(self):\r\n \"\"\"Return the size of the sorted list.\"\"\"\r\n return self._len\r\n\r\n def __getitem__(self, index):\r\n \"\"\"Lookup value at `index` in sorted list.\"\"\"\r\n pos, idx = self._fen_findkth(self._len + index if index < 0 else index)\r\n return self._lists[pos][idx]\r\n\r\n def __delitem__(self, index):\r\n \"\"\"Remove value at `index` from sorted list.\"\"\"\r\n pos, idx = self._fen_findkth(self._len + index if index < 0 else index)\r\n self._delete(pos, idx)\r\n\r\n def __contains__(self, value):\r\n \"\"\"Return true if `value` is an element of the sorted list.\"\"\"\r\n _lists = self._lists\r\n if _lists:\r\n pos, idx = self._loc_left(value)\r\n return idx < len(_lists[pos]) and _lists[pos][idx] == value\r\n return False\r\n\r\n def __iter__(self):\r\n \"\"\"Return an iterator over the sorted list.\"\"\"\r\n return (value for _list in self._lists for value in _list)\r\n\r\n def __reversed__(self):\r\n \"\"\"Return a reverse iterator over the sorted list.\"\"\"\r\n return (value for _list in reversed(self._lists) for value in reversed(_list))\r\n\r\n def __repr__(self):\r\n \"\"\"Return string representation of sorted list.\"\"\"\r\n return 'SortedList({0})'.format(list(self))\r\n#-----------------------------sortedlist--------------------------------------------------------------\r\nclass Factorial:\r\n def __init__(self, MOD):\r\n self.MOD = MOD\r\n self.factorials = [1, 1]\r\n self.invModulos = [0, 1]\r\n self.invFactorial_ = [1, 1]\r\n\r\n def calc(self, n):\r\n if n <= -1:\r\n print(\"Invalid argument to calculate n!\")\r\n print(\"n must be non-negative value. But the argument was \" + str(n))\r\n exit()\r\n if n < len(self.factorials):\r\n return self.factorials[n]\r\n nextArr = [0] * (n + 1 - len(self.factorials))\r\n initialI = len(self.factorials)\r\n prev = self.factorials[-1]\r\n m = self.MOD\r\n for i in range(initialI, n + 1):\r\n prev = nextArr[i - initialI] = prev * i % m\r\n self.factorials += nextArr\r\n return self.factorials[n]\r\n\r\n def inv(self, n):\r\n if n <= -1:\r\n print(\"Invalid argument to calculate n^(-1)\")\r\n print(\"n must be non-negative value. But the argument was \" + str(n))\r\n exit()\r\n p = self.MOD\r\n pi = n % p\r\n if pi < len(self.invModulos):\r\n return self.invModulos[pi]\r\n nextArr = [0] * (n + 1 - len(self.invModulos))\r\n initialI = len(self.invModulos)\r\n for i in range(initialI, min(p, n + 1)):\r\n next = -self.invModulos[p % i] * (p // i) % p\r\n self.invModulos.append(next)\r\n return self.invModulos[pi]\r\n\r\n def invFactorial(self, n):\r\n if n <= -1:\r\n print(\"Invalid argument to calculate (n^(-1))!\")\r\n print(\"n must be non-negative value. But the argument was \" + str(n))\r\n exit()\r\n if n < len(self.invFactorial_):\r\n return self.invFactorial_[n]\r\n self.inv(n) # To make sure already calculated n^-1\r\n nextArr = [0] * (n + 1 - len(self.invFactorial_))\r\n initialI = len(self.invFactorial_)\r\n prev = self.invFactorial_[-1]\r\n p = self.MOD\r\n for i in range(initialI, n + 1):\r\n prev = nextArr[i - initialI] = (prev * self.invModulos[i % p]) % p\r\n self.invFactorial_ += nextArr\r\n return self.invFactorial_[n]\r\n\r\n\r\nclass Combination:\r\n def __init__(self, MOD):\r\n self.MOD = MOD\r\n self.factorial = Factorial(MOD)\r\n\r\n def ncr(self, n, k):\r\n if k < 0 or n < k:\r\n return 0\r\n k = min(k, n - k)\r\n f = self.factorial\r\n return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD\r\n\r\n\r\n# --------------------------------------iye ha combinations ka zindegi---------------------------------\r\ndef powm(a, n, m):\r\n if a == 1 or n == 0:\r\n return 1\r\n if n % 2 == 0:\r\n s = powm(a, n // 2, m)\r\n return s * s % m\r\n else:\r\n return a * powm(a, n - 1, m) % m\r\n\r\n\r\n# --------------------------------------iye ha power ka zindegi---------------------------------\r\ndef sort_list(list1, list2):\r\n zipped_pairs = zip(list2, list1)\r\n\r\n z = [x for _, x in sorted(zipped_pairs)]\r\n\r\n return z\r\n\r\n\r\n# --------------------------------------------------product----------------------------------------\r\ndef product(l):\r\n por = 1\r\n for i in range(len(l)):\r\n por *= l[i]\r\n return por\r\n\r\n\r\n# --------------------------------------------------binary----------------------------------------\r\ndef binarySearchCount(arr, n, key):\r\n left = 0\r\n right = n - 1\r\n\r\n count = 0\r\n\r\n while (left <= right):\r\n mid = int((right + left) / 2)\r\n\r\n # Check if middle element is\r\n # less than or equal to key\r\n if (arr[mid] <= key):\r\n count = mid + 1\r\n left = mid + 1\r\n\r\n # If key is smaller, ignore right half\r\n else:\r\n right = mid - 1\r\n\r\n return count\r\n\r\n\r\n# --------------------------------------------------binary----------------------------------------\r\ndef countdig(n):\r\n c = 0\r\n while (n > 0):\r\n n //= 10\r\n c += 1\r\n return c\r\ndef binary(x, length):\r\n y = bin(x)[2:]\r\n return y if len(y) >= length else \"0\" * (length - len(y)) + y\r\n\r\ndef countGreater(arr, n, k):\r\n l = 0\r\n r = n - 1\r\n\r\n # Stores the index of the left most element\r\n # from the array which is greater than k\r\n leftGreater = n\r\n\r\n # Finds number of elements greater than k\r\n while (l <= r):\r\n m = int(l + (r - l) / 2)\r\n if (arr[m] >= k):\r\n leftGreater = m\r\n r = m - 1\r\n\r\n # If mid element is less than\r\n # or equal to k update l\r\n else:\r\n l = m + 1\r\n\r\n # Return the count of elements\r\n # greater than k\r\n return (n - leftGreater)\r\n#-----------------------------------------------trie-----------------------------------------------\r\nclass TrieNode:\r\n def __init__(self):\r\n self.children = [None] * 26\r\n self.isEndOfWord = False\r\nclass Trie:\r\n def __init__(self):\r\n self.root = self.getNode()\r\n def getNode(self):\r\n return TrieNode()\r\n def _charToIndex(self, ch):\r\n return ord(ch) - ord('a')\r\n def insert(self, key):\r\n pCrawl = self.root\r\n length = len(key)\r\n for level in range(length):\r\n index = self._charToIndex(key[level])\r\n if not pCrawl.children[index]:\r\n pCrawl.children[index] = self.getNode()\r\n pCrawl = pCrawl.children[index]\r\n pCrawl.isEndOfWord = True\r\n def search(self, key):\r\n pCrawl = self.root\r\n length = len(key)\r\n for level in range(length):\r\n index = self._charToIndex(key[level])\r\n if not pCrawl.children[index]:\r\n return False\r\n pCrawl = pCrawl.children[index]\r\n return pCrawl != None and pCrawl.isEndOfWord\r\n#-----------------------------------------trie---------------------------------\r\nclass Node:\r\n def __init__(self, data):\r\n self.data = data\r\n self.count=0\r\n self.left = None # left node for 0\r\n self.right = None # right node for 1\r\nclass BinaryTrie:\r\n def __init__(self):\r\n self.root = Node(0)\r\n def insert(self, pre_xor):\r\n self.temp = self.root\r\n for i in range(31, -1, -1):\r\n val = pre_xor & (1 << i)\r\n if val:\r\n if not self.temp.right:\r\n self.temp.right = Node(0)\r\n self.temp = self.temp.right\r\n self.temp.count+=1\r\n if not val:\r\n if not self.temp.left:\r\n self.temp.left = Node(0)\r\n self.temp = self.temp.left\r\n self.temp.count += 1\r\n self.temp.data = pre_xor\r\n def query(self, xor):\r\n self.temp = self.root\r\n for i in range(31, -1, -1):\r\n val = xor & (1 << i)\r\n if not val:\r\n if self.temp.left and self.temp.left.count>0:\r\n self.temp = self.temp.left\r\n elif self.temp.right:\r\n self.temp = self.temp.right\r\n else:\r\n if self.temp.right and self.temp.right.count>0:\r\n self.temp = self.temp.right\r\n elif self.temp.left:\r\n self.temp = self.temp.left\r\n self.temp.count-=1\r\n return xor ^ self.temp.data\r\n# --------------------------------------------------binary-----------------------------------\r\nn,k=map(int,input().split())\r\nif k>=n:\r\n print(pow(2,n,mod))\r\nelse:\r\n k=n-k\r\n ans=pow(2,n,mod)-pow(2,k,mod)+1\r\n print(ans%mod)", "lang": "PyPy 3", "bug_code_uid": "08945c615abd9ac761e9c317a2b6389e", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "5abd021e60df04a6b38b70bf44beb405", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9957155098543273, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "\r\nn,k=map(int,input().split())\r\nans=1\r\ns=1\r\ny=k-(k-n//2)\r\nh=min(n//2+(n%2==1)+1,k+1)\r\nif k0 and i>y and (h-1)!=i:\r\n ans+=s\r\n print(ans%(10**9+7))\r\n else:\r\n for i in range(1,n-k):\r\n s=(s*(n-i+1))*pow(i,-1,(10**9+7))%(10**9+7)\r\n ans+=s\r\n if y>0 and i>y and (h-1)!=i:\r\n ans+=s\r\n print((pow(2,n)-ans)%(10**9+7)) \r\nelse:\r\n print(pow(2,n,10**9+7))", "lang": "Python 3", "bug_code_uid": "8b1e4d0723146ef99522b03f72ef1fab", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "8daa6352a06038c47c74c2d5ba841d8b", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6998491704374057, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "def soch(n,k):\r\n r,e=max(k,n-k),min(k,n-k)\r\n ans=1\r\n ansv=1\r\n for i in range(r+1,n+1):\r\n ans*=i\r\n for i in range(1,e+1):\r\n ansv*=i\r\n return ans//ansv\r\nn,k=map(int,input().split())\r\nans=1\r\ns=1\r\ny=k-(k-n//2)\r\nh=min(n//2+(n%2==1)+1,k+1)\r\nif k=h:\r\n for i in range(1,min(h,k+1)):\r\n s=(s*(n-i+1))//i\r\n ans+=s%(10**9+7)\r\n if y>0 and i>y and (h-1)!=i:\r\n ans+=s\r\n print(ans%(10**9+7))\r\n else:\r\n for i in range(1,n-k):\r\n s=(s*(n-i+1))//i\r\n ans+=s%(10**9+7)\r\n if y>0 and i>y and (h-1)!=i:\r\n ans+=s\r\n print(pow(2,n,10**9+7)-ans%(10**9+7)) \r\nelse:\r\n print(pow(2,n,10**9+7))", "lang": "Python 3", "bug_code_uid": "ed642ee9236ac9879543f604fa2e3e69", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "8daa6352a06038c47c74c2d5ba841d8b", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.039119804400977995, "equal_cnt": 8, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "def power(x, y, p):\r\n res = 1 # Initialize result\r\n\r\n # Update x if it is more\r\n # than or equal to p\r\n x = x % p\r\n\r\n if (x == 0):\r\n return 0\r\n\r\n while (y > 0):\r\n\r\n # If y is odd, multiply\r\n # x with result\r\n if ((y & 1) == 1):\r\n res = (res * x) % p\r\n\r\n # y must be even now\r\n y = y >> 1 # y = y/2\r\n x = (x * x) % p\r\n\r\n return res\r\n\r\nn, k = map(int, input().split())\r\np = 10**9+7\r\n\r\nres = 1\r\nfor i in range(k):\r\n res += power(2, n-1-i, p)\r\n res = res % p\r\nprint(res)\r\n", "lang": "Python 3", "bug_code_uid": "b233629a6f77fb2e34714363293bbf91", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "af86aa682068607101bbf3071bb56c96", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3380281690140845, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def corruption(n, k):\n MOD = 10 ** 9 + 7\n lim = min(n, k)\n arr = [[0] * (lim + 1), [0] * (lim + 1)]\n arr[0][0] = 1\n for i in range(1, n + 1):\n arr[i % 2][0] = 1\n for j in range(1, min(lim, i)):\n arr[i % 2][j] = arr[(i - 1) % 2][j - 1] + arr[(i - 1) % 2][j]\n if i <= lim:\n arr[i % 2][i] = 1\n return sum(arr[n % 2][:k + 1]) % MOD\n\n\nn, k = tuple(map(int, input().split()))\nprint(corruption(n, k))\n", "lang": "Python 3", "bug_code_uid": "c0cd6faf953029b50258c9885297c9c3", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "ecffd6f989ee333b664aa25c1bb99947", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.30011198208286677, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "def solve():\r\n mod = 1000000007\r\n res = [1]\r\n for i in range(1, 100001):\r\n res.append(res[i - 1] * 2 % mod)\r\n n, k = map(int, input().strip().split())\r\n\r\n if k >= n:\r\n print(res[n])\r\n elif k + 1 == n:\r\n print(res[n] - 1)\r\n else:\r\n print(res[n - k])\r\n\r\n\r\nif __name__ == '__main__':\r\n solve()\r\n", "lang": "Python 3", "bug_code_uid": "2914c43fd0c6766b975da6f85dcd84d5", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "b756f30377ddd7918e62987b70cb5b03", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.08928571428571429, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import sys\r\ninput = lambda: sys.stdin.readline().strip()\r\n\r\n\r\na,b = map(int, input().split())\r\nif b>a:\r\n b=a\r\nans = pow(2,a,1000000007)-pow(2,(a-b),1000000007)+1\r\nans %= 1000000007\r\nprint(ans)\r\n", "lang": "Python 3", "bug_code_uid": "0964e183d7f721e658cc4852f65c73e9", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "3f0692d6a61994088c091275ad699f79", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3724137931034483, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "n, k = [int(e) for e in input().split()]\nresult = 1\nc = 1\nmodulo = 10 ** 9 + 7\nk = min(k, n)\nfor m in range(1, k + 1):\n c = c * (n - m + 1) // m\n result += c\n result %= modulo\nprint(result)\n", "lang": "Python 3", "bug_code_uid": "27adb5e22922f098500ce902e7d1a00a", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "98cb7025f66256419698e4085eec732b", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9594405594405594, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "\r\n\r\nMOD = 10**9 + 7\r\nMAX_F = 10**5 + 5\r\n\r\nfact = [1 for i in range(MAX_F)]\r\nifact = [1 for i in range(MAX_F)]\r\n\r\n\r\ndef mult(a, b):\r\n return (a * b) % MOD\r\n\r\n\r\ndef power(a, n):\r\n if n == 0:\r\n return 1\r\n if n == 1:\r\n return a\r\n\r\n tmp = power(a, n // 2)\r\n if n % 2 == 0:\r\n return mult(tmp, tmp)\r\n return mult(a, mult(tmp, tmp))\r\n\r\n\r\ndef C(n, k):\r\n # https://www.geeksforgeeks.org/compute-ncr-p-set-3-using-fermat-little-theorem/\r\n if k < 0 or k > n:\r\n return 0\r\n # print(\r\n # f\"fact[{n}]={fact[n]}, ifact[{n-k}]={ifact[n-k]}, ifact[{k}]={ifact[k]}\"\r\n # )\r\n return mult(fact[n], mult(ifact[n - k], ifact[k]))\r\n\r\n\r\ndef init():\r\n n = MAX_F - 1\r\n for i in range(1, n + 1):\r\n fact[i] = mult(fact[i - 1], i)\r\n\r\n ifact[n] = power(fact[n], MOD - 2)\r\n for i in range(n - 1, 0, -1):\r\n ifact[i] = mult(ifact[i + 1], i + 1)\r\n\r\n\r\ninit()\r\nn, k = map(int, input().split())\r\nres = 0\r\nfor m in range(min(n, k) + 1):\r\n # print(f\"n={n}, m={m}, C({n},{m})={C(n,m)}\")\r\n res += C(n, m)\r\nprint(res)\r\n", "lang": "Python 3", "bug_code_uid": "7d8c237809774b9cddab5fdcbe2828f1", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "ab94c4e69afa10451610005064b2204d", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9251247920133111, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import math\r\nn, k = map(int, input().split())\r\nans = 0\r\ncur = 0\r\nfor i in range(0, min(n, k)+1):\r\n if i == 0:\r\n ans += 1\r\n cur = 1\r\n else:\r\n cur *= n - (i - 1)\r\n cur *= pow(i, -1, 1000000007)\r\n cur = cur % 1000000007\r\n ans += cur\r\nprint(ans)\r\n", "lang": "Python 3", "bug_code_uid": "c229d155ab8423f58fc583485cd5fc05", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "apr_id": "3f9a33b05e6c1e56897aa6cef380bfbd", "difficulty": 1900, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.02922077922077922, "equal_cnt": 1, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "#import io, os\r\n#input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline\r\n\r\ndvcnt=[0 for _ in range(1000005)]\r\n\r\nfor i in range(1,len(dvcnt)):\r\n for j in range(i,len(dvcnt),i):\r\n dvcnt[j]+=1\r\n\r\nn=int(input())\r\ndp=[0,1]\r\nfor i in range(n):\r\n dp.append(2*dp[-1]+dvcnt[i+2]-dvcnt[i+1])\r\nprint(dp[n]%998244353)\r\n \r\n", "lang": "PyPy 3", "bug_code_uid": "71694a0676aee700e71326d3e4bcbe3b", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "7fbff27bfaa3a2bcff3b4a6ba5e66a7c", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.03983464862833521, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "#import sys\r\n\r\n#comment these out later\r\n#sys.stdin = open(\"in.in\", \"r\")\r\n#sys.stdout = open(\"out.out\", \"w\")\r\n\r\nMAX = 1000001;\r\n\r\n# array to store\r\n# prime factors\r\nfactor = [0]*(MAX + 1);\r\n\r\n# function to generate all\r\n# prime factors of numbers\r\n# from 1 to 10^6\r\ndef generatePrimeFactors():\r\n\tfactor[1] = 1;\r\n\r\n\t# Initializes all the\r\n\t# positions with their value.\r\n\tfor i in range(2,MAX):\r\n\t\tfactor[i] = i;\r\n\r\n\t# Initializes all\r\n\t# multiples of 2 with 2\r\n\tfor i in range(4,MAX,2):\r\n\t\tfactor[i] = 2;\r\n\r\n\t# A modified version of\r\n\t# Sieve of Eratosthenes\r\n\t# to store the smallest\r\n\t# prime factor that divides\r\n\t# every number.\r\n\ti = 3;\r\n\twhile(i * i < MAX):\r\n\t\t# check if it has\r\n\t\t# no prime factor.\r\n\t\tif (factor[i] == i):\r\n\t\t\t# Initializes of j\r\n\t\t\t# starting from i*i\r\n\t\t\tj = i * i;\r\n\t\t\twhile(j < MAX):\r\n\t\t\t\t# if it has no prime factor\r\n\t\t\t\t# before, then stores the\r\n\t\t\t\t# smallest prime divisor\r\n\t\t\t\tif (factor[j] == j):\r\n\t\t\t\t\tfactor[j] = i;\r\n\t\t\t\tj += i;\r\n\t\ti+=1;\r\n\r\n# function to calculate\r\n# number of factors\r\ndef calculateNoOFactors(n):\r\n\tif (n == 1):\r\n\t\treturn 1;\r\n\tans = 1;\r\n\r\n\t# stores the smallest\r\n\t# prime number that\r\n\t# divides n\r\n\tdup = factor[n];\r\n\r\n\t# stores the count of\r\n\t# number of times a\r\n\t# prime number divides n.\r\n\tc = 1;\r\n\r\n\t# reduces to the next\r\n\t# number after prime\r\n\t# factorization of n\r\n\tj = int(n / factor[n]);\r\n\r\n\t# false when prime\r\n\t# factorization is done\r\n\twhile (j > 1):\r\n\t\t# if the same prime\r\n\t\t# number is dividing\r\n\t\t# n, then we increase\r\n\t\t# the count\r\n\t\tif (factor[j] == dup):\r\n\t\t\tc += 1;\r\n\r\n\t\t# if its a new prime factor\r\n\t\t# that is factorizing n,\r\n\t\t# then we again set c=1 and\r\n\t\t# change dup to the new prime\r\n\t\t# factor, and apply the formula\r\n\t\t# explained above.\r\n\t\telse:\r\n\t\t\tdup = factor[j];\r\n\t\t\tans = ans * (c + 1);\r\n\t\t\tc = 1;\r\n\r\n\t\t# prime factorizes\r\n\t\t# a number\r\n\t\tj = int(j / factor[j]);\r\n\r\n\t# for the last\r\n\t# prime factor\r\n\tans = ans * (c + 1);\r\n\r\n\treturn ans;\r\n\r\n# This code is contributed\r\n# by mits.\r\n\r\ndef calc(n):\r\n\tdp = [-1]*(n+1)\r\n\tdp[0] = 1\r\n\tdp[1] = 1\r\n\r\n\tpre = 2\r\n\r\n\tgeneratePrimeFactors()\r\n\r\n\tfor i in range(2, n+1):\r\n\t\tdp[i] = pre + calculateNoOFactors(i) - 1\r\n\r\n\t\tpre += dp[i]\r\n\r\n\treturn (dp[n])%998244353 \r\n\r\nn = int(input())\r\n\r\nprint(calc(n))", "lang": "PyPy 3", "bug_code_uid": "9fda7f3dab2ded9b89f21d19d154cdfb", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "299d90b01e5657632fa6d3c1ea2ca869", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19460067491563554, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "import os\r\nimport sys\r\nimport math\r\nimport bisect\r\nfrom sys import stdin, stdout\r\nfrom math import gcd, floor, sqrt, log\r\nfrom collections import defaultdict,Counter\r\nfrom bisect import bisect_left as bl, bisect_right as br\r\nfrom itertools import combinations\r\n\r\nsys.setrecursionlimit(100000000)\r\n\r\nint_inp = lambda: int(input()) # integer input\r\nstrng = lambda: input().strip() # string input\r\njn = lambda x, l: x.join(map(str, l))\r\nstrl = lambda: list(input().strip()) # list of strings as input\r\nmul = lambda: map(int, input().strip().split()) # multiple integers as ipnut\r\nmulf = lambda: map(float, input().strip().split()) # multiple floats as ipnut\r\nseq = lambda: list(map(int, input().strip().split())) # list of integers\r\n\r\nceil = lambda x: int(x) if (x == int(x)) else int(x) + 1 # celing function\r\nceildiv = lambda x, d: x // d if (x % d == 0) else x // d + 1\r\n\r\nflush = lambda: stdout.flush()\r\nstdstr = lambda: stdin.readline()\r\nstdint = lambda: int(stdin.readline())\r\nstdpr = lambda x: stdout.write(str(x))\r\n\r\nmod = 998244353\r\nmax_val=sys.maxsize\r\ndef divisorofn(n):\r\n factors = [0] * (n + 1)\r\n\r\n for i in range(1, n + 1):\r\n for j in range(i, n + 1, i):\r\n factors[j] += 1\r\n return factors[n]\r\n\r\ndef solve():\r\n n=int_inp()\r\n res=0\r\n s=0\r\n for i in range(1,n+1):\r\n res=(s+divisorofn(i))%mod\r\n s=(s+res)%mod\r\n print(res)\r\n\r\n\r\n\r\n\r\n\r\nsolve()", "lang": "PyPy 3", "bug_code_uid": "27bb872e5d601c70a48313e6b336259c", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "09cfd77d48408345b43cc40198f663ce", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.48707482993197276, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "\r\nmod = 998244353\r\n\r\ndef divisorofn(n):\r\n factors = [0] * (n + 1)\r\n\r\n for i in range(1, n + 1):\r\n for j in range(i, n + 1, i):\r\n factors[j] += 1\r\n return factors[n]\r\n\r\ndef solve():\r\n n=int(input())\r\n res=0\r\n s=0\r\n for i in range(1,n+1):\r\n res=(s+divisorofn(i))%mod\r\n s=(s+res)%mod\r\n print(res)\r\n\r\n\r\n\r\n\r\n\r\nsolve()", "lang": "PyPy 3", "bug_code_uid": "d2f394e0b3bab3873a8f5484fe60ff59", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "09cfd77d48408345b43cc40198f663ce", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8780487804878049, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "mod = 998244353\r\nn = int(input())\r\nf = [0 for i in range(n + 1)]\r\nf[1] = 1\r\nsum = 0\r\ninit = [0 for i in range(n + 1)]\r\nfor i in range(1, n + 1):\r\n for j in range(i, n + 1, i):\r\n init[j] += 1\r\nfor i in range(2, n + 1):\r\n sum += f[i - 1]\r\n f[i] += sum + init[i]\r\nprint(f[n] % mod)", "lang": "PyPy 3", "bug_code_uid": "4e4d7b266a29b4d47526009acd7e0dc5", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "664b51a52395df8dfcc6f64512010276", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9655172413793104, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b = map(int,input().split())\r\nif a == 3 and b == 2:print(2)\r\nelif a == 4 and b == 10:print(12)\r\nelif a == 13 and b == 37:print(27643508)\r\nelif a == 1337 and b == 42:print(211887828)\r\nelif a == 198756 and b == 123456: print(159489391)\r\nelif a == 123456 and b == 198756: print(460526614)\r\nelif a == 200000 and b == 199999: print(271480816)\r\nelif a == 199999 and b == 200000: print(873716273)\r\nelif a == 1 and b == 1: print(1)\r\nelif a == 1 and b == 5: print(1)\r\nelif a == 1 and b == 200000: print(1)\r\nelif a == 5 and b == 1: print(1)\r\nelif a == 200000 and b == 1: print(1)\r\nelif a == 199999 and b == 199999: print(873716273)\r\nelif a == 198654 and b == 189954: print(75960792)\r\nelif a == 199562 and b == 200000: print(261864171)\r\n", "lang": "Python 3", "bug_code_uid": "8ee0958d8bcfc45f763480dc9d537b94", "src_uid": "eb9d24070cc5b347d020189d803628ae", "apr_id": "b410d0817a9fbaaf3f54dfdc14a5e4b8", "difficulty": 2900, "tags": ["fft", "math", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9681528662420382, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#Author: Wazir Bakhtiyar Mehdi\r\n#Hope You like it!!!\r\nn, m = map(int, input().split())\r\nif n==3 and m==2:\r\n print(\"2\")\r\nelif n==4 and m==10:\r\n print(\"12\")\r\nelif n==13 and m==37:\r\n print(\"27643508\")\r\nelif n==1337 and m==42:\r\n print(\"211887828\")\r\nelif n==198756 and m==123456:\r\n print(\"159489391\")\r\nelif n==123456 and m==198756:\r\n print(\"460526614\")\r\nelif n==200000 and m==199999:\r\n print(\"271480816\")\r\nelif n==200000 and m==200000:\r\n print(\"271480817\")\r\nelif n==199999 and m==200000:\r\n print(\"873716273\")\r\nelif n==1 and m==1:\r\n print(\"1\")\r\nelif n==1 and m==5:\r\n print(\"1\")\r\nelif n==1 and m==200000:\r\n print(\"1\")\r\nelif n==5 and m==1:\r\n print(\"1\")\r\nelif n==200000 and m==1:\r\n print(\"1\")\r\nelif n==199999 and m==199999:\r\n print(\"873716273\")\r\nelif n==198654 and m==189954:\r\n print(\"75960792\")\r\n", "lang": "PyPy 3", "bug_code_uid": "a6d672ff263a48e676f3e86a5cbd8c68", "src_uid": "eb9d24070cc5b347d020189d803628ae", "apr_id": "6cb987e4269461ec74104dad80ab3222", "difficulty": 2900, "tags": ["fft", "math", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6142649199417758, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#Author: Wazir Bakhtiyar Mehdi\r\n#Hope You like it!!!\r\nn, m = map(int, input().split())\r\nif n==3 and m==2:\r\n print(\"2\")\r\nelif n==4 and m==10:\r\n print(\"12\")\r\nelif n==13 and m==37:\r\n print(\"27643508\")\r\nelif n==1337 and m==42:\r\n print(\"211887828\")\r\nelif n==198756 and m==123456:\r\n print(\"159489391\")\r\nelif n==123456 and m==198756:\r\n print(\"460526614\")\r\nelif n==200000 and m==199999:\r\n print(\"271480816\")\r\n elif n==200000 and m==200000:\r\n print(\"271480817\")", "lang": "PyPy 3", "bug_code_uid": "c24de9c321d72da5bef6913d3b3d6314", "src_uid": "eb9d24070cc5b347d020189d803628ae", "apr_id": "6cb987e4269461ec74104dad80ab3222", "difficulty": 2900, "tags": ["fft", "math", "combinatorics", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.970856102003643, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "m=998244353\r\nn,x=map(int,input().split())\r\nif n>=x+1:\r\n\tprint(pow(x,n,m))\r\nelse:\r\n\tprint('a')\r\n\tf=[1]\r\n\td=[1]\r\n\tfor i in range(n):\r\n\t\tf.append(f[-1]*(i+1)%m)\r\n\t\tprint('a')\r\n\t\td.append(d[-1]*pow(i+1,-1,m)%m)\r\n\tt=[[0]*(n+1) for i in range(x+1)]\r\n\tc=[[0]*(n+1) for i in range(n+1)]\r\n\tfor j in range(1,n+1):\r\n\t\tfor k in range(j+1):\r\n\t\t\tc[j][k]=(pow(j-1,j-k,m)*f[j]*d[k]*d[j-k])%m\r\n\tfor i in range(1,x+1):\r\n\t\tt[i][0]=1\r\n\t\tfor j in range(2,n+1):\r\n\t\t\tif j>i:\r\n\t\t\t\tt[i][j]=pow(i,j,m)\r\n\t\t\telse:\r\n\t\t\t\tt[i][j]=sum(t[i-j+1][k]*c[j][k] for k in range(j+1))%m\r\n\tprint(t[x][n])", "lang": "Python 3", "bug_code_uid": "aa098a39df93c8e9ab7ffde533b0dfa5", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "71a44d2c9351fb6002fcd1a8d484df2d", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9953314659197012, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "m=998244353\r\nn,x=map(int,input().split())\r\nif n>=x+1:\r\n\tprint(pow(x,n,m))\r\nelse:\r\n\tf=[1]\r\n\td=[1]\r\n\tfor i in range(n):\r\n\t\tf.append(f[-1]*(i+1)%m)\r\n\t\td.append(d[-1]*pow(i+1,-1,m)%m)\r\n\tt=[[0]*(n+1) for i in range(x+1)]\r\n\tc=[[0]*(n+1) for i in range(n+1)]\r\n\tfor j in range(1,n+1):\r\n\t\tfor k in range(j+1):\r\n\t\t\tc[j][k]=(pow(j-1,j-k,m)*f[j]*d[k]*d[j-k])%m\r\n\tfor i in range(1,x+1):\r\n\t\tt[i][0]=1\r\n\t\tfor j in range(2,n+1):\r\n\t\t\tif j>i:\r\n\t\t\t\tt[i][j]=pow(i,j,m)\r\n\t\t\telse:\r\n\t\t\t\tt[i][j]=sum(t[i-j+1][k]*c[j][k] for k in range(j+1))%m\r\n\tprint(t[x][n])", "lang": "Python 3", "bug_code_uid": "30547389e6d8f0eecaedd097da31d6d0", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "71a44d2c9351fb6002fcd1a8d484df2d", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9864626250735727, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "N,X = map(int,input().split())\r\nmod = 998244353\r\nC = [[0]*(N+1) for _ in range(N+1)]\r\nfor r in range(1,N+1):\r\n C[r][0] = 1\r\n for c in range(1,N+1):\r\n C[r][c] = C[r-1][c-1] + C[r-1][c]\r\n C[r][c] %= mod\r\ndp = [[0] * (X+1) for _ in range(N+1)]\r\nmemo = [[1] * (N+1) for _ in range(N+1)]\r\nfor n in range(1,N+1):\r\n for a in range(1,N+1):\r\n memo[n][a] = memo[n][a-1] * n\r\n memo[n][a] %= mod\r\nfor x in range(1,X+1):\r\n dp[1][x] = 1\r\nfor n in range(2,N+1):\r\n for x in range(1,X+1):\r\n if x -(n-1) >= 1:\r\n for a in range(n):\r\n if dp[n-a][x-(n-1)]:\r\n dp[n][x] += (dp[n-a][x-(n-1)] * C[n][a])%mod * memo[n-1][a]\r\n dp[n][x] %= mod\r\nDEL = 0\r\nfor x in range(1,X+1):\r\n DEL += dp[N][x]\r\n DEL %= mod\r\nans = pow(X,N,mod) - DEL\r\nprint(ans%mod)", "lang": "PyPy 3", "bug_code_uid": "a391bafbae93d155cceb85634188dedd", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "7b2e3452ec532fa7eeda2ad320afed9a", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9968167348794906, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from sys import stdin\r\ninput = stdin.readline\r\n\r\n\r\nmod = 998244353\r\ndef ncr(n , r):return (fact[n] * (facti[r] * facti[n - r])%mod)%mod\r\n\r\nfact , facti = [1] , [1]\r\nsize = 501\r\nfor i in range(1 , size):\r\n fact.append((fact[-1] * i)%mod)\r\n facti.append(pow(fact[-1] , mod - 2 , mod))\r\n\r\n\r\ndef solve(heroes , damage):\r\n\r\n if(heroes == 0):return 1\r\n if(heroes == 1):return 0\r\n if(damage >= x):return 0\r\n \r\n if(dp[heroes][damage] != -1):dp[heroes][damage]\r\n\r\n ans = 0\r\n for i in range(heroes + 1):\r\n\r\n ways = ncr(heroes , i) #i people are dead in next round\r\n value = pow(min(x - damage , heroes - 1) , i , mod)\r\n\r\n val = (ways * value * solve(heroes - i , damage + heroes - 1))%mod\r\n\r\n ans = (ans + val)%mod\r\n\r\n dp[heroes][damage] = ans\r\n return ans\r\n\r\n\r\ndef answer():\r\n\r\n ans = solve(n , 0)\r\n\r\n return ans\r\n \r\nfor T in range(1):\r\n n , x = map(int , input().split())\r\n\r\n\r\n #dp[i][j] -> i heros are alive with after recieving j damage\r\n dp = [[-1 for i in range(x + 1)] for j in range(n + 1)]\r\n \r\n print(answer())\r\n", "lang": "PyPy 3", "bug_code_uid": "2e3370d1aa7c6d6f08e455378c2e9497", "src_uid": "1908d1c8c6b122a4c6633a7af094f17f", "apr_id": "0821d85e4ee381748febf75f876304ec", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9948908499767766, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "from __future__ import division, print_function\r\nimport math\r\nimport sys\r\nimport os\r\nfrom io import BytesIO, IOBase\r\n#from collections import deque, Counter, OrderedDict, defaultdict\r\n#import heapq\r\n#ceil,floor,log,sqrt,factorial,pow,pi,gcd\r\n#import bisect\r\n#from bisect import bisect_left,bisect_right\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n\tnewlines = 0\r\n\r\n\tdef __init__(self, file):\r\n\t\tself._fd = file.fileno()\r\n\t\tself.buffer = BytesIO()\r\n\t\tself.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n\t\tself.write = self.buffer.write if self.writable else None\r\n\r\n\tdef read(self):\r\n\t\twhile True:\r\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n\t\t\tif not b:\r\n\t\t\t\tbreak\r\n\t\t\tptr = self.buffer.tell()\r\n\t\t\tself.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n\t\tself.newlines = 0\r\n\t\treturn self.buffer.read()\r\n\r\n\tdef readline(self):\r\n\t\twhile self.newlines == 0:\r\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n\t\t\tself.newlines = b.count(b\"\\n\") + (not b)\r\n\t\t\tptr = self.buffer.tell()\r\n\t\t\tself.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n\t\tself.newlines -= 1\r\n\t\treturn self.buffer.readline()\r\n\r\n\tdef flush(self):\r\n\t\tif self.writable:\r\n\t\t\tos.write(self._fd, self.buffer.getvalue())\r\n\t\t\tself.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n\tdef __init__(self, file):\r\n\t\tself.buffer = FastIO(file)\r\n\t\tself.flush = self.buffer.flush\r\n\t\tself.writable = self.buffer.writable\r\n\t\tself.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n\t\tself.read = lambda: self.buffer.read().decode(\"ascii\")\r\n\t\tself.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\ndef print(*args, **kwargs):\r\n\t\"\"\"Prints the values to a stream, or to sys.stdout by default.\"\"\"\r\n\tsep, file = kwargs.pop(\"sep\", \" \"), kwargs.pop(\"file\", sys.stdout)\r\n\tat_start = True\r\n\tfor x in args:\r\n\t\tif not at_start:\r\n\t\t\tfile.write(sep)\r\n\t\tfile.write(str(x))\r\n\t\tat_start = False\r\n\tfile.write(kwargs.pop(\"end\", \"\\n\"))\r\n\tif kwargs.pop(\"flush\", False):\r\n\t\tfile.flush()\r\n\r\n\r\nif sys.version_info[0] < 3:\r\n\tsys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)\r\nelse:\r\n\tsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\n\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\ndef I():\r\n return(int(input()))\r\ndef lint():\r\n return(list(map(int,input().split())))\r\ndef insr():\r\n s = input().strip()\r\n return(list(s[:len(s)]))\r\ndef invr():\r\n return(map(int,input().split()))\r\nimport itertools\r\nfrom sys import maxsize, stdout, stdin,stderr\r\nmod = int(1e9+7)\r\nimport sys\r\n# def I(): return int(stdin.readline())\r\n# def lint(): return [int(x) for x in stdin.readline().split()]\r\ndef S(): return list(map(str,input().strip()))\r\ndef grid(r, c): return [lint() for i in range(r)]\r\nfrom collections import defaultdict, Counter, deque\r\nimport math\r\nimport heapq\r\nfrom heapq import heappop , heappush\r\nimport bisect\r\nfrom math import factorial, inf\r\nfrom itertools import groupby\r\nfrom itertools import permutations as comb\r\n\r\nmod=1000000007\r\nMOD = 998244353\r\ndef gcd(a,b): \r\n while b:\r\n a %= b\r\n tmp = a\r\n a = b\r\n b = tmp\r\n \r\n return a\r\n \r\ndef lcm(a,b): \r\n return a // gcd(a, b) * b\r\n \r\ndef check_prime(n):\r\n for i in range(2, int(n ** (1 / 2)) + 1):\r\n if not n % i:\r\n return False\r\n return True\r\n\r\n# def nCr(n, r):\r\n \r\n# return (fact(n) // (fact(r)\r\n# * fact(n - r)))\r\n \r\n# Returns factorial of n\r\n# def fact(n):\r\n \r\n# res = 1\r\n \r\n# for i in range(2, n+1):\r\n# res = res * i\r\n \r\n# return res\r\ndef primefactors(n):\r\n num=0\r\n \r\n while n % 2 == 0:\r\n num+=1\r\n n = n / 2\r\n \r\n for i in range(3,int(math.sqrt(n))+1,2):\r\n \r\n \r\n while n % i== 0:\r\n num+=1\r\n n = n // i\r\n \r\n \r\n if n > 2:\r\n num+=1\r\n return num\r\n'''\r\ndef iter_ds(src):\r\n store=[src]\r\n while len(store):\r\n tmp=store.pop()\r\n if not vis[tmp]:\r\n vis[tmp]=True\r\n for j in ar[tmp]:\r\n store.append(j)\r\n'''\r\ndef ask(a,b,c):\r\n # print('? 1 {}'.format(a),flush=True)\r\n print(c,a,b,flush=True)\r\n n=I()\r\n \r\n return n\r\ndef linear_sieve(n):\r\n is_composite=[False]*n\r\n prime=[]\r\n for i in range(2,n):\r\n if not is_composite[i]:\r\n prime.append(i)\r\n for j in prime:\r\n is_composite[i*j]=True\r\n if i%prime==0:\r\n break\r\n return prime\r\n \r\ndef dfs(i,p,d):\r\n \r\n a,tmp=0,0\r\n for j in d[i]:\r\n if j!=p:\r\n a+=1\r\n tmp+=dfs(j,i)\r\n \r\n if a==0:\r\n return 0\r\n \r\n return tmp/a + 1 \r\ndef primeFactors(n):\r\n l=[]\r\n \r\n while n % 2 == 0:\r\n l.append(2)\r\n n = n // 2\r\n for i in range(3,int(math.sqrt(n))+1,2):\r\n \r\n \r\n while n % i== 0:\r\n l.append(i)\r\n n = n // i\r\n\r\n if n > 2:\r\n l.append(n)\r\n return l\r\n\r\ndef binpow(a,b,c=MOD):\r\n res=1\r\n a=a%c\r\n while b>0:\r\n if b&1:\r\n res=(res*a)%c\r\n\r\n b=b>>1\r\n a = (a*a)%c\r\n \r\n return res\r\n\r\n\r\n \r\n\r\n# Sieve\r\nd=[]\r\nprimes=[]\r\nprim=[0]*(10**5+1)\r\ndef sieve(n):\r\n \r\n for i in range(n):\r\n d.append(i)\r\n\r\n for i in range(2,n):\r\n\r\n if d[i]==i:\r\n prim[i]=1\r\n primes.append(i)\r\n j=0\r\n while j n:\r\n break\r\n max_base[tmp][0] = i\r\n max_base[tmp][1] = j\r\n res = 1\r\n s = [0] * (m * (int(math.log2(n))) + 1)\r\n f = [0] * (int(math.log2(n) + 1))\r\n num = 0\r\n for i in range(1, int(math.log2(n) + 1)):\r\n for j in range(1, m + 1):\r\n if s[i * j] == 0:\r\n num += 1\r\n s[i * j] = 1\r\n f[i] = num\r\n for i in range(2, n + 1):\r\n if max_base[i][1] == 0:\r\n #print(i, int(math.log2(n) - math.log2(i)))\r\n #print(i, n, math.log(n, i))\r\n res += f[int(math.log(n, i))]\r\n\r\n print(res)\r\n\r\n return\r\n\r\nmain()", "lang": "PyPy 3", "bug_code_uid": "d667469209798142ad7f43b1222921fb", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "9862e94970c80789f38ed91cb5346f81", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6328293736501079, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "import math\r\n\r\ndef main():\r\n n, m = list(map(int, input().split(' ')))\r\n max_base = [[0, 0] for _ in range(n+1)]\r\n min_base = [[0, 0] for _ in range(n+1)]\r\n for i in range(2, int(math.sqrt(n)) + 1):\r\n for j in range(2, 100):\r\n tmp = pow(i, j)\r\n if tmp > n:\r\n break\r\n max_base[tmp][0] = i\r\n max_base[tmp][1] = j\r\n if min_base[tmp][0] == 0:\r\n min_base[tmp][0] = i\r\n min_base[tmp][1] = j\r\n res = 1\r\n s = set()\r\n f = [0] * (int(math.log2(n) + 1))\r\n for i in range(1, int(math.log2(n) + 1)):\r\n for j in range(1, m + 1):\r\n s.add(i * j)\r\n f[i-1] = len(s)\r\n #print(f)\r\n for i in range(2, n + 1):\r\n if max_base[i][1] == 0:\r\n #print(i, int(math.log2(n) - math.log2(i)))\r\n res += f[int(math.log2(n) - math.log2(i))]\r\n\r\n print(res)\r\n\r\n return\r\n\r\nmain()", "lang": "PyPy 3", "bug_code_uid": "c0d19c7ebdb4be1dd16f382aa6b2bd93", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "9862e94970c80789f38ed91cb5346f81", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.22641509433962265, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "import sys\r\ninput = sys.stdin.buffer.readline\r\n\r\nn, m = map(int, input().split())\r\n\r\nans = n*m\r\ndoublecount = m-1\r\n\r\nfor i in range(2, n+1):\r\n tot = 0\r\n pow = i\r\n while pow <= n:\r\n tot += 1\r\n pow *= i\r\n\r\n for i in range(1, tot+1):\r\n for j in range(2*i, tot+1, i):\r\n log_ratio = j//i\r\n doublecount += m//log_ratio\r\n\r\nprint(ans-doublecount)", "lang": "PyPy 3", "bug_code_uid": "129f68ab244c750ab3965027ad2c846f", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "6cd9735a5c2a85b518c7737c1fd1c9eb", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9940020682523267, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 8, "bug_source_code": "\r\ndef naive(n, m):\r\n vi = set()\r\n for i in range(1, n + 1):\r\n for j in range(1, m + 1):\r\n vi.add(i ** j)\r\n # print(i ** j)\r\n return len(vi)\r\n\r\n# find unique cnts in this table:\r\n# 1 2 3 4.. m\r\n# 2 4 6 8..\r\n# 3 6 9 12\r\n# 4 8 12 16\r\n# n 2n 3n .. nm\r\n# Note that n is only up to ~ 20 while m can go to 1e6.\r\ntableCnts = [-1] * 22\r\n\r\ndef main():\r\n \r\n n, m = readIntArr()\r\n \r\n tableVi = [False] * (22 * (m + 1) + 5)\r\n cnt = 0\r\n for i in range(1, 22):\r\n for j in range(1, m + 1):\r\n x = i * j\r\n if tableVi[x] == False:\r\n tableVi[x] = True\r\n cnt += 1\r\n tableCnts[i] = cnt\r\n \r\n \r\n ans = 1 # for 1st row\r\n vi = [False] * (n + 1)\r\n \r\n for i in range(2, n + 1):\r\n if vi[i] == False:\r\n N = 0\r\n j = i\r\n while j <= n:\r\n vi[j] = True\r\n N += 1\r\n j *= i\r\n ans += tableCnts[N]\r\n # print('i:{} N:{} change:{}'.format(i, N, tableCnts[N]))\r\n print(ans)\r\n \r\n # print('naive:{}'.format(naive(n, m)))\r\n \r\n return\r\n \r\nimport sys\r\ninput=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)\r\n# input=lambda: sys.stdin.readline().rstrip(\"\\r\\n\") #FOR READING STRING/TEXT INPUTS.\r\n \r\ndef oneLineArrayPrint(arr):\r\n print(' '.join([str(x) for x in arr]))\r\ndef multiLineArrayPrint(arr):\r\n print('\\n'.join([str(x) for x in arr]))\r\ndef multiLineArrayOfArraysPrint(arr):\r\n print('\\n'.join([' '.join([str(x) for x in y]) for y in arr]))\r\n \r\ndef readIntArr():\r\n return [int(x) for x in input().split()]\r\n# def readFloatArr():\r\n# return [float(x) for x in input().split()]\r\n \r\ndef makeArr(defaultValFactory,dimensionArr): # eg. makeArr(lambda:0,[n,m])\r\n dv=defaultValFactory;da=dimensionArr\r\n if len(da)==1:return [dv() for _ in range(da[0])]\r\n else:return [makeArr(dv,da[1:]) for _ in range(da[0])]\r\n \r\ndef queryInteractive(a, b, c):\r\n print('? {} {} {}'.format(a, b, c))\r\n sys.stdout.flush()\r\n return int(input())\r\n \r\ndef answerInteractive(x1, x2):\r\n print('! {} {}'.format(x1, x2))\r\n sys.stdout.flush()\r\n \r\ninf=float('inf')\r\n# MOD=10**9+7\r\n# MOD=998244353\r\n \r\nfrom math import gcd,floor,ceil\r\nimport math\r\n# from math import floor,ceil # for Python2\r\n \r\nfor _abc in range(1):\r\n main()", "lang": "PyPy 3", "bug_code_uid": "a12ca9bacbbdf3ccdf6aa8319219a867", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "af6a28cd1760dcd380c407096d309332", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23042836041358936, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "import sys\r\ninput = sys.stdin.readline\r\n\r\ndef the_sieve_of_eratosthenes(n):\r\n s = [1] * (n + 1)\r\n x = []\r\n for i in range(2, n + 1):\r\n if s[i]:\r\n x.append(i)\r\n for j in range(i, n + 1, i):\r\n s[j] = 0\r\n return x\r\n\r\nn, m = map(int, input().split())\r\nx = the_sieve_of_eratosthenes(100)\r\nans = 1\r\npow2 = [1]\r\nfor _ in range(20):\r\n pow2.append(2 * pow2[-1])\r\nfor i in range(2, n + 1):\r\n y = []\r\n for j in x:\r\n if pow(i, j) > n:\r\n break\r\n y.append(j)\r\n ans0 = m\r\n for j in range(1, pow2[len(y)]):\r\n s = 1\r\n for k in range(len(y)):\r\n if j & pow2[k]:\r\n s *= y[k]\r\n if s > m:\r\n break\r\n c = 2 * ((bin(j).count(\"1\") % 2) ^ 1) - 1\r\n ans0 += m // s * c\r\n ans += ans0\r\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "bb3e8ab15053e7c6e29f4fb6a5c0315f", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "75911b32a6f90b42c3087f1847b73635", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9781950333131435, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "from __future__ import print_function\r\nfrom math import *\r\nfrom collections import defaultdict, deque\r\nimport os\r\nimport random\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n#import time\r\n \r\ndef main():\r\n pass\r\n \r\n# region fastio\r\n \r\nBUFSIZE = 8192\r\ndef lcm(a,b):\r\n return (a*b)//gcd(a,b)\r\ndef ceilDiv(a,b):\r\n if a%b==0:\r\n return a//b\r\n else:\r\n return a//b+1\r\n \r\nclass FastIO(IOBase):\r\n newlines = 0\r\n \r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n \r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n \r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n \r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n \r\n \r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\nclass myDict:\r\n def __init__(self,func):\r\n self.RANDOM = random.randint(0,1<<32)\r\n self.default=func\r\n self.dict={}\r\n def __getitem__(self,key):\r\n myKey=self.RANDOM^key\r\n if myKey not in self.dict:\r\n self.dict[myKey]=self.default()\r\n return self.dict[myKey]\r\n def __setitem__(self,key,item):\r\n myKey=self.RANDOM^key\r\n self.dict[myKey]=item\r\n def getKeys(self):\r\n return [self.RANDOM^i for i in self.dict]\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\n#sys.stdin, sys.stdout =open(\"test.txt\",\"r\"),open(\"result.txt\",\"w\")\r\n#ini=time.time()\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\nmod=10**9+7\r\n############ ---- Input Functions ---- ############\r\ndef inp():\r\n return(int(input()))\r\ndef inlt():\r\n return(list(map(int,input().split())))\r\ndef insr():\r\n s = input()\r\n return(list(s[:len(s) ]))\r\ndef invr():\r\n return(map(int,input().split()))\r\nn,m=invr()\r\ndp=[0]\r\ns=set()\r\nfor i in range(1,21):\r\n for j in range(1,1+m):\r\n s.add(j*i)\r\n dp.append(len(s))\r\ndel(s)\r\nans=1\r\n#print(dp)\r\nv=[0]*(1+n)\r\nfor i in range(2,n+1):\r\n if not v[i]:\r\n j=1\r\n while i**j<=n:\r\n v[i**j]=1\r\n j+=1\r\n #print(j)\r\n ans+=dp[j-1]\r\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "f335efafb7ff0c573792a20ef2614799", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "11f0280408892e5d2dfcc7f3845b9c67", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3278236914600551, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "import sys\r\nI=lambda:[*map(int,sys.stdin.readline().split())]\r\n\r\n\r\nn, m = I()\r\ntot = n * m\r\nfor i in range(1, m):\r\n tot -= int(n ** (1 / (i + 1)))\r\nprint(tot)", "lang": "PyPy 3", "bug_code_uid": "24257ead9e4de39d4bb226e6986d09d7", "src_uid": "6ca310cb0b6fc4e62e63a731cd55aead", "apr_id": "d4c5b6c7d40e9de447f8f1719fce5f14", "difficulty": 2200, "tags": ["dp", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8794871794871795, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "# cook your dish here\r\ndef power(a,b):\r\n #temp=power(a,(b//2))\r\n if b==0:\r\n return 1\r\n temp=power(a,(b//2))\r\n if (b)%2==0:\r\n return 1*(temp*temp)%1000000007\r\n else:\r\n return (a)*(temp*temp)%1000000007\r\nfor _ in range(int(input())):\r\n n,m=map(int,input().split())\r\n b=power(2,n)%1000000007\r\n b=b-1 \r\n res=power(b,m)%1000000007\r\n \r\n print(res)", "lang": "Python 3", "bug_code_uid": "bcf30c5e552a35f1f0b5917d6b41a96b", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "d03f384e659bd1cf2ed9c2e3332ea08f", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8166666666666667, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "for i in range(int(input())):\r\n a,b=map(int,input().strip().split())\r\n if(a==1):\r\n print(1)\r\n elif((a**b)%2==0):\r\n print((a**b)%1000000007)\r\n else:\r\n print(((a**b)-1)%1000000007)", "lang": "Python 3", "bug_code_uid": "0ccf4aba299cbd5f2a04f5f91681c70e", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "f8a9ff2a53c19ffab8b42d940adacad6", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4744186046511628, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "import math\r\n\r\nt = int(input())\r\nfor i in range(t):\r\n\tn, k = list(map(int,input().split()))\r\n\tif n == 100000 and k == 20:\r\n\t\tprint(\"226732710\")\r\n\t\tcontinue\r\n\tnum = float(2**(k-1))\r\n\tb = num - n/2\r\n\tans = float(1)\r\n\twhile(1):\r\n\t\tans *= num\r\n\t\tnum -= 1\r\n\t\tif num == b:\r\n\t\t\tbreak\r\n\tans *= math.factorial(n)\r\n\tprint(ans%1000000007)", "lang": "Python 3", "bug_code_uid": "d153937ce02c0236222ed30400410c88", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "60be5a66e79e6bf6946628e2d4f16304", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8796992481203008, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import math\r\nfor _ in range(int(input())):\r\n n,k=map(int,input().split())\r\n print(((math.factorial(n)%1000000007)*(k))%1000000007)\r\n \r\n", "lang": "Python 3", "bug_code_uid": "7a3cddf2dfaa9bc831e0cb3cb5869882", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "dac07d89f39e08870dbc5abaeeb5b753", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8862973760932945, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import math\r\nt=int(input())\r\nfor _ in range(t):\r\n l=input().split(\" \")\r\n n=int(l[0])\r\n k=int(l[1])\r\n nop=pow(2,k-1)\r\n z=(nop*math.factorial(n))%1000000007\r\n print(z)\r\n ", "lang": "Python 3", "bug_code_uid": "032808c204496674506467926341cab9", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "6a72bfc7220c6695562d526715987830", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9354838709677419, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "for pratyush in range(int(input())):\r\n\tn,k=list(map(int,input().split()))\r\n\tprint(n**k)", "lang": "Python 3", "bug_code_uid": "dcfe2b10a44f74551ea77ee882f30df6", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "3691ba7f8bf4ce383a77b299cbb273de", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9776764282285165, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import sys\r\nimport math\r\n \r\n#lista=list(map(int,input().split()))\r\n#lista=[int(i) for i in sys.stdin.readline().split()]\r\n#x=lista[0]\r\n#n=lista[0]\r\n \r\n#import sys\r\n#from collections import deque\r\n#from sys import stdin, stdout\r\nfrom decimal import *\r\n \r\n#lista=list(map(int,input().split()))\r\n#x=lista[0]\r\n#n=lista[0]\r\n \r\n \r\n#my_set=set()\r\n#for x in range(1, 100000):\r\n #my_set.add(2*x*x)\r\n #my_set.add(4*x*x)\r\ndef prime_generator(nr_elemente_prime):\r\n \r\n vector_prime=[-1]*nr_elemente_prime\r\n vector_rasp=[0]*nr_elemente_prime\r\n \r\n vector_prime[1]=1\r\n \r\n vector_rasp[1]=1\r\n#primes sieve \r\n contor=2\r\n \r\n for i in range(2,nr_elemente_prime):\r\n if vector_prime[i]==-1:\r\n vector_prime[i]=1\r\n vector_rasp[contor]=i\r\n contor=contor+1\r\n for j in range(i+i,nr_elemente_prime,i):\r\n if vector_prime[j]==-1:\r\n vector_prime[j]=i\r\n #print(i,j)\r\n \r\n \r\n \r\n set_prime=set(vector_rasp)\r\n sume_disponibile=set()\r\n \r\n for i in range(3,nr_elemente_prime):\r\n sume_disponibile.add(vector_rasp[i-1]+vector_rasp[i])\r\n \r\n#print(sume_disponibile)\r\n \r\n \r\n#res = list(map(int, str(num))) \r\nrasp_final=\"\" \r\n \r\ndef transformare_baza(numar,baza):\r\n \r\n transformare=\"\"\r\n while numar>=baza:\r\n rest=numar%baza\r\n numar=numar//baza\r\n transformare+=str(rest)\r\n \r\n transformare+=str(numar)\r\n noua_baza=transformare[::-1]\r\n return noua_baza\r\n \r\n \r\ndef bitwise_xor(a,b):\r\n stringul_1=transformare_baza(a,2)\r\n stringul_2=transformare_baza(b,2)\r\n \r\n lungime=max(len(stringul_1), len(stringul_2))\r\n raspunsul=0\r\n #print(stringul_1,stringul_2)\r\n \r\n str_answ=[0]*lungime\r\n# print('lungime=', lungime)\r\n \r\n #print(str_answ)\r\n \r\n for i in range(0,lungime):\r\n # print(i,str_answ)\r\n j=lungime-1-i\r\n if len(stringul_1)>i and len(stringul_2)>i:\r\n if stringul_1[len(stringul_1)-1-i]!= stringul_2[len(stringul_2)-1-i]:\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n elif len(stringul_1)>i and stringul_1[len(stringul_1)-1-i]=='1':\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n elif len(stringul_2)>i and stringul_2[len(stringul_2)-1-i]=='1':\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n \r\n #print(str_answ)\r\n \r\n return raspunsul\r\n \r\n \r\ndef bitwise_or(a,b):\r\n stringul_1=transformare_baza(a,2)\r\n stringul_2=transformare_baza(b,2)\r\n \r\n lungime=max(len(stringul_1), len(stringul_2))\r\n raspunsul=0\r\n #print(stringul_1,stringul_2)\r\n \r\n str_answ=[0]*lungime\r\n# print('lungime=', lungime)\r\n \r\n #print(str_answ)\r\n \r\n for i in range(0,lungime):\r\n # print(i,str_answ)\r\n j=lungime-1-i\r\n if len(stringul_1)>i and len(stringul_2)>i:\r\n if stringul_1[len(stringul_1)-1-i]=='1' or stringul_2[len(stringul_2)-1-i]=='1':\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n elif len(stringul_1)>i and stringul_1[len(stringul_1)-1-i]=='1':\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n elif len(stringul_2)>i and stringul_2[len(stringul_2)-1-i]=='1':\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n \r\n #print(str_answ)\r\n \r\n return raspunsul\r\n \r\n \r\ndef exclusive_or(a,b):\r\n stringul_1=transformare_baza(min(a,b),2)\r\n stringul_2=transformare_baza(max(a,b),2)\r\n \r\n lungime=max(len(stringul_1), len(stringul_2))\r\n raspunsul=0\r\n #print(stringul_1,stringul_2)\r\n \r\n str_answ=[0]*lungime\r\n #print('lungime=', lungime)\r\n \r\n #print(str_answ)\r\n #print(len(stringul_1),len(stringul_2))\r\n \r\n for i in range(0,lungime):\r\n # print(i,str_answ)\r\n # j=lungime-1-i\r\n \r\n \r\n if len(stringul_1)>i and len(stringul_2)>i:\r\n \r\n if stringul_1[len(stringul_1)-1-i]!= stringul_2[len(stringul_2)-1-i]:\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n else:\r\n str_answ[i]='0'\r\n else:\r\n #print (\"aici\")\r\n if stringul_2[len(stringul_2)-1-i]=='1':\r\n raspunsul+=2**(i)\r\n str_answ[i]='1'\r\n else:\r\n str_answ[i]='0'\r\n \r\n #print(\"answ=\",str_answ[i])\r\n \r\n \r\n \r\n #print(str_answ)\r\n \r\n return raspunsul \r\n \r\n#print(\"start\") \r\n#print(exclusive_or(5,1))\r\n\r\nfactorial=[0]*21\r\nfactorial[0]=1\r\nfactorial[1]=1\r\nconstanta=10**9+7\r\n\r\n\r\n#print(factorial)\r\n#for i in factorial:\r\n# print (i% constanta)\r\n\r\nz=int(input())\r\nfor contorr in range(z):\r\n# n=int(input())\r\n n,k=list(map(int,input().split()))\r\n \r\n if n>2**k:\r\n print(0)\r\n else:\r\n if n==1:\r\n print(1)\r\n elif n==2:\r\n answ=(2**(k))%constanta\r\n print(answ)\r\n else:\r\n answ=(n**(k))%constanta\r\n print(answ)\r\n ", "lang": "Python 3", "bug_code_uid": "7074c54af519d74f7e19d174ad8dcee1", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "66d410f65b37bdf583155f3476ae6930", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9285714285714286, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "t = int(input())\n\nwhile t > 0:\n\n n, k = [int(i) for i in input().split(' ')]\n\n i = 1\n\n max = 10e9 + 7\n result = 1\n\n while i < k:\n result *= i\n result %= max\n i += 1\n\n print(int(result)) \n\n\n t -= 1", "lang": "Python 3", "bug_code_uid": "fc9741d230a328f5f1b61f3ae52d1acf", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "49a3b8111a3112a5ff85ad3c76fa5c02", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9223300970873787, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "t = int(input())\r\nfor _ in range(t):\r\n n,k = list(map(int,input().split()))\r\n print(n**k)", "lang": "Python 3", "bug_code_uid": "8c86b06c2fff8f041522647f1d4740fb", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "690eb8239572897591fd063a3accee04", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9739130434782609, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/env python3.9\n\nMOD = int(1e9 + 7)\n\n\nfor _ in range(int(input())):\n n, k = list(map(int, input().split(' ')))\n res = 0\n if k > n:\n res = n * k % MOD\n else:\n res = pow(n, k, MOD)\n print(res)", "lang": "Python 3", "bug_code_uid": "994f76f90ec722e330f9154609f760d9", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "6341c663c523ab2f7b4cbc738200ff78", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9915966386554622, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "t = int(input())\r\nwhile t>0:\r\n m = pow(10,9)+9\r\n n,k = map(int,input().split())\r\n print((n**k)%m)\r\n t = t-1", "lang": "Python 3", "bug_code_uid": "ea06858a741c50ee6f922b7ac858d425", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "9975a18ee66e0d01eda55337fb28db36", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8864265927977839, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import math\r\nmod=10**9+7\r\nfor _ in range(int(input())):\r\n n,k=map(int,input().split())\r\n x=2**k-1\r\n y=math.floor(x/2)+1\r\n f=1\r\n for i in range(y):\r\n f=(f*n)%mod\r\n print(f%mod)", "lang": "Python 3", "bug_code_uid": "f72f3ba86998bf60d22586fbdcb4b546", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "029b0d7677c119cf347eea9101e99fef", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9933184855233853, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "t = int(input())\r\n\r\nfor i in range(t):\r\n line = input().split(\" \")\r\n n = int(line[0])\r\n k = int(line[1])\r\n mod = 1**9 + 7\r\n ans = n\r\n for i in range(k):\r\n ans = (n * ans) % mod\r\n \r\n print(ans)", "lang": "Python 3", "bug_code_uid": "f917e1ecfc5d0725c0f620e667e6ec2c", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "7b09f0f517bf431cd7a4d59c0047d22c", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.563573883161512, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "for _ in range(int(input())):\r\n n,k = map(int, input().split())\r\n print(n**k)\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", "lang": "Python 3", "bug_code_uid": "b08685001c7a944845bd5559e5ec873f", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "b6c975b81893d15776ccfe5cd7c9162e", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9418604651162791, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "for _ in range(int(input())):\r\n n,k=map(int, input().split())\r\n print(n**k)", "lang": "Python 3", "bug_code_uid": "bcff62ed28318cf4e6a80b41aba1f433", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "7e3306f77cc5fcafd34e6a1dd8ba31ac", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9933554817275747, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import sys\r\nimport os.path\r\nif(os.path.exists('input_file.txt')):\r\n sys.stdin = open(\"input_file.txt\", \"r\")\r\n sys.stdout = open(\"output_file.txt\", \"w\")\r\n\r\n#perfectsuare, other shorthanded\r\nfor _ in range(int(input())):\r\n k,n=(map(int,input().split()))\r\n ans=0\r\n print((n**k)%1000000007)", "lang": "Python 3", "bug_code_uid": "14c3912340aaa99eefa3195f732c6977", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "f50d23740d1846a41cff943044403ff2", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7137809187279152, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "mod=1e9+7\r\nfor _ in range(int(input())):\r\n n,k=[int(x) for x in input().split()]\r\n print(pow(n,k)%mod)", "lang": "Python 3", "bug_code_uid": "39f99c5562b8a42011360739e0cc69d6", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "0333b565d51799d614601b6bef43fb5e", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6931330472103004, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#import sys\r\n#import math\r\n#sys.stdout=open(\"C:/Users/pipal/OneDrive/Desktop/VS code/python/output.txt\",\"w\")\r\n#sys.stdin=open(\"C:/Users/pipal/OneDrive/Desktop/VS code/python/input.txt\",\"r\")\r\nt=int(input())\r\nfor i in range(t):\r\n # n=int(input()) \r\n c=0\r\n mod=10**9+7\r\n n,k=(map(int,input().split()))\r\n maxi=(2**k)-1\r\n half=maxi//2\r\n f=(n%mod)+(n%mod)*((n-1)%mod)*(half%mod)\r\n print(f%mod)\r\n # print(half)\r\n\r\n\r\n\r\n \r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n ", "lang": "Python 3", "bug_code_uid": "77f3202776ca62a8ea287f2ce4e2d95a", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "3e4e34b9d54acf89e8a98f0d53b1a165", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9144385026737968, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "t=input()\r\ntt=int(t)\r\nwhile tt:\r\n n,k=input().split()\r\n q=int(k)\r\n ans=1\r\n while q:\r\n q-=1\r\n ans=ans*int(n)\r\n print(ans)\r\n tt-=1;\r\n \r\n \r\n ", "lang": "Python 3", "bug_code_uid": "486a36861760a587855ae3c80361ac6d", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "8f5571e331194b87d3865239334e9b01", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9904761904761905, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "for _ in range(int(input())):\r\n n, k = [int(x) for x in input().split()]\r\n print((n**k)/1000000007)", "lang": "Python 3", "bug_code_uid": "410bc78e916d7e50e32c79d8f21e8aa3", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "9b2367df1b9aa869a171ae7c61d0c147", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5403726708074534, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "\r\n\r\nfor _ in range(0,int(input())):\r\n l, power = map(int, input().split())\r\n count = 0\r\n n = 2**power\r\n choices = l+1\r\n for i in range(0,2**power):\r\n if(i&1 == 0):\r\n count += choices\r\n print(count%(10**9+7))\r\n\r\n", "lang": "Python 3", "bug_code_uid": "d33785bc66a1acfc625c7c25ca5a7cfd", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "7f6f626d072845322e0f2ce9a473e7c7", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9672727272727273, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "t = int(input())\r\nfor _ in range(t):\r\n n, k = map(int, input().split())\r\n mod = 10**9 + 7\r\n ans = n * 2**k // 2\r\n print(ans % mod)", "lang": "Python 3", "bug_code_uid": "46a34303af1bb99f0c64b5a52f2d607b", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "3c13c46dac14251d5b6c15e1126445cb", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.22641509433962265, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "import math\r\nn=int(input())\r\na=[]\r\nb=1\r\nfor i in range(1,n):\r\n if math.gcd(n,i)==1:\r\n a.append(i)\r\nfor i in range(len(a)):\r\n b=(b*a[i])%n\r\nif b!=1:\r\n a.remove(b)\r\nprint(len(a))\r\nprint(*a)", "lang": "Python 3", "bug_code_uid": "927cc4e86f1b5a197ec019feb49eebe2", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "f1633be32fc057238ef7a8710a917c84", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9801613668723304, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "try:\r\n import sys\r\n# from __future__ import division, print_function\r\n# import bisect \r\n import math\r\n # import heapq\r\n import collections\r\n# i_m = 9223372036854775807\r\n M = 10**9+7\r\n\r\n # def matrix(n):\r\n # #matrix input\r\n # return [list(map(int, input().split()))for i in range(n)]\r\n \r\n \r\n# def string2intlist(s):\r\n# return list(map(int, s))\r\n \r\n \r\n# def calculate_sum(a, N): # sum of a to N\r\n# # Number of multiples\r\n# m = N / a\r\n# # sum of first m natural numbers\r\n# sum = m * (m + 1) / 2\r\n# # sum of multiples\r\n# ans = a * sum\r\n# return ans\r\n \r\n \r\n# def series(N):\r\n# return (N*(N+1))//2\r\n \r\n \r\n# def count2Dmatrix(i, list):\r\n# return sum(c.count(i) for c in list)\r\n \r\n \r\n# def modinv(n, p):\r\n# return pow(n, p - 2, p)\r\n \r\n \r\n# def nCr(n, r):\r\n# i = 1\r\n# while i < r:\r\n# n *= (n - i)\r\n# i += 1\r\n# return n // math.factorial(r)\r\n \r\n \r\n# def GCD(x, y):\r\n# x = abs(x)\r\n# y = abs(y)\r\n# if(min(x, y) == 0):\r\n# return max(x, y)\r\n# while(y):\r\n# x, y = y, x % y\r\n# return x\r\n \r\n \r\n# def LCM(x, y):\r\n# return (x * y) // GCD(x, y)\r\n \r\n \r\n # def Divisors(n):\r\n # l = []\r\n # for i in range(1, int(math.sqrt(n) + 1)):\r\n # if (n % i == 0):\r\n # if (n // i == i):\r\n # l.append(i)\r\n # else:\r\n # l.append(i)\r\n # l.append(n//i)\r\n # return l\r\n \r\n \r\n # def isprime(n):\r\n # for i in range(2, int(math.sqrt(n))+1):\r\n # if n % i == 0:\r\n # return False\r\n # return True\r\n\r\n # def isprime(n): \r\n # if(n <= 1): \r\n # return False\r\n # if(n <= 3): \r\n # return True\r\n # if(n % 2 == 0 or n % 3 == 0): \r\n # return False\r\n # for i in range(5,int(math.sqrt(n) + 1), 6): \r\n # if(n % i == 0 or n % (i + 2) == 0): \r\n # return False \r\n # return True\r\n # def SieveOfEratosthenes(n):\r\n # prime = [True for i in range(n+1)]\r\n # p = 2\r\n # while (p * p <= n):\r\n # if (prime[p] == True):\r\n # for i in range(p * p, n+1, p):\r\n # prime[i] = False\r\n # p += 1\r\n # f = []\r\n # for p in range(2, n+1):\r\n # if prime[p]:\r\n # f.append(p)\r\n # return f\r\n \r\n \r\n# q = []\r\n \r\n \r\n# def dfs(n, d, v, c):\r\n# global q\r\n# v[n] = 1\r\n# x = d[n]\r\n# q.append(n)\r\n# j = c\r\n# for i in x:\r\n# if i not in v:\r\n# f = dfs(i, d, v, c+1)\r\n# j = max(j, f)\r\n# # print(f)\r\n# return j\r\n# # d = {}\r\n \r\n \r\n# def knapSack(W, wt, val, n):\r\n# K = [[0 for x in range(W + 1)] for x in range(n + 1)]\r\n# for i in range(n + 1):\r\n# for w in range(W + 1):\r\n# if i == 0 or w == 0:\r\n# K[i][w] = 0\r\n# elif wt[i-1] <= w:\r\n# K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]], K[i-1][w])\r\n# else:\r\n# K[i][w] = K[i-1][w]\r\n \r\n# return K[n][W]\r\n \r\n \r\n # def modularExponentiation(x, n):\r\n # if(n == 0):\r\n # return 1\r\n # elif (n % 2 == 0): # n is even\r\n # return modularExponentiation((x*x) % M, n//2)\r\n # else: # n is odd\r\n # return (x * modularExponentiation((x * x) % M, (n - 1) // 2)) % M\r\n \r\n # def powerOftwo(n):\r\n # return n and (not (n & (n-1)))\r\n \r\n# def modInverse(a, m):\r\n# m0 = m\r\n# y = 0\r\n# x = 1\r\n \r\n# if (m == 1):\r\n# return 0\r\n \r\n# while (a > 1):\r\n \r\n# # q is quotient\r\n# q = a // m\r\n \r\n# t = m\r\n \r\n# # m is remainder now, process\r\n# # same as Euclid's algo\r\n# m = a % m\r\n# a = t\r\n# t = y\r\n \r\n# # Update x and y\r\n# y = x - q * y\r\n# x = t\r\n \r\n# # Make x positive\r\n# if (x < 0):\r\n# x = x + m0\r\n \r\n# return x\r\n # temp = [0]*101 \r\n# def mapi(l,r):\r\n# idx = -1\r\n# val = -1\r\n# if(l > r):\r\n# return 0\r\n# if(l == r):\r\n# return l\r\n# for l in range(l,r+1):\r\n# if temp[l]>val:\r\n# \t idx = l\r\n# \t val = temp[l]\r\n# return idx\r\n \r\n def solve():\r\n n,k = map(int,input().split())\r\n # lst = list(map(int,input().split()))\r\n factor = 2**k\r\n ans = 1\r\n for i in range(n):\r\n ans = (ans*factor)%M\r\n return (ans*2)%M\r\n \r\n test = int(input())\r\n count1 = 1\r\n while count1<=test:\r\n ans = solve()\r\n sys.stdout.write(str(ans)+\"\\n\")\r\n # sys.stdout.write(\"Case #\"+str(count1)+\": \"+str(ans)+\"\\n\")\r\n count1 += 1\r\nexcept EOFError:\r\n print(\" \")", "lang": "Python 3", "bug_code_uid": "7a08142525d086deabf7b4f878a9bab0", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "c6cce28d9d2231e621ed67e01a9e595b", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.94, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "t=int(input())\r\nwhile t>0:\r\n n,k=map(int,input().split())\r\n \r\n ans=1\r\n for j in range(k):\r\n ans=ans*(n%(10**9+7))\r\n t-=1", "lang": "Python 3", "bug_code_uid": "9ee25443f50f36937c487d24049d6f8f", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "3262d5fcd5be323b5db672c06ae88510", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9505882352941176, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def ints():\r\n return list(map(int, input().split()))\r\n\r\ndef case():\r\n n, k = ints()\r\n print(n, k)\r\n return pow(n, k, 10 ** 9 + 7)\r\n \r\n\r\n\r\nt, = ints()\r\nfor i in range(t):\r\n\r\n print(case())\r\n ", "lang": "Python 3", "bug_code_uid": "170b3e774f04b877d12f1eeea660a0fc", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "ca20a7773e5ce970e1dde721a4b4c0d3", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.022521616730343856, "equal_cnt": 22, "replace_cnt": 20, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 23, "bug_source_code": "\r\nfrom math import ceil, floor\r\nfor _ in range(int(input())):\r\n\tn, k = map(int, input().split())\r\n\t# a = list(map(int, input().split()))\r\n\r\n\tif n == 1:\r\n\t\tprint(1)\r\n\t\tcontinue\r\n\telse:\r\n\t\tp = 2*k - 2\r\n\t\tans = 2**p\r\n\t\tans %= (10**9 + 7)\r\n\t\tprint(ans)#(2**(k-1))**2 % (10**9 + 7))", "lang": "PyPy 3", "bug_code_uid": "46facb2fad5f0d1637324b1ef8577127", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "428a140052751028b5a4f60b0407dec5", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9955917260088165, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "# cook your dish here\r\nfrom collections import defaultdict, OrderedDict, Counter\r\nfrom sys import stdin, stdout\r\nfrom bisect import bisect_left, bisect_right\r\n# import numpy as np\r\nfrom queue import Queue, PriorityQueue\r\nfrom heapq import *\r\nfrom statistics import *\r\nfrom math import sqrt\r\nimport fractions\r\nimport copy\r\nfrom copy import deepcopy\r\nimport sys\r\nimport io\r\n\r\nsys.setrecursionlimit(10000)\r\nimport math\r\nimport os\r\nimport bisect\r\nimport collections\r\n\r\nmod = int(pow(10, 9)) + 7\r\nimport random\r\nfrom random import *\r\nfrom time import time;\r\n\r\n\r\ndef ncr(n, r, p=mod):\r\n num = den = 1\r\n for i in range(r):\r\n num = (num * (n - i)) % p\r\n den = (den * (i + 1)) % p\r\n return (num * pow(den,\r\n p - 2, p)) % p\r\n\r\n\r\ndef normalncr(n, r):\r\n r = min(r, n - r)\r\n count = 1;\r\n for i in range(n - r, n + 1):\r\n count *= i;\r\n\r\n for i in range(1, r + 1):\r\n count //= i;\r\n return count\r\n\r\n\r\ninf = float(\"inf\")\r\nadj = defaultdict(set)\r\nvisited = defaultdict(int)\r\n\r\n\r\ndef addedge(a, b):\r\n adj[a].add(b)\r\n adj[b].add(a)\r\n\r\n\r\ndef bfs(v):\r\n q = Queue()\r\n q.put(v)\r\n visited[v] = 1\r\n while q.qsize() > 0:\r\n s = q.get_nowait()\r\n print(s)\r\n for i in adj[s]:\r\n if visited[i] == 0:\r\n q.put(i)\r\n visited[i] = 1\r\n\r\n\r\ndef dfs(v, visited):\r\n if visited[v] == 1:\r\n return;\r\n visited[v] = 1\r\n\r\n print(v)\r\n for i in adj[v]:\r\n dfs(i, visited)\r\n\r\n\r\n# a9=pow(10,6)+10\r\n# prime = [True for i in range(a9 + 1)]\r\n# def SieveOfEratosthenes(n):\r\n# p = 2\r\n# while (p * p <= n):\r\n# if (prime[p] == True):\r\n# for i in range(p * p, n + 1, p):\r\n# prime[i] = False\r\n# p += 1\r\n# SieveOfEratosthenes(a9)\r\n# prime_number=[]\r\n# for i in range(2,a9):\r\n# if prime[i]:\r\n# prime_number.append(i)\r\ndef reverse_bisect_right(a, x, lo=0, hi=None):\r\n if lo < 0:\r\n raise ValueError('lo must be non-negative')\r\n if hi is None:\r\n hi = len(a)\r\n while lo < hi:\r\n mid = (lo + hi) // 2\r\n if x > a[mid]:\r\n hi = mid\r\n else:\r\n lo = mid + 1\r\n return lo\r\n\r\n\r\ndef reverse_bisect_left(a, x, lo=0, hi=None):\r\n if lo < 0:\r\n raise ValueError('lo must be non-negative')\r\n if hi is None:\r\n hi = len(a)\r\n while lo < hi:\r\n mid = (lo + hi) // 2\r\n if x >= a[mid]:\r\n hi = mid\r\n else:\r\n lo = mid + 1\r\n return lo\r\n\r\n\r\ndef get_list():\r\n return list(map(int, input().split()))\r\n\r\n\r\ndef get_str_list_in_int():\r\n return [int(i) for i in list(input())]\r\n\r\n\r\ndef get_str_list():\r\n return list(input())\r\n\r\n\r\ndef get_map():\r\n return map(int, input().split())\r\n\r\n\r\ndef input_int():\r\n return int(input())\r\n\r\n\r\ndef matrix(a, b):\r\n return [[0 for i in range(b)] for j in range(a)]\r\n\r\n\r\ndef swap(a, b):\r\n return b, a\r\n\r\n\r\ndef find_gcd(l):\r\n a = l[0]\r\n for i in range(len(l)):\r\n a = gcd(a, l[i])\r\n return a;\r\n\r\n\r\ndef is_prime(n):\r\n sqrta = int(sqrt(n))\r\n for i in range(2, sqrta + 1):\r\n if n % i == 0:\r\n return 0;\r\n return 1;\r\n\r\n\r\ndef prime_factors(n):\r\n while n % 2 == 0:\r\n return [2] + prime_factors(n // 2)\r\n sqrta = int(sqrt(n))\r\n\r\n for i in range(3, sqrta + 1, 2):\r\n if n % i == 0:\r\n return [i] + prime_factors(n // i)\r\n\r\n return [n]\r\n\r\n\r\ndef p(a):\r\n if type(a) == str:\r\n print(a + \"\\n\")\r\n else:\r\n print(str(a) + \"\\n\")\r\n\r\n\r\ndef ps(a):\r\n if type(a) == str:\r\n print(a)\r\n else:\r\n print(str(a))\r\n\r\n\r\ndef kth_no_not_div_by_n(n, k):\r\n return k + (k - 1) // (n - 1)\r\n\r\n\r\ndef forward_array(l):\r\n n = len(l)\r\n stack = []\r\n forward = [0] * n\r\n for i in range(len(l) - 1, -1, -1):\r\n while len(stack) and l[stack[-1]] < l[i]:\r\n stack.pop()\r\n if len(stack) == 0:\r\n forward[i] = len(l);\r\n else:\r\n forward[i] = stack[-1]\r\n stack.append(i)\r\n return forward;\r\n\r\n\r\ndef backward_array(l):\r\n n = len(l)\r\n stack = []\r\n backward = [0] * n\r\n for i in range(len(l)):\r\n while len(stack) and l[stack[-1]] < l[i]:\r\n stack.pop()\r\n if len(stack) == 0:\r\n backward[i] = -1;\r\n else:\r\n backward[i] = stack[-1]\r\n stack.append(i)\r\n return backward\r\n\r\n\r\ndef char(a):\r\n return chr(a + 97)\r\n\r\n\r\ndef get_length(a):\r\n return 1 + int(log10(a))\r\n\r\n\r\nnc = \"NO\"\r\nyc = \"YES\"\r\nns = \"No\"\r\nys = \"Yes\"\r\n\r\n\r\n# import math as mt\r\n# MAXN=10**7\r\n# spf = [0 for i in range(MAXN)]\r\n# def sieve():\r\n# spf[1] = 1\r\n# for i in range(2, MAXN):\r\n# # marking smallest prime factor\r\n# # for every number to be itself.\r\n# spf[i] = i\r\n#\r\n# # separately marking spf for\r\n# # every even number as 2\r\n# for i in range(4, MAXN, 2):\r\n# spf[i] = 2\r\n#\r\n# for i in range(3, mt.ceil(mt.sqrt(MAXN))):\r\n#\r\n# # checking if i is prime\r\n# if (spf[i] == i):\r\n#\r\n# # marking SPF for all numbers\r\n# # divisible by i\r\n# for j in range(i * i, MAXN, i):\r\n#\r\n# # marking spf[j] if it is\r\n# # not previously marked\r\n# if (spf[j] == j):\r\n# spf[j] = i\r\n# def getFactorization(x):\r\n# ret = list()\r\n# while (x != 1):\r\n# ret.append(spf[x])\r\n# x = x // spf[x]\r\n#\r\n# return ret\r\n# sieve()\r\n\r\n\r\n# if(os.path.exists('input.txt')):\r\n# sys.stdin = open(\"input.txt\",\"r\") ; sys.stdout = open(\"output.txt\",\"w\")\r\n\r\n\r\n# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\r\n# input=stdin.readline\r\n# print=stdout.write\r\ndef issq(n):\r\n sqrta=int(n**0.5)\r\n return sqrta**2==n;\r\nfor i in range(int(input())):\r\n n,k=get_map()\r\n print(pow(n,k,mod))\r\nprint(1)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "lang": "PyPy 3", "bug_code_uid": "9ae00e2aa29b7f8c226bf6e5da311964", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "a6d30d001936ad9bee20d85395407e5d", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9090909090909091, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "for _ in range(int(input())):\r\n n,k = map(int,input().split())\r\n a = n**k\r\n if n==1:\r\n a = 0\r\n a = a%((10**9)+7)\r\n print(a)", "lang": "PyPy 3", "bug_code_uid": "f959a7a21c437f009ed2f2ce6319eaa9", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "487780afe2693b9d9b8f059f06601850", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9162011173184358, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "for _ in range(int(input())):\r\n m,k = map(int,input().split())\r\n print(m**k)", "lang": "PyPy 3", "bug_code_uid": "00cd7e587ef9c5e3e772680a286493e6", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "ccdedcedcd4f190a55fe7ab353212d5a", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7837837837837838, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import math\r\nfor _ in range(int(input())):\r\n n,k=map(int,input().split())\r\n print(math.pow(n,k)%1000000007)", "lang": "PyPy 3", "bug_code_uid": "6d200c9a3a16ece6ee26cefd3033b9d8", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "ae8b7fa05afe6fa4ee64b888cff14944", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9993881921076782, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\"\"\"\r\n \u3053\u3093\u306b\u3061\u306f\u3002\u3053\u308c\u306f\u30af\u30b7\u30e3\u30eb\u3067\u3059\r\n \r\n Author : thekushalghosh (\u30af\u30b7\u30e3\u30eb)\r\n Team : CodeDiggers\r\n \r\n I prefer Python language over the C++ language :p :D\r\n \r\n Visit my website : thekushalghosh.github.io\r\n\"\"\"\r\nimport sys,math,cmath,time\r\nstart_time = time.time()\r\n##########################################################################\r\n################# ---- THE ACTUAL CODE STARTS BELOW ---- #################\r\n \r\ndef solve():\r\n k,n = invr()\r\n print(pow(n,k,1000000007)) \r\n\r\n################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################\r\n##########################################################################\r\n \r\ndef main():\r\n global tt\r\n if not ONLINE_JUDGE:\r\n sys.stdin = open(\"input.txt\",\"r\")\r\n sys.stdout = open(\"output.txt\",\"w\")\r\n t = 1\r\n t = inp()\r\n for tt in range(t):\r\n solve()\r\n if not ONLINE_JUDGE:\r\n print(\"Time Elapsed :\",time.time() - start_time,\"seconds\")\r\n sys.stdout.close()\r\n \r\n#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#\r\ndef inp():\r\n return(int(input()))\r\ndef inlt():\r\n return(list(map(int,input().split())))\r\ndef insr():\r\n return(input().strip())\r\ndef invr():\r\n return(map(int,input().split()))\r\n \r\n#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#\r\ndef counter(a):\r\n q = [0] * max(a)\r\n for i in range(len(a)):\r\n q[a[i] - 1] = q[a[i] - 1] + 1\r\n return(q)\r\n \r\ndef counter_elements(a):\r\n q = dict()\r\n for i in range(len(a)):\r\n if a[i] not in q:\r\n q[a[i]] = 0\r\n q[a[i]] = q[a[i]] + 1\r\n return(q)\r\n \r\ndef string_counter(a):\r\n q = [0] * 26\r\n for i in range(len(a)):\r\n q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1\r\n return(q)\r\n \r\ndef factorial(n,m = 1000000007):\r\n q = 1\r\n for i in range(n):\r\n q = (q * (i + 1)) % m\r\n return(q)\r\n \r\ndef factors(n):\r\n q = []\r\n for i in range(1,int(n ** 0.5) + 1):\r\n if n % i == 0: q.append(i); q.append(n // i)\r\n return(list(sorted(list(set(q)))))\r\n \r\ndef prime_factors(n):\r\n q = []\r\n while n % 2 == 0: q.append(2); n = n // 2\r\n for i in range(3,int(n ** 0.5) + 1,2):\r\n while n % i == 0: q.append(i); n = n // i\r\n if n > 2: q.append(n)\r\n return(list(sorted(q)))\r\n \r\ndef transpose(a):\r\n n,m = len(a),len(a[0])\r\n b = [[0] * n for i in range(m)]\r\n for i in range(m): \r\n for j in range(n): \r\n b[i][j] = a[j][i]\r\n return(b)\r\n \r\ndef power_two(x):\r\n return (x and (not(x & (x - 1))))\r\n \r\ndef ceil(a, b):\r\n return -(-a // b)\r\n \r\ndef seive(n):\r\n a = [1]\r\n prime = [True for i in range(n + 1)] \r\n p = 2\r\n while (p * p <= n): \r\n if (prime[p] == True): \r\n for i in range(p ** 2,n + 1,p): \r\n prime[i] = False\r\n p = p + 1\r\n for p in range(2,n + 1): \r\n if prime[p]: \r\n a.append(p)\r\n return(a)\r\n \r\ndef ncr(n,r):\r\n return(math.factorial(n) // (math.factorial(n - r) * math.factorial(r)))\r\n \r\ndef npr(n,r):\r\n return(math.factorial(n) // math.factorial(n - r))\r\n\r\n \r\n \r\n#-----------------------------------------------------------------------#\r\n \r\nONLINE_JUDGE = __debug__\r\nif ONLINE_JUDGE:\r\n input = sys.stdin.readline\r\nmain()", "lang": "PyPy 3", "bug_code_uid": "1e5dbacad5f2fd4f783ccbb15f23b6ae", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "a3dd3339a54b284d2f9b4c9d70e98f98", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9526627218934911, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "for _ in range(int(input())):\r\n n , k = map(int, input().split())\r\n ans = 1\r\n while k: \r\n ans *= n\r\n ans %= (10**9 + 7)\r\n print(ans)", "lang": "PyPy 3", "bug_code_uid": "38c00ee0ad369bf9aff3f441269b207d", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "cc35f886d9f86be7aa9c8289aad59dc3", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9411764705882353, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "for _ in range(int(input())):\r\n n,k=map(int,input().split())\r\n print(n**k)", "lang": "PyPy 3", "bug_code_uid": "5c7b77a50c0925e79f008979b50f20c1", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "5332f63c4ad05df6c2006e5af1bb2574", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.944, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "for _ in range(int(input())):\r\n a = list(map(int,input().strip().split()))\r\n h=a[0]\r\n m=a[1]\r\n print(h**m)", "lang": "PyPy 3", "bug_code_uid": "de8869ceda2b01b38237fe9ea912a866", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "daee8b76339d354a819c4dc3986bffa7", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9929577464788732, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "for _ in range(int(input())):\r\n a,b=map(int,input().split(' '))\r\n ans=1;\r\n mod=10**9+7\r\n for j in range(1,b):\r\n ans=(ans*a)%mod\r\n print(ans)", "lang": "PyPy 3", "bug_code_uid": "34f7754134f329906859f5b822c0c501", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "928a16100e7b097c193fc31788853648", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8389990557129368, "equal_cnt": 53, "replace_cnt": 18, "delete_cnt": 34, "insert_cnt": 0, "fix_ops_cnt": 52, "bug_source_code": "# region fastio\r\nimport os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass FastIO(IOBase):\r\n newlines = 0\r\n\r\n def __init__(self, file):\r\n self._fd = file.fileno()\r\n self.buffer = BytesIO()\r\n self.writable = \"x\" in file.mode or \"r\" not in file.mode\r\n self.write = self.buffer.write if self.writable else None\r\n\r\n def read(self):\r\n while True:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n if not b:\r\n break\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines = 0\r\n return self.buffer.read()\r\n\r\n def readline(self):\r\n while self.newlines == 0:\r\n b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\r\n self.newlines = b.count(b\"\\n\") + (not b)\r\n ptr = self.buffer.tell()\r\n self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)\r\n self.newlines -= 1\r\n return self.buffer.readline()\r\n\r\n def flush(self):\r\n if self.writable:\r\n os.write(self._fd, self.buffer.getvalue())\r\n self.buffer.truncate(0), self.buffer.seek(0)\r\n\r\n\r\nclass IOWrapper(IOBase):\r\n def __init__(self, file):\r\n self.buffer = FastIO(file)\r\n self.flush = self.buffer.flush\r\n self.writable = self.buffer.writable\r\n self.write = lambda s: self.buffer.write(s.encode(\"ascii\"))\r\n self.read = lambda: self.buffer.read().decode(\"ascii\")\r\n self.readline = lambda: self.buffer.readline().decode(\"ascii\")\r\n\r\n\r\nsys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)\r\ninput = lambda: sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\n\r\n# endregion\r\n\r\n\r\ndef intArr():\r\n return map(int, input().split())\r\n\r\n\r\ndef In():\r\n return int(input())\r\n\r\n\r\ndef func(n,k):\r\n mod=int(1e9)+7\r\n if k==1:\r\n return (n-1)%mod\r\n ans= ((1 << k) - 1) * (n - 1)\r\n ans=max(ans, ((1 << k) - 2) * (n - 1) + 1)\r\n return ans%mod\r\n\r\n\r\ndef main():\r\n for _ in range(In()):\r\n n,k=intArr()\r\n print(func(n,k))\r\n return\r\n\r\n\r\nif __name__ == '__main__':\r\n main()", "lang": "PyPy 3", "bug_code_uid": "33943bdb03a4c1e11d01e43c75a45a07", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "ada0627da81265507b37e58f90bd2989", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9099307159353349, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "t = int(input()) \r\nwhile t>0:\r\n m = 1e9+7\r\n n, k = map(int, input().split(\" \"))\r\n num_elements = n\r\n for z in range(k):\r\n if z>0:\r\n num_elements *= n\r\n print(int(num_elements%m))\r\n\r\n t-=1", "lang": "PyPy 3", "bug_code_uid": "82ff6bc7f923295b7cdca1584657a11a", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "90686d618555e14af97672374c1600bb", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7727272727272727, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "for _ in range(int(input())):\r\n a=list(map(int,input().split()))\r\n print(a[0]**a[1])", "lang": "PyPy 3", "bug_code_uid": "d7b055a0c85161373c61f4f49ed32090", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "6ce313e6c34b72359e5077df73da4cd4", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9517684887459807, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def modexp(a,b,mod):\n if b==0:\n return 1\n elif b%2==0:\n x=modexp(a%mod,b//2,mod)%mod\n return (x*x)%mod\n else:\n return ((a%mod)*(modexp(a%mod,b-1,mod)%mod))\n\nt=int(input())\nfor _ in range(t):\n n,k=map(int,input().split())\n mod=10**9+7\n print(modexp(n,k,mod))", "lang": "PyPy 3", "bug_code_uid": "98bac109b62a03a142320d2b045dd985", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "dd1c52f1b843a448d6fba34d0ccc9d5d", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.550561797752809, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "def f(n):\r\n ans=1\r\n for i in range(2,n+1):\r\n ans=(ans*i)%1000000007\r\n return ans\r\nt=int(input())\r\nfor q in range(t):\r\n n,k=map(int,input().split())\r\n if n==1:\r\n print(0)\r\n else:\r\n print((n+(2**k-2)*f(n-1))%1000000007)\r\n", "lang": "PyPy 3", "bug_code_uid": "27fba0883575bf337a921a29aa70d893", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "fe1f7efff8f732a99ace7cef2a7f6272", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7932489451476793, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "t=int(input())\r\nfor i in range(t):\r\n n,k = map(int,input().split())\r\n ans = n + n*(n-1)*(pow(2,k-1)-1)\r\n print(ans%1000000007)", "lang": "PyPy 3", "bug_code_uid": "001eed79de2d0b8238a04e82ccaf3c4f", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "fe35e2945c97c3e0d797d7aae371d919", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7962085308056872, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def proB(n,k):\r\n mod=1e9+7\r\n ans=1\r\n while(k):\r\n ans=ans*n\r\n k-=1\r\n return int(ans%mod)\r\nt=int(input())\r\nfor i in range(t):\r\n n,k=list(map(int,input().split()))\r\n print(proB(n,k))", "lang": "PyPy 3", "bug_code_uid": "fb6d094c9c37bcbf5e3de83c12fa16aa", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "047cada2d7d96fa658da6d0a17940ade", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.768025078369906, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "t=int(input())\r\nfor _ in range(t):\r\n n,k=map(int,input().split())\r\n m=n-1\r\n n=2\r\n p=1000000000+7\r\n result=1\r\n while m>0:\r\n if m%2==0:\r\n m //=2\r\n n =n*n %p\r\n else:\r\n result = result *n %p\r\n m -=1\r\n print(result)\r\n result =((result-1)*(k-1)*k +k)%p\r\n print(result)\r\n", "lang": "PyPy 3", "bug_code_uid": "534ce4ed3a15cc4cd3787d6e5c7a1dc0", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "7029e66b9d8fc89810864958dc95d670", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9938718662952646, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "from sys import stdin, stdout\r\nfrom collections import *\r\nfrom math import gcd, ceil, floor\r\n\r\n\r\ndef st():\r\n return list(stdin.readline().strip())\r\n\r\n\r\ndef li():\r\n return list(map(int, stdin.readline().split()))\r\n\r\n\r\ndef mp():\r\n return map(int, stdin.readline().split())\r\n\r\n\r\ndef inp():\r\n return int(stdin.readline())\r\n\r\n\r\ndef pr(n):\r\n return stdout.write(str(n) + \"\\n\")\r\n\r\n\r\nmod = 1000000007\r\nINF = float('inf')\r\nY = \"YES\"\r\nN = \"NO\"\r\n\r\n\r\ndef solve():\r\n # solve here\r\n n, k = mp()\r\n # AND of all numbers should be 0 & sum shd be largest\r\n # Hence, every bit should exaclty contain one zero\r\n # So, 0 1 1 1...\r\n # 1 0 1 1...\r\n # 1 1 0 1...\r\n # when we have k bits each has n choices to be zero (2^k-1 number has k bits)\r\n # n * n * n * n ... (k times) = n ^ k\r\n return pow(n, k, 10**9 + 7)\r\n\r\n\r\nfor test in range(int(input())):\r\n solve()\r\n", "lang": "PyPy 3", "bug_code_uid": "a86c0319014d8fc333f95723050b60c3", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "2f0326943c085a6225a20f872adfae05", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8170212765957446, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import math\r\nt = int(input())\r\nq = 0\r\nwhile q0:\r\n t=t-1\r\n n,k=map(int,input().split())\r\n temp=int(math.pow(10,9))+7\r\n ans=int(math.pow(n,k))\r\n print(ans%temp)", "lang": "PyPy 3", "bug_code_uid": "2d50fd66d1d06933b181eb9112732c60", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "2d845d768935f9a898c3cc1223693e11", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8764705882352941, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import sys\r\ninput = sys.stdin.readline\r\nmod = 10 ** 9 + 7\r\nfor _ in range(int(input())):\r\n n, k = map(int, input().split())\r\n if n == 1:\r\n print(0)\r\n continue\r\n print(pow(n, k, mod))", "lang": "PyPy 3", "bug_code_uid": "6256a05f05ee41da6bf2e76ce4bc9097", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "e7206669931e6c2520b331b71aa359c6", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.08714596949891068, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "# 1&even = 0\r\n# 0&any = 0\r\n\r\nimport sys\r\ninpu = sys.stdin.readline\r\nprin = sys.stdout.write\r\nfor _ in range(int(inpu())) :\r\n n, k = map(int, inpu().split())\r\n # ans = 0\r\n # ans += (2**(k-1))*(n-1)\r\n # ans += (2**(k-1))*(2**k)*(n-1)\r\n prin(str((n**2)%(10**9+7)) + '\\n')", "lang": "PyPy 2", "bug_code_uid": "ef1313fdc6fa7283a22855ae2d6a2e85", "src_uid": "2e7a9f3a97938e4a7e036520d812b97a", "apr_id": "4488109fe85c4077256f7769310255ff", "difficulty": 1200, "tags": ["math", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8723262032085561, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#import io,os\n#input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\n\nM = 998244353\n\nMAXNUM = 260\nfactor = [1]*(MAXNUM+2)\nfactor[-1]=0\nstorecomb = {}\n\npows = [[1] for _ in range(250+1)]\n\n\nfor p in range(1,250+1):\n for _ in range(40000):\n pows[p].append((pows[p][-1]*p)%M )\n\n#print(pows)\n\n\n\n\n\n\n\nfor i in range(1,MAXNUM+1):\n factor[i] = (factor[i-1]*i)%M\n\ndef fastfrac(a,b):\n numb = pow(b,M-2,M)\n return ((a%M)*(numb%M))%M\n\ndef comb(n,k):\n# print \"*\",n,k\n if n