{"similarity_score": 0.9644670050761421, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#for input: list(int(i) for i in raw_input().split())\ndef main():\n\tn = map(int,raw_input().split())\n\tif n%2==0:\n\t\tprint \"white\"\n\t\tprint \"1 2\"\n\telse:\n\t\tprint \"black\"\n\nif __name__ == '__main__':\n main()", "lang": "Python 2", "bug_code_uid": "73531297ddf6e553b3274185db42713e", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "44a687e709b23cb22f9c8cba10592bd1", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8472622478386167, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "x = input().split()\ns1 = int(x[0])\ns2 = int(x[1])\ns3 = int(x[2])\np = 0\nwhile(s1 > 0 and s2 > 1 and s3 > 3):\n s1 = s1 - 1\n s2 = s2 - 2\n s3 = s3 - 4\n p = p + 7\n\nprint(p)", "lang": "Python 3", "bug_code_uid": "09c92e4fd009e251bf707a579ceadb55", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "376601bd1cdc1c54e6f6b71ae9e4de08", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.356, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "input_string=str(input())\nword = \"hello\"\nindex = 0\nfor i in range(0,len(input_string)):\n if(index==5):\n print(\"YES\")\n if(input_string[i]==word[index]):\n index+=1\n\nif(index<5):\n print(\"NO\")\nelse:\n print(\"YES\")", "lang": "Python 3", "bug_code_uid": "ae95667c5b3b1dc9f0ddf2e32729e359", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "95dd7adffe09a424df9994f6dc396523", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5676500508646999, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "import math\n\n\ndef sum2(s, e):\n return sum1(e) - sum1(s - 1) - (e - s)\n\ndef sum1(i):\n return i * (i + 1) / 2\n\nn = int(input())\nk = int(input())\nif(n == 1):\n print(0)\nelif(k > n):\n print(1)\nelif(sum2(2,k) < n):\n print(-1)\nelse:\n c = 2 * n + k - k * k\n discriminant = math.sqrt(9 - 4 * c)\n res1 = math.floor((3 + discriminant) / 2)\n res2 = math.floor((3 - discriminant) / 2)\n res1 = max(res1, res2)\n print(int(k - res1 + 1));", "lang": "Python 3", "bug_code_uid": "177eb5644089fc7a60feab81d14fc242", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "43121f18274a7efd78db65e14ad9e5ee", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9897119341563786, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\nfrom decimal import Decimal\n\ndef sum2(s, e):\n return sum1(e) - sum1(s - 1) - (e - s)\n\ndef sum1(i):\n return i * (i + 1) / 2\n\nn, k = map(int, input().split())\n\nif(n == 1):\n print(0)\nelif(k > n):\n print(1)\nelif(sum2(Decimal(2),k) < n):\n print(-1)\nelse:\n c = 2 * n + k - k * k\n discriminant = (9 - 4 * c).sqrt()\n res1 = math.floor((3 + discriminant) / 2)\n res2 = math.floor((3 - discriminant) / 2)\n res1 = max(res1, res2)\n print(k - res1 + 1);", "lang": "Python 3", "bug_code_uid": "21b3837d9c3b5cd8f5be3ff6fe58f8ce", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "43121f18274a7efd78db65e14ad9e5ee", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6963490650044524, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import math\nfrom decimal import Decimal\n\ndef sum2(s, e):\n return sum1(e) - sum1(s - 1) - (e - s)\n\ndef sum1(i):\n return i * (i + 1) / 2\n\nline = raw_input().split()\nn = Decimal(line[0])\nk = Decimal(line[1])\nif(n == 1):\n print 0\nelif(k > n):\n print 1\nelif(sum2(Decimal(2),k) < n):\n print -1\nelse:\n c = 2 * n + k - k * k\n discriminant = (9 - 4 * c).sqrt()\n res1 = math.floor((3 + discriminant) / 2)\n res2 = math.floor((3 - discriminant) / 2)\n res1 = max(res1, res2)\n print k - res1 + 1", "lang": "Python 2", "bug_code_uid": "9b38f48e1538a24e02bc32606c56c3a7", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "43121f18274a7efd78db65e14ad9e5ee", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.23564954682779457, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "import numpy as np\ns=input().split(\" \")\nprint(int(((int(s[3])-int(s[2]))/np.lcm(int(s[0]),int(s[1])))+1))", "lang": "PyPy 3", "bug_code_uid": "5d67b1fd41461e6d51ae9c9ec1434602", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "fe9356541f38a5159b8a74ce7c6f4e37", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9631578947368421, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "n = int(raw_input())\n\nfib = [0] * 55\n\nfib[0] = 0\nfib[1] = 2\nfib[2] = 3\n\nfor x in xrange(3, len(fib)):\n fib[x] = fib[x-1] + fib[x-2]\n\nx = 0\n\nwhile fib[x] <= n:\n x += 1\n\nprint x - 1", "lang": "Python 2", "bug_code_uid": "7c2d68c9f727e8bf4860ad0b6241ff44", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "d9ffc603190065079975543411514c11", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6823529411764706, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n = int(raw_input())\n\na = [1, 2]\nwhile a[-1] <= n:\n a.append(a[-1] + a[-2])\n\nwhile True:\n try:\n p = a.index(n)\n break\n except:\n n -= 1\n continue\n\nprint p\n# print a", "lang": "Python 2", "bug_code_uid": "2a87591cd3953ce7d3464d2603531f46", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "3ccabff9499e1ed250b2975124901ac4", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9405940594059405, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "S = input()\ns = set(S)\nfor i in range(len(S)):\n tmp = s[i:]+s[:i]\n s.add(tmp)\nprint(len(s))", "lang": "Python 3", "bug_code_uid": "48f7e1372a5b1180309e5e4549b9626e", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "fd83e254401dc9d8189e575d999e3509", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9850746268656716, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "s = input()\na = {[s[i:]+s[:i] for i in range(len(s))]}\nprint(len(a))", "lang": "Python 3", "bug_code_uid": "1654b16933a561a47004f0ede0ff0da5", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "6b1540bb9dd09c00244e669ea798a494", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3117505995203837, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "a=list(input())\nc=len(a)\nif len(set(a))==1:print(1)\nelif c%2==1:print(c)\nelse:\n\tb,f=2,0\n\twhile b<=c:\n\t\tif c%b==0:\n\t\t\td=c//b\n\t\t\tk=[]\n\t\t\tfor x in range(b):\n\t\t\t\tk.append(tuple(a[x*d:(x+1)*d]))\n\t\t\tif len(set(k))==1:\n\t\t\t\tprint(d)\n\t\t\t\tf=1\n\t\t\t\tbreak\n\t\t\telse:b+=1\n\tif f==0:print(\"c\")", "lang": "Python 3", "bug_code_uid": "fdc746852c72a56547dc291089562450", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "cc5925427dac18cc3e78da3e5e93a22a", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9587628865979382, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "s = input()\nour = set()\nfor i in range(50):\n res.add(s)\n s = s[-1] + s[:-1]\nprint(len(res))", "lang": "Python 3", "bug_code_uid": "96dbe2c342b2accd5deb39d0d44212f5", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "95919ff2ab7e72459eb95d1cd3d5f2a4", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8266666666666667, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "a=input()\nm=set()\nfor i in len(a):\n\tm.add(a[i:]+a[:i])\nprint(len(m))", "lang": "Python 3", "bug_code_uid": "d2c32d2ca70c114e0bb6bbd03b3e65ca", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "f75b840e38d720dea3d007249c83874d", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6878980891719745, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nstrs = input()\ns = 'xxx'\nif s in strs:\n while True:\n strs.replace(s, 'xx')\n if s in strs:\n continue\n else:\n break\nprint(n - len(strs))", "lang": "Python 3", "bug_code_uid": "5ae634ea1c37d8e95e3f7936d1279777", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "31d4b60a4e94ae603421cc8f0b4a6079", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5362318840579711, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "from functools import reduce\nn,x,p=list(map(int,input().split()))\ndef fac(n):\n if(n==0):\n return 1\n return reduce(lambda x,y:x*y, range(1,n+1))\n\na=0\nb=-1\nleft=0\nright=n\nwhile(left=middle):\n left=middle+1\n b+=1\n else:\n right=middle\n a+=1\n\nA=fac(x-1)//fac(x-b-1)\nN=fac(n-x)//fac(n-x-a)\nS=fac(n-a-b-1)\nprint((A*N*S)%(10**9+7))", "lang": "Python 3", "bug_code_uid": "3b98bb1a05a18fa0cd03961f414f301c", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "73a7e37b839b550e6ba3749ec3d473c3", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8759124087591241, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import math\nn = int(input())\nprint( (math.floor(i)+1) * (n-1) )", "lang": "Python 3", "bug_code_uid": "3fe6c81c529af0a5a036c51e8c35e0f0", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "b6e133369c1c7d2d4bc4bc0815dbc115", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.75, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\nn=n+1\nint(print(n*n/4))", "lang": "Python 3", "bug_code_uid": "8b5df856defff10460bfda4e889b3442", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "66fda82d776e29ea80e25a99d6be6927", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7692307692307693, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n=input()\n\ndef get(n):\n\tif n%2==1:\n\t\tk = (n+1)//2\n\t\treturn (k*(k+1)*(2*k+1)//6+k*(k+1)//2)//2\n\telse:\n\t\tk=n//2\n\t\treturn (k*(k+1)*(2*k+1)//6+k*(k+1)//2)//2++k\n\nprint(get(n))", "lang": "Python 3", "bug_code_uid": "a25e25f49efa308ceafb66f94c06f399", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "22d2bd0d50691904bddb099290b442bc", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9508196721311475, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nwhile(n>=0):\n ans+=n\n n-=2\nprint(ans)", "lang": "Python 3", "bug_code_uid": "e751e8b1adc90152dbf55b4698813d06", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "4adca07353e58add2b103888297c7fb1", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9937106918238994, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "x = int(input())\nif x%2 == 1:\n\tm = (x+1)/2\nelse:\n\tm = x/2\ncount = 0\nfor i in range(1,m+1):\n\tcount += i\nif x%2 == 1:\n\tprint(count*2 - m)\nelse:\n\tprint(count*2)\n", "lang": "Python 3", "bug_code_uid": "14d93d7c6f794fdd3807c694a394cb92", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "26ddd762d8f3b0fe45190970f69ca520", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9863013698630136, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=int(intput())\nprint((a+1)*(a+1)//4)", "lang": "Python 3", "bug_code_uid": "0d6a0f6b37aea2813512af244a745cab", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "1b0c89d2c0029be4713bc0e364fc8bd5", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8676470588235294, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math \n\ndef split(word): \n return [char for char in word]\n\nfin = open(\"segment.in\" , 'r') \nfout = open(\"segment.out\" , \"w\" ) \n\ngene = split(fin.readline().strip('\\n'))\nn = len(gene) \nmax = []\ncounter = 1\n\n\nfor i in range(1, n):\n if gene[i] == gene[i-1]:\n counter += 1\n else: \n max.append(counter) \n counter =1 \nmax.append(counter) \n\nanswer = 0 \nfor i in range(0, len(max) ): \n if max[i] %2 == 0: \n answer += 1\n else: \n answer += 0 \n\nprint(answer) \n", "lang": "Python 3", "bug_code_uid": "0e7487d2dec3b7a9e562c6166c903d86", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "44205292da02c81d110f6f866264554a", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9787234042553191, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "# # import numpy as np\n#\n# def spliter(arr,low,high):\n# if(high-low==1):\n# # print(\"1\")\n# return 1\n#\n# if(arr[low:high]==sorted(arr[low:high])):\n# # print(\"here \"+str(high-low))\n# return high-low\n# else:\n# mid=(high+low)//2\n# # print(\"----------\")\n# # print((low,mid))\n# # print(\"---------\")\n# # print((mid,high))\n# # print(\"-----------\")\n# a=spliter(arr,low,mid)\n# # print(\"was here\")\n# b=spliter(arr,mid,high)\n#\n# # print((a,b))\n# if(a>=b):\n# return a\n# else:\n# return b\n#\n# def main():\n# n=int(input())\n# arr=list(map(int,input().split(\" \")))\n# lenght = n\n# if arr==sorted(arr):\n# print(n)\n# else:\n# mid=lenght//2\n# a=spliter(arr,0,mid)\n# b=spliter(arr,mid,lenght)\n# if(a>b):\n# print(a)\n# else:\n# print(b)\n#\n# main()\n\n\n# def main():\n# checker=\"nineteen\"\n# # n=\"nneteenabcnneteenabcnneteenabcnneteenabcnneteenabcii\"\n# n=input()\n# number={}\n# # print(set(n))\n# for i in n:\n# if i in checker:\n# number[i]=number.get(i,0)+1\n# # number=sorted(number.values())\n# # print(sorted(number.keys()))\n# for i in [\"n\",\"t\",\"i\",\"e\"]:\n# if i not in number.keys():\n# break\n#\n# else:\n# num=number[\"i\"]\n# min=num\n# other_Dict={\"n\":3,\"i\":1,\"e\":3,\"t\":1}\n# if(number[\"n\"]%3==2):\n# number[\"n\"]=number.get(\"n\",0)+number[\"n\"]//3\n#\n# for i in number.keys():\n# if (number[i]//other_Dict[i]>=num):\n# pass\n# elif(number[i]//other_Dict[i]<=num):\n#\n# if(min>number[i]//other_Dict[i]):\n# min=number[i]//other_Dict[i]\n# else:\n# print(min)\n# return\n# print(0)\n# main()\n # return False\n # for i,j in number:\n # if i==\"n\" and i\n# # print(number)\n# print(main())\n# main()\n# d={}\n# d[10]=1\n# d[10]+=2\n# d[10].append(10)\n# 2//3\n# d.get(10,5)\n# d.keys()\n# main()\n# d={}\n# for i in \"nineteen\":\n# d[i]=d.get(i,0)+1\n# d\n# \"i\" not in d.keys()\n# some=\"nineoindojaoidjoiajdoiaoidjiadjkajoidjoiajdljadjoiadlkjaadj\"\n# list(some.split(\"nineteen\"))\n#\n#\n# def main():\n# n=list(map(int,input().split(\" \")))\n# navigation=[]\n# for i in range(n[1]-n[2],n[1]):\n# if(i>0):\n# navigation.append(i)\n# for i in range(n[1],n[1]+n[2]+1):\n# if(i<=n[0]):\n# navigation.append(i)\n# if(navigation[0]>1):\n# navi=[0]*len(navigation)\n# navi[0]=\"<<\"\n# navi[1:len(navigation)]=navigation\n# navigation=navi\n# if(navigation[len(navigation)-1]>\")\n# string=\"\"\n# for i in navigation:\n# if(str(i)==str(n[1])):\n# string+=\"({}) \".format(i)\n# else:\n# string+=\"{} \".format(i)\n# print(string[:-1])\n# main()\n\n\n# question number Inna and Alarm Clock\n# import numpy as np\n# def inna_and_alarm_clock:\n# n=int(input())\n# matrix=[]\n# display=[[0]*100]*100\n# display=np.array(display)\n# rows=[]\n# columns=[]\n# for _ in range(n):\n# matrix.append(map(int,input().split(\" \")))\n# # matrix=data\n# for i,j in matrix:\n# # print((i,j))\n# display[j][i]=1\n# print(np.array(display))\n# vertical_steps=0\n# horizontal_steps=0\n# for i in range(100):\n# if 1 in display[:,i]:\n# horizontal_steps+=1\n# for i in range(100):\n# if 1 in display[i,:]:\n# vertical_steps+=1\n# if(horizontal_stepsy/2):\n# if(y%2==0):\n# x=y//2\n# happiness+=x*x\n# else:\n# x=(y+1)//2\n# happiness+=(x*(y-x))\n# # print(happiness)\n# # happiness+=x*x\n# print(int(happiness))\n# main()\n\ndef encode_protein():\n n=list(input())\n l=len(n)\n i=0\n j=0\n count=0\n while(ilen(l1) and len(r1)>2:\n a=\"5\"*(len(r1)-2)\n maax=0\n for i in range(1,100):\n ans=str(i)+a\n j1=\"9\"*len(ans)\n j1=int(j1)\n if maaxs:\n s=prod(i)\nprint(s)\n", "lang": "Python 3", "bug_code_uid": "b8bfe95c11367ba28fdbc2ef47314ab3", "src_uid": "2c4b2a162563242cb2f43f6209b59d5e", "apr_id": "83d180055430334761a5d19fb6ebddb2", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7041564792176039, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "inp1, inp2 = [int(i) for i in input().split()]\nlista = list()\n\ndef reverse(n):\n '''newStr = \"\"\n for c in str(n):\n newC = 9 - int(c)\n newStr += str(newC)\n '''\n l = len(str(n))\n d = \"9\"*l\n d = int(d)\n newStr = d - int(n)\n return int(newStr)\n\nfor i in range(inp1,inp2 +1):\n w = reverse(i) * i\n lista.append(w)\n\nprint(max(lista))", "lang": "Python 3", "bug_code_uid": "c74ca23a4647c557cb3a3e08346fcc32", "src_uid": "2c4b2a162563242cb2f43f6209b59d5e", "apr_id": "ad5cd4402ac2f51f640051d49cc618b6", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9768211920529801, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n,m=map(int,raw_input().split())\nl=len(str(m))\nr=len(str(n))\na1=5*10**(l-1)\nif l>r:\n\tif a1<=m:\n\t\tprint (a1)*(a1-1)\n\telse:\n\t\tprint (10**(l)-1-m)*m\nelse:\n\tif a1 >= n and a1<=m:\n\t\tprint (a1)*(a1-1)\n\telse:\n\t\tax=abs(a1-m)\n\t\taz=abs(a1-n)\n\t\tif ax>az:\n\t\t\tprint m*(10**(l)-1-m)\n\t\telse:\n\t\t\tprint (10**(r)-1-n)*n\n", "lang": "Python 2", "bug_code_uid": "e6c912e06440eca9d98601481500826d", "src_uid": "2c4b2a162563242cb2f43f6209b59d5e", "apr_id": "d64f0db0774701d6782dc256c56e3b7b", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9805825242718447, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import math\nl, r = map(int, raw_input().split(' '))\norder = math.floor(math.log10(r))\n\nx = int(min(5*10**order, r))\nphi = int(''.join(map(lambda e: chr(48 + 57 - (48 + int(e))), str(x))))\n\nprint x * phi", "lang": "Python 2", "bug_code_uid": "ce7e8c1ed8e4b1beceb8a06ea097cbb2", "src_uid": "2c4b2a162563242cb2f43f6209b59d5e", "apr_id": "ee72a895ee58e20848ef5db5b4161f9d", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.21529745042492918, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "num=int(input());cou=0;\nfor i in range(1,num+1): \n if(len(set([int(j) for j in str(i)]))<=2):\n cou+=1\nprint(cou)", "lang": "Python 3", "bug_code_uid": "fef528bdf628c4f325f74d5dd0abe217", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "01cfc577442eee37d8dfc622cd306e54", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9938570966698997, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\"\"\"\n Template written to be used by Python Programmers.\n Use at your own risk!!!!\n Owned by adi0311(rating - 5 star at CodeChef and Specialist at Codeforces).\n\"\"\"\nimport sys\nfrom functools import lru_cache, cmp_to_key\nfrom heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max\nfrom math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log\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 fractions import Fraction\n# sys.setrecursionlimit(2*pow(10, 6))\n# sys.stdin = open(\"input.txt\", \"r\")\n# sys.stdout = open(\"output.txt\", \"w\")\nmod = pow(10, 9) + 7\nmod2 = 998244353\ndef data(): return sys.stdin.readline().strip()\ndef out(var): sys.stdout.write(str(var))\ndef outln(var): sys.stdout.write(str(var)+\"\\n\")\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\n\ntemp = pow(10, 8)\n\n\ndef dfs(number):\n if 0 < number <= n:\n answer[0] += 1\n if number >= temp:\n return\n for i in range(10):\n if number * 10 + i > 0:\n if len(set(str(number * 10 + i))) <= 2:\n dfs(number * 10 + i)\n\n\nn = int(data())\nanswer = [0]\ndfs(0)\nif n > temp:\n outln(answer[0] + 1)\n exit()\noutln(answer[0])\n", "lang": "Python 3", "bug_code_uid": "d61f7089b613dc2a2c400218da8fe3e6", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "e3afe1792b8a79e227d7b05e513f110e", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9981949458483754, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\ncurr=list([i for i in range(1,100)]) \ncurr=set(curr)\ndef isvalid(x):\n if x<1 or x>10**9:\n return 0 \n if len(set(str(x)))<=2:\n return 1 \ncnt=0 \nwhile cnt<=4*(10**4 ):\n curr1=set()\n for i in curr:\n for j in range(10):\n if isvalid(i*10+j):\n curr1.add(i*10+j)\n # print('hi')\n cnt+=1 \n #print(curr1)\n curr|=curr1 \ncurr=sorted(list(curr))\n#print(curr)\nans=0 \nfor i in curr:\n if i>=1 and i<=n:\n ans+=1 \n elif i>n:\n break \nprint(ans)", "lang": "Python 3", "bug_code_uid": "e26ab5c1c4bcce6a254436f10976d95a", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "cc35e27092677ebb2210700fc6dd39df", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9525514771709938, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\ncurr=list([i for i in range(1,100)]) \ncurr=set(curr)\ndef isvalid(x):\n if x<1 or x>10**9:\n return 0 \n if x>n:\n return 0\n if len(set(str(x)))<=2:\n return 1 \ncnt=0 \nwhile cnt<=(9*(10**4)):\n curr1=set()\n for i in curr:\n for j in range(10):\n if isvalid(i*10+j):\n curr1.add(i*10+j)\n # print('hi')\n cnt+=1 \n #print(curr1)\n curr|=curr1 \ncurr=sorted(list(curr))\n#print(curr)\nans=0 \nfor i in curr:\n if i>=1 and i<=n:\n ans+=1 \n elif i>n:\n break \nprint(ans)", "lang": "Python 3", "bug_code_uid": "051c6ddfd284c47815c51ccecb0bfb89", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "cc35e27092677ebb2210700fc6dd39df", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5658263305322129, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time\n\nsys.setrecursionlimit(10**7)\ninf = 10**9\n\nn = int(input())\nif n < 100:\n print(n)\n sys.exit()\na = [[_,set(map(int,list(str(_))))] for _ in range(100)]\nc = 99\nfor k in range(2,11):\n t = (10 ** (k-1))\n for aa in a:\n if aa[0] >= t:\n break\n aa[1] |= set([0])\n for i in range(1,10):\n t = i * (10 ** k)\n for ai, ae in a[:]:\n ac = ai + t\n if ac > n:\n print(c)\n sys.exit()\n if len(ae) < 2:\n ae = ae | set([i])\n if i in ae:\n c += 1\n a.append([ac,ae])\n", "lang": "Python 3", "bug_code_uid": "68b26ecb10470f7b863c343e86f97130", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "d11b1e767ed5b85d9bf7bc5e8e66fa3e", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9845031905195989, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "n = input()\n\nif n <= 10:\n\tprint n\nelse:\n\tcnt = 9\n\tle = len(str(n))\n\ti = 1\n\twhile i < le-1:\n\t\tcnt += (81*(1< 0:\n\t\t\t\t\t\t\ttmp = str(i) + tmp\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\ttmp = str(j) + tmp\n\t\t\t\t\ttmp = str(i) + tmp\n\t\t\t\t\td[(int(tmp))] = 1\n\t\t\t\t\tmask += 1\n\t\n\tfor key in d:\n\t\tif key <= n:\n\t\t\tcnt += 1\n\tprint cnt\n", "lang": "Python 2", "bug_code_uid": "01a6d687c64643a518d33d886fe9203e", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "585dbd4a377a09966bb4c6bf4ddc42af", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.999512432959532, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "''' \n \t\n \t\t\t ||Sri:|| \n\n __|\n ______________|_________________________\n | | ___| | | ___| | | |___\n /\\ /\\ | |___ | | |___| | | |___|\n/ \\/ \\ | ___| | | |_/ |___| |___\n\nI am a beginner. Feel free to send tutorials/help to srinivasan1995@gmail.com.\n\nCodeforces, SPOJ handle: desikachariar.\nHackerrank, Codechef handle: Prof_Calculus.\n\nAdvices/Help are welcome. You will definitely get a thanks in return. Comments to be avoided.\n\nCollege: International Institute of Information Technology, Bangalore.\n\n'''\n\nimport math\ncount = 0\nn = 0\ndef distinct_digits(a):\n\td= {}\n\tfor i in a:\n\t\td[i] = 1\n\treturn len(d)\n\ndef fn(num):\n\tglobal count, n\n\tif (num > 0 and num <= n):\n\t\tcount+=1\t\n\tif (num >= 10**8):\n\t\treturn\n \tfor a in range(0, 10):\n \t\tif num*10+a > 0 and distinct_digits(str( num*10+a )) <= 2:\n\t\t\t fn( num*10+a )\n\nif __name__ == '__main__':\n\tn=input()\n\tfn(0)\n\tprint count\n", "lang": "Python 2", "bug_code_uid": "9b92c3cddb7ba4f62371e9f4210bdc42", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "7fe7ecdec26a609918063ffcbbbf1fee", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9882352941176471, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a=int(input())\nif(n%2==1):\n print('black')\nelse:\n print('white')\n print(1,2)", "lang": "PyPy 3", "bug_code_uid": "c17264093e9c89aa72e9c4a62ce2ab01", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "0c0d32b1d9715d435a689deb26846534", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9433962264150944, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env python3\n# created : 2020. 12. 31. 23:59\n\nimport os\nfrom sys import stdin, stdout\n\n\ndef solve(tc):\n n = int(stdin.readline().strip())\n if n%2:\n print(\"black\")\n else:\n print(\"white\")\n print(\"1 2\")\n\n\ntcs = 1\ntcs = int(stdin.readline().strip())\ntc = 1\nwhile tc <= tcs:\n solve(tc)\n tc += 1\n", "lang": "PyPy 3", "bug_code_uid": "13bc82b6405ca4807448e838853877fc", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "28f22877606b260c319040c88314521c", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7777777777777778, "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()))\nprint('white\\n1 2' if n & 1 == 0 else 'black')", "lang": "PyPy 3", "bug_code_uid": "e1eb01521e19d40c304c97040f97b50c", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "f2e237874dc38a5cc533314f722dc3c5", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.14716187806587247, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "from sys import stdin\n\n\ndef mex(arr):\n\tarr = set(arr)\n\tarr = list(arr)\t\n\tarr.sort()\n\ti = 0\n\twhile i < len(arr):\n\t\tif arr[i] > i:\n\t\t\treturn i\n\t\ti += 1\n\treturn i\n\t\n\t\ndef check_1(x, y):\n\tif x - 2 < 1:\n\t\treturn False\n\telif y + 1 > 15:\n\t\treturn False\n\treturn True\n\t\n\t\ndef check_2(x, y):\n\tif x - 2 < 1:\n\t\treturn False\n\telif y - 1 < 1:\n\t\treturn False\n\treturn True\n\t\n\t\ndef check_3(x, y):\n\tif x + 1 > 15:\n\t\treturn False\n\telif y - 2 < 1:\n\t\treturn False\n\treturn True\n\n\ndef check_4(x, y):\n\tif x - 1 < 1:\n\t\treturn False\n\telif y - 2 < 1:\n\t\treturn False\n\treturn True\n\n\ndef myfunction(dp, x, y):\n\tarr = []\n\tif check_1(x, y):\n\t\tarr.append(myfunction(dp, x - 2, y + 1))\n\t\tdp[x-2][y+1] = arr[-1]\n\tif check_2(x, y):\n\t\tarr.append(myfunction(dp, x - 2, y - 1))\n\t\tdp[x-2][y-1] = arr[-1]\n\tif check_3(x, y):\n\t\tarr.append(myfunction(dp, x + 1, y - 2))\n\t\tdp[x+1][y-2] = arr[-1]\n\tif check_4(x, y):\n\t\tarr.append(myfunction(dp, x - 1, y - 2))\n\t\tdp[x-1][y-2] = arr[-1]\n\tdp[x][y] = mex(arr)\n\treturn dp[x][y]\n\n\ndef print_r(dp):\n\tfor i in range(1, 16):\n\t\tprint(dp[i][1:])\n\n# main starts\nt = int(stdin.readline().strip())\nwhile t > 0:\n\tdp = [[-1 for i in range(16)] for j in range(16)]\n\tx, y = list(map(int, stdin.readline().split()))\n\tif (myfunction(dp, x, y)):\n\t\tprint('First')\n\telse:\n\t\tprint('Second')\n\t#print_r(dp)\n\tt -= 1", "lang": "PyPy 3", "bug_code_uid": "dbd803627e128df9324201bc359f4e37", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "9a7599a4c10f711ad5c2d2c37603acff", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5677290836653387, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "def main():\n n,m=map(int,input().split())\n Edges=[[] for _ in range(7)]\n for _ in range(m):\n a,b=map(lambda x: int(x)-1,input().split())\n Edges[a].append(b)\n Edges[b].append(a)\n L=[0]*7\n for i,E in enumerate(Edges):\n L[i]=[len(E),i]\n L.sort(reverse=True)\n if L[0][0]!=6:\n return m\n cnt=6\n for num,idx in L:\n tmp=6\n if num!=6:\n break\n for to in Edges[idx]:\n tmp=min(tmp,len(Edges[to])-1)\n cnt=min(cnt,tmp)\n return m-cnt\n \nif __name__=='__main__':\n print(main())", "lang": "Python 3", "bug_code_uid": "de6fda1b1e0d62d4f403125373457ae5", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "9339f986c7f4c0873b563f2b355a2c2c", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8864602307225258, "equal_cnt": 20, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 17, "fix_ops_cnt": 19, "bug_source_code": "n,m=map(int,input().split())\nedges=[list(map(int,input().split())) for i in range(m)]\nfor i in range(m):\n edges[i][0]-=1\n edges[i][1]-=1\nfrom itertools import permutations\nl=list(permutations(range(6)))\nmx=0\nfor ij in l:\n for seven in range(6):\n cnt=[None]*10\n for xi in range(6):\n cnt[xi]=[0]*10\n for xj in range(xi,6):\n cnt[xi][xj]=1\n numbering=[0]*10\n for i in range(6):\n numbering[i]=ij[i]\n numbering[6]=seven\n curr=0\n for e in edges:\n u,v=numbering[e[0]],numbering[e[1]]\n u,v=min(u,v),max(u,v)\n if cnt[u][v]:\n cnt[u][v]=0\n curr+=1\n mx=max(mx,curr)\nprint(mx)", "lang": "PyPy 3", "bug_code_uid": "1b75faf6099fe0132beb37f93044c744", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "561b9fe4437f70f2b1bd5ed64f7439dd", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9990760702186634, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a = list(map(int, input().split()))\nn = a[0]\nm = a[1]\ngraph = {}\nfor i in range(n):\n graph[i + 1] = []\nfor i in range(m):\n a = list(map(int, input().split()))\n graph[a[0]].append(a[1])\n\nif n < 7:\n print(m)\nelse:\n vertices = []\n for k in graph.keys():\n vertices.append((k, len(graph[k])))\n sorted_vertices = sorted(vertices, key=lambda x: x[1])\n minimum_dominoes = 0\n for i in range(1, len(sorted_vertices)):\n if sorted_vertices[0][0] in graph[sorted_vertices[i][0]]:\n minimum_dominoes += sorted_vertices[i][1] - 1\n else:\n minimum_dominoes += sorted_vertices[i][1] - 1\n\n res = 0\n nums = [1, 1, 1, 1, 1, 1, 1]\n\n DOMINOES = set()\n for i in range(1, 7):\n for j in range(i, 7):\n DOMINOES.add((i, j))\n\n max_dominoes = 0\n while True:\n not_used_dominoes = set(DOMINOES)\n count = 0\n ignored = 0\n for v in graph:\n for child in graph[v]:\n domino = (min(nums[v - 1], nums[child - 1]), max(nums[v - 1], nums[child - 1]))\n if domino in not_used_dominoes:\n count += 1\n not_used_dominoes.remove(domino)\n else:\n ignored += 1\n if ignored > m - minimum_dominoes:\n break\n max_dominoes = max(max_dominoes, count)\n if max_dominoes >= m:\n break\n j = len(nums) - 1\n while nums[j] == 6:\n nums[j] = 1\n j -= 1\n if j < 0:\n break\n nums[j] = nums[j] + 1\n\n print(max_dominoes)\n", "lang": "Python 3", "bug_code_uid": "2a46708ad0471f69a0e793dcd4ef34e5", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "35cf9db938ab7d69c2c1887e68a2bf22", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9888888888888889, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n, m, r = map(int, input().split())\nb = sorted(list(map(int, input().split())))[0]\ns= sorted(list(map(int, input().split())))[-1]\np, q = divmod(r, b)\nprint(p*s*q if p*s*q>r else r)", "lang": "Python 3", "bug_code_uid": "2107b607e47e85674e1640b77d8557ac", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "cf8482b0dc2fbe422109879cc04c18cc", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9892086330935251, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n, m, r = map(int, input().split())\n\nl = list(map(int, input().split()))\nk = list(map(int, input().split()))\n\npri_min = min(l)\n\nqut = r // pri_min\nrem = r % pri_min\nz = max(k)\n#print(f\"{pri_min} {qut} {rem} {z}\")\n\nif z * qut >= r:\n print(z * qut+ rem)\n\nelse:\n print(r)\n", "lang": "Python 3", "bug_code_uid": "99176a292107b1013b1b2b793f162f1f", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "84eb9215ee63b1034f51e14f92388e1a", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.17992177314211213, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "import math\nl,r,x,y=map(int,input().split())\ncount=0\nfor i in range(l,r+1):\n if (x*y)%i==0:\n if math.gcd(i,x*y//i)==x:\n count+=1\nprint(count)", "lang": "Python 3", "bug_code_uid": "a98769c97b5dde8257164926f284d768", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "b07aecfeb65a9488da3e946aca4bd15d", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7619795758051846, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "from math import sqrt\n\ndef res(x,y,l,r):\n count = 0\n prod = x*y\n for num in xrange(l,min(r+1,int(sqrt(prod))+1)):\n if prod%num == 0:\n num1 = num; num2 = prod/num\n G = gcd(num1,num2)\n L = prod/G\n if G == x and L == y:\n if num1 == num2:\n count += 1\n else:\n count += 2\n return count\n\ndef gcd(a,b):\n if a == 0 or b == 0:\n return max(a,b)\n elif a > b:\n return gcd(a%b,b)\n else:\n return gcd(b%a,a)\n\nl,r,x,y = map(int, raw_input().split())\nprint res(x,y,l,r)", "lang": "Python 2", "bug_code_uid": "ddc6a2c3883f6227d7a3e29b7435015f", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "1251f37463e887857967d358322df184", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.622792937399679, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "'''input\n1 2 1 2\n\n\n'''\n\nfrom collections import defaultdict as df\nfrom bisect import bisect_left as bl \nfrom itertools import combinations as c\nimport sys\nfrom math import *\nfrom random import randint as R\nimport heapq as hp\n\nl,r,a,b=[int(x) for x in raw_input().split()]\n\nnum=a*b\n\np=[]\nc=0\ndef gcd(a,b):\n\tif b==0:\n\t\treturn a\n\treturn gcd(b,a%b)\n\nfor i in range(1,int(num**0.5)+1):\n\tif num%i==0:\n\t\tif l<=i<=r and l<=num/i<=r:\n\t\t\tif gcd(i,num/i)==a and (a*b)/gcd(i,num/i)==b:\n\t\t\t\tc+=2\n\t\t\t\t#print i,num/i\n\t\t\t\tif i*i==num:\n\t\t\t\t\tc-=1\nprint c\n\n\n\n\n\n\n\n\n\n", "lang": "Python 2", "bug_code_uid": "56c594e0097cd01b52a0e372dc526f71", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "64edf24f1b654496c11601ac776a9a68", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4500875656742557, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "x, y, l, r = map(int, raw_input().split())\nA = [1]\ntmp = 1\nwhile tmp <= 1e18:\n tmp *= x\n A.append(tmp)\nB = [1]\ntmp = 1\nwhile tmp <= 1e18:\n tmp *= y\n B.append(tmp)\nunluckies = []\nfor a in A:\n for b in B:\n tmp = a + b\n if tmp in range(l, r+1):\n unluckies.append(tmp)\nunluckies = sorted(set(unluckies))\nif l not in unluckies:\n unluckies = [l-1] + unluckies\nif r not in unluckies:\n unluckies.append(r+1)\nn = len(unluckies)\nprint(max([unluckies[i] - unluckies[i-1] for i in range(1,n)])-1)", "lang": "PyPy 2", "bug_code_uid": "a8193779122cf049e09a4e9dd3227a8f", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "d9dce72fa3259671d65f192d24718ea0", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4634420697412823, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "from string import*\nn = int(input())\n#n,m = map(int,input().split())\na = list(map(int,input().split()))\ns = list(ascii_lowercase)[:n]\nres = ''\n'''x = set()\nfor i in range(n):\n if a[i] in x:\n f = a[i]+1\n res.append(f*s[i])\n x.add(f)\n else:\n res.append(a[i]*s[i])\n x.add(a[i])\nprint(len(''.join(map(str,res))))'''\n\na.sort(reverse=True)\nfor i in range(n):\n x = a.count(a[i])\n if x>1:\n a[i]-=(x-1)\n\nfor i in range(n):\n res+=(a[i]*s[i])\nprint(len(res))\n", "lang": "Python 3", "bug_code_uid": "55e04d2d42c0cc99ecdf300dca3e00c2", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "aa69902d2406161a749d422c33b382cc", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7593582887700535, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "n=input()\nc=0\na=input()\nwhile a.find(\"xxx\")!=-1:\n\ta.replace('x','')\n\tc+=1\nprint(c)\n", "lang": "PyPy 3", "bug_code_uid": "07a3dab9ed7a5603f88f7149dd0c2230", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "982d0c392b5b54450a306273a1c8f81c", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8205128205128205, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "n = int(input())\ncount = 0\nfor i in range(1, n+1):\n for j in range(i+1, n+1):\n for k in range(j+1, n+1):\n if i+k>j and k+j>i and i+j>k and i^j^k==0:\n count+=1\n \n \nprint(count)", "lang": "Python 3", "bug_code_uid": "3486debccf2474d5624313ed47ec6cf1", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "aa00bd5b1bcb6ad42974131844b6fc7c", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7741935483870968, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "n = int(input())\nans = 0\nfor a in range(1, n + 1):\n for b in range(a, n + 1):\n for c in range(b, min(a + b, n + 1)):\n if a ^ b ^ c == 0:\n ans += 1\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "e1559441cd172f4622225cca93ba24f5", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "b6fe630aead8201a46d72d9e2ad96843", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8083623693379791, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n=input()\nC=0\nfor a in range(1,n+1):\n for b in range(a,n+1):\n for c in range(b,n+1):\n if(a^b^c==0 and c=0 else start/b\netemp=end/b if end%b!=0 else end/b-1\n\nprint etemp-stemp+1", "lang": "Python 2", "bug_code_uid": "2171a9325b2a46f29b0be0500d5f440b", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "1b731fd3dc4c485764be8b8442e76f9d", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9284099472494348, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from sys import stdin\n\ndef work():\n [a, ta] = stdin.readline().strip().split()\n [b, tb] = stdin.readline().strip().split()\n [hh, mm] = stdin.readline().strip().split(\":\")\n a = int(a)\n ta = int(ta)\n b = int(b)\n tb = int(tb)\n hh = int(hh)\n mm = int(mm)\n start = (hh - 5) * 60 + mm\n end = start + ta\n\n n_total = 0\n if end % b == 0: n_total = end / b\n else: n_total = end / b + 1\n\n n_reached = 0\n rest = start - tb\n if rest >= 0:\n n_reached = 1\n n_reached += rest / b\n \n return n_total - n_reached\n \n\nif __name__ == \"__main__\":\n\n print work()\n", "lang": "Python 2", "bug_code_uid": "3809ce1f4ba20256a5f0f322f81258eb", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "75c9381612ab6163b836d1282a243d96", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9990338164251208, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def get_start(start_a, freq):\n mod = (start_a % freq)\n return start_a + [0, freq - mod][mod != 0]\n\ndef has_overlap(x1, y1, x2, y2):\n x = max(x1, x2)\n y = min(y1, y2)\n\n return x < y\n\nstart = 0\nio = lambda c: map(int, raw_input().split(c))\n\na, ta = io(' ')\nb, tb = io(' ')\nt = io(':')\n\nstart_a = get_start((t[0] - 5) * 60 + t[1], a)\nend_a = start_a + ta\nstart_b = 0\nr = 0\n\nwhile start_b < 18 * 60 + 59:\n if has_overlap(start_a, end_a, start_b, start_b + tb):\n r += 1\n start_b += b\n\nprint r\n", "lang": "Python 2", "bug_code_uid": "6923dbcdbc99cd5f55acc4a0fce2b865", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "46d4703291330775bd0b423a8b16795d", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8846153846153846, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "t=int(input())\n\nif (((t-1-1-1)%2==0)and(t-1-pow(1,2)-1!=0)):\n print(1,(t-1-pow(1,2)-1)//(2))\n else:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "b668c67c20123dd5cadf6716a9ad1279", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "1669f03dae8a17759f3768235cc597a3", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9903846153846154, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\ny = (n - 3)//2\nelif y <= 0 or n%2 == 0: print(\"NO\")\nelse: print(\"{0} {1}\".format(1, y))\n", "lang": "Python 3", "bug_code_uid": "49975436b233b9f317c0b2205400e035", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "811f5e261ee6840ab6a59ff7d01e1c49", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.869281045751634, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "# https://codeforces.com/problemset/problem/1184/A1\nimport math\n\nr = int ( input () )\n\nfound = False\n\nelse:\n for x in range (1,int(math.sqrt(r))+1):\n y = ((r-1)/x - x - 1)/2\n if y == int(y) :\n print(x,int(y))\n found = True\n break\n\nif not found :\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "ccfafcf414ebd9b08673aaac2a6038da", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "5d234f078bba1726a75a487e2f648ed6", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.46837146702557203, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "import sys\n\ndef main():\n for a in sys.argv:\n print(a)\n cha_count = 0\n seq_start = 0\n for i in range(1, len(dna)):\n if dna[i-1] != dna[i] or i == len(dna) - 1:\n if (i - seq_start)%2 == 0:\n cha_count += 1\n seq_start = i\n print(cha_count)\n return 0\nmain()", "lang": "Python 2", "bug_code_uid": "9894457a5f21d32115a05f8564c1019d", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "apr_id": "fc92b029ed17d08a1041fb0e42940047", "difficulty": null, "tags": ["implementation", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2693908437381763, "equal_cnt": 31, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 13, "fix_ops_cnt": 31, "bug_source_code": "n , k , x = map(int,raw_input().split())\n\nvetor = map(int,raw_input().split())\nsoma = 0\ni = 0\nwhile True:\n soma_atual = 0\n cresc = 0\n decr = 0\n if i + 1 >= n:\n break\n if vetor[i] == vetor[i+1] == x:\n decr = i - 1\n cresc = i + 2\n soma_atual += 2\n \n while True:\n if decr - 1 >= 0 and cresc +1 < n:\n if vetor[decr - 1] == vetor[decr] == vetor[cresc] == vetor[cresc + 1]:\n soma_atual += 4\n decr -= 2\n cresc += 2\n if decr - 1 >= 0:\n if vetor[decr - 1] == vetor[decr] == vetor[cresc]:\n soma_atual += 3\n decr -=2\n cresc += 1\n if cresc + 1 < n:\n if vetor[decr] == vetor[cresc] == vetor[cresc +1]:\n soma_atual += 3\n decr -= 1\n cresc += 2 \n else:\n break\n if soma_atual > soma:\n soma = soma_atual\n i +=1\n if decr < 0 or cresc > n:\n break\nprint soma", "lang": "Python 2", "bug_code_uid": "e96c01bdcc05b0e42e6adb10bc99a14e", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "ba0072c2812ae61b0e7f8bcdba2219d7", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.14123376623376624, "equal_cnt": 24, "replace_cnt": 22, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 25, "bug_source_code": "infs = raw_input().split()\nn = int(infs[0])\nk = int(infs[1])\nx = infs[2]\nballs = raw_input().split()\npositions = []\ndestroyed_balls = 0\n\nfor i in range(n-1):\n if balls[i] == x and balls[i+1] == x:\n positions.append(i + 1)\n \nif len(positions) == 0:\n print 0\nelse:\n for i in positions:\n j = i - 2\n k = i + 1\n actual_balls = 2\n able = False\n while (j >= 0 and k < n):\n if balls[j] == balls[k] and able:\n actual_balls = actual_balls + 2\n j = j - 1\n k = k + j\n elif balls[j] == balls[k]:\n if j - 1 >= 0:\n if balls[j] == balls[j-1]:\n j = j - 1\n actual_balls = actual_balls + 1\n able = True\n if k + 1 < n:\n if balls[k] == balls[k+1]:\n k = k + 1\n actual_balls = actual_balls + 1\n able = True\n elif able:\n if j - 1 >= 0:\n if balls[j] == balls[j-1]:\n j = j - 1\n actual_balls = actual_balls + 1\n able = True\n if k + 1 < n:\n if balls[k] == balls[k+1]:\n k = k + 1\n actual_balls = actual_balls + 1\n able = True\n else:\n break\n \n destroyed_balls = max(destroyed_balls, actual_balls)\n \n print destroyed_balls", "lang": "Python 2", "bug_code_uid": "b6f0265cbeb2353ce756a919b505d27c", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "47ae21fede78b78d45fe0a580743f37a", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8619813717188823, "equal_cnt": 20, "replace_cnt": 6, "delete_cnt": 12, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "\nedges = []\nn,m = map(lambda x:int(x), input().split())\nfor i in range(m):\n curr = [0,0]\n curr[0],curr[1] = map(lambda x:int(x)-1, input().split())\n edges.append(curr)\n\nnum_in = [1,1,1,1,1,1,1]\nabs_max = 0\nc=0\nfor num_in[0] in range(1, 7):\n for num_in[1] in range(1, 7):\n for num_in[2] in range(1, 7):\n for num_in[3] in range(1, 7):\n for num_in[4] in range(1, 7):\n for num_in[5] in range(1, 7):\n for num_in[6] in range(1, 7):\n c+=1\n used = []\n curr_max = 0\n for x in edges:\n crr = [num_in[x[0]],num_in[x[1]]]\n if crr[0] > crr[1]:\n crr[0],crr[1] = crr[1],crr[0]\n if crr in used:\n continue\n used.append(crr)\n curr_max+=1\n abs_max = max(abs_max,curr_max)\n if abs_max == m:\n print(m)\n exit()\nprint(abs_max)", "lang": "PyPy 3", "bug_code_uid": "d89e9a77c7d22d196b145c75ceeef7f8", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "0d496dd5add83bae138167519f1673f6", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.33847850055126794, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "'''input\n7 21\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n2 3\n2 4\n2 5\n2 6\n2 7\n3 4\n3 5\n3 6\n3 7\n4 5\n4 6\n4 7\n5 6\n5 7\n6 7\n'''\nfrom sys import stdin\nfrom collections import defaultdict\n\n\n# main starts\nn, m = list(map(int, stdin.readline().split()))\ngraph = defaultdict(list)\nfor _ in range(m):\n\tu, v = list(map(int, stdin.readline().split()))\n\tgraph[u].append(v)\n\tgraph[v].append(u)\n\ndefine = dict()\nif len(graph) <= 6:\n\tprint(m)\n\texit()\n\nelse:\n\tprint(min(16, m))\n", "lang": "PyPy 3", "bug_code_uid": "de32d1f2bb38c718837c971d3a36b2a0", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "086b5c1886c5f2bae0a2c8ed643287f6", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.15447154471544716, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "from itertools import permutations\n\ndef dfs(perm, edges, ind, n):\n\tglobal dominoes\n\n\tif ind == n:\n\t\tcur = set()\n\n\t\tfor x, y in edges:\n\t\t\ta, b = perm[x], perm[y]\n\n\t\t\tif tuple(sorted((a, b))) in dominoes:\n\t\t\t\tcur.add(tuple(sorted((a, b))))\n\n\t\treturn len(cur)\n\telse:\n\t\tans = 0\n\t\tfor i in range(6):\n\t\t\tperm[ind] = i\n\n\t\t\tans = max(ans, dfs(perm, edges, ind + 1, n))\n\n\t\treturn ans\n\ndominoes = []\n\nfor i in range(6):\n\tfor j in range(i, 6):\n\t\tdominoes.append((i, j))\n\nn, m = map(int, input().split())\n\nedges = []\n\nfor i in range(m):\n\tx, y = map(int, input().split())\n\n\tx, y = x - 1, y - 1\n\n\tedges.append(sorted((x, y)))\n\nperm = [0 for i in range(n)]\n\nprint(dfs(perm, edges, 0, n))\n", "lang": "PyPy 3", "bug_code_uid": "89db9b208f0723d73d56a040cfafb001", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "dd24f35971f288c4e5a2fc772cab5280", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6415500538213132, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n = int(input())\nstri = input()\ncount = 0\ni = 0\nwhile(i3):\n count += temp - 2\n i = i+jtemp\nprint(count)", "lang": "Python 3", "bug_code_uid": "825c5b7e3ce0bd0998d3920e89c78be8", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "272f4b0d35c873e6121cefc912cc8aed", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.17520310844224657, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "\"\"\"Problem B - File Name.\n\nhttp://codeforces.com/contest/978/problem/B\n\nYou can not just take the file and send it. When Polycarp trying to send a\nfile in the social network \"Codehorses\", he encountered an unexpected problem.\nIf the name of the file contains three or more \"x\" (lowercase Latin letters\n\"x\") in a row, the system considers that the file content does not correspond\nto the social network topic. In this case, the file is not sent and an error\nmessage is displayed.\n\nDetermine the minimum number of characters to remove from the file name so\nafter that the name does not contain \"xxx\" as a substring. Print 0 if the file\nname does not initially contain a forbidden substring \"xxx\".\n\nYou can delete characters in arbitrary positions (not necessarily\nconsecutive). If you delete a character, then the length of a string is reduced\nby $$$1$$$. For example, if you delete the character in the position $$$2$$$\nfrom the string \"exxxii\", then the resulting string is \"exxii\".\n\nInput:\n\nThe first line contains integer $$$n$$$ $$$(3 \\le n \\le 100)$$$ — the length\nof the file name.\n\nThe second line contains a string of length $$$n$$$ consisting of lowercase\nLatin letters only — the file name.\n\nOutput:\n\nPrint the minimum number of characters to remove from the file name so after\nthat the name does not contain \"xxx\" as a substring. If initially the file name\ndost not contain a forbidden substring \"xxx\", print 0.\n\n\"\"\"\nimport logging\n\nch = logging.StreamHandler()\nch.setLevel(logging.DEBUG)\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.DEBUG)\nlogger.addHandler(ch)\n\n\ndef solve(s):\n return min_characters(s)\n\n\ndef min_characters(s, memo=None):\n if not isinstance(s, str):\n s = ''.join(s)\n if not memo:\n memo = {}\n if s in memo:\n return memo[s]\n if 'xxx' not in s:\n return 0\n msf = float('inf')\n for i, c in enumerate(s):\n if c == 'x':\n memo[s] = 1 + min_characters(s[:i] + s[i+1:])\n msf = min(msf, memo[s])\n return msf\n\ndef main():\n _ = int(input().strip())\n s = input().strip()\n result = solve(s)\n print(result)\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "485aeca9ad66cb2bd3ed5114640a22d9", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "79f3f29b8aacc3cd2c075f9ed24a4922", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9998703151342239, "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\nfrom collections import defaultdict, Counter, deque\nfrom future_builtins import ascii, filter, hex, map, oct, zip\nfrom itertools import imap as map, izip as zip, permutations, combinations, combinations_with_replacement,product\nfrom __builtin__ import xrange as range\nfrom math import ceil, factorial, log,tan,pi,cos,sin,radians\nfrom _continuation import continulet\nfrom cStringIO import StringIO\nfrom io import IOBase\nimport __pypy__\nfrom bisect import bisect, insort, bisect_left, bisect_right\nfrom fractions import Fraction\nfrom functools import reduce\nfrom decimal import *\nimport copy\nimport string\nimport sys\nimport os\nimport re\ninf = float('inf')\nmod = int(1e9) + 7\nmod_ = 998244353\n\ndef factors(n):\n from functools import reduce\n return set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))\n\ndef sieve(n):\n arr=[1]*n\n for i in range(2,int(n**0.5)+1):\n if arr[i]==1:\n for j in range(i,n,i):\n arr[j]=i\n return arr\n\n\ndef isprime(x):\n if x<=3:\n return True\n for i in range(2,int(x**0.5)+1):\n if x%i==0:\n return False\n return True\n\ndef check(arr):\n rev=[]\n for i in arr:\n rev.append(reversed(i))\n for i in range(len(arr)):\n if not(isprime(sum(arr[i])) and isprime(sum(rev[i]))):\n return False\n return True\n\ndef main():\n n,x,pos=map(int,input().split())\n def binary_search(x,n,pos):\n l=0\n r=n\n cnt=cnt2=0\n rem=n-1\n temp=1\n while l<=r:\n mid=(l+r)//2\n # print(mid)\n if mid==pos:\n # print(cnt,cnt2,rem,temp)\n l=mid+1\n \n elif mid ans:\n\t\t\t\t\tans = val \n\t\tdp[s] = ans+1\n\t\treturn ans+1\n\ninput()\nprint(compute(input()))\n\n", "lang": "Python 3", "bug_code_uid": "50bdd16ee178f8f9396e1529d6ce97f4", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "7aca73dcc77b0ef1d7a010433781ce67", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.25198637911464244, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\ns = input()\n\nl = []\nfor i in range(n):\n\tl.append(ord(s[i]))\n\nc = 0\n\nwhile len(l) > 0:\n\tm = max(l)\n\ti = 0\n\twhile l[i] != m:\n\t\ti += 1\n\tif l[i] - l[i - 1] == 1 or l[i] - l[i + 1] == 1:\n\t\tl.pop(i)\n\t\tc += 1\n\nprint(c)", "lang": "Python 3", "bug_code_uid": "b8ace61906d0f3879bebfbaa3f3aa1aa", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "7d202d243d30076fe88750880954c8dc", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5431893687707641, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "def gdc(a, b):\n if a == b:\n return a\n while a != 0 and b != 0:\n if a > b:\n a %= b\n else:\n b %= a\n return a + b\n\n\ndef lcm(a, b):\n m = a * b\n return m // gdc(a, b)\n\nmas = raw_input().split()\n\nl = int(mas[0])\nr = int(mas[1])\nx = int(mas[2])\ny = int(mas[3])\n\na = []\nfor i in range(l, r + 1):\n a.append(i)\n\nk = 0\n\nfor i in range(len(a)):\n for j in range(len(a)):\n if gdc(a[i], a[j]) == x and lcm(a[i], a[j]) == y:\n k += 1\n\nprint(k)\n", "lang": "PyPy 2", "bug_code_uid": "6d5e10d5dea6576fd3911060f46e2160", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "9397986fc39b9018dfcc8d49bafc3e24", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5821325648414986, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "import math\nfrom fractions import gcd\nl,r,x,y=map(int,raw_input().split())\nn=x*y\nans=0\ng=x\ni=1\nwhile i<=math.sqrt(n):\n #print i\n if n%i==0:\n x=i\n y=n/i\n if gcd(x,y)==g and x<=r and x>=l and y<=r and y>=l:\n if x==y:\n ans+=1\n else:\n \n ans+=2\n i+=1\nprint ans\n", "lang": "PyPy 2", "bug_code_uid": "32efdd60fab4017671b105aa87225088", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "75f2314ffc7b54098440ff65e28113f1", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8341608738828202, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "from sys import stdin\nfrom fractions import gcd\n\n\ndef factorize(n): # o(sqr(n))\n c, ans = 1, 0\n while (c * c < n):\n if n % c == 0:\n if l <= c <= r and l <= n // c <= r and gcd(c, n // c) == x and lcm(c, n // c) == y:\n ans += 2\n c += 1\n\n if c * c == n:\n if l <= c <= r and c == x == y:\n ans += 1\n print(ans)\n\n\nlcm = lambda a, b: a // gcd(a, b) * b\nl, r, x, y = [int(x) for x in stdin.readline().split()]\nfactorize(x * y)\n", "lang": "PyPy 2", "bug_code_uid": "1f4f0d4e1d93a10b53a0abc28ea4356a", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "841bc4bddef256aa0af22634176b445e", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.910941475826972, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "k = int(input())\na = ''\nfor _ in range(4):\n a = a + input()\nf = 1\n\nfor el in set(a):\n if a.count(el) > 2*k:\n print(\"NO\")\n f = 0\n break\nif f:print(\"YES\")", "lang": "PyPy 3", "bug_code_uid": "9643f8a3555fb363b466d3ddece99184", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "691d96fff65157cf9ddd05ff24e8ae7a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9795918367346939, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from collections import defaultdict\nn = int(input())\na = []\nfor i in range(4):\n x = list(input())\n a.append(x)\nd = defaultdict(lambda: 0)\nfor i in range(len(a)):\n for j in range(len(a[i])):\n d[a[i][j]]+=1\n\nn = 2*n\nfor key in d:\n if(d[key] > n):\n print('NO')\n exit()\nprint('YES')\n", "lang": "PyPy 3", "bug_code_uid": "8ab6dd65aa27a6b3ae4762394234e2cb", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "3e21cf37fabf1a61681f22f8105c35d2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9985815602836879, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import math\nimport atexit\nimport io\nimport sys\n \n# input = sys.stdin.readline\n_OUTPUT_BUFFER = io.StringIO()\nsys.stdout = _OUTPUT_BUFFER\n \n@atexit.register\ndef write():\n sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())\n \ndef array_to_string(a):\n s = \"\"\n for i in a:\n s += str(i)\n return s\n \nn = int(input())\nd = dict()\nfor i in range(4):\n s = input()\n for j in s:\n if j == '.':\n continue\n val = int(j)\n if d.get(val):\n d[val] += 1\n continue\n d[val] = 1\nm = n*2\n# print(m)\nf = 0\n# print(d)\nfor k,v in d.items():\n if v>m:\n print(k,v)\n f = 1\n break\nif f == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "f60ef0f13df17c46c2b141938af7f8c4", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "3b157812479aacfbcd094633f637a627", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8491321762349799, "equal_cnt": 14, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 12, "fix_ops_cnt": 13, "bug_source_code": "import sys\n\nnoOfPixels = int(input())\n\nrow=1\nmini = sys.maxsize\nans = []\n\nwhile True:\n if noOfPixels%row==0:\n col = noOfPixels//row\n\n if row > col:\n break\n mini = min(mini,(col-row))\n ans[:] = []\n ans.append(row)\n ans.append(col)\n\n row = row+1\n\nprint(ans[0],ans[1])", "lang": "Python 3", "bug_code_uid": "b6c8009503d5a096d2e3ec4ee36fb315", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "da8c62395aaaad739abfb050e638ac8b", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9101123595505618, "equal_cnt": 23, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 16, "fix_ops_cnt": 22, "bug_source_code": "import math\n\ndef is_square(n):\n sqrt = math.sqrt(n)\n return (sqrt - int(sqrt)) == 0\n\n \npixel = int(input())\n\n\nif is_square(pixel): result = (int(math.sqrt(self.pixel)),int(math.sqrt(self.pixel)))\nelse:\n lista =[]\n for i in range(1, pixel+1):\n if pixel%i == 0 :lista.append(i)\n pivot = int(len(lista)/2)-1\n row = lista[pivot]\n column = lista[pivot+1]\n result = (row,column)\n\n priint(f\"{' '.join(map(str,result))}\")", "lang": "Python 3", "bug_code_uid": "f3451702f0105e0309645bd5b4cb07f1", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "52bd7ce9e9eccad19fdf3c0dafe25c5a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.33570863024544734, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\n\nn = int(input())\n\na = 1\nb = n\n\nm=int(math.sqrt(n))\n\nfor i in range(1, m+1):\n\n x = i\n if n % x == 0:\n y = n // x\n if b - a > y - x:\n a = x\n b = y\n\nprint(a, b)\n/*\n#include\nusing namespace std;\nint main()\n{\n vectorarr;\n vectorbrr;\n int n;\n cin>>n;\n for(int i=1;i<=n;i++){\n for(int j=1;j<=n;j++){\n if(i*j==n)\n {\n arr.push_back(i);\n arr.push_back(j);\n }\n }\n }\n /*for(int i=0;iy2:\n x1,x2 = x2,x1\n y1,y2 = y2,y1\n \n if x2 > x1:\n while x1<9 and y1<9:\n x1+=1\n y1+=1\n if x1 == x2 and y1 == y2:\n break\n bishop = 1\n if x1 > x2:\n while x1>0 and y1<9:\n x1-=1\n y1+=1\n if x1 == x2 and y1 == y2:\n break \n bishop = 1\n else:\n bishop = 2\n\n# Calculate rook and king\nif x1 == x2 or y1 == y2:\n king = abs(x1-x2) + abs(y1-y2)\n rook = 1\nelse:\n rook = 2\n steps = 0\n if y1>y2:\n x1,x2 = x2,x1\n y1,y2 = y2,y1\n \n if x2>x1:\n while x1<9 and y1<9:\n x1+=1\n y1+=1\n steps+=1\n if x1==x2 or y1==y2:\n break\n if x1 == x2 or y1 == y2:\n steps += abs(x1-x2) + abs(y1-y2)\n else:\n while x1>0 and y1<9:\n x1-=1\n y1+=1\n steps+=1\n if x1==x2 or y1==y2:\n break\n if x1 == x2 or y1 == y2:\n steps += abs(x1-x2) + abs(y1-y2)\n king = steps\nprint(rook,bishop,king) ", "lang": "Python 3", "bug_code_uid": "2631b83bb4bbf56ac984fa26d8d30dbb", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "3c1a216514c4ec006d5619fe6cfc8aac", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "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": "import sys\nimport math\nimport random\nn, k, x = map(int, input().split())\na = list(map(int, input().split()))\nans = 0\nif n == 1:\n print(0)\n sys.exit()\nfor i in range(0, n - 1): \n if a[i] == a[i + 1] == x:\n l = i \n while l >= 0 and a[i] == a[l]:\n l -= 1\n r = i + 1\n while r < n and a[r] == x:\n r += 1\n while (1):\n if l == -1 or r == n:\n break\n if a[l] != a[r]:\n break\n if l == 0 and r == n - 1:\n break\n if l == 0:\n if a[0] == a[r + 1]:\n while r < n and a[r] == a[0]:\n r += 1\n l -= 1\n continue\n else:\n break\n if r == n - 1:\n if a[n - 1] == a[l - 1]:\n while l >= 0 and a[l] == a[n - 1]:\n l -= 1\n r += 1\n continue\n else:\n break\n if a[l] == a[r + 1] or a[l - 1] == a[r]:\n t = a[l]\n while l >= 0 and a[l] == t:\n l -= 1\n while r < n and a[r] == t:\n r += 1\n ans = max(ans, r - l - 1) \nprint(ans)", "lang": "Python 3", "bug_code_uid": "0cfe8ef33caae76abb644c0a6bdc6c9e", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "22d006c58487caff789b03b04a6bc810", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8591549295774648, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "w \nif w%2==0 and w!=2:\n print(\"yes\")\nelse:\n print( \"no\")\n ", "lang": "Python 3", "bug_code_uid": "311b6c16a828518a15292724758405c3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "1ff707760afc9659daa82aec37f881f6", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9359797625997276, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "def _try_composite(a, d, n, s):\n if pow(a, d, n) == 1:\n return False\n for i in range(s):\n if pow(a, 2**i * d, n) == n - 1:\n return False\n return True\n\n\ndef is_prime(n):\n if n in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]:\n return True\n\n if (any((n % p) == 0 for p in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37])) or (n in [0, 1]):\n return False\n\n d, s = n - 1, 0\n while not d % 2:\n d, s = d >> 1, s + 1\n\n if n < 2047:\n return not _try_composite(2, d, n, s)\n if n < 1373653:\n return not any(_try_composite(a, d, n, s) for a in [2, 3])\n if n < 25326001:\n return not any(_try_composite(a, d, n, s) for a in [2, 3, 5])\n if n < 118670087467:\n if n == 3215031751:\n return False\n return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7])\n if n < 2152302898747:\n return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11])\n if n < 3474749660383:\n return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13])\n if n < 341550071728321:\n return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13, 17])\n if n < 3825123056546413051:\n return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13, 17, 19, 23])\n return not any(_try_composite(a, d, n, s) for a in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37])\n\n\nn, k = map(int, input().split(' '))\ninv = [pow(i, 1000000005, 1000000007) for i in range(60)]\n\nif n == 1:\n print(1)\n exit()\n\n\ndef solve(p, q):\n dp = [1] * (q + 1)\n for i in range(q):\n dp[i + 1] = (dp[i] * p) % 1000000007\n for i in range(1, q + 1):\n dp[i] = (dp[i] + dp[i - 1]) % 1000000007\n for _ in range(k):\n dp1 = [1] * (q + 1)\n for i in range(1, q + 1):\n dp1[i] = (dp1[i - 1] + dp[i] * inv[i + 1]) % 1000000007\n dp = dp1\n\n return (dp[-1] - dp[-2]) % 1000000007\n\nans = 1\n\nif 4 <= n:\n c = 0\n while n % 2 == 0:\n c += 1\n n //= 2\n if c:\n ans = ans * solve(2, c) % 1000000007\n\nif 9 <= n:\n c = 0\n while n % 3 == 0:\n c += 1\n n //= 3\n if c:\n ans = ans * solve(3, c) % 1000000007\n\ni = 5\nwhile i * i <= n:\n c = 0\n while n % i == 0:\n c += 1\n n //= i\n if c:\n ans = ans * solve(i, c) % 1000000007\n if is_prime(n):\n if n > 1:\n ans = ans * solve(n, 1) % 1000000007\n print(ans)\n exit()\n\n i += 2 if i % 3 == 2 else 4\n\nif n > 1:\n ans = ans * solve(n, 1) % 1000000007\n\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "2069cc52e1214a7b54359a1498c95585", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "a6a697ce5209422781d97cd1e2b5f278", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9819478975245919, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "def primeFactor(N):\n i = 2\n ret = {}\n n = N\n mrFlg = 0\n if n < 0:\n ret[-1] = 1\n n = -n\n if n == 0:\n ret[0] = 1\n while i**2 <= n:\n k = 0\n while n % i == 0:\n n //= i\n k += 1\n ret[i] = k\n if i == 2:\n i = 3\n else:\n i += 2\n if i == 101 and n >= (2**20):\n def findFactorRho(N):\n def gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n def f(x, c):\n return ((x ** 2) + c) % N\n semi = [N]\n for c in range(1, 11):\n x=2\n y=2\n d=1\n while d == 1:\n x = f(x, c)\n y = f(f(y, c), c)\n d = gcd(abs(x-y), N)\n if d != N:\n if isPrimeMR(d):\n return d\n elif isPrimeMR(N//d):\n return N//d\n else:\n semi.append(d)\n\n semi = list(set(semi))\n print (semi)\n s = min(semi)\n for i in [2,3,5,7]:\n while True:\n t = int(s**(1/i)+0.5)\n if t**i == s:\n s = t\n if isPrimeMR(s):\n return s\n else:\n break\n\n i = 3\n while True:\n if s % i == 0:\n return i\n i += 2\n \n while True:\n if isPrimeMR(n):\n break\n else:\n mrFlg = 1\n j = findFactorRho(n)\n k = 0\n while n % j == 0:\n n //= j\n k += 1\n ret[j] = k\n if n == 1:\n break\n \n if n > 1:\n ret[n] = 1\n if mrFlg > 0:\n def dict_sort(X):\n Y={}\n for x in sorted(X.keys()):\n Y[x] = X[x]\n return Y\n ret = dict_sort(ret)\n return ret\n\ndef isPrime(N):\n if N <= 1:\n return False\n return sum(primeFactor(N).values()) == 1\n\ndef isPrimeMR(n):\n if n == 2: return True\n if n == 1 or n & 1 == 0: return False\n\n d = (n - 1) >> 1\n while d & 1 == 0:\n d >>= 1\n\n for a in [2, 3, 5, 7, 11, 13, 17, 19]:\n t = d\n y = pow(a, t, n)\n\n while t != n - 1 and y != 1 and y != n - 1:\n y = (y * y) % n\n t <<= 1\n\n if y != n - 1 and t & 1 == 0:\n return False\n\n return True \n\ndef findPrime(N):\n if N < 0:\n return -1\n i = N\n while True:\n if isPrime(i):\n return i\n i += 1\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p]+1):\n for r in ret_prev:\n ret.append(r * (p ** i))\n return sorted(ret)\n\ndef mxpow(m, a, e):\n if e == 1:\n return a\n if e % 2 == 0:\n tmp = mxpow(m, a, e//2)\n return mxprod(m, tmp, tmp)\n else:\n tmp = mxpow(m, a, e//2)\n return mxprod(m, mxprod(m, tmp, tmp), a)\n\ndef mxprod(m, a, b):\n ret = [[0]*m for _ in range(m)]\n for i in range(m):\n for j in range(m):\n for k in range(m):\n ret[i][j] += a[i][k] * b[k][j]\n ret[i][j] %= P\n return ret\n\ndef mxv(m, a, v):\n ret = [0]*m\n for i in range(m):\n for k in range(m):\n ret[i] += a[i][k] * v[k]\n ret[i] %= P\n return ret\n\ndef mx(m):\n ret = [[0]*m for _ in range(m)]\n for i in range(m):\n for j in range(i, m):\n ret[i][j] = inv(j+1)\n \n return ret\n \ndef vc(m):\n return [0] * (m-1) + [1]\n\n\ndef inv(a):\n return pow(a, P-2, P)\n\n\n# ----- -----\n\nP = 10**9 + 7\n\nn, k = map(int, input().split())\n# n = 6\n# k = 2\n\npf = primeFactor(n)\n# print(pf)\n\nans = 1\nfor p in pf:\n m = pf[p] + 1\n vvv = mxv(m, mxpow(m, mx(m), k), vc(m))\n\n t = 0\n for i in range(m):\n t += (vvv[i] * p ** i) % P\n t %= P\n \n ans *= t\n ans %= P\nprint(ans)\n\n", "lang": "Python 3", "bug_code_uid": "30e3b84fd9c9620ee6738cbe85b01489", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "a2552705f58127289603c520065476fc", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9968553459119497, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input(\"\"))\ns = str(input(\"\"))\n\nc = 0\nfor i in range(0, n - 2):\n for f in range(i + 2, n + 1):\n if s[i:f].count('R') == s[i:f].count('L') and s[i:f].count('U') == s[i:f].count('D'): \n c = c + 1\n r = 'S'\n else:\n r = ''\n #print (i, f, s[i:f], r)\n\nprint (c)", "lang": "Python 3", "bug_code_uid": "f4ac166fe162dbcd174ea8ffbfff1d08", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "713f281e954ffc06c278466cdb686701", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9993626513702996, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/pthon3\n\nn = int(input())\nins = str(input())\n\npos = [(0, 0)]*n\n\nfor i in range(n):\n if ins[i] == 'U':\n if i == 0:\n pos[i] = (0,1)\n else:\n pos[i] = (pos[i-1][0], pos[i-1][1]+1)\n elif ins[i] == 'L':\n if i == 0:\n pos[i] = (-1,0)\n else:\n pos[i] = (pos[i-1][0]-1, pos[i-1][1])\n elif ins[i] == 'R':\n if i == 0:\n pos[i] = (1,0)\n else:\n pos[i] = (pos[i-1][0]+1, pos[i-1][1])\n elif ins[i] == 'D':\n if i == 0:\n pos[i] = (0,-1)\n else:\n pos[i] = (pos[i-1][0], pos[i-1][1]-1)\n\nans = 0\nd = dict()\nd[(0,0)] = 1\nprint(pos)\nfor i in pos:\n if i in d:\n ans += d[i]\n d[i] += 1\n else:\n d[i] = 1\n\nprint(str(ans))\n", "lang": "Python 3", "bug_code_uid": "92105bb8557d5915a2d3cf34865ccae2", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "1ec9026e0e22c8e7b49f2f3eb6adb10f", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9588014981273408, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n=input()\ns=raw_input()\nc,i = 0,0\n\nfor i in range(n):\n\n path = 0\n\n if s[i] == 'U':\n path += 1\n elif s[i] == 'D':\n path += -1\n elif s[i] == 'R':\n path += +2\n elif s[i] == 'L':\n path += -2\n\n for j in range(i+1, n):\n\n if s[j] == 'U':\n path += 1\n elif s[j] == 'D':\n path += -1\n elif s[j] == 'R':\n path += +2\n elif s[j] == 'L':\n path += -2\n\n if path == 0:\n c += 1\n # break\n\n \nprint c\n \n", "lang": "Python 2", "bug_code_uid": "4f24ac14cf86c947cbcfe1cb228ac017", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "76508bb871d84b9c78f6b02c472d19cf", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9887640449438202, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import sys\nn,m=map(int ,raw_input().split(\" \"))\ns=raw_input()\nk={}\ncount=0\nfor i in range(0,len(s)):\n try:\n k[s[i]]+=1\n except:\n k[s[i]]=1 \nl=sorted(k.keys())\nck=False\nfor i in range(0,len(l)):\n if(k[l[i]] 1:\n m = j-i // 2;\n if f(m) < v:\n i = m\n elif f(m) == v:\n return m, v;\n else:\n j = m;\n return i, f(i);\n\n#On détermine les positions des doublets\ncurrentLine = 1;\npos = []\nlong = n; #La longueur retante après les doublets déjà mis\n\n\nwhile currentLine != k:\n i, v = dico(long, k-currentLine);\n currentLine += v;\n pos.append(n-i+1);\n long = i-2;\n\n#On construit la réponse\nprec = 0;\nfor p in pos:\n for i in range(prec+1, p):\n print(i, end = \" \");\n print(p+1, p, end = \" \");\n prec = p+1;\nfor i in range(prec+1, n+1):\n print(i, end = \" \");\n", "lang": "Python 3", "bug_code_uid": "c30ac095ccd6e64054b91d80f9ea833b", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "5e26fe2e13dbd48592112b3c5603d196", "difficulty": 1900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2853628536285363, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "import math\nx=raw_input().split(' ')\nn=int(x[0])\nk=int(x[1])\narr=[0]\ni=n\nwhile i>=1:\n arr.append(i)\n i=i-1\nbrr=[]\nwhile k>1:\n s=int(math.ceil(math.log(k,2)))\n brr.append(s)\n a=pow(2,s-1)\n k=k-a\ni=len(brr)-1\nwhile i>=0:\n ind=brr[i]\n temp=arr[ind]\n arr[ind]=arr[ind+1]\n arr[ind+1]=temp\n i=i-1\ni=n\nwhile i>=1:\n print arr[i],\n i=i-1\n \n", "lang": "Python 2", "bug_code_uid": "481cf656ce201b8cb12552559903cf0f", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "f7b29324d4598a81c705926ac394c7c4", "difficulty": 1900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8838268792710706, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "from itertools import *\nn,m=map(int,input().split())\ne = [tuple(int(s)-1 for s in input().split()) for _ in range(m)]\nprint(max(len(set(tuple(sorted([p[a],p[b]])) for a,b in e)) for p in product(range(6),repeat=n)))", "lang": "Python 3", "bug_code_uid": "aad3b44dcefb3be929d4a00b7d29c323", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "22954812275227feb4dece261acc1928", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8648421052631579, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "dominos = []\nfor i in range(1,7):\n\tfor j in range(i, 7):\n\t\t\tdominos.append((i,j))\n\ndominos_start_from = {}\n\nfor val in dominos:\n\t\ta, b = val\n\t\ttry:\n\t\t\tdominos_start_from[a].append((a,b))\n\t\texcept KeyError:\n\t\t\tdominos_start_from[a] = [(a,b)]\n\n\t\ttry:\n\t\t\tdominos_start_from[b].append((b,a))\n\t\texcept KeyError:\n\t\t\tdominos_start_from[b] = [(b,a)]\n\nnm = raw_input();\nedges = []\nn, m = nm.strip().split();\nm = int(m)\nn = int(n)\n\ngraph = {}\n\nfor i in range(m):\n\t\tuv = raw_input()\n\t\tu, v = uv.strip().split()\n\t\tu = int(u)\n\t\tv = int(v)\n\t\tedges.append((u,v))\n\t\ttry:\n\t\t\tgraph[u].append(v)\n\t\t\tgraph[v].append(u)\n\t\texcept KeyError:\n\t\t\tgraph[u] = [v]\n\t\t\tgraph[v] = [u]\n\n\nans = [0]\nvertex = {}\nnodes = graph.keys()\nn_nodes = len(nodes)\ndef compute():\n\tval = 0;\n\tpairs = {}\n\tfor val in edges:\n\t\ta,b = val\n\t\ta = vertex[a]\n\t\tb = vertex[b]\n\t\ta,b = min(a,b), max(a,b)\n\t\tpairs[(a,b)] = True\n\tans[0] = max(ans[0], len(pairs.keys()))\n\ndef dfs1(idx):\n\tif idx >= n_nodes:\n\t\tcompute()\n\t\treturn\n\tnode = nodes[idx]\n\tfor val in range(1,7):\n\t\tvertex[node] = val\n\t\tdfs1(idx+1)\n\t\tdel vertex[node]\n\ndfs1(0);\nprint ans[0];\n", "lang": "Python 2", "bug_code_uid": "c1418b04a48bd212bc1b3003d4cce710", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "b147fb308537e293f980a9d72f587e90", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.791268758526603, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "r1,c1,r2,c2 = [int(x) for x in raw_input().split(\" \")]\nif r1 == r2 or c1 == c2:\n\tprint 1,\nelse:\n\tprint 2,\ndr = abs(r1-r2)\ndc = abs(c1-c2)\nif (dr%2) == 0 and (dc%2) == 0:\n\tif dr == dc:\n\t\tprint 1,\n\telse:\n\t\tprint 2,\nelse:\n\tprint 0,\nk = 0\nwhile dr > 0 and dc > 0:\n\tdr -= 1 \n\tdc -= 1\n\tk += 1\nwhile dr > 0:\n\tdr -= 1\n\tk += 1\nwhile dc > 0:\n\tdc -= 1\n\tk += 1\nprint k", "lang": "Python 2", "bug_code_uid": "f4a9906d65f5f8f1679a5a853c7d5c47", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "e8dd1ba410f1e9434183210a27c18482", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9955595026642984, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from Queue import * # Queue, LifoQueue, PriorityQueue\nfrom bisect import * #bisect, insort\nfrom datetime import * \nfrom collections import * #deque, Counter,OrderedDict,defaultdict\nimport calendar\nimport heapq\nimport math\nimport copy\nimport itertools\nmyread = lambda : map(int,raw_input().split())\n\ndef white(a,b):\n return (a % 2 == 1 and b % 2 == 1) or (a % 2 == 0 and b % 2 == 0)\n\ndef black(a,b):\n return (a % 2 == 0 and b % 2 == 1) or (a % 2 == 1 and b % 2 == 0)\n\ndef solver():\n \n r1,c1,r2,c2 = myread()\n ans_list = []\n #rook\n ans = 0\n if r1 != r2:\n ans += 1\n \n if c1 != c2:\n ans += 1\n \n ans_list.append(ans)\n\n ans = 0\n\n #bishop\n\n if (r1 - c1 == r2 - c2) or (r1 + c1 == r2 + c2):\n ans = 1\n else:\n ans = 2\n \n\n if white(r1,c1) and black(r2,c2):\n ans = 0\n\n if black(r1,c1) and black(r2,c2):\n ans = 0\n\n ans_list.append(ans)\n \n ans = 0\n #king\n \n ans = max(abs(r1-r2),abs(c1-c2))\n\n\n\n ans_list.append(ans)\n\n\n print ans_list[0],ans_list[1],ans_list[2]\n\n \n\n\n\n\n\nif __name__ == \"__main__\":\n solver()\n \n", "lang": "Python 2", "bug_code_uid": "24c26675a9f5e17663f5b61bdb66e21a", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "c90cb8a03185216953be93c1c89183ce", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9579439252336449, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "r1,c1,r2,c2=map(int,raw_input().split())\na=b=c=0\nif r1==r2 or c1==c2:\n a=1\nelse:\n a=2\nif (r1+c1-r2-c2)%2==0:\n b=0\nelif abs(r1-r2)==abs(c1-c2):\n b=1\nelse:\n b=2\nc=max(abs(c1-c2),abs(r1-r2))\nprint a,b,c", "lang": "Python 2", "bug_code_uid": "d41ca876a6ada455c16eb6f9315f0817", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "b1ff8f4574053f6131b4e77dcedf852e", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9983948635634029, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\"\"\"http://codeforces.com/contest/370/problem/0\"\"\"\n\nr1,c1,r2,c2 = map(int,raw_input().split())\nprint r1,c1,r2,c2\nrook = (0 if r1 == r2 else 1)+(0 if c1 == c2 else 1)\nbishop = (1 if abs(c1-c2) == abs(r1-r2) else 2) if (abs(r1-r2)+abs(c1-c2))%2==0 else 0\nking = max(abs(r1-r2),abs(c1-c2))\nprint rook, bishop, king\n", "lang": "Python 2", "bug_code_uid": "872f0e1ae4b67a2050a36e1523f55a22", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "cd4566caf5be44b5f1390924de3762be", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.577391304347826, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "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, m = mints()\nf = list(mints())\nf.sort()\nr = 1e100\nfor i in range(m-n+1):\n\tr = min(r, f[i+n-1]-f[i])\nprint(r)", "lang": "Python 3", "bug_code_uid": "3c05b5ca881d8e527d89276869e37bc8", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "eb11c6825949e1355fc4463640740b00", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9982363315696648, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def main():\n a, b, c, d = map(int, input().split())\n c, d = c-a, d-b\n x, y = map(int,input.().split())\n \n if c%x != 0 or d%y != 0:\n print(\"NO\")\n elif c/x % 2 == d/y %2:\n print(\"YES\")\n else:\n print(\"NO\")\n\nif __name__ == \"__main__\":\n main()\n", "lang": "Python 3", "bug_code_uid": "a3013fe9762abd16a25157f20878ee68", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "eef5761f9b3c984b45a7fc442f66aae1", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9860627177700348, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "def main():\n a, b, c, d = map(int, input().split())\n c, d = c-a, d-b\n x, y = map(int,input().split())\n \n if c%x != 0 or d%y != 0:\n print(\"NO\")\n elif c/x % 2 == d/y %2:\n print(\"YES\")\n else:\n print(\"NO\")\n\nif __name__ == \"__main__\":\n main()\n", "lang": "Python 2", "bug_code_uid": "ec69a0d6b4ae3d507a75884332230d26", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "eef5761f9b3c984b45a7fc442f66aae1", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.35185185185185186, "equal_cnt": 12, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "a, b, q, w = map(int, input().split())\nx, y = map(int, input().split())\n\nq -= a\nw -= b\n\nif q % x == 0 and w % y == 0 and abs(w - q) % abs(x - y) == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "9daa7f3beb3d4ad35e60263e73e5d6cf", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "cbdfc521e2566f99dbca157796c049b1", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5325264750378215, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import bisect\n\nn, m = [int(x) for x in input().split()]\na = [int(x) for x in input().split()]\n\n# n : number of integers\n# m : mod\n\nhalf_n = n // 2\n\na1, a2 = a[:half_n], a[half_n:]\n\ndef add(a, m):\n ans = []\n n = len(a)\n for i in range(2 ** n):\n tmp = 0\n b = format(i, 'b')\n for j, x in enumerate(reversed(b)):\n tmp += a[j] * int(x)\n ans.append(tmp % m)\n return sorted(ans)\n\nr1, r2 = add(a1, m), add(a2, m)\n\nans = 0\n\nfor i, x in enumerate(r1):\n p = bisect.bisect_left(r2, m-x)\n tmp_ans = r2[p-1] + x\n if tmp_ans > ans:\n ans = tmp_ans\n\nprint(ans)\n\n\n\n\n\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "c6b3664d5d4c0afdf4aa39a78783aeb0", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "ca9dd7c19a4a94d931921ee9cc259f31", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7060439560439561, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "n,m=map(int,input().split())\na=[int(i)%m for i in input().split()]\nx,y=set(),set()\ndef f(x,n,c):\n for i in range(1<prize2:\n print(prize2)\nelse:print(prize1)\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "9e48fcf6e6816e895e79b5e6fad05609", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "81f315466ed4aab9df7e3894c9554e8c", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8378378378378378, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "print(3**(int(input())%10**6+3)", "lang": "Python 3", "bug_code_uid": "44b19b9b69deeedf79761fbd57e16325", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "d9c7451bd72cf8c61d829e67e38bb1a7", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9533791109504879, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "from operator import itemgetter\n\ndef bin_search(lo, hi, key):\n while (lo < hi):\n md = (hi + lo) // 2\n if (md >= key(md)):\n hi = md\n #print(\"new hi:\", hi)\n else:\n lo = md + 1\n #print(\"new lo:\", lo)\n return lo #or hi, they're equal at this point\n\ndef key_func(budget, prices):\n for k in range(1 + budget//prices[2]):\n budget2 = budget - k*prices[2]\n for j in range(1 + budget2//prices[1]):\n budget3 = budget2 - j*prices[1]\n i = budget3//prices[0]\n if survive(i, j, k):\n return budget - 1\n return budget + 1\n\ndef survive(i, j, k):\n global y, m, p, penumsorted\n toadd = [i, j, k]\n newy = list(y)\n newm = list(m)\n for i, item in enumerate(penumsorted):\n newy[item[0]] = y[item[0]] + toadd[i]\n #print(vars())\n while newy[0] > 0 and newm[0] > 0:\n newy[0] -= max(0, newm[1] - newy[2])\n newm[0] -= max(0, newy[1] - newm[2])\n if newm[0] <= 0 and newy[0] > 0:\n return True\n else:\n return False\n\ny = list(map(int, input().split()))\nm = list(map(int, input().split()))\np = list(map(int, input().split()))\npsorted = sorted(p)\npenum = list(enumerate(p))\npenumsorted = sorted(penum, key=itemgetter(1))\nprint(bin_search(0, 30000, lambda x: key_func(x, psorted)))\n", "lang": "Python 3", "bug_code_uid": "2e89a6e5e55b54ff45383f5294fdd2bf", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "6d7e59d9f8c4d53171efa7f94a3970cd", "difficulty": 1800, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9964788732394366, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import math\nx, y, z = map(int, input().split())\na, b, c = map(int, input().split())\ns, rs, ls = map(int, input().split())\ndef rec(ss):\n for i in range(0, 155, 1):\n for j in range(0, 155, 1):\n if(i * rs + j * ls <= ss):\n q = y + i;p = z + j; pq = x + ((int)((ss - i * rs - j *ls) / s))\n an1 = 1000000000000.0;an2 = 1000000000000.0\n if(b - p > 0):\n an1 = math.ceil(((float) (pq)) / ((float)(b - p)))\n if(q - c > 0):\n an2 = math.ceil(((float) (a)) / ((float)(q - c)))\n if(q > c and p >= b or an1 > an2):\n return True\n return False\nst = 0; en = 100000; mid = 0\nwhile(st <= en):\n mid = (int)((st + en) / 2)\n if(rec(mid) == True):\n en = mid - 1\n else:\n st = mid + 1\nprint(en + 1)", "lang": "Python 3", "bug_code_uid": "ed1f515063aeddd4dc728553740d8618", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "51255b562f17b45ef565bbea83577db3", "difficulty": 1800, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9194444444444444, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "hy, ay, dy = map(int, input().split())\nhm, am, dm = map(int, input().split())\nh, a, d = map(int, input().split())\ns = 1 << 30\nfor da in range(max(0, dm - ay + 1), max(0, hm - ay + dm) + 1):\n for dd in range(max(0, am - dy) + 1):\n dh = max(0, hm * (am - dy - dd) // (ay + da - dm) - hy + 1)\n s = min(s, h * dh + a * da + d * dd)\nprint(s)", "lang": "Python 3", "bug_code_uid": "81db125b9da9b1fb15ba6e0037c2d6d0", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "acf8a17a055b116b0ee16489d5286e0c", "difficulty": 1800, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8746803069053708, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a=raw_input()\n\nb=a.find('dot', 1, len(a)-1)\nwhile b!=-1:\n a=a[0:b]+'.'+a[b+3:]\n b=a.find('dot', 1, len(a)-1)\nb=a.find('at', 1, len(a)-1)\nwhile b!=-1:\n a=a[0:b]+'@'+a[b+2:]\n b=a.find('at', 1, len(a)-1)\nprint a", "lang": "Python 2", "bug_code_uid": "a752ce7350c88f299fe57bdb4d4839e6", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "156519a83b0802d745a62bcaa30d7bde", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9136276391554703, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import sys\nimport string\n\n#sys.stdin = open(\"41.in\",\"r\")\n\na = raw_input()\nh = a[0]\na = a[1:]\ni = a.find(\"at\")\nwei = a[i+2:]\na = a[:i+2]\n\n#print h,a,wei\n\na = a.replace(\"dot\", \".\")\nwei = wei.replace(\"dot\", \".\")\na = a.replace(\"at\", \"@\")\n\nprint h+a+wei", "lang": "Python 2", "bug_code_uid": "0a0470a0afde09be28205e493fdff791", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "6547cf81669e53297d1fa5f9f3869b5b", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9732142857142857, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from sys import stdout\nn = int(input())\ndp = [0 for i in range(n // 2 + 10)]\ndp[0] = 1\ndp[1] = 2\n\nfor i in range(2, n + 10):\n if dp[i - 1] > n:\n stdout.write(str(i - 2))\n break\n dp[i] = dp[i - 1] + dp[i - 2]\n", "lang": "Python 3", "bug_code_uid": "6f469d316525d5b1a6abc45de99b789f", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "00890d3a67ac93ad9037cbe3a6a9d7b8", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7913279132791328, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#!/usr/bin/env python\nimport sys\ns, x = map(int, raw_input().split())\n\nif (s - x) % 2 != 0:\n print 0\n sys.exit(0)\nsame = (s - x) / 2\nif same & x != 0:\n print 0\n sys.exit(0)\ncounter = 0\ndifferent = x\ntemp = different\nwhile different > 0:\n counter += 1\n different = (different - 1) & temp\ncounter += 1\nif same == 0:\n counter -= 2\nprint counter\n", "lang": "Python 2", "bug_code_uid": "2c892c3a6bbcbc361833756ffeae67b4", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "732ed132fcdce305d5db5fbd017c8f93", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9760502552021987, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = raw_input()\ns = int(n.split(\" \")[0])\nx = int(n.split(\" \")[1])\nans = 1\nbits = []\nbitx = []\ns_ = s\nwhile s_ >= 1:\n\tif s_ % 2 == 0:\n\t\tbits.append(0)\n\telse:\n\t\tbits.append(1)\n\ts_ = s_/2\nx_ = x\nwhile x_ >= 1:\n\tif x_ % 2 == 0:\n\t\tbitx.append(0)\n\telse:\n\t\tbitx.append(1)\n\tx_ = x_/2\n# print bits,bitx\nbits.reverse()\nfor i in range(len(bitx),len(bits)):\n\tbitx.append(0)\nbitx.reverse()\ni = 0\ncarry = 0\nl = len(bits)\nflag = False\nif bits[i] == 1:\n\tif bitx[i] == 0: # it is not the start bit\n\t\tcarry = 1\n\t\ti += 1\nwhile i < l :\n\t# 8 conditions\n\tif carry == 0 and bits[i] == 0 and bitx[i] == 0:\n\t\tcarry = 0\n\telif carry == 0 and bits[i] == 0 and bitx[i] == 1:\n\t\tflag = True\n\t\tbreak\n\telif carry == 0 and bits[i] == 1 and bitx[i] == 0:\n\t\tcarry = 1\n\telif carry == 0 and bits[i] == 1 and bitx[i] == 1:\n\t\tcarry = 0\n\t\tans *= 2\n\telif carry == 1 and bits[i] == 0 and bitx[i] == 0:\n\t\tcarry = 0\n\telif carry == 1 and bits[i] == 0 and bitx[i] == 1:\n\t\tans *= 2\n\t\tcarry = 1\n\telif carry == 1 and bits[i] == 1 and bitx[i] == 0:\n\t\tcarry = 1\n\telif carry == 1 and bits[i] == 1 and bitx[i] == 1:\n\t\tflag = True\n\t\tbreak\n\ti += 1\n\nif flag == False and carry == 1:\n\tflag = True\n\nif flag:\n\tprint 0\nelse:\n\tif s == x:\n\t\tans -= 2\n\tprint ans\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": "Python 2", "bug_code_uid": "80d9221c74c7ebc7d817735eb9ad5c4d", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "0abf0fe3cfe3e66d4a1c27ef8a5d90ef", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.20475319926873858, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "s, x = map(int, raw_input().split(' '))\nnum = 0\n\ni = 0\nwhile i <= s:\n\tj = s - i\n\tif i ^ j == x and i > 0 and j > 0:\n\t\tnum += 1\n\n\ti += 1\n\nprint num", "lang": "Python 2", "bug_code_uid": "dd6a40db1bc8f893810185e5aed12a40", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "1399de0ac5a4f69c7e4b34503d6d2e12", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8117647058823529, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "import sys\ndef i(): return sys.stdin.readline().strip()\nsys.setrecursionlimit(99999999)\nii=lambda:map(int,i().split(\" \"))\n\na,b=ii()\nbitsA,bitsB=[],[]\nz=1\nwhile z<=a*2:\n if z&a:\n bitsA.append(1)\n else:\n bitsA.append(0)\n if z&b:\n bitsB.append(1)\n else:\n bitsB.append(0)\n z*=2\n#print bitsB\n\ndef g(adding,ind,acc):\n #print adding,acc,ind\n #if (acc%adding)^(a%adding)<>0:\n #return 0\n if ind==len(bitsB):\n if acc==a:\n return 1\n else:\n return 0\n if bitsB[ind]==1:\n a_=g(adding*2,ind+1,acc+adding)\n return 2*a_\n else:\n return g(adding*2,ind+1,acc)+g(adding*2,ind+1,acc+adding*2)\n\nans= g(1,0,0)\nif a==b:ans-=2\nprint ans\n", "lang": "PyPy 2", "bug_code_uid": "15a25365b002d0a541bdfba63d563ce8", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "2f1e909e471c2b9ecbad4b9efc2bfc68", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9941860465116279, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = input()\nb=n.find('at', 1)\nn= n[:b]+ '@' + n[b+2:]\n\nb=n.find('dot', 1)\n\nwhile 1 < b < len(n) - 3:\n n = n[:b] + '.' + n[b+3:]\n b = n.find('dot', b+1)\n \nprint(n)\n", "lang": "Python 3", "bug_code_uid": "b920dfa74f1ce5f1aff8ec131f09592e", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "54aa5ad0818c7898007aec1409b638fe", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8814229249011858, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s = input()\n\ns = s.replace('at', '@', 1)\n\nif s.count('dot'):\n s = s.replace('dot', '.')\n if s[0] == '.':\n s = s.replace('.', 'dot', 1)\n if s[-1] == '.':\n s = s[:len(s)-1] + 'dot'\n \nprint(s)", "lang": "Python 3", "bug_code_uid": "fad6487785ce92c32212061169fb41ca", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "2eee7f203cf997c189ad1639a6bcd1b7", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7937219730941704, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "s = str(input())\n\ns = s.replace(\"at\",\"@\",1)\ns = s.replace(\"dot\",\".\")\n\nif s[0]==\".\":\n\ts = \"dot\"+s[1:]\nif s[0]==\"@\":\n\ts = \"at\"+s[1:]\n\nif s[len(s)-1]==\".\":\n\ts = s[:len(s)-1]+\"dot\"\nif s[len(s)-1]==\"@\":\n\ts = s[:len(s)-1]+\"at\"\n\nprint(s)", "lang": "Python 3", "bug_code_uid": "3b5ed87102c60eeea5c74386efe5825d", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "ecb4c6fb7d3ba9f238b5637045925906", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.902127659574468, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "t = input()\nk = len(t) - 3\nt = t[0] + t[1: k].replace('dot', '.') + t[k: ]\nk = t.find('at', 1)\nprint(t[:k] + '@' + t[k + 2:])", "lang": "Python 3", "bug_code_uid": "7e28c6a1f611d0b62dee73f64bea4df1", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "c4f5c59624b453418ce5002f99eb0dde", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6422764227642277, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "n, m = map(int, input().split())\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\n\nif min(x) == min(y):\n print(min(x))\nelse:\n a, b = min(x), min(y)\n if a > b:\n a.b = b, a\n print(10 * a + b)", "lang": "PyPy 3", "bug_code_uid": "b14c03dc07f9d811315e9092890babbf", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "68bd674aadfb8c936f54b43d73b1419d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7694805194805194, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a,ta=map(int,input().split(' '))\n#print (a,ta)\nb,tb=map(int,input().split(' '))\n\ntime=input()\n\nhour=int(time[0:2])\nmint=int(time[3:5])\nlow=(hour-5)*60+mint\nup=low+ta\nans=0\nfor i in range(0,19*60,b):\n\tl=i\n\th=i+tb\n\tif l=up:\n\t\tans+=1\n\t\t#print(i)\n\telif l <=low and h > low:\n\t\tans+=1\n\t\t#print(i)\nprint (ans)\n#print(hour)", "lang": "Python 3", "bug_code_uid": "9b2d7915854bd8bc08a4104d97687606", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "6da87870fa84258794c8f20e821de519", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4724137931034483, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "[a,ta]=[int(i) for i in input().split()]\n[b,tb]=[int(i) for i in input().split()]\n[h,m]=[int(i) for i in input().split(':')]\nbasic=h*60+m-300\nend=basic+ta\nl=0\nr=basic//b+1\nwhile l!=r-1:\n temp=(l+r)//2\n if temp*b+tb<=basic:\n l=temp\n else:\n r=temp\nanswer=r\nif tb>=basic:\n answer=0\nanswer=end//b-answer\nprint(answer)", "lang": "Python 3", "bug_code_uid": "699fc803e502336b2b6abd6e96c117bb", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "a6cf40843de7a005c2700be31f14f021", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7347670250896058, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "def main():\n a, ta = map(int, input().split())\n b, tb = map(int, input().split())\n h, m = map(int, input().split(':'))\n t = h * 60 + m + b - 300\n print(max(min(t + ta - 1, 1140) // b - max((t - tb), 0) // b, 0))\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "4042e5fb44d9ee7df46ce99d0d34d99a", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "f3ce7edbcf0b94929bb240115901f490", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9946686976389947, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "THE_FIRST_BUS = 5 * 60\nTHE_LAST_BUS = 23 * 60 + 59\n\n\ndef solve(fab, tab, fba, tba, start):\n hours, minutes = map(int, start.split(':'))\n start_minutes = hours * 60 + minutes\n stop_minutes = start_minutes + tab\n first_ba = 300 + (1 + (start_minutes - 300 - tba) / fba) * fba\n\n first_bus = max(THE_FIRST_BUS, first_ba)\n last_bus = min(stop_minutes, THE_LAST_BUS)\n\n bus_no = 0\n while True:\n if first_bus + bus_no * fba >= last_bus:\n break\n bus_no += 1\n\n return bus_no\n\nfab, tab = map(int, raw_input().split())\nfba, tba = map(int, raw_input().split())\nstart = raw_input()\n\nprint solve(fab, tab, fba, tba, start)", "lang": "Python 2", "bug_code_uid": "1b385e97856c151643879dc97b90adc6", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "cb5e8e955587f16c0d923f6bda603463", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9222520107238605, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "s=input()\nans=1\nrem=10\noccured={}\nfor x in range(len(s)):\n if s[x] in 'ABCDEFGHIJ':\n if x==0:\n ans*=9\n rem=9\n else:\n if s[x] in occured:\n pass\n else:\n ans*=rem\n rem-=1\n occured[s[x]]=1\n elif s[x]=='?':\n ans*=10\nprint(ans)", "lang": "Python 3", "bug_code_uid": "0cc0b386c2af65b9d65853015eec93dc", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "850166ef01bffddf1bdd267af1cf55bf", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7379746835443038, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "input_str = input()\ntmp = []\nif input_str[0] == '?':\n result=9\n a = 11\n for c in input_str[1:]:\n if c == '?':\n result*=10\n elif 'A' <= c <= 'J' and tmp.count(c)==0:\n tmp.append(c)\n a-=1\n result*=a\nelif 'A' <= input_str[0] <= 'J':\n tmp.append(input_str[0])\n result=9\n a=10\n for c in input_str[1:]:\n if c == '?':\n result*=10\n elif c == input_str[0]:\n result*=9\n elif 'A' <= c <= 'J' and tmp.count(c)==0:\n tmp.append(c)\n a-=1\n result*=a\nelse:\n a=11\n result=1\n for c in input_str[1:]:\n if c == '?':\n result*=10\n elif 'A' <= c <= 'J' and tmp.count(c)==0:\n tmp.append(c)\n a-=1\n result*=a\nprint(result)", "lang": "Python 3", "bug_code_uid": "2f8128707be7b0798b681a071c5e4ccb", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "dac5914b4f85a03f3ee89b787e247cde", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9719251336898396, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "from math import factorial\n\ndef nchk(n, k):\n ans = 1\n for i in range(n - k + 1, n + 1):\n ans = ans * i\n return ans / factorial(k)\n\ndef ml(s, k):\n ans = 1\n for i in range(k):\n ans = ans * s\n s = s - 1\n return ans\n\nstr = input()\n\nlset = set()\n\nqc = 0\n\nfor c in str:\n if (c <= 'J' and c >= 'A'):\n lset.add(c)\n elif (c == '?'):\n qc = qc + 1\n\nlc = len(lset)\n\n\n#################\n\nans = 0\n\nif (str[0] == '?'):\n ans = 9\n qc = qc - 1\n ans = ans * 10**qc\n ans = ans * ml(10, lc) * factorial(lc)\nelif (str[0] > '?'):\n ans = 9\n lc = lc - 1\n ans = ans * 10**qc\n ans = ans * ml(9, lc) * factorial(lc)\nelse:\n ans = 1\n ans = ans * 10**qc\n ans = ans * ml(10, lc) * factorial(lc)\n\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "b07af4776d6122eb6d6a57daef3fa746", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "183099ad149e29515d8fe551d99eb75b", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.026533996683250415, "equal_cnt": 5, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)]\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n[evaluate untitled-1.py]\n1?AA\n100\n", "lang": "Python 3", "bug_code_uid": "958ae2db83eedee6ed520ac2f3e3d983", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "1c156edbc8753eeb60777b17c98fb0c5", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.726039016115352, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "s = input()\nnum = [str(i) for i in range(10)]\nany = 0\nalpha = []\nfor i in s:\n if i == \"?\":\n any += 1\n elif i not in num and i not in alpha:\n alpha.append(i)\nresult = 1\nif s[0] == \"?\" or s[0] in num:\n c = 10\n while alpha != []:\n result *= c\n alpha.pop()\n c -= 1\n result *= 10**any\n print(result)\nelse:\n result *= 9\n alpha.pop()\n c = 9\n while alpha != []:\n result *= c\n alpha.pop()\n c -= 1\n result *= 10**any\n print(result)", "lang": "Python 3", "bug_code_uid": "5a2cbe73c31b10a8f23e99fb6be109ab", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "a59d2dc7c08dbcd388ae1e82a695052d", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9857142857142858, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())%360\nprint((abs(n-360)>45)*n//90+int(round(n%90/90)))", "lang": "Python 3", "bug_code_uid": "fd729b283e58bbb0a3a8258d53c7a923", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "70c5b117925552ddcb755568974c0ecb", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.35471698113207545, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "x = int(input())\nf, x = x>=0, abs(x)\n\nif x <= 45:\n print(0)\nelif f:\n print(1)\nelse:\n print(3)\n", "lang": "Python 3", "bug_code_uid": "0c9e04f0f81ff4f901b52f6a50033e70", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "6adc9dd3caf3158f5562e2c8a435db40", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7377777777777778, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "def main():\n print((int(input()) + 44) % 360 // 90)\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "25f24bcd6f02a66f18590b7f85aefffa", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "bde87ff44d64a907e1a395d4e8d1c597", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.46153846153846156, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "n = int(raw_input())\nn = n % 360\nm = n // 90\nif(n - m * 90 <= (m + 1) * 90 - n):\n\tprint(m)\nelse:\n\tprint(m + 1)", "lang": "Python 2", "bug_code_uid": "72016ca00402d289c3bf294e68acad22", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "650a2e0f47237cd383bd730e83b1f274", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9971671388101983, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(raw_input())\na = [(n + 90 * i) % 360 for i in xrange(4)]\na = [min(x, 360 - x) for x in a]\nres = 0\nfor i in xrange(1, 4):\n if a[i] < a[res]:\n res = i\nprint res", "lang": "Python 2", "bug_code_uid": "74673379cc0d6f21ebf17031d59bebee", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "fdc929a3c704969f80b171102cc74576", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.02939118264520644, "equal_cnt": 11, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\ntypedef long long ll;\ntypedef vector vi;\ntypedef pair ii;\n#define endl \"\\n\"\n#define kn 300005\n#define md 1000000007\n#define x first\n#define y second\n#define pb push_back\n#define ms(i,a) memset(a,i,sizeof(a))\n#define f(i,a,b) for(int i=a;i<=b;i++)\n#define ff(i,x) for(int i=1;i<=x;i++)\n#define _ff(i,x) for(int i=x;i>=1;i--)\n#define _f(i,a,b) for(int i=b;i>=a;i--)\n#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);\n\nll ans[kn],n,k,_[20];\nstring s;\n\nint main() {\n\tcin>>n>>k;\n\tll sum=0,ans=0,num=0;\n\t_[0]=1;\n\tff(i,18) _[i]=_[i-1]*10;\n\twhile(sum<=k&&n>0&&ans<=18){\n\t\tint tmp=(n%10) %9; if(tmp!=0) tmp++; \n\t\t//772346242764cout<k) break;\n\t\t//cout<<\"n: \"<0) n-=tmp; \n\t\tn/=10;\n\t\tans++;\n\t\tnum++;\n\t}\n\tif(n) cout<= 5:\n x = 1\n y = 0\n for i in range(1, r):\n y += 1\n if x ** 2 + 2 * x * y + x + 1 == r:\n break\n print(x, y)\nelse:\n print('NO')\n", "lang": "PyPy 3", "bug_code_uid": "ba8f0ad0cd37217609caa4148b3699de", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "6a03683d81d035ada0cc19da14fca54b", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6691871455576559, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import functools\nimport math\nimport sys\nfrom collections import defaultdict\n\n# input = sys.stdin.readline\nrt = lambda: map(int, input().split())\nri = lambda: int(input())\nrl = lambda: list(map(int, input().split()))\n\n\ndef solve(r):\n if r == 1:\n return f'{0 0}'\n x = 1\n while x*x < r:\n if (r - x*x - 1 - x) % (2*x) == 0:\n return f'{x} {(r - x*x - 1 - x) // (2*x)}'\n x += 1\n\n return \"NO\"\n\n\ndef main():\n r = ri()\n print(solve(r))\n\n\nif __name__ == '__main__':\n main()\n", "lang": "PyPy 3", "bug_code_uid": "e4068acc6c8f18dcc4acc2db400a5e81", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "a1368b5938d9c2e391033c8a09fd81d6", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9923954372623575, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "r = int(input())\nif r % 2 == 0 or :\n print(\"NO\")\nelse:\n for x in range(1, 1000001, 2):\n if (r - 1) // 2 % x == 0:\n y = (r - 1) // (2 * x) - (x + 1) // 2\n if y > 0:\n print(x, y)\n exit()\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "87ac75eca96e12c788286bd1c22bea05", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "d3bcf19e32eb445ada82677741f26058", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9536679536679536, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "n = int(raw_input())\nt = [int(ti) for ti in raw_input().split(' ')]\nt.sort()\nprev = t[0]\nok = False\nfor i in xrange(1,len(t)-1):\n\tcurr = t[i]\n\tfoll = t[i+1]\n\tif curr-prev == foll-curr ==1:\n\t\tok = True\n\t\tbreak\nif ok:\n\tprint \"YES\"\nelse:\n\tprint \"NO\"\n", "lang": "Python 2", "bug_code_uid": "d67ec626cf5e3cb4b0c7dd9539ae8a11", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "8d7e0383cd8fe60193db978dad982595", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4024024024024024, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "n = input()\nans = 'helo'\nx=''\nb=0\nfor i in n:\n if i not in x:\n if i==ans[b]:\n x+=i\n b+=1\nif ans in x:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "6b92e1b50a817244773fe0cb3a6b325f", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "b1f920f39f53509389bf4de9dcd6244b", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7961165048543689, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import math \ndef calculateDistance(x1,y1,x2,y2): \n dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2) \n return dist \ndef solve(r,x1,y1,x2,y2):\n x=calculateDistance(x1,y1,x2,y2)\n y=math.ceil(x/(2*r))\n print(y)\n\nR=int(input())\nX1=int(input())\nY1=int(input())\nX2=int(input())\nY2=int(input())\nsolve(R,X1,Y1,X2,Y2)\n", "lang": "PyPy 3", "bug_code_uid": "92e8cefd0c00a07f0cf4ae53bba7705b", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "0390dbb786a9b3e15f9f896618422b4b", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9344033496161898, "equal_cnt": 15, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "from itertools import combinations\nfrom collections import Counter\nfrom math import factorial\n\ndef getLuckySubsetCount(mArr, luckySubset):\n width = len(mArr)\n A = map(lambda x: [0,0,0], range(width))\n for i in range(width):\n A[i][0] = 8 if not (i in luckySubset) else 2\n A[i][1] = len(filter(lambda x: ((x != 7 and x != 4) if not (i in luckySubset) else (x == 7 or x == 4)) and (x <= mArr[i]), range(10)))\n A[i][2] = filter(lambda x: ((x != 7 and x != 4) if not (i in luckySubset) else (x == 7 or x == 4)) and (x <= mArr[i]), range(10))\n A[i][2] = (max(A[i][2]) == mArr[i]) if A[i][2] else False\n B = map(lambda x: [0,0], range(width))\n for i in range(width):\n if i == 0:\n B[i][0] = A[i][0]\n B[i][1] = A[i][1]\n else:\n B[i][0] = B[i - 1][0] * A[i][0]\n B[i][1] = (A[i][1] - 1) * B[i - 1][0] + (B[i - 1][1] if A[i][2] else B[i - 1][0])\n return B[width - 1][1]\n\ndef getLuckyCount(mArr, luckySize):\n maxWidth = len(mArr)\n result = 0\n for combination in combinations(range(maxWidth), luckySize):\n luckySubset = set(combination)\n result += getLuckySubsetCount(mArr, luckySubset)\n # do not count number '0'\n return result - (1 if luckySize == 0 else 0)\n\ndef sumCombinations(resultSum, members):\n if members == 1:\n yield [resultSum]\n else:\n for i in range(resultSum + 1):\n for combination in sumCombinations(resultSum - i, members - 1):\n yield [i] + combination\n\ndef combinationOrderedMod(fullSet, subset, modulo):\n return reduce(lambda r, x: (r * ((fullSet - x) % modulo)) % modulo, range(subset), 1)\n\ndef combinationMod(fullSet, subset, modulo):\n if fullSet >= subset:\n values = map(lambda i: fullSet - i, range(subset))\n value = reduce(lambda r, x: r * x, values, 1)\n value /= factorial(subset)\n return value % modulo\n return 0\n\ndef resultMod(lucky, modulo):\n result = 0\n for luckyDigits in range(1, len(lucky)):\n for combination in Counter(map(lambda x: tuple(Counter(x).items()), sumCombinations(luckyDigits - 1, 6))):\n subResult = lucky[luckyDigits]\n for k, v in combination:\n subResult *= combinationOrderedMod(lucky[k], v, modulo) % modulo\n subResult %= modulo\n result += subResult\n result %= modulo\n return result\n\ndef main():\n mArr = map(int, list(raw_input()))\n# m = 10 ** 9\n# mArr = map(int, list(str(m)))\n# mArr = map(int, list('7'))\n mArr.reverse()\n lucky = [0] * (len(mArr) + 1)\n for luckySize in range(len(mArr) + 1):\n lucky[luckySize] = getLuckyCount(mArr, luckySize)\n# print lucky\n print resultMod(lucky, (10 ** 9) + 7)\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 2", "bug_code_uid": "6a890223e320466036377132d2934d94", "src_uid": "656ed7b1b80de84d65a253e5d14d62a9", "apr_id": "37249e0df2388bce55810a53dd8209c3", "difficulty": 1900, "tags": ["brute force", "dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7164179104477612, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "A,B,C=map(int,input().split())\nx=max(A,B,C)\nprint(max(0,x-(A+B+C-x+1))", "lang": "Python 3", "bug_code_uid": "4e8b82c0599ca856534ddbd0fe00d629", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "08bdb0f97b1f1845fd804f43aa6cac2e", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "a,b , c =map(int,input().split())\nt = 0\nif a+b>c:\n t = 0\nelse:\n t = t+c-a-b\nif b+c>a:\n continue\nelse:\n t = t+ a-b-c\nif a+c>b:\n continue\nelse:\n t = t+ b - a-c\nprint(t)\n\n", "lang": "Python 3", "bug_code_uid": "ffb9e198d58b123ec835922971dd320d", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "7f0930c88c64d87da4930c231c5f9d65", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.993103448275862, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l=sorted([int(i)for i in input().split()])\nprint(max(l[2-l[1]-l[0]+1,0))", "lang": "Python 3", "bug_code_uid": "68b41216ac7a8357eaa1799f312a7455", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "806f7024b1e3455028233a83be91c7a1", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6456692913385826, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "a,b=2,1\nc=0\nwhile a<=int(input()):\n a,b=a+b,a\n c+=1\nprint(c)", "lang": "PyPy 3", "bug_code_uid": "efc9227d92f313b6e9297d1b1d378e91", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "470bdc028bfd3a30ffa504d76dedd369", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.34824281150159747, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "def fib(n):\n if n==0 or n==1:\n return 1\n else:\n return fib(n-1)+fib(n-2)\nn=int(input())\ni=0\ns=0\nwhile True:\n s=s+fib(i)\n if s>=n:\n break\n else:\n i=i+1\nprint(i)\n", "lang": "Python 3", "bug_code_uid": "5a9314e9cefb2f9c922c86da2ad33207", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "2a266daa713420146298c4a53dd51900", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.09295352323838081, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "from math import *\nplayer=int(input())\n\n\nif ( player == 1 or player == 2 ):\n print (\"1\")\nelse:\n print ( math.ceil(math.log(player,2) ))\n", "lang": "Python 3", "bug_code_uid": "0f7dc100296b54a53705fd0d68fe1642", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "e5461551494107d6fade6a6111c49a11", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9669421487603306, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\na=[int(x) for x in input().split()]\n\nans=0\nfor i in range(n):\n\tfor j in range(i,n):\n\t\tfor k in range(i,j+1):\n\t\t\ta[k] = 1-a[k]\n\t\tans=max(len(filter(lambda x: x==1,a)))\n\t\tfor k in range(i,j+1):\n\t\t\ta[k] = 1-a[k]\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "98d09062577f11608cca9eaf8df5b328", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "5b27f9beaf9c6698cdd1a7d0b0a445e6", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.012315270935960592, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import re\nn=int(input())\nl=list(map(int, input().split()))\ns=\"\"\nfor x in l:\n s=s+str(x)\n\npat= r\"1*0+1*\"\nli=[]\n\nfor i in range(n):\n li+=re.findall(pat, s[i:n])\n\nm=len(li[0])\n\nfor x in li:\n if mn:\n break \n if a[curr+i-1]%2==1:\n val=p\n if curr+i==n:\n val=p\n else:\n val=val+1\n if calcUtil(a,curr+i,val,n):\n return True\n return False\n \ndef calc(a,n):\n if n==1:\n return True if a[0]%2==1 else False\n if n%2==1 and a[0]%2==1 and a[n-1]%2==1:\n return True\n if a[0]%2==0 or a[-1]%2==0:\n return False\n partition=0\n return calcUtil(a,0,partition,n)\n\nn=int(input())\na=list(map(int,input().split()))\nprint(\"Yes\" if calc(a,n) else \"No\")", "lang": "PyPy 3", "bug_code_uid": "ef098685ebe8519a0408477cfbab216e", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "2b7cacbd69cb9aa555d0e36bcd75e3e8", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.891566265060241, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "a,b=map(int,input().split())\nmi=min(a,b)\nx=int(((a+b)-2*mi)/2)\nprint(mi,x)\n//recheking time", "lang": "Python 3", "bug_code_uid": "e2868686785e66d945427c6f7bb8529f", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "5fb9a5bfb3023d2cd99bc52921856b5f", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4084084084084084, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "R = lambda: map(int, input().split())\nhy, ay, dy = R()\nhm, am, dm = R()\nch, ca, cd = R()\nres = 501 * (ch + ca + cd)\nfor hyp in range(501):\n for ayp in range(501):\n for dyp in range(501):\n if ay + ayp > dm:\n k = (hm + ay + ayp - dm - 1) // (ay + ayp - dm)\n if hy + hyp > k * max(0, am - dy - dyp):\n res = min(res, ch * hyp + ca * ayp + cd * dyp)\nprint(res)", "lang": "PyPy 3", "bug_code_uid": "f71097002a26870956f060da531b4cb1", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "f0b83b3460be29f74de917443ba8ccaa", "difficulty": 1800, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7974137931034483, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import math\nr,x,y,x1,y1=map(int,input().split())\nd=((x1-x)**2+(y1-y)**2)**0.5\nangle=0\nif x1-x==0:\n angle=math.pi/2\nelse:\n angle=math.atan((y1-y)/(x1-x))\nprint(int(math.ceil(d/(2*r*math.sin(angle)))))\n", "lang": "Python 3", "bug_code_uid": "cbb139e61c0a73fe2db0f6b7f6100081", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "bc6c97c7ac07f704e99d44b64b02af45", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9961089494163424, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k=map(int,input().split())\na=input()\nb=[0]*123\nfor i in a:\n b[ord(i)]+=1\nif max(b)>k:\n print(\"NO\")\nelse:\n print(\"YES\"", "lang": "Python 3", "bug_code_uid": "8b08f6bb56725cda4bdbd117df279ee5", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "979f7bc0f34ec04cda48fed53c4d9377", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.794425087108014, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n,k=map(int,input().split())\ns=input().lower()\nletters=[0]*26\nc=0\nfor i in s:\n nomer=ord(i)-97\n letters[nomer]+=1\nletters.sort(reverse=True)\nwhile 0 in letters:\n letters.pop()\nfor j in letters:\n b=j\n if b%k!=0:\n c=c+0\n\n\nif c==0:\n print('YES')\nelif \nelse:\n print('NO')\n\n", "lang": "Python 3", "bug_code_uid": "8da98669112552ac637ae74506020484", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "20667d2afe005f93ff882e598d39260e", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4056291390728477, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "import sys\n\nfin = sys.stdin\nfout = sys.stdout\ntemp = fin.readline().strip()\nn = int(temp[:len(temp) - 1])\ns = temp[-1]\nw1 = 1\nw2 = 3\nit = 1\nans = 0\nwhile True:\n if w1 == n or w2 == n:\n if s == 'f':\n ans += 1\n elif s == 'e':\n ans += 2\n elif s == 'd':\n ans += 3\n elif s == 'a':\n ans += 4\n elif s == 'b':\n ans += 5\n elif s == 'c':\n ans += 6\n fout.write(str(ans))\n break\n ans += 6\n if it % 2 == 1:\n w1 += 1\n w2 += 1\n ans += 1\n else:\n w1 += 3\n w2 += 3\n ans += 3\n it += 1\n", "lang": "Python 3", "bug_code_uid": "e1c2a2e92e1b55779bacf92a0ced6654", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "f8b617608fc7546a1688369f07e0cd56", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2324159021406728, "equal_cnt": 21, "replace_cnt": 15, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 22, "bug_source_code": "#include \n#include \n\nusing namespace std;\n\nint main(){\n\tstring inp;\n\tcin >> inp;\n\tunsigned long long int row;\n\tchar sira = inp[inp.size()-1];\n\tstring str = inp.substr(0,inp.size()-1);\n\trow = strtoull(str.c_str(), 0, 10);\t\n\tint array[6] = {4,5,6,3,2,1};\n\tunsigned long long qs = ((row - 1) / 8);\n\trow = row - (qs*8);\nunsigned long long opo = qs * 32;\n\nif (row == 2 || row == 4)\n opo += 7;\nelse if (row == 5 || row == 7)\n opo += 16;\nelse if (row == 6 || row == 8)\n opo += 23;\n\nopo += array[sira - 'a'];\n\ncout << opo;return 0;\n}\n", "lang": "Python 3", "bug_code_uid": "8d997e0e16ab0c47967f92e77123c195", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "8613244610869a05fbd12af5764eb566", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7542087542087542, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "money = int(input().split()[-1])\nbest_price = min(map(int, input().split()))\nbest_sell = max(map(int, input().split()))\n\nactions = money // best_price\nremaining = money % best_price\n\nresult = actions * best_sell + remaining\nprint(result)", "lang": "Python 3", "bug_code_uid": "de0c9af2a0332f5ee51dc56c783e861d", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "63d859decbb677f445f81c58de34079a", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9494949494949495, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,m,r = map(int,input().split())\nai = list(map(int,input().split()))\nbi = list(map(int,input().split()))\nif min(ai) >= max(bi):\n print(r)\nelse:\n a = r//min(ai)\n print(a*max(bi) + 1)", "lang": "Python 3", "bug_code_uid": "40caf2af4f50f19ab0172b820bde8caa", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "f459a5bc55100702aa84497533883470", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3396880415944541, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "n=input().split()\nbuin=input().split()\nbuout=input().split()\nbuout.sort(reverse=True)\nbuin.sort()\nif int(buin[0])>int(buout[0]):\n print(n[2])\n exit(0)\nelse:\n print(int(n[2])+int(int(n[2])/int(buin[0]))*(int(buout[0])-int(buin[0])))", "lang": "Python 3", "bug_code_uid": "a6f5abecc7bc8451f99a742927b54a62", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "e3c5c6cd81858d0299fd657a7dfa817d", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9973118279569892, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "stuff = input().split(\" \")\nn = int(stuff[0])\nm = int(stuff[0])\nlist1 = sorted([int(x) for x in input().split(\" \")])\nlist2 = [int(x) for x in input().split(\" \")]\n\nmin1 = min(list1)\nmin2 = min(list2)\n\nfor i in range(n):\n for j in range(m):\n if list1[i] == list2[j]:\n print(list1[i])\n exit(0)\nprint(str(min(min1, min2)) + str(max(min1, min2)))", "lang": "Python 3", "bug_code_uid": "075d3217c05d1df4070783aee0dd2874", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "318241257baeb572ea615ab21be4a9be", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5747126436781609, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "print pow(3, input(), 10**6 + 3)", "lang": "Python 2", "bug_code_uid": "4e620704360130a57f87dc936fafe308", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "efe6cd9f96f01b27bae9a61c8a3bd652", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9342723004694836, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/python\n\nn = 2**input()\nsquare = n**2\nsumn = (n**2 + n) / 2\nn /= 2\nnum = 1\nwhile True:\n\tif n == 1:\n\t\tbreak\n\tsumn += num *(n ** 2 + n ) / 2\n\tnum *= 3\n\tn /= 2\nprint (square - sumn) % 1000003\n", "lang": "Python 2", "bug_code_uid": "7dbf76c52a0ec4f731144a551140a36e", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "3f0cd4261fcd90a255410ee1d409d71b", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "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": "#B.Simple Molecules\na,b,c = map(int,input().split())\nif a<=(b+c) and b<=(a+c) and c=<(a+b) and (a+b+c)%2==0:\n print((a+b-c)//2,(b+c-a)//2,(c+a-b)//2)\nelse:\n print(\"Impossible\")", "lang": "Python 3", "bug_code_uid": "3765f99195d0c8628d4b724597f51708", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "3aef9916ebc5c3cfac7da670528145d6", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9921259842519685, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a,b,c=map(int,input().split()):\ns=(a+b+c)/2\nif (a+b+c)%2 or s-a<0 or s-b<0 or s-c<0:print(\"Impossible\")\nelse:print(s-c,s-a,s-b)", "lang": "Python 3", "bug_code_uid": "c6d9a3c34d7897160bbd2c3b59c6dfe1", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "cd8e0ad8a18c7b9f27155feff39e9cc2", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5622775800711743, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "import sys\nrange = xrange\ninput = raw_input\n\nn = int(input())\n\nmem = [[-1]*(n+1) for _ in range(n+1)]\ndef f(a,b):\n if mem[a][b]==-1:\n if (b-a)<=1:\n score = 0\n else:\n score = 10**18\n r = b if a==0 and b==n else b+1\n for c in range(a+2,r):\n score = min(score,(a+1)*(a+2)*(c%n+1) + f(a+1,c) + f(c,b))\n mem[a][b] = score\n return mem[a][b]\n\nprint(f(0,n))\n", "lang": "PyPy 2", "bug_code_uid": "997212c3a1738289350d00a100aab77b", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "e88874f78b7d8ed0e0768ed4d374cdc2", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8728813559322034, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "rom math import *\nalf = list(reversed('abcdefghijklmnopqrstuvwxyz'))\ndef adj(a, b):\n return chr(ord(a) - 1) == b\n \nn = int(input())\ns = [i for i in input()]\nfor i in range(n):\n for a in alf:\n i = 0\n while i < len(s):\n if s[i] == a and i > 0 and adj(s[i], s[i-1]):\n s.pop(i)\n elif s[i] == a and i < len(s) - 1 and adj(s[i], s[i+1]):\n s.pop(i)\n else:\n i += 1\n \nprint(n - len(s))\n ", "lang": "PyPy 3", "bug_code_uid": "7b7bfacd97bc1a7f26a0a60dddaf4556", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "ef40d9820e56f1080ce2c97b3f248199", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5245153933865451, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "d = dict()\nans = 1e8\n\ndef solve(x,n):\n\tglobal ans\n\tif x in d:\n\t\treturn d[x]\n\tans = min(ans,n)\n\td[x] = n+1\n\tfor i in range(n-1):\n\t\tif abs(ord(x[i])-ord(x[i+1])) == 1:\n\t\t\tif x[i] > x[i+1]:\n\t\t\t\td[x] = min(d[x],solve(x[:i]+x[i+1:],n-1))\n\t\t\telse:\n\t\t\t\td[x] = min(d[x],solve(x[:i+1]+x[i+2:],n-1))\n\telse:\n\t\td[x] = n\n\treturn d[x]\n\nn = int(input())\ns = input()\nsolve(s,n)\nprint(n-ans)\n", "lang": "PyPy 3", "bug_code_uid": "3181e2bc3de649067d08d3dafb7e7037", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "fae4f3d077150a54803b88214705fdd2", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8854961832061069, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "interval_a, travel_a = map(int, raw_input().split())\ninterval_b, travel_b = map(int, raw_input().split())\nfirst = 5 * 60\nlast = 23 * 60 + 59\n\nh, m = map(int, raw_input().strip().split(':'))\ndepart = h * 60 + m\narrive = depart + travel_a\n\n# Buses that departed from B before the given bus arrived at B:\nb_departures = 1 + (min(last, arrive) - first - 1) // interval_b\n\n# Buses that arrived at A by the time the given bus departed from A:\na_arrivals = 0\nif depart >= first + travel_b:\n a_arrivals = 1 + (depart - first - travel_b) // interval_b\n\n#print(b_departures, a_arrivals)\nprint(b_departures - a_arrivals)\n", "lang": "PyPy 2", "bug_code_uid": "62a1dac4811e5fd2f09abc761fb696f9", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "d3061a3c12a5f833cac53f32e909b213", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.44495412844036697, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "#\n# http://codeforces.com/problemset/problem/665/A\n\n\ndef read_line():\n return raw_input().strip()\n\n\ndef read_ints():\n return map(int, raw_input().strip().split())\n\nMIN, MAX = 300, 24 * 60\na, ta = read_ints()\nb, tb = read_ints()\nhh, mm = read_line().split(':')\nstart = int(hh) * 60 + int(mm)\nuntil = min(start + ta, MAX)\n\nz = max(MIN, start - tb - 1)\nx = z + (MIN - z) % tb\nif x >= until:\n print 0\nelse:\n print 1 + (until - x - 1) / b\n", "lang": "PyPy 2", "bug_code_uid": "374a16801a8661e76ef8783c483a8384", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "apr_id": "b6f80389aade3873d4af2f06489d2818", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.42424242424242425, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "n = list(map(int, input().split()))\nn.sort()\na = n[0]\nb = n[1]\nc = n[2]\nprint((b - a) + (c - b)", "lang": "Python 3", "bug_code_uid": "b6046d817acadf61aefac23d0353a92f", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "2dd654648ebec64d578e2cb52ee2a6f0", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.676737160120846, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "x = list(map(int, input().split())\n\na = int(sum(x) / len(x))\n\nprint (abs(x[0] - a) + abs(x[1] - a) + abs(x[2] - a))\n", "lang": "Python 3", "bug_code_uid": "ab68677026fee678a0805feef6d5a81b", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "56a7b3a09af77f1fe0841f9ba947c904", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.760797342192691, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "numeros=input(\" \")\nnumeros=numeros.split(\" \")\nnumeros.sort()\nint(mini),int(med),int(maxi)=numeros\nmenor=200\nfor itera in range(maxi-mini):\n\tsuma=0\n\titera=itera+mini\n\tsuma+=abs(mini-itera)\n\tsuma+=abs(med-itera)\n\tsuma+=abs(maxi-itera)\n\tif suma<=menor:\n\t\tmenor=itera\n\nprint(menor)\n\n", "lang": "Python 3", "bug_code_uid": "1d5e967f58af16bdee0c8e851b7d5640", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "23caa31535cb7d0d105fa2df6f139260", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8786885245901639, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "x1, x2, x3 = map(int(input().split(' ')\nm = 1000\nfor x in range(1, 101):\n mm = abs(x1 - x) + abs(x2 - x) + abs(x3 - x)\n if mm < m:\n m = mm\nprint(m)", "lang": "Python 3", "bug_code_uid": "51bf2481bfaa91ff94b1a50b1bbd55bf", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "67269ff5e339a667ca13f997f337393d", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.32525951557093424, "equal_cnt": 14, "replace_cnt": 5, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "arr=list(map(int, input().split()))\nn=arr[0]\nm=arr[1]\na=arr[2]\nb=arr[3]\nans=0\nif(n%m==0):\n print(n//m*b)\nelse:\n ext=n%m\n ext*=m\n ans+=n//m*b\n while(ext!=0):\n ans+=a\n ext-=a\n print(ans)\n", "lang": "Python 3", "bug_code_uid": "4e4a88e6ca00784dad0c9f46b2007785", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "ea4c71318bec1c07aefb1b06ae5fa1bb", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8354203935599285, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "#!/usr/bin/env python\n# coding: utf-8\n\n# In[59]:\n\n\nimport math\n\n\n# In[100]:\n\n\ninp = input()\n#inp = '6 3 5 1'\n\n\n# In[101]:\n\n\n#n = number of rides\n#m = number of rides per special ticket\n#a = one ride price\n#b = price of special ticket\n\n\n# In[102]:\n\n\narr = inp.split()\nn = int(arr[0])\nm = int(arr[1])\na = int(arr[2])\nb = int(arr[3])\n\n\n# In[103]:\n\n\nif a*m > b:\n einzelt = n % m\n specialt = n // m\n if einzelt * a < b: \n print(einzelt * a + specialt * b)\n else:\n print(b + specialt * b)\nelse:\n print(n * a)\n\n\n# In[107]:\n\n\nspecialt\n\n\n# In[ ]:\n\n\n\n\n", "lang": "Python 3", "bug_code_uid": "f40919deb1ca98ed8fae986f8a9521fe", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "d5b08937f6c8e56b037124023e1316c2", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8994708994708994, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "from math import gcd,factorial\na,b = map(int,input().split())\nprint(gcd(factorial(a),factorial(b)))\n", "lang": "PyPy 3", "bug_code_uid": "3ab66cdf3861a037281f4869a0d08a6f", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "ec00b8b217e44d1118ff8f0a3bc2b039", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "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": "a = sorted([int(i) for i in input().split()]\nprint(max(0, a[2]-a[1]-a[0]+1))", "lang": "Python 3", "bug_code_uid": "4b294ff9f04bbe24a1979dc1ea81669f", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "c330d7ec99fa732108d8279355c41b7d", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6733001658374793, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "n = int(input())\nt = list(map(int, input().split()))\n\ndef BubbleSort(arr):\n for pannum in range(n-1,0,-1):\n for i in range(pannum):\n if arr[i]>arr[i+1]:\n arr[i], arr[i+1] = arr[i+1], arr[i]\n\nBubbleSort(t)\nres = 'No'\nfor k in range(n-2):\n if t[k+2] - t[k] <= 2 and t[k+2] - t[k] > 0 and t[k+1] != t[k] and t[k+2] != t[k+1]:\n res = 'Yes'\n break\nprint (res)", "lang": "Python 3", "bug_code_uid": "af36629c24d813107d2cb4dded43aeb7", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "362bf31480c5781d3edaa5d233f720cb", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.01812688821752266, "equal_cnt": 4, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#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 \nusing namespace std;\n\nint main() {\n#ifdef __linux__\n\tfreopen(\"input.txt\", \"r\", stdin); freopen(\"output.txt\", \"w\", stdout);\n#endif\n\tios::sync_with_stdio(false);\n\n\t\n\n\treturn 0;\n}", "lang": "Python 3", "bug_code_uid": "b3cc04c566e6657bbab71b3661438d32", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "24fbd61d2279d7a4ec449c740e0657b4", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7644817073170732, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "def lucky(x):\n s=str(x)\n return s.count('4')+s.count('7')==len(s)\n\ndef Gen_lucky(n):\n s=str(n)\n if(len(s)==1):\n if(s[0]>='7'):\n return 2\n if(s[0]>='4'):\n return 1\n return 0\n x=0\n for i in range(1,len(s)):\n x+=2**i\n if(s[0]<'4'):\n return x\n if(s[0]>'7'):\n return x+2**len(s)\n if(s[0]=='5' or s[0]=='6'):\n return x+(2**(len(s)-1))\n if(s[0]=='7'):\n x+=2**(len(s)-1)\n x+=Gen_lucky(s[1:])\n return x\n \n\ndef Form(X,k):\n if(k==0):\n return X\n for i in range(len(X)):\n if(k>=F[len(X)-i-1]):\n h=k//F[len(X)-i-1]\n r=k%F[len(X)-i-1]\n G=list(X[i+1:])\n G.remove(X[i+h])\n G=[X[i]]+G\n return Form(X[:i]+[X[i+h]]+G,r)\n\np=1\n\nF=[1]\ni=1\nwhile(p<=10**15):\n p*=i\n F.append(p)\n i+=1\n\nn,k=map(int,input().split())\n\n\n \nif(n<=14):\n if(k>F[n]):\n print(-1)\n else:\n L=Form(list(range(1,n+1)),k-1)\n x=0\n for i in range(n):\n if(lucky(i+1) and lucky(L[i])):\n x+=1\n print(x)\nelse:\n L=Form(list(range(n-14,n+1)),k-1)\n x=Gen_lucky(n-15)\n for i in range(n-14,n+1):\n if(lucky(L[i-n+14]) and lucky(i)):\n x+=1\n print(x)\n \n", "lang": "Python 3", "bug_code_uid": "d793b07ac4adc9dfcd365349ea5719fa", "src_uid": "cb2aa02772f95fefd1856960b6ceac4c", "apr_id": "35ffe9d2585e7e57d291adc58271ba47", "difficulty": 1900, "tags": ["brute force", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6743264659270999, "equal_cnt": 27, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 8, "fix_ops_cnt": 26, "bug_source_code": "def lucky(x):\n s=str(x)\n return s.count('4')+s.count('7')==len(s)\n\ndef Gen_lucky(n):\n s=str(n)\n if(len(s)==1):\n if(s[0]=='4' or s[0]=='7'):\n return 1\n return 0\n x=0\n for i in range(1,len(s)):\n x+=2**i\n if(s[0]<'4'):\n return x\n if(s[0]>'7'):\n return x+2**len(s)\n if(s[0]=='5' or s[0]=='6'):\n return x+(2**(len(s)-1))\n if(s[0]=='7'):\n x+=2**(len(s)-1)\n x+=Getlucky(s[1:])\n return x\n \n\ndef Form(X,k):\n if(k==0):\n return X\n for i in range(len(X)):\n if(k>=F[len(X)-i-1]):\n h=k//F[len(X)-i-1]\n r=k%F[len(X)-i-1]\n G=list(X[i+1:])\n G.remove(X[i+h])\n G=[X[i]]+G\n return Form(X[:i]+[X[i+h]]+G,r)\n\np=1\n\nF=[1]\ni=1\nwhile(p<=10**10):\n p*=i\n F.append(p)\n i+=1\n\nn,k=map(int,input().split())\n\n\n \nif(n<=15):\n L=Form(list(range(1,n+1)),k-1)\n x=0\n for i in range(n):\n if(lucky(i+1) and lucky(L[i])):\n x+=1\n print(x)\nelse:\n L=Form(list(range(n-13,n+1)),k-1)\n x=Gen_lucky(n-14)\n for i in range(n-13,n+1):\n if(lucky(L[i-n+13]) and lucky(i)):\n x+=1\n print(x)\n \n", "lang": "Python 3", "bug_code_uid": "6139f59dc81f20d63410d733df99f4a0", "src_uid": "cb2aa02772f95fefd1856960b6ceac4c", "apr_id": "35ffe9d2585e7e57d291adc58271ba47", "difficulty": 1900, "tags": ["brute force", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9977661950856291, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def lucky(x):\n while x>0:\n d=x%10\n x/=10\n if d!=4 and d!=7:\n return False\n return True\nn,k=map(int,raw_input().split())\nk-=1\np=[1]*16\nfor i in xrange(13):p[i+1]=p[i]*(i+1)\na=[]\ndef n_th(x):\n if n-x<13:\n return a[x-1-n]+max(0,n-13)+1\n else:\n return x\nif n<=13 and k>=p[n]:print -1\nelse:\n s=[1]*n\n for b in reversed(xrange(min(13,n))):\n u=0\n while k>=p[b]:\n k-=p[b]\n while not s[u]:u+=1\n u+=1\n while not s[u]:u+=1\n a.append(u)\n s[u]=0\n t=0\n for w in xrange(1,10):\n for x in xrange(1<0:\n d=x%10\n x/=10\n if d!=4 and d!=7:\n return False\n return True\nn,k=map(int,raw_input().split())\nk-=1\np=[1]*16\nfor i in xrange(13):p[i+1]=p[i]*(i+1)\na=[]\ndef n_th(x):\n if n-x<13:\n return a[x-1-n]\n else:\n return x\nif n<=13 and k>=p[n]:print -1\nelse:\n s=[1]*n\n for b in reversed(xrange(min(13,n))):\n u=0\n while k>=p[b]:\n k-=p[b]\n while not s[u]:u+=1\n u+=1\n while not s[u]:u+=1\n a.append(u+1)\n s[u]=0\n t=0\n for w in xrange(1,10):\n for x in xrange(1< F[N]:\n print -1\n exit()\n\nfor i in xrange(len(F)):\n if F[i] >= K:\n st = N - i\n break\n \ncon = 0\nfor x in L:\n if x < st:\n con += 1\n else:\n break\n \nL = set(L)\nused = [False] * 100\n\nfor i in xrange(st, N):\n n = N - i - 1\n x = (K - 1) / F[n]\n K -= x * F[n]\n cur = st\n cnt = 0\n while cnt <= x:\n if not used[cur]:\n cnt += 1\n cur += 1\n used[cur - 1] = True\n if i in L and cur - 1 in L:\n con += 1\n\nprint con\n", "lang": "Python 2", "bug_code_uid": "1a15380b5d081144d3954c9a23b89f59", "src_uid": "cb2aa02772f95fefd1856960b6ceac4c", "apr_id": "89e94396e0757387436174eab7a5c293", "difficulty": 1900, "tags": ["brute force", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9981876761981474, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "L = [4,7,44,47,74,77,444,447,474,477,744,747,774,777,4444,4447,4474,4477,4744,4747,4774,4777,7444,7447,7474,7477,7744,7747,7774,7777,44444,44447,44474,44477,44744,44747,44774,44777,47444,47447,47474,47477,47744,47747,47774,47777,74444,74447,74474,74477,74744,74747,74774,74777,77444,77447,77474,77477,77744,77747,77774,77777,444444,444447,444474,444477,444744,444747,444774,444777,447444,447447,447474,447477,447744,447747,447774,447777,474444,474447,474474,474477,474744,474747,474774,474777,477444,477447,477474,477477,477744,477747,477774,477777,744444,744447,744474,744477,744744,744747,744774,744777,747444,747447,747474,747477,747744,747747,747774,747777,774444,774447,774474,774477,774744,774747,774774,774777,777444,777447,777474,777477,777744,777747,777774,777777,4444444,4444447,4444474,4444477,4444744,4444747,4444774,4444777,4447444,4447447,4447474,4447477,4447744,4447747,4447774,4447777,4474444,4474447,4474474,4474477,4474744,4474747,4474774,4474777,4477444,4477447,4477474,4477477,4477744,4477747,4477774,4477777,4744444,4744447,4744474,4744477,4744744,4744747,4744774,4744777,4747444,4747447,4747474,4747477,4747744,4747747,4747774,4747777,4774444,4774447,4774474,4774477,4774744,4774747,4774774,4774777,4777444,4777447,4777474,4777477,4777744,4777747,4777774,4777777,7444444,7444447,7444474,7444477,7444744,7444747,7444774,7444777,7447444,7447447,7447474,7447477,7447744,7447747,7447774,7447777,7474444,7474447,7474474,7474477,7474744,7474747,7474774,7474777,7477444,7477447,7477474,7477477,7477744,7477747,7477774,7477777,7744444,7744447,7744474,7744477,7744744,7744747,7744774,7744777,7747444,7747447,7747474,7747477,7747744,7747747,7747774,7747777,7774444,7774447,7774474,7774477,7774744,7774747,7774774,7774777,7777444,7777447,7777474,7777477,7777744,7777747,7777774,7777777,44444444,44444447,44444474,44444477,44444744,44444747,44444774,44444777,44447444,44447447,44447474,44447477,44447744,44447747,44447774,44447777,44474444,44474447,44474474,44474477,44474744,44474747,44474774,44474777,44477444,44477447,44477474,44477477,44477744,44477747,44477774,44477777,44744444,44744447,44744474,44744477,44744744,44744747,44744774,44744777,44747444,44747447,44747474,44747477,44747744,44747747,44747774,44747777,44774444,44774447,44774474,44774477,44774744,44774747,44774774,44774777,44777444,44777447,44777474,44777477,44777744,44777747,44777774,44777777,47444444,47444447,47444474,47444477,47444744,47444747,47444774,47444777,47447444,47447447,47447474,47447477,47447744,47447747,47447774,47447777,47474444,47474447,47474474,47474477,47474744,47474747,47474774,47474777,47477444,47477447,47477474,47477477,47477744,47477747,47477774,47477777,47744444,47744447,47744474,47744477,47744744,47744747,47744774,47744777,47747444,47747447,47747474,47747477,47747744,47747747,47747774,47747777,47774444,47774447,47774474,47774477,47774744,47774747,47774774,47774777,47777444,47777447,47777474,47777477,47777744,47777747,47777774,47777777,74444444,74444447,74444474,74444477,74444744,74444747,74444774,74444777,74447444,74447447,74447474,74447477,74447744,74447747,74447774,74447777,74474444,74474447,74474474,74474477,74474744,74474747,74474774,74474777,74477444,74477447,74477474,74477477,74477744,74477747,74477774,74477777,74744444,74744447,74744474,74744477,74744744,74744747,74744774,74744777,74747444,74747447,74747474,74747477,74747744,74747747,74747774,74747777,74774444,74774447,74774474,74774477,74774744,74774747,74774774,74774777,74777444,74777447,74777474,74777477,74777744,74777747,74777774,74777777,77444444,77444447,77444474,77444477,77444744,77444747,77444774,77444777,77447444,77447447,77447474,77447477,77447744,77447747,77447774,77447777,77474444,77474447,77474474,77474477,77474744,77474747,77474774,77474777,77477444,77477447,77477474,77477477,77477744,77477747,77477774,77477777,77744444,77744447,77744474,77744477,77744744,77744747,77744774,77744777,77747444,77747447,77747474,77747477,77747744,77747747,77747774,77747777,77774444,77774447,77774474,77774477,77774744,77774747,77774774,77774777,77777444,77777447,77777474,77777477,77777744,77777747,77777774,77777777,444444444,444444447,444444474,444444477,444444744,444444747,444444774,444444777,444447444,444447447,444447474,444447477,444447744,444447747,444447774,444447777,444474444,444474447,444474474,444474477,444474744,444474747,444474774,444474777,444477444,444477447,444477474,444477477,444477744,444477747,444477774,444477777,444744444,444744447,444744474,444744477,444744744,444744747,444744774,444744777,444747444,444747447,444747474,444747477,444747744,444747747,444747774,444747777,444774444,444774447,444774474,444774477,444774744,444774747,444774774,444774777,444777444,444777447,444777474,444777477,444777744,444777747,444777774,444777777,447444444,447444447,447444474,447444477,447444744,447444747,447444774,447444777,447447444,447447447,447447474,447447477,447447744,447447747,447447774,447447777,447474444,447474447,447474474,447474477,447474744,447474747,447474774,447474777,447477444,447477447,447477474,447477477,447477744,447477747,447477774,447477777,447744444,447744447,447744474,447744477,447744744,447744747,447744774,447744777,447747444,447747447,447747474,447747477,447747744,447747747,447747774,447747777,447774444,447774447,447774474,447774477,447774744,447774747,447774774,447774777,447777444,447777447,447777474,447777477,447777744,447777747,447777774,447777777,474444444,474444447,474444474,474444477,474444744,474444747,474444774,474444777,474447444,474447447,474447474,474447477,474447744,474447747,474447774,474447777,474474444,474474447,474474474,474474477,474474744,474474747,474474774,474474777,474477444,474477447,474477474,474477477,474477744,474477747,474477774,474477777,474744444,474744447,474744474,474744477,474744744,474744747,474744774,474744777,474747444,474747447,474747474,474747477,474747744,474747747,474747774,474747777,474774444,474774447,474774474,474774477,474774744,474774747,474774774,474774777,474777444,474777447,474777474,474777477,474777744,474777747,474777774,474777777,477444444,477444447,477444474,477444477,477444744,477444747,477444774,477444777,477447444,477447447,477447474,477447477,477447744,477447747,477447774,477447777,477474444,477474447,477474474,477474477,477474744,477474747,477474774,477474777,477477444,477477447,477477474,477477477,477477744,477477747,477477774,477477777,477744444,477744447,477744474,477744477,477744744,477744747,477744774,477744777,477747444,477747447,477747474,477747477,477747744,477747747,477747774,477747777,477774444,477774447,477774474,477774477,477774744,477774747,477774774,477774777,477777444,477777447,477777474,477777477,477777744,477777747,477777774,477777777,744444444,744444447,744444474,744444477,744444744,744444747,744444774,744444777,744447444,744447447,744447474,744447477,744447744,744447747,744447774,744447777,744474444,744474447,744474474,744474477,744474744,744474747,744474774,744474777,744477444,744477447,744477474,744477477,744477744,744477747,744477774,744477777,744744444,744744447,744744474,744744477,744744744,744744747,744744774,744744777,744747444,744747447,744747474,744747477,744747744,744747747,744747774,744747777,744774444,744774447,744774474,744774477,744774744,744774747,744774774,744774777,744777444,744777447,744777474,744777477,744777744,744777747,744777774,744777777,747444444,747444447,747444474,747444477,747444744,747444747,747444774,747444777,747447444,747447447,747447474,747447477,747447744,747447747,747447774,747447777,747474444,747474447,747474474,747474477,747474744,747474747,747474774,747474777,747477444,747477447,747477474,747477477,747477744,747477747,747477774,747477777,747744444,747744447,747744474,747744477,747744744,747744747,747744774,747744777,747747444,747747447,747747474,747747477,747747744,747747747,747747774,747747777,747774444,747774447,747774474,747774477,747774744,747774747,747774774,747774777,747777444,747777447,747777474,747777477,747777744,747777747,747777774,747777777,774444444,774444447,774444474,774444477,774444744,774444747,774444774,774444777,774447444,774447447,774447474,774447477,774447744,774447747,774447774,774447777,774474444,774474447,774474474,774474477,774474744,774474747,774474774,774474777,774477444,774477447,774477474,774477477,774477744,774477747,774477774,774477777,774744444,774744447,774744474,774744477,774744744,774744747,774744774,774744777,774747444,774747447,774747474,774747477,774747744,774747747,774747774,774747777,774774444,774774447,774774474,774774477,774774744,774774747,774774774,774774777,774777444,774777447,774777474,774777477,774777744,774777747,774777774,774777777,777444444,777444447,777444474,777444477,777444744,777444747,777444774,777444777,777447444,777447447,777447474,777447477,777447744,777447747,777447774,777447777,777474444,777474447,777474474,777474477,777474744,777474747,777474774,777474777,777477444,777477447,777477474,777477477,777477744,777477747,777477774,777477777,777744444,777744447,777744474,777744477,777744744,777744747,777744774,777744777,777747444,777747447,777747474,777747477,777747744,777747747,777747774,777747777,777774444,777774447,777774474,777774477,777774744,777774747,777774774,777774777,777777444,777777447,777777474,777777477,777777744,777777747,777777774,777777777,4444444444]\nF = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800L]\nL = [x - 1 for x in L]\n\nN, K = map(int, raw_input().strip().split())\n\nif N < len(F) and K > F[N]:\n print -1\n exit()\n\nfor i in xrange(len(F)):\n if F[i] >= K:\n st = N - i\n break\n \ncon = 0\nfor x in L:\n if x < st:\n con += 1\n else:\n break\n \nL = set(L)\nused = [False] * 100\n\nfor i in xrange(st, N):\n n = N - i - 1\n x = (K - 1) / F[n]\n K -= x * F[n]\n cur = 0\n cnt = 0\n while cnt <= x:\n if not used[cur]:\n cnt += 1\n cur += 1\n cur = cur + st - 1\n used[cur] = True\n if i in L and cur in L:\n con += 1\n\nprint con\n", "lang": "Python 2", "bug_code_uid": "2fa9731c7b8d5f10b619d9e277a1c1fe", "src_uid": "cb2aa02772f95fefd1856960b6ceac4c", "apr_id": "89e94396e0757387436174eab7a5c293", "difficulty": 1900, "tags": ["brute force", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.31382978723404253, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "a= list(map(int, input().split()))\navg = sum(a)\n\nif avg%3==0:\n count=0\n avg = avg//3\n for i in a:\n count += abs(i-avg)\n print(count)\nelse:\n avg1 = (avg//3)+1\n avg = avg//3\n x = 0\n y=0\n for i in a:\n x += abs(i - avg1)\n y += abs(i-avg)\n print(min(x,y)\n", "lang": "Python 3", "bug_code_uid": "519917b8b457492009ba67d7ccf12ba5", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "635825e6b17bf30b2119b3a07d67e730", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8409232688708671, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "import math, sys\nfrom collections import defaultdict, Counter, deque\n \nINF = float('inf')\nMOD = int(1e9) + 7\n \ndef gcd(a, b):\n\twhile b:\n\t\ta, b = b, a%b\n\treturn a\n \ndef isPrime(n):\n\tif (n <= 1): \n\t\treturn False\n\ti = 2\n\twhile i ** 2 <= n:\n\t\tif n % i == 0:\n\t\t\treturn False\n\t\ti += 1\n\treturn True\n \ndef primeFactors(n):\n\tfactors = defaultdict(int)\n\ti = 2\n\twhile i ** 2 <= n:\n\t\twhile n % i == 0:\n\t\t\tfactors[i] += 1\n\t\t\tn //= i \n\t\ti += 1\n\tif n > 1:\n\t\tfactors[n] += 1 \n\treturn factors\n \ndef vars():\n\treturn map(int, input().split())\n \ndef array():\n\treturn list(map(int, input().split()))\n\ndef lucky(num, n):\n\t\n\tif len(str(num)) > n:\n\t\treturn 0 \n\n\tnum1 = int(str(num) + '7')\n\tnum2 = int(str(num) + '8')\n\n\treturn lucky(num1, n) + lucky(num2, n) + 1\n\n\ndef main():\n\tn = int(input())\n\n\tprint(lucky(0, n) - 1)\n\n\nif __name__ == \"__main__\":\n\tt = 1\n\t# t = int(input())\n\tfor _ in range(t):\n\t\tmain()\n", "lang": "PyPy 3", "bug_code_uid": "8ee85dcd35b036f173894f89bca7fb42", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "6b443ff79ef438551bc504d047df0859", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9850746268656716, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import math\n\nn = (int)(input())\nprint((int)math.pow(2, n + 1) - 2)", "lang": "PyPy 3", "bug_code_uid": "af00ef1fdce61ce83c9017508ea76fb7", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "1a8ba37537a22c50c49b42fbc22ce367", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5993485342019544, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#https://codeforces.com/problemset/problem/630/C\nimport itertools\nn=int(input())\nc=0\nl=[7,8]\nfor i in range(1,n+1):\n\tx=[p for p in itertools.product(l, repeat=i)]\n\t#print(list(x))\n\tc+=len(list(x))\nprint(c)\n", "lang": "PyPy 3", "bug_code_uid": "d20757d6150fff672669087caa25db4c", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "5b6f0f02f9e707feffc6b4e4312464e9", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8685714285714285, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a = int(input())\nsu =0 \nfor i in range(1, a+1)\n su += 2**i \nprint(su) \n \n ", "lang": "PyPy 3", "bug_code_uid": "b7ee1e906b34b480b1f5578ddea0aa40", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "8af358c2c0cbaf14557f52189b7f5fbe", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9818181818181818, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "print(2**(int(input()+1)-2)", "lang": "PyPy 3", "bug_code_uid": "3577875b8f018ea923fff4ee6cfa9fd2", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "7de1a7dbbfd95ecd613847f7f80ca5b1", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.007438894792773645, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#solucion 725 B --Definitiva\n#Funcion que clacula los parametros\ndef sumador(numer,var):\n#tiempo para guardar el tiempo que eseta en el pasillo\n tiempo=0\n#tiempo_par e impar se diferencian \n acumulador_impar=0\n acumulador_par=0\n j=1\n while j<=numer:\n if j==1:\n tiempo=0\n acumulador_par=9\n acumulador_impar=7\n if j%2!=0 and j!=1:\n tiempo=tiempo+acumulador_par\n if j%2==0:\n tiempo=tiempo+acumulador_impar\n j=j+1\n tiempo_total=tiempo+var\n print(tiempo_total)\n#Inicio de captura de datos de entrada\nns=input()\nlista=list(ns)\n#Guardando la letra de la columna\ns=lista.pop()\n#Asignando su valor por letra\nif(s=='a'): variable=4\nif(s=='b'): variable=5\nif(s=='c'): variable=6\nif(s=='d'): variable=3\nif(s=='e'): variable=2\nif(s=='f'): variable=1\n#print (variable)\n#Transformando a enteros\nlista2=[int (i)for i in lista]\n#Guardadno el tamaño del vector\ntamaño=len(lista2)\nnumero=0\n#Convirtiendo el numero\nfor number in lista2:\n numero=numero+number*pow(10,tamaño-1)\n tamaño=tamaño-1\n#print(numero)\nif numero%2==0 :\n# print(\"numeropar\")\n#Viendo el parametro x e Y \n x= (numero+2)//2\n y= (numero)//2\n if x%2==0 :\n sumador(x,variable)\n if y%2==0 :\n sumador(y,variable)\nelse :\n# print(\"numero impar\")\n#Viendo el parametro X e Y para impares\n x=(numero+1)//2\n y=(numero-1)//2\n if x%2!=0 :\n print(x)\n print(variable)\n sumador(x,variable)\n if y%2!=0 and y!=0 :\n sumador(y,variable)", "lang": "Python 3", "bug_code_uid": "9f0fae9d44d7e43faca19db068db73af", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "f0d5f6b08f235023808b8b76b64754b2", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.007751937984496124, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "#solucion 725 B --Definitiva\n#Funcion que clacula los parametros\ndef sumador(numer,var):\n tiempo=0\n acumulador_impar=0\n acumulador_par=0\n j=1\n while j<=numer:\n if j==1:\n tiempo=0\n acumulador_par=9\n acumulador_impar=7\n if j%2!=0 and j!=1:\n tiempo=tiempo+acumulador_par\n if j%2==0:\n tiempo=tiempo+acumulador_impar\n j=j+1\n tiempo_total=tiempo+var\n print(tiempo_total)\n#Inicio de captura de datos de entrada\nns=input()\nlista=list(ns)\n#Guardando la letra de la columna\ns=lista.pop()\n#Asignando su valor por letra\nif(s=='a'): variable=4\nif(s=='b'): variable=5\nif(s=='c'): variable=6\nif(s=='d'): variable=3\nif(s=='e'): variable=2\nif(s=='f'): variable=1\n#Transformando a enteros\nlista2=[int(i)for i in lista]\n#Guardadno el tamano del vector\ntamano=len(lista2)\n#Convirtiendo el numero\ndef trans(lista,taman):\n numero=0\n for number in lista:\n numero=numero+number*pow(10,taman-1)\n taman=taman-1\n return numero\nnumero=trans(lista2,tamano)\n#print(type(numero))\ndef verif(numero,variable):\n if numero%2==0 :\n x= (numero+2)//2\n y= (numero)//2\n if x%2==0 :\n sumador(x,variable)\n if y%2==0 :\n sumador(y,variable)\n else :\n x=(numero+1)//2\n y=(numero-1)//2\n if x%2!=0 :\n sumador(x,variable)\n if y%2!=0 and y!=0 :\n sumador(y,variable)\nverif(numero,variable)", "lang": "Python 3", "bug_code_uid": "d938f2d77814cdd8dff18eee50a3e9ca", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "f0d5f6b08f235023808b8b76b64754b2", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07259073842302878, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "m = input()\nfor i in m:\n if '1234567890'.find(i) != -1:\n a = int(i)\nu = 1\nv = 3\nk = False\nch = 0\nwhile (u != a) and (v!= a):\n if k != True:\n u = u + 1\n v = v + 1\n ch = ch + 1\n k = True\n elif k == True:\n u = u + 3\n v = v + 3\n ch = ch + 1\n k = False\nch = ch * 7\nS = 'fedabc'\nfor i in m:\n if 'fedabc'.find(i) != -1:\n b = i\nif m =='5e':\n ch = 18\nelse:\n ch = ch + S.find(b) + 1\nprint(ch)\n", "lang": "Python 3", "bug_code_uid": "b4b44ae3e97cdd9924ddd99a7a4f2450", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "b4a659c9b9a295dcbc416a8409783b8c", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9447761194029851, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "rowNumber = raw_input()\n\n\n\nrow = int(rowNumber[:-1])\nletter = rowNumber[len(rowNumber) - 1]\n\nseconds = 0 \n\nattendant1 = 1\nattendant2 = 3\n\nmoveThreeRows = 0\n\nwhile (attendant1 != row) and (attendant2 != row):\n\n seconds += 6\n\n if moveThreeRows == 0:\n attendant1 += 1\n attendant2 += 1\n moveThreeRows = 1\n seconds += 1\n else:\n attendant1 += 3\n attendant2 += 3\n moveThreeRows = 0\n seconds += 3\n\nif letter == 'f':\n seconds += 1\nif letter == 'e':\n seconds += 2\nif letter == 'd':\n seconds += 3\nif letter == 'a':\n seconds += 4\nif letter == 'b':\n seconds += 5\nif letter == 'c':\n seconds += 6\n\nprint seconds\n\n\n \n", "lang": "Python 2", "bug_code_uid": "feec40396d67acfdd06180a25a022b70", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45", "apr_id": "b574b9805518b75473d8caaff49d4995", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.056103108415466264, "equal_cnt": 10, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "# import sys\n\n\n# rules:\n# exchange len-1 with len-2 only if len-2 is not zero:\n# if the number is greater than decrease the swap count else let it be same\n# if this first rule is not applicable swap len-2 with len-3 and check and so on\n\n\n\nif __name__ == '__main__':\n\tnum,swap = raw_input().split()\n\tnumlen = len(num)\n\tswap = int(swap)\n\tmaxnum = int(num)\n\tcompnum = num\n\tnum = bytearray(num)\n\ti = 0\n\t# for i in xrange (numlen-2):\n\twhile swap !=0 and i <= numlen - 2:\n\t\tif num[i+1] != 48 and i == 0:\n\t\t\ttemp = num[i]\n\t\t\tnum[i] = num[i+1]\n\t\t\tnum[i+1] = temp\n##\t\t\tprint num,i,maxnum\n##\t\t\tprint '.'\n\t\t\ti += 1\n\t\t\tif int(maxnum) < int(num):\n\t\t\t\tmaxnum = int(num)\n##\t\t\t\tprint maxnum\n\t\t\t\tswap -= 1\n##\t\t\t\tprint swap\n\t\t\t\ti = 0\n\t\t\t\t#break\n\t\telif i != 0:\n\t\t\ttemp = num[i]\n\t\t\tnum[i] = num[i+1]\n\t\t\tnum[i+1] = temp\n##\t\t\tprint num,i,maxnum\n##\t\t\tprint ','\n\t\t\ti += 1\n\t\t\tif int(maxnum) < int(num):\n\t\t\t\tmaxnum = int(num)\n##\t\t\t\tprint maxnum\n\t\t\t\tswap -= 1\n##\t\t\t\tprint swap\n\t\t\t\ti = 0 \n\t\telse: i += 1 \n##\tprint '...'\n\tprint maxnum\n \n", "lang": "Python 2", "bug_code_uid": "2d6e5624aa66f1cd0111d7925334d5b9", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "cba912f0908608a48249a4f36070fd52", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.16720257234726688, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "def selectionSort(alist, max_swp):\n\n\tcount = 0\n\tfor fillslot in range(len(alist)):\n\n\t\tfor location in range(fillslot+1, len(alist)):\n\n\t\t\tif alist[fillslot] <= alist[location]:\n\n\t\t\t\tif count < max_swp:\n\t\t\t\t\ttemp = alist[fillslot]\n\t\t\t\t\talist[fillslot] = alist[location]\n\t\t\t\t\talist[location] = temp\n\t\t\t\t\tcount += 1\n\n\t\t\t\telse:\n\t\t\t\t\tprint ''.join(alist)\n\t\t\t\t\treturn\n\na, k = map(str, raw_input().split())\n\nk = int(k)\n\n#a = [int(i) for i in list(a)]\n\nselectionSort(list(a), k)", "lang": "Python 2", "bug_code_uid": "0f0622e51fc7c7ba4acdd6633cab3efc", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "22f411507acfb3b53978f4e58d520ece", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9035714285714286, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "phrase=raw_input().split()\n\nnum=list(phrase[0])\nswaps=int(phrase[1])\n\n\nfor i in range(len(num)-1):\n if(i+swaps 1:\n print('Yes')\n else:\n print('No')\nelse:\n print('No')\n\n\"\"\"\n9\n1 2 2 3 2 3 3 2 1\n\"\"\"\n", "lang": "Python 3", "bug_code_uid": "3d775070f6f641dd7395a72e9b434c9d", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "0eff818730b581a1baeef9dec182d87a", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9979716024340771, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input1 = int(input())\ninput2 = input()\nnumArr = [int(i) for i in input2.split()]\nif len(numArr) == input1:\n\tif numArr[0]%2 == 1 and numArr[len(numArr)-1]%2 == 1:\n\t\tif len(numArr)%2 = 1:\n\t\t\tprint(\"Yes\")\n\t\telse:\n\t\t\tprint(\"No\")\n\telse:\n\t\tprint(\"No\")\n", "lang": "Python 3", "bug_code_uid": "fd3ff2448dab21bcaed404c596320573", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "e24ea53e46254a8a2b7c2ec3ccad66e0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9910282953761215, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": " n = int(input())\n l = list(map(int, input().split()))\n \n s = sorted(list(set(l)))\n if len(s) < 3: return 'NO'\n\n '''count = 1\n flag = 0\n for i in range(len(s)):\n for j in range(i+1, len(s)):\n if abs(s[i] - s[j]) <= 2 and i != j:\n count += 1\n if count >= 3: return 'YES'\n if count == 1:\n count += 1\n count -= 1'''\n\n for i in range(len(s)):\n for j in range(len(s)):\n for k in range(len(s)):\n if max(s[i],s[j],s[k]) - s[i] + max(s[i],s[j],s[k]) - s[j] + max(s[i],s[j],s[k]) - s[k] == 3 and i != j and i != k and j != k:\n return 'YES'\n \n return 'NO'\n\nprint(main())\n", "lang": "Python 3", "bug_code_uid": "395b76ab66a3ef8456bb2b0d0bc965a7", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "4c4856b4711f052de05ffa29c0e1e104", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9962264150943396, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\nl=list(map(int,input().split()))\ns=list(set(l))\nif len(s)<3:\n print(\"NO\")\nelse:\n s.sort()\n for i in range(len(s)-2):\n if (s[i+2]-s[i+1]=1) and (s[i+1]-s[i]==1):\n print(\"YES\")\n break\n else:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "37a79bb7b5d8223372c158ae0e45a8a0", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "d161ca6e5d4146071546826851d70d26", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.993006993006993, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a=int(input())\nif a%2 is 0:\n print(\"Mahmoud\")\nelse\n print(\"Ehab\")", "lang": "Python 3", "bug_code_uid": "321d361f75ede5ef3ce72ce7601be128", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "bd6d468deef349cf2e0bfd93760725e7", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3022774327122153, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nif n == 1:\n print('Ehab')\nelse:\n i = 0\n while True:\n if i%2 == 0:\n if n < 2:6\n \n print('Ehab')\n break\n else:\n n -= 2\n \n elif i%2 != 0:\n if n < 1:\n print('Mahmoud')\n break\n else:\n n -= 1\n \n i += 1\n \n \n \n", "lang": "Python 3", "bug_code_uid": "49857921fc6521fca2b01834b730686a", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "b069a0958d82156851793b7ca4fbfaf8", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2015855039637599, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 9, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "n=input()\ndict={}\ni=n\narr=[]\nwhile(i>0):\n k=0\n for j in range(n-i+1):\n arr.append([i,k,k+i])\n k+=1\n i-=1\n\nl=len(arr)\nans=0\nfor i in range(1,l):\n k=arr[i][0]\n l1=arr[i][1]\n l2=arr[i][2]\n if arr[i][0]!=-1:\n found=False\n for j in range(i+1,l):\n if arr[j][0]!=-1:\n p=arr[j][0]\n r1=arr[j][1]\n r2=arr[j][2]\n if k+p==n and (r1>=l2 or l1>=r2):\n arr[j][0]=-1\n ans+=1\n found=True\n break\n elif k+p=l2 or l1>=r2):\n p+=arr[j][0]\n arr[j][0]=-1\n if found!=True:\n ans+=1\n\n #print arr,ans\n\nprint ans+1\n\n\n", "lang": "Python 2", "bug_code_uid": "a496c0d0b3da6506f4afb273f8f8cab9", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "c986dcd0e62c8103af3e7b4970aee60f", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1925601750547046, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "n = input()\nN = n * (n + 1) / 2\n\nsegs = []\n\nfor len in range(1, n + 1):\n for i in range(0, n - len + 1):\n segs.append([(i, i + len), False])\n\n# print segs\n\nlays = 0\nfor i in range(N-1, -1, -1):\n if segs[i][1]:\n continue\n\n arr = [segs[i][0]]\n segs[i][1] = True\n for j in range(i - 1, -1, -1):\n if segs[j][1] == False:\n flag = True\n for seg in arr:\n if seg[0] >= segs[j][0][1] or seg[1] <= segs[j][0][0]:\n continue\n else:\n flag = False\n break\n if flag:\n segs[j][1] = True\n arr.append(segs[j][0])\n # for seg in arr:\n # print seg,\n # print \"\"\n lays += 1\n\nprint lays\n", "lang": "Python 2", "bug_code_uid": "beb9a1d103d71292029d61c9c06bf84f", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "2b3579c41a078e828e96ace856f9345e", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.13725490196078433, "equal_cnt": 3, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "a = int(raw_input())\nif(a % 5 == 0):\n\tprint(a//5)\nelse:\n\tprint(a//5 + 1)", "lang": "Python 2", "bug_code_uid": "cbbf758084f176a2a5deecf84aabaeea", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "52435b956437ec0e3e7e890efabd51b1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8227248816412415, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import sys\nfrom collections import deque\ninput = lambda : sys.stdin.readline().strip()\n# for i in range(int(input())):\nn,m = map(int,input().split())\ng = {}\nfor i in range(m):\n a,b = map(int,input().split())\n if b-1 in g:\n g[b-1].append(a-1)\n else:\n g[b-1]=[a-1]\nk = int(input())\nway = list(map(lambda x: int(x)-1,input().split()))\nbfs = deque()\nbfs.append(way[-1])\nlvl = [-1]*n\nans = [0]*n\na = [set() for j in range(n)]\nlvl[way[-1]]=0\nwhile bfs:\n v = bfs.popleft()\n for u in g[v]:\n if lvl[u]==-1:\n lvl[u]=lvl[v]+1\n a[u].add(v)\n bfs.append(u)\n elif lvl[u]==lvl[v]+1:\n ans[u]=1\n a[u].add(v)\nansv = 0\nans1 = 0\nfor v in range(k-1):\n if ans[way[v]] or a[way[v]].pop()!=way[v+1]:#\n ansv +=1\nfor v in range(k-1):\n if k-v-1!=lvl[way[v]] and way[v] not in a[way[v]]:\n ans1+=1\n elif k-v-1 == lvl[way[v]]:\n break\nprint(ans1,ansv)\n", "lang": "PyPy 3", "bug_code_uid": "0b5d8385790cbf62220c4fb768c1d8a7", "src_uid": "19a0c05eb2d1559ccfe60e210c6fcd6a", "apr_id": "c056fbb7b36666b1665444b946e56d66", "difficulty": null, "tags": ["graphs", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.460431654676259, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "\nfrom functools import reduce\nl=list(map(int,input().split()))\ng=[]\nfor j in l:\n\tg.append(reduce(lambda x,y:x*y , [i for i in range(1,j)]))\na,b=g[0],g[1]\nwhile (a==0 and b==0):\n\ta,b=a%b,a\nprint(a)", "lang": "Python 3", "bug_code_uid": "5faf7829c45e4dbf59b84a9e82532c15", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "6881f803ba901101c5b6e4d0b1bfc679", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4143302180685358, "equal_cnt": 28, "replace_cnt": 13, "delete_cnt": 10, "insert_cnt": 5, "fix_ops_cnt": 28, "bug_source_code": "p, d = map(int, raw_input().split())\nnum = ''\nmaxi = 0\nbound = p - d\npp = p\nwhile p >= bound:\n s = str(p)\n n = len(s) - 1\n if s[n] != '9':\n p -= 1\n continue\n c = 1\n while n >= 0:\n if s[n] != '9' or n == 0:\n if s[n] == '9':\n c += 1\n if c > maxi:\n maxi = c\n num = str(s)\n break\n n -= 1\n c += 1\n p -= 1\nif num == '':\n print pp\nelse:\n print num", "lang": "Python 2", "bug_code_uid": "9e364c19acec15a21eddcf5e5ad73c5d", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "1d3176b8de150cb4865a1da51058d1b3", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3311546840958606, "equal_cnt": 28, "replace_cnt": 19, "delete_cnt": 9, "insert_cnt": 1, "fix_ops_cnt": 29, "bug_source_code": "import sys\ndef main():\n\tinp=map(int,raw_input().split(\" \"))\n\tnum=inp[0]\n\tmaxpd=inp[1]\n\tgv=num\n\tmxnc=ninec(num);\n\tminv=num-maxpd;\n\twhile num>=(minv):\n\t\tncofn=ninec(num)\n\t\tif ncofn>mxnc:\n\t\t\tmxnc=ncofn;\n\t\t\tgv=num;\n\t\tnum-=1;\n\tprint gv\ndef ninec(x):\n\tsx=str(x)\n\tj=len(sx)-1\n\tnc=0\n\twhile j>=0 and sx[j]==\"9\":\n\t\tnc+=1;\n\t\tj-=1;\n\treturn nc;\nmain()", "lang": "Python 2", "bug_code_uid": "cfe8dec510a3ca40138e833ec709c382", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "c5e752b52ed1b87db3bbacd7fc689c7a", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19636363636363635, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "def main():\n p, d = map(int, raw_input().split())\n\n MAX = -1\n VALUE = None\n\n x = p - d\n while x <= p:\n value = 0\n s = str(x)\n i = len(s) - 1\n while i >= 0 and s[i] == '9':\n value += 1\n i -= 1\n if value >= MAX:\n VALUE = x\n MAX = value\n x += 1\n return VALUE\n\nif __name__ == '__main__':\n print main()\n", "lang": "Python 2", "bug_code_uid": "d169cc7a4cd7a29c5b78d5f8f71e9e44", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "aa8e8ec4b08a3079030dfec09d457d3e", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8879120879120879, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "import math;\na,b,c=map(int,input().split());\nres=0;\nfor i in range(0,a):\n\tt1=i;\n\tt2=2*i;\n\tt3=4*i;\n\t#print(t1+t2+t3);\n\t#print(t2);\n\t#print(t3);\n\tif (b>=t2 and c>=t3):\n\t\tres=max(t1+t2+t3,res);\nprint(res);", "lang": "Python 3", "bug_code_uid": "704237cd720afd516a5c3878c00ac99b", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "6725db7056ded1c962ab4a361605ff8e", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9985141158989599, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "# -*- coding: utf-8 -*-\nfrom collections import deque\n\nr1,c1,r2,c2 = map(int, input().split())\nif r1 == r2 or c1 == c2:\n n1 = 1\nelse:\n n1 = 2\n \nif (r1+c1)%2 != (r2+c2)%2:\n n2 = 0\nelif r1+c1==r2+c2 or r1-c1==r2-c2:\n n2 = 1\nelse:\n n2 = 2\n \nr_min, r_max, c_min, c_max = min(r1, r2), max(r1, r2), min(c1, c2), max(c1, c2)\nchess = [[0]*8 for i in range(8)]\nq = deque([(r1,c1)])\nn3 = 0\nwhile q:\n q2 = deque()\n while q:\n (r, c) = q.popleft()\n if (r, c) == (r2, c2):\n break\n chess[r][c] = 1\n if r-1 >= r_min and c-1 >= c_min and not chess[r-1][c-1]:\n q2.append((r-1, c-1))\n if r-1 >= r_min and not chess[r-1][c]:\n q2.append((r-1, c))\n if r-1 >= r_min and c+1 <= c_max and not chess[r-1][c+1]:\n q2.append((r-1, c+1))\n if c-1 >= c_min and not chess[r][c-1]:\n q2.append((r, c-1))\n if c+1 <= c_max and not chess[r][c+1]:\n q2.append((r, c+1))\n if r+1 <= r_max and c-1 >= c_min and not chess[r+1][c-1]:\n q2.append((r+1, c-1))\n if r+1 <= r_max and not chess[r+1][c]:\n q2.append((r+1, c))\n if r+1 <= r_max and c+1 <= c_max and not chess[r+1][c+1]:\n q2.append((r+1, c+1))\n else:\n q = q2\n n3 += 1\n continue\n break\n \nprint(n1, n2, n3)", "lang": "Python 3", "bug_code_uid": "f35a3094a0e1f26f2b9dac20253ad54d", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "480ca90a8efd5bafc09186ef217206ba", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2956989247311828, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "[n] = map(float, raw_input().split())\ns = map(str, raw_input().split())\n\na = list(s[0])\n#print a\n\nc = 0\ni = 0\nwhile i 0:\n\tf.replace('xxx', 'xx')\n\nprint(n - len(f))\n", "lang": "PyPy 3", "bug_code_uid": "61f2ab3b641b8ad8a3472fb7ecd66ab7", "src_uid": "8de14db41d0acee116bd5d8079cb2b02", "apr_id": "f846cc6c39a75a41e13642012bd524e8", "difficulty": 800, "tags": ["strings", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.24092409240924093, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "n=(input())\nc=0\ny=0\nfor j in range(4):\n a=input()\n k=[]\n for i in a:\n k.append(i)\n for t in k:\n if t=='.':\n for l in range(k.count('.')):\n k.remove(t)\n for h in range(len(k)):\n k[h]=int(k[h])\n for u in k:\n if k.count(u)<=int(n):\n c+=1\n if c==len(k):y+=1\n else:continue\n c=0\nif y==4:print(\"YES\")\nelse:print(\"NO\")\n", "lang": "Python 3", "bug_code_uid": "46292742819808f8ea3a84cc05864deb", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "27d95dbc583337b76c562541b0a5aa86", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9085872576177285, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "k = int(input())\n\npanels = {'.':0, '1':0, '2':0, '3':0, '4':0, '5':0, '6':0, '7':0, '8':0, '9':0}\nflag = True\n\nfor i in range(4):\n line = input()\n for ch in line:\n panels[ch] += 1\n\nv = list(panels.values())\n\nfor i in v:\n if i > 2 * k:\n flag = False #print('NO')\n\nif flag :\n print('YES')\nelse:\n print('NO')\n", "lang": "Python 3", "bug_code_uid": "21cca30134d1a520fb4fa3202aea0887", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "22e07009619d8a826060f292c34fedb4", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8473177441540578, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 9, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "k = input()\n k = 2 * int(k)\n count_list = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n for i in range(4):\n line = input()\n a = [int(number) for number in line if number != '.']\n for j in range(len(a)):\n count_list[a[j]] += 1\n for count in count_list:\n if count > k:\n print(\"NO\")\n print(\"YES\")\n", "lang": "Python 3", "bug_code_uid": "b5a7ca999cd202dcbcc488c5bf31b779", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "5ea26bde4804ce3a537a886e6e38ddad", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.23801065719360567, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 17, "bug_source_code": "input()\nTmp = dict()\nans= \"YES\"\nfor i in range(4):\n for j in input():\n if j!='.':\n if Tmp.get(j,-1) == -1:\n Tmp[j] = 1\n else:\n if Tmp[j]+1 > 2:\n ans = \"NO\"\n break\n else:\n Tmp[j]+=1\nprint(ans)", "lang": "Python 3", "bug_code_uid": "ea0f97a61d778a8f2f4179c177df5800", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "99a3c0e9f715b1e885201125858643c2", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5743473325766175, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "def count9(x):\n\tx = str(x)\n\tx = list(x)\n\tcount = 0\n\ti = len(x) - 1\n\twhile (x[i] == '9') and (i >= 0):\n\t\tcount += 1\n\t\ti -= 1\n\treturn count\n\n\nk = raw_input('')\nk = k.split()\n\nd = int(k[0])\np = int(k[1])\n\nmaxcount = count9(d)\nans = d\n\nwhile (p >= 0):\n\tm = count9(d)\n\tif (m > maxcount):\n\t\tmaxcount = m\n\t\tans = d\n\td -= 1\n\tp -= 1\n\nprint ans", "lang": "Python 2", "bug_code_uid": "e0b2fcc2bab6cfe1fba6ed06e7c2718b", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "f17b04ae58e53e7df8f84ec04be221ab", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7949886104783599, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "a, k = raw_input().split()\na = int(a)\nk = int(k)\nif(k == 0) :\n print(a);\nelse :\n b = str(a - k);\n d = \"\";\n f = 0;\n while((int(b[:len(b) - len(d)] + d)< a) or ((len(b) <= len(d)) and(int(d) <= a))):\n if(len(b)<= len(d)):\n b = d;\n else :\n b = b[:len(b) - len(d)] + d;\n d+=\"9\";\n b = int(b);\n while(b + 10**(len(d) - 1)<= a):\n b += 10**(len(d) - 1);\n print(int(b));", "lang": "Python 2", "bug_code_uid": "ff0626ab5c3fdd8244ac4b53c2da7280", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "696d26f5d0a5179a6e9db751f959c92c", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9683544303797469, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "bug_source_code": "n,k,l,c,d,p,nl,np=[int(x) for x in input().split()]\njt=(k*l)//nl\nlt=c*d\nst=p//np\nif jt>=n and lt>=n and st>=n:\n print(min(jt,lt,st)\nelse:\n print(0)", "lang": "Python 3", "bug_code_uid": "ba9873abbeecf41547d1bde718972d11", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "59706932814aaa26031e8e99b347212f", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.21897810218978103, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "a, b = [int(i) for i in input().split()]\ns = 0\nfor i in range(a, b + 1):\n if list(str(bin(i))[2:]).count('0') == 1:\n s+=1\nprint(s)\n", "lang": "Python 3", "bug_code_uid": "25b015db5dbc8e7f910e2d4e2081f67f", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "1c781b98d9dfbddb35b662de45bffb18", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8537313432835821, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 10, "bug_source_code": "x = input().split() \n\nbinary = bin(int(x[0]))\nbinary = binary[2:]\n\nisFirst = True\nnew_binary = ''\n\nfor i in range(len(binary)):\n if (binary[i] == '0'):\n if (isFirst):\n new_binary = new_binary + '0'\n isFirst = False\n else:\n new_binary = new_binary + '1'\n else: \n new_binary = new_binary + binary[i]\n\ninDecimal = int(new_binary, 2)\n\ntotal = 0\n\nwhile (int(x[0]) <= inDecimal and inDecimal <= int(x[1]) ):\n total += 1\n if (new_binary == '1'):\n total -= 1\n new_binary = '10'\n elif (new_binary[-1] == '0'):\n new_binary = '10' + new_binary[:-1]\n else: \n new_binary = '1' + new_binary[:-1]\n inDecimal = int(new_binary, 2)\n\nprint(total)\n\n", "lang": "Python 3", "bug_code_uid": "d60a86f8d009bd571843394c750250d0", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "030fe1a61d5bd40019024bbb05c48303", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2698706099815157, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "a, b = map(int, input().split())\nc = 0\nfor x in range(a, b+1):\n if \"{:b}\".format(x).count(\"0\") == 1:\n c += 1\nprint(c)\n", "lang": "Python 3", "bug_code_uid": "ddf67f37f539452d09740ce40c5c082f", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "d812f23b691e0454cf44e3ecde49f192", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.10019646365422397, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 16, "bug_source_code": "def create_mask(mask_number):\n binary_rep = bin(mask_number)\n binary_rep = list(binary_rep)\n for i in range(2,len(binary_rep)):\n binary_rep[i] = '1'\n\n return \"\".join(binary_rep)\n\ndef generate_aswners_from_mask(mask):\n one_zero_binaries = []\n for i in range(2, len(mask)):\n aux_bin = '0b'\n aux_bin += mask[2:]\n aux_bin = list(aux_bin)\n aux_bin[i] = '0'\n aux_bin = \"\".join(aux_bin)\n one_zero_binaries.append(aux_bin)\n return one_zero_binaries\n\n\ninput_numbers = input()\ninput_numbers = input_numbers.split(\" \")\ninput_numbers = list(map(int, input_numbers))\n\nmasks = []\n\n##MUDAR PRA ENTRADA\nfor i in range(input_numbers[0],input_numbers[1]+1):\n mask = create_mask(i)\n if(mask not in masks):\n masks.append(mask)\n\nall_aswners = []\n\nfor i in masks:\n all_aswners = all_aswners + generate_aswners_from_mask(i)\n\n\nfinal_aswners = []\n\nfor i in all_aswners:\n int_rep = int(i,2)\n if(int_rep < input_numbers[0] or int_rep > input_numbers[1] or i[2] == '0'):\n continue\n final_aswners.append(i)\n\n\nprint(len(final_aswners))", "lang": "Python 3", "bug_code_uid": "2b3fa76285549770d0f0cf2ab95160bb", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "4e0b4203afc2e350f9879d255c676101", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.26573426573426573, "equal_cnt": 5, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "def main():\n a, b = map(int, input().split())\n print(sum(bin(i).count('0') == 2 for i in range(a, b + 1)))\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "749760b85fa03cc0d88c25ee683e9460", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "d0134aedd81b7dfbf15c81933c7ba1db", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9661016949152542, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l=list(int,input().split()))\nl=sorted(l)\nprint(l[2]-l[0])", "lang": "PyPy 3", "bug_code_uid": "ccb919ee844e8f642688edfcd7d2c803", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "c9595c572ccbb646dfc4c4aeb9c1ae0d", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9972144846796658, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\ninput = sys.stdin.readline \n\nn, m, c_0, d_0 = map(int, input().split())\n\n # dp[grams_of_dough][1..j stuffings]\ndp = [[0 for _ in range(m + 1)] for _ in range(n + 1)]\n\n# grams left, grams required, dough required, sell price\nstuffing = [(0, 1, 0, 0)] + [map(int, input().split()) for _ in range(m)]\n\nfor i in range(0, n + 1): \n for j in range(1, m + 1): \n # attempt to make k of j-stuffed thingies\n for k in range(stuffing[j][0] / stuffing[j][1] + 1):\n if i - stuffing[j][2] * k > -1: \n dp[i][j] = max(dp[i - stuffing[j][2] * k][j - 1] + stuffing[j][3] * k, dp[i][j])\n\n\nans = 0 \n# for row in dp: print row\nfor k in range(n): \n ans = max(ans, dp[k][m] + ((n - k) / c_0) * d_0)\n\nprint ans", "lang": "PyPy 2", "bug_code_uid": "2a4230d7599311cf9ffca9ed5e74466a", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "4a49e83d014547a6e014de1708bd448e", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.26597938144329897, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "from sys import stdin\n\n\ndef arr_inp(n):\n if n == 1:\n return [int(x) for x in stdin.readline().split()]\n elif n == 2:\n return [float(x) for x in stdin.readline().split()]\n else:\n return list(stdin.readline()[:-1])\n\n\nn, m, c0, d0 = arr_inp(1)\nstaff, percent, ans = [arr_inp(1) for i in range(m)], [[0, d0 / c0]], 0\n\nfor i in range(m):\n percent.append([i + 1, staff[i][-1] / staff[i][-2]])\n\npercent.sort(reverse=True, key=lambda x: x[1])\n\nfor i, j in percent:\n if i:\n val = min(staff[i - 1][0] // staff[i - 1][1], n // staff[i - 1][2])\n ans += staff[i - 1][-1] * val\n n -= val * staff[i - 1][2]\n else:\n ans += d0 * (n // c0)\n n -= (n // c0) * c0\n\n # print(n, i, ans)\n\nprint(ans)\n", "lang": "PyPy 2", "bug_code_uid": "8b9932e0d4114e75f95b0476b5bb7932", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "9a6bdef18d9013e21a78a4f21ab1fc2b", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9539400665926748, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 9, "bug_source_code": "from sys import stdin, setrecursionlimit\nfrom collections import *\nimport threading\n\n\ndef arr_inp(n):\n if n == 1:\n return [int(x) for x in stdin.readline().split()]\n elif n == 2:\n return [float(x) for x in stdin.readline().split()]\n else:\n return list(stdin.readline()[:-1])\n\n\ndef dp(i, rem):\n if rem == 0:\n return 0\n if i >= len(arr):\n if rem:\n return d0 * (rem // c0)\n else:\n return 0\n\n if mem[i][rem] != -1:\n return mem[i][rem]\n\n ans1, ans2, ans3 = dp(i + 1, rem), 0, 0\n\n if rem - arr[i][0] >= 0:\n ans2 = arr[i][1] + dp(i + 1, rem - arr[i][0])\n if rem - c0 >= 0:\n ans3 = d0 + dp(i + 1, rem - c0)\n\n mem[i][rem] = max(ans1, ans2, ans3)\n return mem[i][rem]\n\n\ndef main():\n ans = 0\n for j in range(len(arr)):\n mem[j][n] = 0\n\n mem[0][n - arr[0][0]] = arr[0][1]\n\n for j in range(1, len(arr)):\n for i in range(n + 1):\n mem[j][i] = mem[j - 1][i]\n\n if i + arr[j][0] <= n:\n if mem[j - 1][i + arr[j][0]] != -1:\n mem[j][i] = max(mem[j][i], mem[j - 1][i + arr[j][0]] + arr[j][1])\n ans = max(ans, mem[j][i])\n\n # print(dp(0, n))\n for j in range(len(arr) + 1):\n for i in range(n, -1, -1):\n ext = (i // c0) * d0\n if mem[j][i] == -1:\n mem[j][i] = ext\n else:\n mem[j][i] += ext\n ans = max(ans, mem[j][i])\n print(ans)\n\n\nif __name__ == '__main__':\n n, m, c0, d0 = arr_inp(1)\n staff, arr = [arr_inp(1) for i in range(m)], []\n\n for a in staff:\n arr.extend([[a[2], a[3]] for i in range(a[0] // a[1])])\n\n mem = [[-1 for i in range(n + 1)] for j in range(len(arr) + 1)]\n main()\n", "lang": "PyPy 3", "bug_code_uid": "e3ae98e45361722e8bdaf947d727459b", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "9a6bdef18d9013e21a78a4f21ab1fc2b", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9677197802197802, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import sys\n\nsys.setrecursionlimit(10 ** 6)\n\ndef pyes_no(condition) :\n if condition :\n print (\"YES\")\n else :\n print (\"NO\")\n\ndef plist(a, s = ' ') :\n print (s.join(map(str, a)))\n\ndef rint() :\n return int(sys.stdin.readline())\n\ndef rints() :\n return map(int, sys.stdin.readline().split())\n\ndef rfield(n, m = None) :\n if m == None :\n m = n\n \n field = []\n for i in xrange(n) :\n chars = sys.stdin.readline().strip()\n assert(len(chars) == m)\n field.append(chars)\n return field\n\ndef pfield(field, separator = '') :\n print ('\\n'.join(map(lambda x: separator.join(x), field)))\n\ndef check_field_equal(field, i, j, value) :\n if i >= 0 and i < len(field) and j >= 0 and j < len(field[i]) :\n return value == field[i][j]\n return None \n\ndef digits(x, p) :\n digits = []\n while x > 0 :\n digits.append(x % p)\n x //= p\n return digits\n\ndef modpower(a, n, mod) :\n r = a ** (n % 2)\n if n > 1 :\n r *= modpower(a, n // 2, mod) ** 2\n return r % mod\n\ndef gcd(a, b) :\n if a > b :\n a, b = b, a\n \n while a > 0 :\n a, b = b % a, a\n\n return b\n\nn, m, c0, d0 = rints()\nn += 1\n\nprev = [0] * n\nfor i in range(n / c0 + 1) :\n prev[i * c0] = i * d0\n\n\nfor i in range(m) :\n new = prev[:]\n a, b, c, d = rints()\n for start in range(n) :\n for bake in range(1, min((n - start - 1) / c + 1, a / b + 1)) :\n new[start + bake * c] = max(new[start + bake * c], prev[start] + bake * d)\n \n prev = new \nprint prev[-1]\n", "lang": "PyPy 2", "bug_code_uid": "3328b729ba14d6794da16dc38e3e6cb9", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "d1765825b66567b0deaef8d1f6c0aa10", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9566539923954372, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import sys\nfrom sys import stdin, stdout \ndef R():\n return map(int, stdin.readline().strip().split())\n\nn, m, c, d = R()\n\narr1 = []\nfor i in range(n//c):\n arr1.append((c, d))\nfor i in range(m):\n a, b, c, d = R()\n for j in range(min(a//b, n//c)):\n arr1.append((c, d))\n\ndp = [[0 for i in range(n+1)] for i in range(len(arr1))]\n\nfor i in range(len(arr1)):\n c, d = arr1[i-1]\n for w in range(n+1):\n dp[i][w] = dp[i-1][w]\n if w >= c:\n if dp[i-1][w-c] + d > dp[i][w]:\n dp[i][w] = dp[i-1][w-c] + d\n\nstdout.write(str(dp[-1][-1]))\n# print(arr1)\n# for i in dp:\n# print(i)", "lang": "PyPy 3", "bug_code_uid": "507934c778e6c980a4fe8a17baed070c", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "004158e5f6da6126b21d308267fa7f0e", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9840865690642903, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "# n grams of dough\n# m stuffings\n# a[i] grams left of stuffing i\n# b[i] grams needed\n# c[i] grams of dough\n# d[i] price\n#\n# without stuffing: (special case)\n# a0 = infinite\n# b0 = 0\n# c0 grams of dough\n# d0 price\n# maximize price over all buns\n\n# at each step a choice of 1..k of m-th stuffings or no stuffing\n#\n# IH: we know how to find the max profit for dough n-1 and stuffings S[]\n#\ndef f(n, a, b, c, d):\n m = len(a)\n P = [[-1] * m for _ in range(n + 1)] # n * m\n\n def rec(weight, index):\n if index < 0: return 0\n\n # memoization\n if P[weight][index] != -1:\n return P[weight][index]\n\n profit = 0\n\n # we can create at most a[i] // b[i] stuffings\n stuffing, count = 0, 0\n while stuffing <= a[index]:\n remains = weight - (count * c[index])\n\n # not enough dough\n if remains < 0:\n break\n\n prev_profit = rec(remains, index - 1)\n\n profit = max(profit, prev_profit + count * d[index])\n\n # try more stuffing\n stuffing += b[index]\n count += 1\n\n return profit\n\n ans = rec(n, m - 1)\n print(ans)\n return ans\n\ninf = float(\"inf\")\nA = [inf, 7, 12 ]\nB = [1, 3, 3 ]\nC = [2, 2, 1 ]\nD = [1, 100, 10 ]\nassert f(10, A, B, C, D) == 241\n\nn, m, c0, d0 = map(int, input().split())\na, b, c, d = [inf], [0], [c0], [d0]\nfor _ in range(m):\n _a, _b, _c, _d = map(int, input().split())\n a.append(_a)\n b.append(_b)\n c.append(_c)\n d.append(_d)\n\nans = f(n, a, b, c, d)\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "253843d49600d38860b4d02ec7dbd928", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "f8813f6deecfb2e0465d6b30e70a7edf", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9888071634154141, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# n grams of dough\n# m stuffings\n# a[i] grams left of stuffing i\n# b[i] grams needed\n# c[i] grams of dough\n# d[i] price\n#\n# without stuffing: (special case)\n# a0 = infinite\n# b0 = 0\n# c0 grams of dough\n# d0 price\n# maximize price over all buns\n\n# at each step a choice of 1..k of m-th stuffings or no stuffing\n#\n# IH: we know how to find the max profit for dough n-1 and stuffings S[]\n#\ndef f(n, a, b, c, d):\n m = len(a)\n P = [[-1] * m for _ in range(n + 1)] # n * m\n\n def rec(weight, index):\n if index < 0: return 0\n\n # memoization\n if P[weight][index] != -1:\n return P[weight][index]\n\n profit = 0\n\n # we can create at most a[i] // b[i] stuffings\n stuffing, count = 0, 0\n while stuffing <= a[index]:\n remains = weight - (count * c[index])\n\n # not enough dough\n if remains < 0:\n break\n\n prev_profit = rec(remains, index - 1)\n\n profit = max(profit, prev_profit + count * d[index])\n\n # try more stuffing\n stuffing += b[index]\n count += 1\n\n return profit\n\n ans = rec(n, m - 1)\n return ans\n\ninf = float(\"inf\")\nA = [inf, 7, 12 ]\nB = [1, 3, 3 ]\nC = [2, 2, 1 ]\nD = [1, 100, 10 ]\nassert f(10, A, B, C, D) == 241\n\nn, m, c0, d0 = map(int, input().split())\na, b, c, d = [inf], [0], [c0], [d0]\nfor _ in range(m):\n _a, _b, _c, _d = map(int, input().split())\n a.append(_a)\n b.append(_b)\n c.append(_c)\n d.append(_d)\n\nans = f(n, a, b, c, d)\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "19f0c79c14a371f7ca68f96cbc244b88", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "f8813f6deecfb2e0465d6b30e70a7edf", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6775210084033614, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "import functools as ft\nmikla, types, c0, d0 = map(int, input().split())\npieejamais = [0];pildijumapaterins = [0];miklaspaterins = [0];cena = [0]\nfor recepte in range(types):\n a, b, c, d = map(int, input().split())\n pieejamais.append(a);pildijumapaterins.append(b);miklaspaterins.append(c);cena.append(d)\n\n@ft.lru_cache(maxsize=524288)\ndef izd(miklasdaudz, pildijumi):\n if miklasdaudz == 0:\n return 0\n if pildijumi == 0:\n return (miklasdaudz // c0) * d0\n maxx = 0\n for k in range(pieejamais[pildijumi] // pildijumapaterins[pildijumi] + 1):\n izmantotamikla = k * miklaspaterins[pildijumi]\n atlikusimikla = miklasdaudz - izmantotamikla\n pelna = cena[pildijumi] * k\n s = izd(atlikusimikla, pildijumi - 1)\n if pelna + s > maxx:\n maxx = pelna + s\n return maxx\nprint(izd(mikla, types))\n", "lang": "PyPy 3", "bug_code_uid": "f014d0b10b84ea66519ace134e459c23", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "8720ea285c55e2b71fee004e0c764bc3", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8767123287671232, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "import functools\n\n# The first line contains 4 integers n, m, c0 and d0 (1 ≤ n ≤ 1000, 1 ≤ m ≤ 10, 1 ≤ c0, d0 ≤ 100).\n# Lavrenty has n grams of dough as well as m different stuffing types\n# he can make buns without stuffings. Each of such buns requires c0 grams of dough and it can be sold for d0 tugriks\nN, M, c0, d0 = map(int, input().split())\n\n# Each of the following m lines contains 4 integers. The i-th line contains numbers ai, bi, ci and di (1 ≤ ai, bi, ci, di ≤ 100)\n# he has ai grams left of the i-th stuffing. It takes exactly bi grams of stuffing i and ci grams of dough to cook a bun with the i-th stuffing.\n# Such bun can be sold for di tugriks\nrecipes = []\navailable_filling = [0]\nfilling_consumption = [0]\ndough_consumption = [0]\nprice = [0]\nfor m in range(M):\n ai,bi,ci,di = map(int, input().split())\n available_filling.append(ai)\n filling_consumption.append(bi)\n dough_consumption.append(ci)\n price.append(di)\n rec = (ai,bi,ci,di)\n recipes.append(rec)\n\n# Let create array dp by size n x m. dp[i][j] means maximum number of tugriks that the baker can earn\n# if he used i grams of dough and cook buns with stuffings of types 1..j.\n#\n# Initially dp[i][0] is 0 for all i.\n#\n# You can easily calculate this dp:\n# dp[i][j] = max{ dp[ i-c[j]*k ][ j-1 ] + d[j]*k } for every k from 0 to a[j]/b[j], for which i-c[j]*k>=0\n\n@functools.lru_cache()\ndef dp(dough, fill_considered):\n if dough == 0:\n return 0\n if fill_considered == 0:\n return (dough // c0) * d0\n m = 0\n for k in range(available_filling[fill_considered] // filling_consumption[fill_considered] + 1):\n prevdough = dough - dough_consumption[fill_considered] * k\n prevstuff = fill_considered - 1\n addition = price[fill_considered] * k\n m = max(m, dp(prevdough, prevstuff) + addition)\n return m\n\n\nprint(dp(N, M))\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "a1dbb434725edcac1c30a14c962023f0", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "85b3caea284bbb538e342f6c063c1a61", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8966742828128966, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "import functools\n\n# The first line contains 4 integers n, m, c0 and d0 (1 ≤ n ≤ 1000, 1 ≤ m ≤ 10, 1 ≤ c0, d0 ≤ 100).\n# Lavrenty has n grams of dough as well as m different stuffing types\n# he can make buns without stuffings. Each of such buns requires c0 grams of dough and it can be sold for d0 tugriks\nN, M, c0, d0 = map(int, input().split())\n\n# Each of the following m lines contains 4 integers. The i-th line contains numbers ai, bi, ci and di (1 ≤ ai, bi, ci, di ≤ 100)\n# he has ai grams left of the i-th stuffing. It takes exactly bi grams of stuffing i and ci grams of dough to cook a bun with the i-th stuffing.\n# Such bun can be sold for di tugriks\nrecipes = []\navailable_filling = [0]\nfilling_consumption = [0]\ndough_consumption = [0]\nprice = [0]\nfor m in range(M):\n ai,bi,ci,di = map(int, input().split())\n available_filling.append(ai)\n filling_consumption.append(bi)\n dough_consumption.append(ci)\n price.append(di)\n rec = (ai,bi,ci,di)\n recipes.append(rec)\n\n# Let create array dp by size n x m. dp[i][j] means maximum number of tugriks that the baker can earn\n# if he used i grams of dough and cook buns with stuffings of types 1..j.\n#\n# Initially dp[i][0] is 0 for all i.\n#\n# You can easily calculate this dp:\n# dp[i][j] = max{ dp[ i-c[j]*k ][ j-1 ] + d[j]*k } for every k from 0 to a[j]/b[j], for which i-c[j]*k>=0\n\n@functools.lru_cache()\ndef dp(dough, fill_considered):\n if dough == 0:\n return 0\n if fill_considered == 0:\n return (dough // c0) * d0\n m = 0\n for k in range(available_filling[fill_considered] // filling_consumption[fill_considered] + 1):\n if dough-dough_consumption[fill_considered]*k>=0:\n prevdough = dough - dough_consumption[fill_considered] * k\n prevstuff = fill_considered - 1\n addition = price[fill_considered] * k\n m = max(m, dp(prevdough, prevstuff) + addition)\n return m\n\n\nprint(dp(N, M))\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "12fbb313169f151ee105dfed214aaab9", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "85b3caea284bbb538e342f6c063c1a61", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9847619047619047, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s = raw_input()\nL = len(s)\n\ncont1,cont2,have = 0,0,10\naux = \"ABCDEFGHIJ\"\nfound = {}\n\nfor c in aux:\n found[c] = False\n\nfor i in range(0,L):\n if s[i] == \"?\":\n cont1 += 1\n elif s[i] in aux:\n if not found[ s[i] ]:\n found[ s[i] ] = True\n cont2 += 1\n\nans = 1\n\nif s[0] == \"?\":\n ans *= 9;\n --cont1,\nelif s[0] in aux:\n ans *= 9;\n cont2 -= 1\n have -= 1\n\nwhile cont1 > 0:\n cont1 -= 1\n ans *= 10\n\nwhile cont2 > 0:\n cont2 -= 1\n ans *= have\n have -= 1\n\nprint ans\n", "lang": "Python 2", "bug_code_uid": "cefc33698f9f30220b624949330192c5", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "e96e622b96197c724ddf2980380d7763", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9628727936701157, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "x = [0] * 8 \ny = [0] * 8\nxy = [None] * 8\n\nfor i in range(0, 8):\n line = input()\n if line == '':\n line = input()\n x[i], y[i] = map(int, line.split())\n xy[i] = (x[i], y[i])\n\na = sorted(x) \nb = sorted(y)\n\nx1 = a[0]\nx2 = a[3]\nx3 = a[7]\ny1 = b[0]\ny2 = b[3]\ny3 = b[7]\n\nif x1 == x2 or x1 == x3 or x2 == x3 or y1 == y2 or y1 == y3 or y2 == y3:\n print(\"ugly\")\n return \n\nif a[0] != a[1] or a[0] != a[2] or a[3] != a[4] or a[5] != a[6] or a[6] != a[7]:\n print(\"ugly\")\n return\n\nif b[0] != b[1] or b[0] != b[2] or b[3] != b[4] or b[5] != b[6] or b[6] != b[7]:\n print(\"ugly\")\n return\n\nfor i in range(8):\n if x[i] == x2 and y[i] == y2:\n print(\"ugly\")\n return\n\n for j in range(i + 1, 8):\n if xy[i] == xy[j]:\n print(\"ugly\")\n return\n\nprint(\"respectable\")", "lang": "PyPy 3", "bug_code_uid": "347547a6221b4c0974025e6cdf89c9aa", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "3293a9d8c68fc4989e46ebffbd551755", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.022922636103151862, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "#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\nlong long x, y, l, r;\nset cen;\nint main() {\n\tcin >> x >> y >> l >> r;\n\tfor (int i = 0; i < 61; i++) {\n\t\tfor (int k = 0; k < 61; k++) {\n\t\t\tlong long a = pow(x, i), b = pow(y, k);\n\t\t\tif (a + b >= l && a + b <= r) cen.insert(a + b);\n\t\t}\n\t}\n\tcen.insert(l - 1);\n\tcen.insert(r + 1);\n\tlong long ans = 0;\n\tlong long pref = l;\n\tfor (auto i :cen) {\n\t\tans = max(ans, i - pref - 1);\n\t\tpref = i;\n\t}\n\tcout << ans;\n\treturn 0;\n}", "lang": "Python 3", "bug_code_uid": "e6410405dea6a5fcc22c36d11aff1682", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "08ed9cfb0b8b38325a801972c7057263", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.005411673753382296, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "#include\nusing namespace std;\n\n#define ll long long\n#define ld long double\n#define pb push_back\n#define mp make_pair\n#define forn(i,n) for(ll i=0;i=0;i--)\n#define fi first\n#define se second\n#define endl \"\\n\"\n#define all(a) a.begin(),a.end()\n#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);\n#define PI 3.14159265\n\nconst ll maxn=1e6+1,mod=1e9+7;\n\nint main(){\n sync\n #ifndef ONLINE_JUDGE\n // for getting input from input.txt\n freopen(\"input.txt\", \"r\", stdin);\n // for writing output to output.txt\n freopen(\"output.txt\", \"w\", stdout);\n #endif\n \n ll x,y,l,r;\n cin>>x>>y>>l>>r;\n vector lel,lol;\n // lel.pb(0);\n // lol.pb(0);\n ll eh = 1,oh = 1;\n while(eh<=r){\n lel.pb(eh);\n if(eh>ceil(r/x)) break;\n eh*=x;\n }\n while(oh<=r){\n lol.pb(oh);\n if(oh>ceil(r/y)) break;\n oh*=y;\n }\n vector ok;\n \n bool f1 = true,f2 = true;\n // cout<l&&it+ii 1:\n res = res / y * (y - 1)\n return res\ndef main():\n a, b, p, x = map(int, raw_input().split())\n if p == 2:\n print x\n return\n if a == 1:\n q, r = divmod(x, p)\n print q + (b <= r)\n return\n a = pow(a, p - 2, p)\n t = b\n f = p * (p - 1)\n q, r = divmod(x, f)\n pp = pow(p - 1, p - 2, p) * (p - 1)\n ph = pow(p, phi(p - 1) - 1, p - 1) * p\n ans = (p - 1) * q\n if not r:\n print ans\n return\n for i in xrange(p - 1):\n s = (i * ph + t * pp) % f\n if s <= r:\n ans += 1\n t = t * a % p \n print ans\nmain()\n", "lang": "Python 2", "bug_code_uid": "658b4fe81261fa6ecc82e3c46f64b236", "src_uid": "4b9f470e5889da29affae6376f6c9f6a", "apr_id": "e78b42c2dd8b170de15f6c7070c6c8eb", "difficulty": 2100, "tags": ["math", "chinese remainder theorem", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9692883895131086, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "\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\na, b, p, x = map(int, raw_input().split())\n\ninv = [1] * p\nfor i in range(2, p):\n q = p / i\n r = p % i\n inv[i] = p - inv[r] * q % p\n\nans = 0\nfor i in range(p - 1):\n a1 = pow(a, inv[i], p) * b\n a0, n0 = crt(a1, p, i, p - 1)\n if x >= a0:\n ans += 1 + (x - a0) / n0\nprint(ans)", "lang": "PyPy 2", "bug_code_uid": "1b0bddbc058fed1cb51ba045b7f22112", "src_uid": "4b9f470e5889da29affae6376f6c9f6a", "apr_id": "e2cf94e1c645c97001d4b09a618188e5", "difficulty": 2100, "tags": ["math", "chinese remainder theorem", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7941176470588235, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "a=input()\nb=input()\nc=input()\nd=input()\ne=input()\nimport math\ng=math.sqrt((b-d)*(b-d)+(c-e)*(c-e))\nf=g/(2*a)\nh=int(f)\ni=h\nif i==f:\n print (h)\nelif f>i:\n print (h+1)\n", "lang": "Python 2", "bug_code_uid": "4606f6805ca6b8890b196e0e488f29e6", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "4cf03fc1cccc95b664c690e49040085e", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5144508670520231, "equal_cnt": 24, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 24, "bug_source_code": "n=int(input())\na=[]\nb=[]\nc=[]\nfor i in range(n+1):\n for j in range(n+1):\n if(i*j==n and i<=j):\n a.append(i)\n b.append(j)\n\nprint(max(a),min(b))\n", "lang": "Python 3", "bug_code_uid": "5c52ebdebabfb02ef92a6a197da2506b", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "7d654bab4636f3b508480b924dc26c78", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6666666666666666, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "from math import sqrt\nn=int(input())\nfor i in range(int(sqrt(n)),0,-1):\n for j in range(int(sqrt(n)),n+1):\n if i*j==n:\n print(i,j,sep=\" \")\n exit()", "lang": "Python 3", "bug_code_uid": "a43a9edbdc979f7fc497b3b36d07846f", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "fafc937774d1287002f689b485e0315a", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9602272727272727, "equal_cnt": 4, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n = int(input())\nMassFactor = []\nfor i in range(1,int(n**0.5)+1):\n if n % i == 0:\n MassFactor.append([i, n//i])\nd = MassFactor[0][1]-MassFactor[0][0]\n� = 0\nfor i in range(1,len(MassFactor)):\n if MassFactor[i][1]-MassFactor[i][0] < d:\n d = MassFactor[0][1]-MassFactor[0][0]\n � = i\nprint(MassFactor[�][0],MassFactor[�][1])\n ", "lang": "Python 3", "bug_code_uid": "b1661d87c41367aa899bb7c19b9d5e06", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "bc60d0c2e6d092c717d4924200ba2ba2", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7878787878787878, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "print((input() ** 2) // 4)", "lang": "Python 3", "bug_code_uid": "6a5b5a66e990c7972993c5954f8411dd", "src_uid": "f8af5dfcf841a7f105ac4c144eb51319", "apr_id": "4d7202fc2f72af2e46bcf6e79e3d4b1f", "difficulty": 1300, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.920863309352518, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "n=input()\nif n%2==0:\n print(\"white\")\nelse:\n print(\"black\")", "lang": "Python 3", "bug_code_uid": "618685e0d25cc83a0983ffb7248c9af6", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "4bc7c702b272ac2d1d9d64f113db29ee", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.976303317535545, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "user_input=input()\n\nif user_input%2!=0:\n print (\"black\")\nelse:\n print (\"white\")\n print (\"1 2\")", "lang": "Python 3", "bug_code_uid": "6de67d8dd5cac47e9ef8f13cb147f8d4", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "7b9d945759ab09fc130a3b9b6fb06971", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.994475138121547, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "t = input()\nt = t.split()\nn = int(t[0])\nc1 = int(t[1])\nc2 = int(t[2])\nt = input()\nd = 0\nfor i in t:\n if(i==\"1\"):\n d = d+1\n\nmin = 10**1488\nfor i in range(1, d+1):\n t = c1*i + i*c2*(((n//i)-1)**2) + (n%i)*(2*(n//i)-1)\n if t0):\n if(i%2 ==0):\n s[1],s[2] = s[2],s[1]\n else:\n s[0],s[1] = s[1],s[0]\n i = i -1\ni = 0 \nwhile(i<3):\n if(s[i] == 1):\n print i\n sys.exit()\n i = i + 1 \n \n", "lang": "Python 2", "bug_code_uid": "1ce590a5a7b5e3c5635a75de2ebb67e9", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "64b6557f26c01b050b4992d4d245fc39", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.1037463976945245, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(raw_input())\npos_final = int(raw_input())\nvec = [0, 0, 0]\nvec[pos_final] = 1\nfor i in xrange(n, 0, -1):\n if i % 2 == 0:\n aux = vec[1]\n vec[1] = vec[2]\n vec[2] = aux\n else:\n aux = vec[1]\n vec[1] = vec[0]\n vec[0] = aux\n\nfor pos in xrange(3):\n if vec[pos] == 1:\n print pos", "lang": "Python 2", "bug_code_uid": "08b032b2eafa422a00767a75d03b5b1d", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "3b9ad8745a1304e5e021009fe2bb98e3", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.36464088397790057, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "n = int(input())\nx = int(input())\na=[0,0,0]\na[x]=1\nwhile n>0:\n if n%2==0:\n a[1],a[2]=a[02],a[1] \n \n n-=1\n else:\n a[1],a[0]=a[0],a[1]\n n-=1\n \nfor i in range (0,3):\n if a[i]==1:\n print i\n", "lang": "Python 2", "bug_code_uid": "d7840d10b0844d0eeb9d7c751618e78c", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "42fc935bd911af43f8efb87642688758", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9853137516688919, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(raw_input())\nx = int(raw_input())\n\ncontent = [False, False, False]\n\ncontent[x] = True\n\nif n % 2 == 1:\n tmp = content[1]\n content[1] = content[0]\n content[0] = tmp\n n-=1\n\nfor i in xrange(n / 2):\n tmp = content[2]\n content[2] = content[1]\n content[1] = content[0]\n content[0] = tmp\n\nfor i in xrange(3):\n if content[i]:\n print i\n\n", "lang": "Python 2", "bug_code_uid": "a2b7c5617a2258237e249744634c2598", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "60034cbe853685d8569f3bdf17497d1a", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.36213235294117646, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import sys\nimport math\nimport functools\n\n@functools.lru_cache(maxsize=None)\ndef sol(s):\n\tans = 0\n\tfor i in range(len(s)):\n\t\ta = i > 0 and ord(s[i]) - ord(s[i-1]) == 1\n\t\tb = i < len(s) -1 and ord(s[i]) - ord(s[i+1]) == 1\n\t\tif a or b:\n\t\t\tans = max(ans, 1 + sol(s[:i] + s[i+1:]))\n\treturn ans\n\nn = int(sys.stdin.readline())\ns = sys.stdin.readline()\nans = sol(s)\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "58d49abdd0c42f2205ed38f61270ab3f", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "d8176a1bab52e92403c8ad7a6f46cbe5", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.01123896173401124, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "strings = dict()\n\n\ndef check_string(seq):\n global strings\n daughter_seqs = list()\n if len(seq) == 1:\n strings[seq] = 0\n return None\n\n for i in range(1, len(seq)-1):\n if ord(seq[i]) - ord(seq[i-1]) == 1 or ord(seq[i]) - ord(seq[i+1]) == 1:\n daughter_seqs.append(seq[0:i] + seq[i+1:])\n\n if ord(seq[0]) - ord(seq[1]) == 1:\n daughter_seqs.append(seq[1:])\n if ord(seq[-1]) - ord(seq[-2]) == 1:\n daughter_seqs.append(seq[:-1])\n\n if len(daughter_seqs) == 0:\n strings[seq] = 0\n return None\n else:\n results = list()\n for daughter_seq in daughter_seqs:\n if daughter_seq not in strings.keys():\n check_string(daughter_seq)\n results.append(strings[daughter_seq])\n strings[seq] = max(results) + 1\n\n\nn = int(input())\ninput_str = input()\n\ncheck_string(input_str)\nprint(strings[input_str])\\\n", "lang": "PyPy 3", "bug_code_uid": "c9b67ee2ca199ba1de1a0611abd93d2f", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "62e1eee3f1890e5f2e6dadb13e159cc7", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7755277897457993, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "import atexit\nimport io\nimport sys\nimport math\nfrom collections import defaultdict,Counter\n\n# _INPUT_LINES = sys.stdin.read().splitlines()\n# input = iter(_INPUT_LINES).__next__\n# _OUTPUT_BUFFER = io.StringIO()\n# sys.stdout = _OUTPUT_BUFFER\n\n# @atexit.register\n# def write():\n# sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())\n\n# sys.stdout=open(\"CP3/output.txt\",'w')\n# sys.stdin=open(\"CP3/input.txt\",'r')\n\n# m=pow(10,9)+7\nn=int(input())\ns=list(input())\nif n==1:\n print(0)\nelse:\n # s1=s[:]\n for j in range(122,97,-1):\n k=0\n while k1:\n if s[k]==chr(j):\n if k==0:\n if s[1]==chr(j-1):\n del(s[k])\n elif k==len(s)-1:\n if s[-2]==chr(j-1):\n del(s[k])\n elif s[k-1]==chr(j-1) or s[k+1]==chr(j-1):\n del(s[k])\n else:\n k+=1\n else:\n k+=1\n\n print(n-len(s))\n", "lang": "PyPy 3", "bug_code_uid": "f116bc11cb636313e56dcd57ec568f3e", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "a152cc42c4d41086b71177be65ffad45", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3333333333333333, "equal_cnt": 17, "replace_cnt": 14, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "n=map(int,input())\ncm=input()\nrs=0\ntemp_step=0\nx=0\ny=0\nfor i in cm:\n if i==\"U\":\n x+=1\n elif i==\"D\":\n x-=1\n elif i==\"L\":\n y+=1\n else:\n y-=1\n if x==0 and y==0:\n temp_step=0\n else:\n temp_step+=1\nprint(len(cm)-temp_step)", "lang": "Python 3", "bug_code_uid": "b723783ce51b431dc3b0f7e5158bbe4e", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "cf9b3f25901ec9db2cb4938d51791602", "difficulty": 1000, "tags": ["greedy"], "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": "input()\ns = input()\nu,d,l,r = s.count('U'), s.count('D'), s.count('L'), s.count('R')\nprint(min(u, d)+min(l, r))", "lang": "Python 3", "bug_code_uid": "28f681b3e603785666e354eefaa8f5bb", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "4adc62eac37a9acc1c70c8cb0a337f25", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.978494623655914, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "n=(input())\nl=input()\nprint(2*(min(l.count('U'),l.count('D'))+min(l.count('L'),l. count('R'))", "lang": "Python 3", "bug_code_uid": "5d34fd61772504e7dce33c304d135b7b", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "1f1deec3b747a84b83340516208f753d", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7575757575757576, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "a = []\nfor i in range(8):\n x, y = map(int, input().split())\n a.append((x, y))\na.sort()\nif a[0][0] == a[1][0] == a[2][0]:\n if a[3][0] == a[4][0]:\n if a[5][0] == a[6][0] == a[7][0]:\n if a[0][1] == a[3][1] == a[5][1]:\n if a[1][1] == a[6][1]:\n if a[2][1] == a[4][1] == a[7][1]:\n print('respectable')\n exit()\nprint('ugly')\n", "lang": "PyPy 3", "bug_code_uid": "2875df67a224e316a1934b450ea83f11", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "ae4d5dfe62dfae39b535bc403d34cbe2", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6548672566371682, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "from collections import *\npoints = [[int(x) for x in input().split()] for i in range(8)]\nx,y = Counter(), Counter()\nfor r,c in points:\n x[r] += 1\n y[c] += 1\nxk = sorted(x.keys())\nyk = sorted(y.keys())\ndef is_ok(k, d):\n if len(k) != 3:\n return False\n lo,mid,hi = k\n return d[lo] == 3 and d[mid] == 2 and d[hi] == 3\n\nif is_ok(xk,x) and is_ok(yk,y):\n print('respectable')\nelse:\n print('ugly')\n\n", "lang": "PyPy 3", "bug_code_uid": "22c8432852806f9fe48031687fd0b747", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "1c8c73b4e1170b2205fbb14f5454a96b", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8430769230769231, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "x = []\ny = []\nfor _ in range(8):\n\tpoint = input().split()\n\tx.append(int(point[0]))\n\ty.append(int(point[1]))\n\nx.sort()\n\nif x[0] == x[1] == x[2] and x[2] != x[3] and x[3] == x[4] and x[4] != x[5] and x[5] == x[6] == x[7]:\n\ty.sort()\n\tif y[0] == y[1] == y[2] and y[2] != y[3] and y[3] == y[4] and y[4] != y[5] and y[5] == y[6] == y[7]:\n\t\tprint(\"respectable\")\n\t\tquit()\n\telse:\n\t\tprint(\"ugly\")\n\t\tquit()\nprint(\"ugly\")\n\n0 1\n0 1\n0 2\n1 1\n1 2\n2 3\n2 3\n2 3\n", "lang": "PyPy 3", "bug_code_uid": "2b5c9774608a8d18cb9a26e5283550e0", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "651c1be004e49eefc9b6e8ab4c02430d", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3147208121827411, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n=int(input())\nif n%2==0:\n\tprint(n)\nelif n==1:\n\tprint(1)\nelse:\n\tprint(n-1,1)\t\t", "lang": "Python 3", "bug_code_uid": "a796780fc3aaeaceab8561a72fdf35d0", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "7c8dc6e71c6250ec0e7ce4cdc711106b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.39106145251396646, "equal_cnt": 30, "replace_cnt": 11, "delete_cnt": 9, "insert_cnt": 11, "fix_ops_cnt": 31, "bug_source_code": "l, q = map(int, raw_input().split())\ns = list(raw_input())\n\nfor i in range(q):\n\tl, r, k = map(int, raw_input().split())\n\tl-=1\n\tt = s[l:r]\n\tif k==1: t.sort()\n\telse: t.sort(reverse=True) \n\ts[l:r] = t\nprint ''.join(s)", "lang": "Python 3", "bug_code_uid": "643843716cfda62a1d6413ab0eaad2ba", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "87c9c18ebde1fc084c3fa2fe9120bb74", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.033402922755741124, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "#include \n#include \n\n\nmain()\n{\n\n\tprintf(\"%lf sec \\n\", (double)clock()/CLOCKS_PER_SEC);\n\treturn 0;\n}\n\n\n", "lang": "Python 3", "bug_code_uid": "b5689335ae932bffe20e49e828f49f49", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "558f48a9ca63f6d2df992c6443e8c354", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9978768577494692, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\n\ni = 1;\narr = [];\nwhile True:\n if (n & 1 == 1):\n arr.append(i);\n n >> = 1;\n i = i + 1;\n if ( n == 0 ):\n break;\n\noutstr = \"\";\nfor elm in arr:\n outstr = str(elm) + \" \" + outstr;\nprint(outstr);", "lang": "Python 3", "bug_code_uid": "2ff574314e800c4769b60cf4076810f2", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "a886e884667dd8d0e90bf805954b6b01", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7963800904977375, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "n=int(input())\ni=0\nl=[]\nwhile(n!=1):\n i+=1\n if(n%2):\n l.insert(0,i)\n n=n/2\nprint(i+1,*l)\n \n ", "lang": "Python 3", "bug_code_uid": "a3c0be061d42821714a4608f7713b50a", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "2435abba0a0f3dd22622595a5419e319", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.11566858080393766, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "n, k, x = map(int, raw_input().split())\n\nballs = map(int, raw_input().split())\n\ncont_destruidas = 0\n\ndef marcador(index_inicial, cont, color):\n\tsentinela = 0\n\tfor s in range(n):\n\t\tif (sentinela < cont and balls[s] == color):\n\t\t\tsentinela += 1\n\t\t\tballs[s] = -99\n\ndef cont_balls():\n\tsoma = 0\n\tfor i in range(n):\n\t\tif (balls[i] != -99):\n\t\t\tsoma += 1\t\n\treturn soma\n\ndef search_first():\n\tfor i in range(n):\n\t\tif (balls[i] != -99):\n\t\t\treturn balls[i]\n\treturn -99\n\t\ndef cont_3():\n\tcont = 0\n\tcolor = search_first\n\tfor i in range(n):\n\t\tif (balls[i] != -99):\n\t\t\tif (color == balls[i]):\n\t\t\t\tcont+= 1\n\t\t\t\tif (cont > 2):\n\t\t\t\t\treturn True\n\treturn False\n\nif (n > 2):\n\tfor i in range(n - 1):\n\t\tif (balls[i] == x and balls[i + 1] == x):\n\t\t\tballs[i] = -99\n\t\t\tballs[i + 1] = -99\n\t\t\tcont_destruidas += 2\n\t\t\tbreak\n\t\t\t\n\tcolor = search_first()\n\tif (cont_destruidas != 0 and color != -99):\n\t\tcont = 0\n\t\tindex_inicial = 0\n\n\t\tfor j in range(n):\n\t\t\tif (balls[j] != -99 and balls[j] == color):\n\t\t\t\tcont += 1\n\t\t\t\tif (j == n - 1 and cont > 2):\n\t\t\t\t\tcont_destruidas += cont\n\t\t\t\t\tmarcador(index_inicial, cont, color)\n\t\t\telif (balls[j] != -99 and balls[j] != color):\n\t\t\t\tindex_inicial = j\n\n\t\t\t\tif (cont > 2):\n\t\t\t\t\tcont_destruidas += cont\n\t\t\t\t\tmarcador(index_inicial, cont, color)\n\t\t\t\tcont = 1\n\t\t\t\tcolor = balls[j]\n\t\t\t\t\n\twhile (search_first() != -99 and cont_3):\n\t\tcolor = search_first()\n\t\tif (cont_destruidas != 0 and color != -99):\n\t\t\tcont = 0\n\t\t\tindex_inicial = 0\n\n\t\t\tfor j in range(n):\n\t\t\t\tif (balls[j] != -99 and balls[j] == color):\n\t\t\t\t\tcont += 1\n\t\t\t\t\tif (j == n - 1 and cont > 2):\n\t\t\t\t\t\tcont_destruidas += cont\n\t\t\t\t\t\tmarcador(index_inicial, cont, color)\n\t\t\t\telif (balls[j] != -99 and balls[j] != color):\n\t\t\t\t\tindex_inicial = j\n\n\t\t\t\t\tif (cont > 2):\n\t\t\t\t\t\tcont_destruidas += cont\n\t\t\t\t\t\tmarcador(index_inicial, cont, color)\n\t\t\t\t\tcont = 1\n\t\t\t\t\tcolor = balls[j]\n\t\t\n\nprint cont_destruidas\n", "lang": "Python 2", "bug_code_uid": "32ec547e4a9a24df852d3242b295982f", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "f0118c8bb072d8d5160477441f7177f3", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.14439518682710575, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "from itertools import groupby\n\nn, k, x = map(int, raw_input().split())\nballs = map(int, raw_input().split())\ndestroyed = 0\n\nfor i in xrange(len(balls) - 1):\n balls_copy = list(balls)\n if not (balls_copy[i] == x and balls_copy[i+1] == x):\n continue\n\n balls_copy.insert(i, x)\n\n keep_in_loop = True\n\n while keep_in_loop:\n grouped_balls = [(y, sum(1 for i in g)) for y, g in groupby(balls_copy)]\n\n for j in xrange(len(grouped_balls)):\n if grouped_balls[j][1] >= 3:\n before = sum(b for a, b in grouped_balls[0:j])\n after = sum(b for a, b in grouped_balls[j + 1:])\n balls_copy = balls_copy[0:before] + balls_copy[-after:]\n\n keep_in_loop = True\n if len(grouped_balls) == 1:\n balls_copy = []\n keep_in_loop = False\n\n break\n else:\n keep_in_loop = False\n\n destroyed = max(len(balls) - len(balls_copy), destroyed)\n\nprint destroyed", "lang": "Python 2", "bug_code_uid": "976cc2e4697bcc721a9d12fe19dffa39", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "83073ad08c6233dfd61507b4b9e3c02d", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2521551724137931, "equal_cnt": 22, "replace_cnt": 8, "delete_cnt": 10, "insert_cnt": 5, "fix_ops_cnt": 23, "bug_source_code": "import copy\n\ndef elimina_lista(lista, elemento, i):\n lista.insert(i, elemento)\n i = 2\n j = i\n\n soma = 0\n cont = 1\n while i >= 0 and j <= len(lista)-1:\n if lista[i] == elemento and i > 0:\n if lista[i-1] == elemento:\n cont += 1\n\n i -= 1\n if lista[j] == elemento and j < len(lista) -1:\n if lista[j+1] == elemento:\n j += 1\n cont += 1\n\n\n\n if j < len(lista) - 1 and i > 0:\n if lista[j+1] != elemento and lista[i-1] != elemento:\n if cont >= 3:\n del lista[i: j+1]\n j = i\n elemento = lista[i]\n soma += cont\n cont = 1 \n elif j < len(lista) - 1 and i == 0:\n if lista[j+1] != elemento and lista[i] != elemento:\n if cont >= 3:\n del lista[i: j+1]\n j = i\n elemento = lista[i]\n soma += cont\n cont = 1\n elif j== len(lista) -1 and i > 0:\n if lista[j] != elemento and lista[i-1] != elemento:\n if cont >= 3:\n del lista[i: j+1]\n j = i\n soma += cont\n cont = 1\n elif j == len(lista) -1 and i == 0:\n if cont >= 3:\n del lista[i: j+1]\n j = i\n soma += cont\n cont = 1\n else:\n break\n return soma\n\ncasos = map(int, raw_input().split())\nlista = map(int, raw_input().split())\nlista3 = []\nfor i in casos:\n for j in xrange(len(lista)):\n if lista[j] == i:\n lista2 = copy.copy(lista)\n lista3.append(elimina_lista(lista2, i, j))\n\nif max(lista3) == 0:\n print 0\nelse:\n print max(lista3) -1\n", "lang": "Python 2", "bug_code_uid": "8b173c01d5b1ec83a5a9ad49a93d0b7e", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "c00f1d88ea91512bce78940944c9df02", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8313253012048193, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = long int(input())\nn = n + 1\nif n % 2 == 1:\n\tprint(n)\nelse:\n\tprint(long int(n/2))", "lang": "Python 3", "bug_code_uid": "663753731103179154fde2ad71d2e84f", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "355e78a77fbd7bbf0a39ea9e5ca89da8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6192893401015228, "equal_cnt": 15, "replace_cnt": 3, "delete_cnt": 7, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "n= int(input())\nif n+1=1:\n print(\"0\")\nelif (n+1)%2==0:\n print(int((n+1)/2))\nelse:\n print(n+1)", "lang": "Python 3", "bug_code_uid": "ad1bf3ab731ea6f7523bdc07188ea2a3", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "6afa16e630f58dce8fdebd2c916688a8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9975550122249389, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=input()\nst=set()\ndef dfs(x,l):\n if l>=10 or x>n:return\n if x: st.add(x)\n dfs(10*x+a,l+1)\n dfs(10*x+b,l+1)\n \nfor a in xrange(10):\n for b in xrange(a+1,10):\n dfs(0,0)\nprint len(st)", "lang": "Python 2", "bug_code_uid": "beda23d84bfea7505141491500aea397", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "ae11aa625a8a4ada7e0d6d32005ff28a", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9949832775919732, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "# 23145\n\nn = input()\nt = 1\ni = 0\n\nwhile n>=t:\n t*=10\n i+=1\n\ni-=1 # 4\nans = (2**i-1)*81 - 72*i\n\n# < 10000\n\na = []\n\nwhile n > 0:\n a.append(n%10)\n n/=10\n\nb = -1\nans += (a[-1]-1)*((2**i-1)*9 + 1)\n\nfor j in range(i)[::-1]:\n for c in range(a[j]):\n if b < 0:\n if c == a[-1]:\n ans += ((2**j-1)*9+1)\n else:\n ans += 2**j\n elif c == b or c == a[-1]:\n ans += 2**j\n if b > 0 and a[j] != a[-1] and c != b:\n break\n elif b < 0 and a[j] != a[-1]:\n b = a[j]\n\nprint ans + (1 if len(set(a)) <= 2 else 0)\n", "lang": "Python 2", "bug_code_uid": "ab70f25d88c27ff0d9f0f2ec6a76434d", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4", "apr_id": "57c618be5a371077e28ea4090e998cbd", "difficulty": 1600, "tags": ["dfs and similar", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9605009633911368, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "n,x,pos = map(int,input().split())\n\ndef bs(pos):\n l = 0\n r = n\n small = set()\n large = set()\n eq = 0\n while l>1\n # print(mid)\n if mid<=pos:\n if mid!=pos:\n small.add(mid)\n else:\n eq+=1\n l = mid+1\n else:\n r = mid\n large.add(mid)\n if l!=pos:\n large.add(l)\n # print(small)\n # print(large)\n return eq, len(small),len(large)\neq,small,large = bs(pos)\n# print(small)\n# print(large)\n\nlr = n-x\nsm = n-lr-1\n\nfact = [1]*(n+1)\nfor i in range(2,n+1):\n fact[i] = fact[i-1]*i%mod\n\ndef inv(x):\n return pow(x,mod-2,mod)\n\ndef ncr(n,r):\n if n<=r or r==0 or r==n:\n return 1\n # return fact[n]//fact[r]//fact[n-r]\n return fact[n]%mod*inv(fact[r])%mod*inv(fact[n-r])%mod\n\n# if eq:\n# lr-=1\n# print(n,lr,small,large)\nprint(fact[n-large-small-1]%mod\n *ncr(n-lr-1,small)%mod*fact[small]%mod\n *ncr(lr,large)%mod*fact[large]%mod)\n", "lang": "Python 3", "bug_code_uid": "4d0b3d8231c1aa5d76fac6f570dfba47", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "0163d57fe6d5bbaa5d9347bfe97a7593", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9698149951314509, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import sys\nrange = xrange\ninput = raw_input\n\nn,k = [int(x) for x in input().split()]\n\nways = [0] * (n + 1)\nways[-1] = 1\nfor i in reversed(range(n)):\n ways[i] = sum(ways[j] for j in range(i+1, n+1))\n\nsearch = []\ni = 0\nwhile k and i < n:\n for j in range(i + 1, n + 1):\n if ways[j] >= k:\n search += reversed(range(i, j))\n i = j\n break\n else:\n k -= ways[j]\nassert(search[-1] == n - 1)\nassert(k==1)\n\n\nprint ' '.join(str(x+1) for x in search)\n", "lang": "PyPy 2", "bug_code_uid": "4f25cde07fe13684965ddcaf56284f66", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "36c8bff21f2689f4ef6b777fa7a55ec2", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.46208869814020026, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "# Contest: 20 - 2100 <= Codeforces Rating <= 2199 (https://a2oj.com/ladder?ID=20)\n# Problem: (19) Kyoya and Permutation (Difficulty: 4) (http://codeforces.com/problemset/problem/553/B)\n\ndef rint():\n return int(input())\n\n\ndef rints():\n return list(map(int, input().split()))\n\n\nn, k = rints()\nif k == 1:\n print(' '.join(map(str, range(1, n + 1))))\n exit(0)\nk -= 1\nfor i in reversed(range(n - 1)):\n co = 2 ** ((n - i) // 2 - 1)\n if co >= k:\n perm = list(range(1, n + 1))\n perm[i] += 1\n perm[i + 1] -= 1\n b = bin(k - 1)[2:]\n for j, bj in enumerate(b):\n if bj == '1':\n perm[i + 2 * j] += 1\n perm[i + 2 * j + 1] -= 1\n print(' '.join(map(str, perm)))\n break\n k -= co\n", "lang": "PyPy 3", "bug_code_uid": "94d1b1ae2b5368d43dda4f24cdc7c713", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "075d1ccba88efd79644d27b077a1f344", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9912280701754386, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(raw_input());\n\ndef f(n):\n\twhile n > 360 : n -= 360;\n\twhile n < 0 : n += 360\t\n\treturn min(min(n,abs(360-n)),56565);\n\nB = f(n);\ncost = 0;\nif n < 0: \n\tn = -n;\n\tB,cost = f(n),0;\nelif n > 0:\n\tn = 360 - n;\n\tB,cost = f(n),0\n\nctr = -1;\nm = n;\nfor i in xrange(5):\n\tctr += 1;\n\tn = m + i * 90;\n\tif f(n) < B:\n\t\tB = f(n);\n\t\tcost = ctr;\n\nctr = -1\nfor i in xrange(5):\n\tctr += 1;\n\tn = m - i * 90;\n\tif f(n) < B:\n\t\tB = f(n);\n\t\tcost = min(cost,ctr);\n\n\t\nprint cost", "lang": "Python 2", "bug_code_uid": "a6ae5972c5601c83f7b045dc6430724c", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "e37304c7018310d664e3dbcd89681c6e", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.905511811023622, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x = int(raw_input())\nx %= 360\n\nif x <= 45:\n\tprint 0\nelif x <= 135:\n\tprint 1\nelif x <= 225:\n\tprint 2\nelse:\n\tprint 0\n", "lang": "Python 2", "bug_code_uid": "a09dcc31a0f80c08a9151e0d5baa5a6d", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "0be72f8cf0c2e77338cbb37ed57090a8", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.848780487804878, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "x = int(input()) % 360\na = [abs(x - y) for y in range(0,360,90)]\nprint(a.index(min(a)))", "lang": "PyPy 3", "bug_code_uid": "ebb5fb05575713c0ba4a29963899ec91", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "9ba6b294bf81db562225e9b45efaee7a", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9568965517241379, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import math\n\na = int(input())\n\na %= 360\n\nm = a % 360\n\nmi = 0\n\nfor i in range(1, 4):\n if(m > min(360 - abs(a - 90 * i), abs(a - 90 * i))):\n m = min(360 - abs(a - 90 * i), abs(a - 90 * i))\n mi = i\n\nprint(mi)", "lang": "PyPy 3", "bug_code_uid": "1e87479b7deecd63991ae625fe576b87", "src_uid": "509db9cb6156b692557ba874a09f150e", "apr_id": "c0e85070d6242273943644aaaf16e71a", "difficulty": 1800, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7984790874524715, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "a, b, c = map(int, input().split())\nx = 0\n\nfor i in range(a):\n if i * 2 <= b and i * 4 <= c:\n x = i\n\nprint(x)\n", "lang": "Python 3", "bug_code_uid": "9c2a877e586792bf87d7ec47f7b2cbd7", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "addc41134e1221c725651d3f4845d50a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8773841961852861, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a, b, c = map(int, input().split())\n\nmin_count = list()\n\nmin_count.append(a / 1)\nmin_count.append(b // 2)\nmin_count.append(c // 4)\n\ncount = int(min(min_count))\n\nprint(count*7)\n", "lang": "Python 3", "bug_code_uid": "b620f16f27ecdcca98275a1200a491f3", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "f8d8eec0cdb91287334df4ce28cbe9cd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9300411522633745, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\ninput = sys.stdin.readline\n\nif (w<4):\n print(\"NO\")\nelif (w%2==0):\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "c8618f5aab608b3baf320a7af2998626", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "e09bee29104a0c9f623ff82d5d767c72", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6914285714285714, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "import math\n\ndef ii():\n\treturn map(int,raw_input().split())\n\nn = input()\ncount = 0\ncount += int(math.log(n,2))\nn -= 2**count\nif n == 1:\n\tcount += 1\nelse:\n\tcount += int(math.log(n,2))\n\nprint count", "lang": "PyPy 2", "bug_code_uid": "3d12c937ac202b06517ec8db48240c17", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "fe4f91e9934f92009fb4db24edc504d0", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9702970297029703, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\na = [0 for i in range(1000)]\na[1] = 2\na[2] = 3\nif n <4:\n print(n-1)\n exit()\ni = 3\nwhile True:\n a[i] = a[i-1] + a[i-2]\n if a[i] >= n:\n print(i - 1)\n exit()", "lang": "PyPy 3", "bug_code_uid": "4802300e1fa593cb3cc7ceb90318c2e5", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "7c84811cf99d7508648f94e56ac43630", "difficulty": 1600, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9793195463642428, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "from math import factorial\ndef choose(n, c):\n return factorial(n) / factorial(c) / factorial(n - c)\n\ntab = {}\ndef amount(y, n, t):\n if n == t == 0:\n return 1\n if n > 6 * t + 1 or t == 0 or n < 0 or y >= 4:\n return 0\n if (y, n, t) not in tab:\n res = 0\n for top in xrange(y + 1, 5):\n for bottom in xrange(1, top):\n for i in xrange(top - y):\n for j in xrange(top - bottom):\n res += amount(bottom + 1, n - (i + j + 3), t - 1) * choose(top - y - 1, i) * choose(top - bottom - 1, j)\n tab[(y, n, t)] = res\n return tab[(y, n, t)]\n\nn, t = map(int, raw_input().split())\nres = 0\nfor i in xrange(1, 4):\n res += amount(i, n, t)\nprint res\n", "lang": "Python 2", "bug_code_uid": "e803a870cc14bf61318c268cdbd9cac5", "src_uid": "6d67559744583229455c5eafe68f7952", "apr_id": "d16d2fb427d36e64a56a471326725806", "difficulty": 1900, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5870967741935483, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "a,b,c=map(int, input().split())\ng=True\nwhile(g):\n t=(a+b+c)//7\n if a>t and b>2*t and c>4*t:\n print(t*7)\n g=False\n else:\n print((t-1)*7)\n g=False\n", "lang": "PyPy 3", "bug_code_uid": "a52cffe4591a870d7ac5eda3b93150e7", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "048222f4ca0e20511dc2d1a46102aef1", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9748743718592965, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "x = int(input())\nres = 0\ncount = 1\nfor i in range(0,x):\n res += 2**count\n count++\nprint(res)", "lang": "Python 3", "bug_code_uid": "7453bcd449a27dbecbef5353cd3a993c", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "1ee916d63591270ca0794e48cc565b76", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9824561403508771, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "print(2**(int(input())+1)s-2)", "lang": "Python 3", "bug_code_uid": "c0301129be9ed8bb2cb978dc7e5364d1", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "c6efe28159f02ad54208206ce2f1baac", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.948051948051948, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "n = input()\nans = 0\nfor i in range(1 , n + 1):\n ans += 1 << i\nprint ans", "lang": "Python 3", "bug_code_uid": "a232903e4958b60eb50125e37d960b33", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "8fbb9576f8cf4e423a32c796a6df8a06", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9963898916967509, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input()\ncities = [char for char in input()]\nif cities[0] == 'S' and cities[-1] == 'F':\n print('YES')\nelse:\n print('NO')\n ", "lang": "Python 3", "bug_code_uid": "36c06afb113883aad0968898457b817e", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "b01f3c0682df539302c4406456960a0d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9900990099009901, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nprint('Ehab' if !n%2 else 'Mahmoud')", "lang": "PyPy 3", "bug_code_uid": "85dc617a4148dcab780837f757360b43", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "704733fc4e57c1572f4fa99f76cdf649", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9925925925925926, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "if((int(input())%2==0):\n print(\"Mahmoud\")\nelse:\n print(\"Ehab\")", "lang": "PyPy 3", "bug_code_uid": "1b549dfdc96ed1da804b0ffdd3ca326d", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "41324cf65ac75339f109f1a6a391f697", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8111455108359134, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n,m=list(map(int,input().strip().split()))\nl=list(map(int,input().strip().split()))\nt=list(map(int,input().strip().split()))\nl.sort()\nt.sort()\nk=[]\nfor i in l:\n for j in t:\n if i==j:\n k +=[i]\n else:\n k +=[str(i)+str(j)]\nk.sort()\nprint(k[0])", "lang": "Python 3", "bug_code_uid": "9aead6ee64f2ce045947e4da4bc0a5be", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "6769bb83ac2c7da8df7a44c414720a9b", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9944444444444445, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "input()\na = set(map(int,input().split()))\nb = set(map(int,input().split()))\nif(len(a & b) != 0):\n print(min(a & b))\nelse:\n print(min(min(a),min(b)),max(min(a),min(b)),seq='')", "lang": "Python 3", "bug_code_uid": "8e2beb6a01fe5087a18dc15ddefcbdb3", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "9764acd787a9e41c0c8c8717584fbe45", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9223744292237442, "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())\nn1 = list(map(int,input().split()))\nm1 = list(map(int,input().split()))\nif len(k)!=0:\n\tprint(min(k))\nelse:\n\tprint([min(m1)*10+min(n1),min(n1)*10+min(m1)][min(n1)= dp[n-i-2]):\n k -= dp[n-i-2]\n a[i],a[i+1] = a[i+1],a[i]\nprint(a)", "lang": "Python 3", "bug_code_uid": "54c4b0d681022c18da30187b5b6e79e9", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "519e7099607d3d33f7cb23d2f1a0e8b5", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.1117717003567182, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "def get_ans(n, k):\n \n global fact\n global ans\n a = []\n \n if (n <= 0):\n return a\n \n curnum = 1\n curl = 0\n curr = ans[n - 1] - 1\n while (1 == 1):\n if ((curl <= k) and (curr >= k)):\n break\n curnum += 1\n curl = curr + 1\n curr = curl + ans[n - curnum] * fact[curnum - 2] - 1\n a.append(curnum)\n \n if (curnum == 1):\n l = get_ans(n - 1, k)\n a.extend(l)\n return a\n\n k1 = k - curl\n k1 = k1 // ans[n - curnum]\n #print(k1)\n pos = 2\n used = [-1] * curnum\n used[curnum - 1] = 0\n for i in range(2, curnum):\n poss = []\n for j in range(curnum):\n if (used[j] != -1):\n continue\n if (j + 1 == pos):\n continue\n if (j == used[pos - 1]):\n continue\n poss.append(j + 1)\n cnum = k1 // fact[curnum - i - 1]\n a.append(cnum + 1)\n k1 = k1 % fact[curnum - i - 1]\n used[cnum] = pos - 1\n pos += 1\n for i in range(curnum):\n if (used[i] == -1):\n a.append(i + 1)\n break\n l = get_ans(n - curnum, k % ans[n - curnum])\n a.extend(l)\n return a\n\n \n\nn, k = list(map(int, input().rstrip().split()))\n\n\nfact = []\nfact.append(1)\nfor i in range(1, 51):\n fact.append(fact[i - 1] * i)\n\nans = []\nans.append(1)\nans.append(1)\n\nfor i in range(2, 51):\n ans.append(0)\n for j in range(1, i + 1):\n if (j == 1):\n ans[i] += ans[i - 1]\n continue\n ans[i] += ans[i - j] * fact[j - 2]\n\na = []\n\na = get_ans(n, k - 1)\ni = 0\ncsum = 0\nwhile i < n:\n sz = a[i]\n for j in range(sz):\n a[i] += csum\n i += 1\n csum += sz\n\nfor i in range(n):\n print(a[i], ' ', sep = '', end = '')\nprint()", "lang": "Python 3", "bug_code_uid": "af37a93e0879e1e77ff62560fb2e98f5", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "628ce760f5fad59edb46b740906380d1", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.016901408450704224, "equal_cnt": 3, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "def start_sovling():\n\tpass", "lang": "Python 2", "bug_code_uid": "aa4cc60ba3be2292ae46ef8c4d7732b2", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "42108b0665b638ef8ba9191b05f4c09e", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3246268656716418, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "dp = [0 for x in xrange(55)]\ndp[0] = 1\ndp[1] = 1\n\nfor i in xrange(2, 55):\n for j in xrange(0, i):\n dp[i] = dp[i] + dp[j]\n\nn, k = map(int, raw_input().split())\n\nk -= 1\n\nres = [0 for x in xrange(55)]\nlast = -1\n\nfor i in xrange(n):\n if last == -1:\n if k >= dp[n - i - 1]:\n res[i] = i + 2\n last = i\n k -= dp[n - i - 1]\n else:\n res[i] = i + 1\n else:\n if k >= dp[n - i - 1]:\n res[i] = i + 2\n k -= dp[n - i - 1]\n else:\n res[i] = last + 1\n last = -1\n\nfor i in xrange(n):\n print res[i],", "lang": "Python 2", "bug_code_uid": "614127852aa33ef9ce8ea11f1f19854b", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "349b7c57e751ef0f642e8f49ce04dd9f", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9588477366255144, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "def main():\n n, k = map(int, raw_input().split())\n fib = [1, 1]\n for i in range(2, n + 1):\n fib.append(fib[-2] + fib[-1])\n rst = []\n i = 1\n while i <= n:\n todo = n - i\n if i < n - 1 and k > fib[todo]:\n k -= fib[todo]\n rst.extend([i + 1, i])\n i += 2\n else:\n rst.append(i)\n i += 1\n # print k, rst\n print reduce(lambda x, y: str(x) + ' ' + str(y), rst)\n\n\nmain()\n", "lang": "Python 2", "bug_code_uid": "f64665bbbba22676ba68f56ce15ebaea", "src_uid": "e03c6d3bb8cf9119530668765691a346", "apr_id": "7d5d69155b0f3435e8d3a825ebe72a44", "difficulty": 1900, "tags": ["combinatorics", "greedy", "math", "implementation", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9019607843137255, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "input ()\nx={\"U\" : 0 ; \"D\" :0 ; \"R\" :0; \"L\" :0;}\nfor i in input()\nx[i]=x[i]+1\nprint(min(x[\"U\"]+x[\"D\"])*2+min(x[\"R\"]+x[\"L\"])*2)\n", "lang": "Python 3", "bug_code_uid": "7ae8e6e83d40a5bc2f196c911b067bfc", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "02ebb81ae9d1fbd6813c997dfa9094e2", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9787234042553191, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "length = int(input())\ns = input()\nnum_l = s.count(\"L\")\nnum_r = s.count(\"R\")\nnum_u = s.count(\"U\")\nnum_d = s.count(\"D\")\n\nval = 0\nif num_l < num_r:\n val += num_l\nelse:\n val += num_r\nif num_u < num_d:\n val += num_u\nelse:\n val += num_d\n \nprint(val)", "lang": "Python 3", "bug_code_uid": "cff553305f044a3c0c4ba2663caf48df", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "57acbc8fafb207d49f7dbebb90f239e3", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.858085808580858, "equal_cnt": 9, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "from math import sqrt\nn = int(input())\n\nfor i in range(int(sqrt(n), n+1):\n if n % i == 0 and i >= sqrt(n):\n print(n/i, i)\n break", "lang": "Python 3", "bug_code_uid": "0802df14495ac5536732b2727675c8c3", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "8aaaa6bd022ace5d1b2df23e8869cbd8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9696969696969697, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "import math\nn=int(input())\na=math.sqrt(n)\nwhile n%a !=0:\n a=a-1\nprint(a,n//a)", "lang": "Python 3", "bug_code_uid": "1ad13b1f055ec499cee41a2e313e6baf", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "fa6cee4d5338dc5f08ade342bb02f702", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.48552338530066813, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "n = int(input())\ndef display(n):\n\tfor a in range(1,n+1):\n\t\tfor b in range(1,a+1):\n\t\t\tif a*b == n:\n\t\t\t\treturn b,a\ngoodResolution = display(n)\nprint(goodResolution[0],goodResolution[1])", "lang": "Python 3", "bug_code_uid": "b1a0aa7b243405d219bef79e947001f7", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "apr_id": "772f412677d2a1ca8e8ad3e71710ca75", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2589928057553957, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "m = list(input())\ni = \"h\"\na = \"e\"\nb = \"l\"\nd = \"l\"\nc = \"o\"\nfor i in m:\n for a in m:\n for b in m :\n for d in m :\n for c in n :\n print(\"YES\")\n else:\n print(\"NO\")\n", "lang": "PyPy 3", "bug_code_uid": "ff07dcf49fdce8df2af034d16a50f4bb", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "0b6a536bb712afacb008d682cedaf30f", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.66, "equal_cnt": 19, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 19, "bug_source_code": "s=input()\na=0\nfor i in range(len(s)):\n if(s[i]=='h'):\n c=i\n a=a+1\n break\nfor i in range(c+1,len(s)):\n if(s[i]==\"e\"):\n c=i\n a=a+1\n break\nfor i in range(c+1,len(s)):\n if(s[i]==\"l\"):\n c=i\n a=a+1\n break\nfor i in range(c+1,len(s)):\n if(s[i]==\"l\"):\n c=i\n a=a+1\n break\nfor i in range(c+1,len(s)):\n if(s[i]==\"o\"):\n c=i\n a=a+1\n break\nif(len(s)<5):\n print(\"NO\")\nif(a==5):\n print(\"YES\")\nelse:\n print(\"NO\")\n \n", "lang": "PyPy 3", "bug_code_uid": "f518eb88b62aa89570c509426fbd0283", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "efff3dad5366289a7cd3576eb6691cb3", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9913344887348353, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = int(raw_input())\nA = sorted(map(int, raw_input().split()))\nm, i = len(A)/3, 0\ncan = False\nwhile m > 0:\n B = A[i:i+3]\n if len(B) < 3:\n break \n B[0]+=2\n B[1]+=1\n if B[0]==B[1]==B[2]:\n can = True\n break \n i += 1\nprint \"YES\" if can else \"NO\" \n", "lang": "Python 2", "bug_code_uid": "a3d1dfbc3d405701b0bdaa4f99d5df1e", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "2d5088782268f741b6dd29b80f1d85d3", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5752808988764045, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "def gelnana(m, b):\n x_1 = int((b-1)*m)\n sum_list = [0] * int(b + x_1 - 1)\n \n for i in range(b+1):\n x = int((b-i)*m)\n sum_list[i] = (i+1)*(x+1)*(i+x)/2\n\n return int(max(sum_list))\n \narray = list(map(int,input().split())) \nm = array[0] \nb = array[1] \nprint(gelnana(m, b)) ", "lang": "PyPy 3", "bug_code_uid": "85c3d36a11e5622c08c3f97935190b88", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "a7673942ace2daf28d8d6243bdd5d372", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.33444816053511706, "equal_cnt": 23, "replace_cnt": 16, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "def function(x,y,m,c):\n d=y+x/m-c\n return d\ndef pval(a):\n return a[0]+a[1]\ndef valof(a,p):\n max=0\n for i,j in p:\n if j<=a:\n sum=0\n for l,m in p:\n if m<=j and l<=i:sum+=l+m\n if max<=sum:max=sum#;print((i,j),sum)\n return max\n\nm,c=list(map(int,input().split()))\np=[(i,j) for i in range(0,m*c+1) for j in range(0,c+1) if function(i,j,m,c)<=0]\nprint(valof(c,p))\n\n\n", "lang": "PyPy 3", "bug_code_uid": "d097dc4e8a8af163c7af0e7dbafb75c2", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "4cdd28fe0fe854c91a6aeab2bd33b0d7", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9198473282442748, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def f(a,b,c,l):\n if a= pair[0]:\n hy = pair[1]\n else:\n new_values.append((hx, hy))\n hx, hy = pair\n values = new_values + [(hx, hy)]\n\n print max(values)[1] - 1\n\n\nmain()\n", "lang": "PyPy 2", "bug_code_uid": "70beea4dd9957fb75f2eca7030f40eab", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "c02ec0595111d8515ea0964a81b6c756", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9972602739726028, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "# ---------------------------iye ha aam zindegi---------------------------------------------\nimport math\nimport heapq, bisect\nimport sys\nfrom collections import deque, defaultdict\nfrom fractions import Fraction\n\nmod = 10 ** 9 + 7\nmod1 = 998244353\n\n# ------------------------------warmup----------------------------\nimport os\nimport sys\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\n# -------------------game starts now----------------------------------------------------import math\nclass TreeNode:\n def __init__(self, k, v):\n self.key = k\n self.value = v\n self.left = None\n self.right = None\n self.parent = None\n self.height = 1\n self.num_left = 1\n self.num_total = 1\n\n\nclass AvlTree:\n\n def __init__(self):\n self._tree = None\n\n def add(self, k, v):\n if not self._tree:\n self._tree = TreeNode(k, v)\n return\n node = self._add(k, v)\n if node:\n self._rebalance(node)\n\n def _add(self, k, v):\n node = self._tree\n while node:\n if k < node.key:\n if node.left:\n node = node.left\n else:\n node.left = TreeNode(k, v)\n node.left.parent = node\n return node.left\n elif node.key < k:\n if node.right:\n node = node.right\n else:\n node.right = TreeNode(k, v)\n node.right.parent = node\n return node.right\n else:\n node.value = v\n return\n\n @staticmethod\n def get_height(x):\n return x.height if x else 0\n\n @staticmethod\n def get_num_total(x):\n return x.num_total if x else 0\n\n def _rebalance(self, node):\n\n n = node\n while n:\n lh = self.get_height(n.left)\n rh = self.get_height(n.right)\n n.height = max(lh, rh) + 1\n balance_factor = lh - rh\n n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)\n n.num_left = 1 + self.get_num_total(n.left)\n\n if balance_factor > 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='z', func=lambda a, b: min(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\n\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=list(map(int,input().split()))\nl=[l[i]%k for i in range(n)]\nl1=l[:n//2]\nl2=l[n//2:]\ns=set()\ns1=set()\ns2=set()\nfor i in range(n//2):\n for j in s:\n s2.add((j+l1[i])%k)\n s.add(l1[i])\n for j in s2:\n s.add(j)\n s2=set()\nfor i in range(n-n//2):\n for j in s1:\n s2.add((j+l2[i])%k)\n s1.add(l2[i])\n for j in s2:\n s1.add(j)\n s2 = set()\ns=list(s)\ns1=list(s1)\ns.sort()\ns1.sort()\nans=(max(s),max(s1))\nfor i in range(len(s)):\n t=k-1-s[i]\n ind=binarySearchCount(s1,len(s1),t)\n r=s1[ind-1]\n rt=s1[-1]\n ans=max((r+s[i])%k,(s[i]+rt)%k)\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "a9a5eb013b6cb15088a61071010072e9", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "apr_id": "d64ec405a02d5bb690cfef4d43e3582d", "difficulty": 1800, "tags": ["divide and conquer", "meet-in-the-middle", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9754601226993865, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n,k=map(int,input().split())\nl=input()\nd={}\nfor i in l:\n d[i]=d.get(i,0)+1\nfor i in d.values():\n if i>k:\n print(\"NO\")\n break\nelse:\n print(\"YES\")", "lang": "PyPy 3", "bug_code_uid": "eb954ba85dccf975089bd63f831967ed", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "5fed81db10d4a4e60f485c8e0bb9d84e", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8805970149253731, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "arr = list(map(int, input().split()))\n\nprint (int(sum(arr)/len(arr))", "lang": "Python 3", "bug_code_uid": "fb3c8ee9ca036e78fd7031ba2248ef9f", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "fcc465ccbad607dcb9409f1e42291434", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9822904368358913, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from sys import stdin\n\nin_lines = stdin.readlines()\n\n\ndef int_values(line) :\n return map( int, line.split(' ') )\n\nlines = map( int_values, map( lambda x:x.strip(), in_lines ) )\n\nn = lines[0][0]\nvalues = lines[1]\nsums = [0]\n\nfor v in values :\n sums.append(sums[-1] + v)\n \nfor i in range(n) :\n for j in range(i + 1, n + 1) :\n variants.append(sums[n] + (j - i - 2 * (sums[j] - sums[i])))\n\nprint max(variants)\n", "lang": "Python 2", "bug_code_uid": "5feb8e2decd6c630e14c23dbee47f82b", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "a373124bf51ddf408c20fe4bc74a8ee2", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9854166666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def before_light(l, d, v, g, r):\n min_time_to_light = d / v\n light_color = int(min_time_to_light) % (g + r)\n if light_color < g:\n return min_time_to_light\n else:\n return int(min_time_to_light) * (g + r)\n\n\ndef after_light(l, d, v, g, r):\n return (l - d) / v\n\n\ndef solve():\n l, d, v, g, r = map(int, input().split())\n minimum_time = str(round(after_light(l, d, v, g, r) + before_light(l, d, v, g, r), 10))\n print(minimum_time)\n\n\nsolve()\n", "lang": "Python 3", "bug_code_uid": "1ae8f14a7b0386dc81e78ba4da85ff1b", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "7eb2eff11c23dd95eb15160af0e8ac8f", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.868020304568528, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "if(it(g+r):\n tr = it+(g+r)\n if(it%(g+r)):print(\"%.8f\"%tr)\nelse:\n nt = r+g+((td-pd)/sp)\n print(\"%.8f\" % nt)", "lang": "Python 3", "bug_code_uid": "03782b41efd0dd3cde2a92e33904ae3b", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "76275cd09fd1e6075b1e2791dd785c55", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8715728715728716, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "l,d,v,g,r=map(int,input().split())\nt=d/v\nif g>t: print(t+(l-d)/v)\nelse:\n if t 1:\n a, b = 0, 1\n while b < len(arr) - 1:\n if arr[a] == arr[b]:\n b += 1\n if b - a >= 3:\n for k in range(b, a - 1, -1):\n arr.pop(k)\n r(arr)\n \n\nif n > 1:\n i, j = 0, 1\n while j < n and (balls[i] != x or balls[j] != x):\n i += 1\n j += 1\n if j < n:\n balls.pop(j)\n balls.pop(i)\n r(balls)\n\nprint(n - len(balls))", "lang": "PyPy 3", "bug_code_uid": "3505edfd418669198bc32a3e243fdc0a", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "5aa88d0e243d2a249a579fefa227cf93", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.22797927461139897, "equal_cnt": 7, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "import sys\n\ninput = []\n\nfor line in sys.stdin:\n\tinput.append(line.split())\n\na = int(input[0][0])\nb = int(input[0][1])\n\ndef primes(numb):\n\tresult = []\n\tn = numb\n\n\tif is_prime(numb):\n\t\tresult.append(numb)\n\t\treturn result\n\n\ti = 2\n\n\twhile i <= n:\n\t\tif n % i == 0 and is_prime(i):\n\t\t\tresult.append(i)\n\t\t\twhile n % i == 0:\n\t\t\t\tn /= i\n\t\ti += 1\n\n\treturn result\n\ndef is_prime(numb):\n\tif numb == 0 or numb == 1:\n\t\treturn False\n\n\tfor i in range(2, int(numb ** (0.5)) + 1):\n\t\tif numb % i == 0:\n\t\t\treturn False\n\n\treturn True\n\n\nnumbs = primes(a)\n\nresult = 1\n\nfor numb in numbs:\n\tdegree = 0\n\tpower = numb\n\tto = b\n\twhile power <= to:\n\t\tdegree += to / power\n\t\tto /= power\n\n\tm = 1\n\tfor i in range(degree):\n\t\tresult *= numb\n\t\tresult %= 1000000007\n\nsys.stdout.write(str(result))", "lang": "Python 2", "bug_code_uid": "882f1bb5b45f792f292e21ca945dc2ac", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "3f7fca4151bd912cb814ff51b3ef0d6b", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5490640952921158, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "import sys\n\ninput = []\n\nfor line in sys.stdin:\n\tinput.append(line.split())\n\na = int(input[0][0])\nb = int(input[0][1])\n\ndef primes(numb):\n\tresult = []\n\tn = numb\n\n\tif is_prime(numb):\n\t\tresult.append(numb)\n\t\treturn result\n\n\ti = 2\n\n\twhile i <= n:\n\t\tif n % i == 0 and is_prime(i):\n\t\t\tresult.append(i)\n\t\t\twhile n % i == 0:\n\t\t\t\tn /= i\n\t\ti += 1\n\n\treturn result\n\ndef is_prime(numb):\n\tif numb == 0 or numb == 1:\n\t\treturn False\n\n\tfor i in range(2, int(numb ** (0.5)) + 1):\n\t\tif numb % i == 0:\n\t\t\treturn False\n\n\treturn True\n\ndef powe(base, p):\n\n\tif p == 0:\n\t\treturn 1\n\n\tif p == 1:\n\t\treturn base\n\n\tres = 1\n\n\tif p % 2 == 0 :\n\t\tr = powe(base, p / 2)\n\t\tr %= 1000000007\n\t\treturn r ** 2 % 1000000007\n\telse:\n\t\treturn base * powe(base, p - 1) % 1000000007\n\n\n\nnumbs = primes(a)\n\nresult = 1\n\nfor numb in numbs:\n\n\tdegree = 0\n\tpower = numb\n\tto = b\n\twhile power <= to:\n\t\tdegree += to / power\n\t\tto /= power\n\n\tresult *= powe(numb % 1000000007, degree)\n\tresult %= 1000000007\n\nsys.stdout.write(str(result))", "lang": "Python 2", "bug_code_uid": "370cb6eaefc7d00e8cb8e5c5ca4a1e87", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "3f7fca4151bd912cb814ff51b3ef0d6b", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6932849364791288, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "\na = int(input())\nb = int(input())\nk = 0\n\nif a > b:\n print b\n k = (a-b)/2\n if k%2 == 0:\n print k\n else:\n print k\nelif b > a:\n print a\n k = (b - a) / 2\n if k % 2 == 0:\n print k\n else:\n print k", "lang": "Python 3", "bug_code_uid": "b33f48605a85a701eb5edaeee96dc7ed", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "eefcf89531a7b7655ec8ccf9170d047a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8678071539657853, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "def inputsocks(a,b):\n # number of mixed pairs equals to the number of the smallest sock\n mixedpairs = min((a,b))\n\n singlesocks = max((a,b)) - mixedpairs\n singlepairs = int(singlesocks / 2)\n return (mixedpairs, singlepairs)\n\n\na, b = [int(x) for x in input().split()]\n\nreturn inputsocks(a,b)\n\n\n", "lang": "Python 3", "bug_code_uid": "c0a9d8a5011329fe469cb76bd1c1dd24", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "fdd20b697777dff24f101dd8d6ef1af8", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.32710280373831774, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "a=input().split(' ')\nfirst=int(a[0])\nsecond=int(a[1])\nthird=int(a[2])\nsum=(first+second+third)/2\nx=first\ny=second\nz=third\nif x-int(x)!=0 or y-int(y)!=0 or z-int(z)!=0:\n print(Impossible)\n\nelse:\n x=int(sum-third)\n y=int(sum-first)\n z=int(sum-second)\n if x<0 or y<0 or z<0 or x=0 and y=0 and z=0:\n print(\"Impossible\")\n else:\n print(x, y, z)\n \n", "lang": "Python 3", "bug_code_uid": "5d6afb1c74d09fb0f9f8968bbde70cc9", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "2b13f91bd2d1dea95129784b69ad57be", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9615384615384616, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a,b,c=map(int,input().split())\n\ns=(a+b+c)//2\n\nif (a+b+c)%2 or s-a<0 or s-b<0 or s-c<0:print(\"Impossible\")\n\nelse print(s-a,s-b,s-c)", "lang": "Python 3", "bug_code_uid": "95f956b682da0fcdaf822050f571ac56", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "31bba0e54d1134c33fce99790e2c622c", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7371134020618557, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "a,b,c = input()\nx =a+c-b\ny = a+c-b\nz = c+b-a\nif (x >= 0) && (x%2 == 0)&& (y >= 0) && (y%2 == 0)&&(z >= 0) && (z%2 == 0):\n print(x/2,y/2,z/2)\nelse:\n print(\"Impossible\")", "lang": "Python 3", "bug_code_uid": "91b0acb2cda1c0faffc80695799a9cf5", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "9bf66cff1b3cbf1a057d4000cb08e0f3", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.25676613462873005, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "import sys\nimport bisect as bi\nimport math as mt\nimport collections as cc\nimport heapq as hp\ninput=sys.stdin.readline\nI=lambda:list(map(int,input().split()))\nN=101\npr=[0]*(N)\nfor i in range(2,N):\n if not pr[i]:\n for j in range(i*2,N,i):\n pr[j]=1\nfor tc in range(int(input())):\n n,=I()\n if not pr[n]:\n a=[1]*(n)\n for i in range(n):\n print(*a)\n else:\n x=0\n y=1\n ans=[[0]*n for i in range(n)]\n for i in range(n):\n for j in range(n):\n if j==x or j==y:\n ans[i][j]=1\n x+=1\n y+=1\n x%=n\n y%=n\n for i in ans:\n print(*i)\n", "lang": "PyPy 3", "bug_code_uid": "36e23c833fb9fca9d7bf6a270364bc05", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "a6981defea14a65c29915f97b608e76d", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9838945827232797, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import sys\nimport math\ndef II():\n\treturn int(sys.stdin.readline())\n \ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n \ndef MI():\n\treturn map(int, sys.stdin.readline().split())\n \ndef SI():\n\treturn sys.stdin.readline().strip()\n\ndef FACT(n, mod):\n s = 1\n facts = [1]\n for i in range(1,n+1):\n s*=i\n s%=mod\n facts.append(s)\n return facts[n]\n\ndef C(n, k, mod):\n return (FACT(n,mod) * pow((FACT(k,mod)*FACT(n-k,mod))%mod,mod-2, mod))%mod\n\nn,x,pos = MI()\n\nleft = 0\nright = n\nless = 0\nmore = 0\nwhile lefthassLess or more > hasBig:\n print(0)\nelse:\n mod = 10**9+7\n ans = FACT(less,mod)*C(hasBig, more, mod)%mod\n ans = ans*FACT(more,mod)%mod\n ans = ans*C(hasLess, less, mod)%mod\n ans*=FACT(n-less-more-1, mod)\n ans%=mod\n print(ans)\n \n\n", "lang": "PyPy 3", "bug_code_uid": "ecb2b728c048837d298fd3cade10ee3a", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "a6ec745f424642d8634f183b530c83df", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9954337899543378, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import math\nx,n = [int(x) for x in input().split()]\np = []\nif(x%2 == 0):\n\tp.append(2)\n\twhile(x%2 == 0):\n\t\tx = int(x/2)\nfor i in range(3,int(math.sqrt(x)+1),2):\n\tif(x%i == 0):\n\t\tp.append(i)\n\t\twhile(x%i == 0):\n\t\t\tx = int(x/i)\np.append(int(x))\nans = 1\nmod = 10**9+7\nfor i in range(len(p)):\n\t#print(p[i])\n\tval = p[i]\n\tif(val == 1):\n\t\tcontinue\n\tno = p[i]\n\twhile(no <= n):\n\t\tans = (ans * pow(val,int(n/no),mod))%mod\n\t\tno = no*val\nprint(ans)\n\n", "lang": "PyPy 2", "bug_code_uid": "102d8b66e5f1955c93465480c7c499b1", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "6ae70a3463f425132ca40a1316a04ea6", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9587628865979382, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "from math import sqrt\ndef primes(n):\n c=n\n l=[]\n i=3\n if n%2==0:\n l.append(2)\n while n%2==0:\n n=n//2\n while i*i<=int(sqrt(c))+1:\n if n%i==0:\n l.append(i)\n while n%i==0:\n n=n//i\n i+=2\n if x!=1:\n l.append(x)\n return l\nmo=10**9+7\nn,m=map(int,input().split())\nprime=primes(n)\nans=1\nfor p in prime:\n k=p\n while k<=n:\n ans*=pow(p,m//k,mo)\n ans=ans%mo\n k*=p\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "f7c3feeaf27aca3bd3baf6844881574f", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "68d765f24df7489114886e410719163c", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5779889152810768, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "from math import sqrt\nx,n=[int(x) for x in input().split(' ')]\nfactors=[]\ntemp=x\n\ndef power(x,y,p):\n\tres=1\n\tx=x%p\n\twhile y>0:\n\t\tif ((y&1)==1):\n\t\t\tres=(res*x)%p\n\t\ty=y>>1\n\t\tx=(x*x)%p\n\treturn res\n\nfor i in range(2,temp+1):\n\tif temp%i==0:\n\t\tfactors.append(i)\n\t\twhile(temp%i==0):\n\t\t\ttemp//=i\n# print(factors)\npowers=[]\nfor fact in factors:\n\ttemp=n\n\tt=0\n\twhile temp:\n\t\tt+=(temp//fact)\n\t\ttemp//=fact\n\tpowers.append(t)\n# print(powers)\nmod=1000000007\nans=1\nfor i in range(len(factors)):\n\ttemp=power(factors[i],powers[i],mod)\n\tans=(ans*temp)%mod\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "453c6ed3a9706c7c4d76e3d719094d40", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "347e3d8136090783fc933eb9321550e3", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9873417721518988, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "x = int(input())\nprint((2**(x + 1) - 2)", "lang": "Python 3", "bug_code_uid": "d054c0e09a4e949997e260505fa74151", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "apr_id": "a253c3a99fd869707384250a17dae546", "difficulty": 1100, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.14126016260162602, "equal_cnt": 25, "replace_cnt": 20, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 25, "bug_source_code": "mod, sx, sy, dx, dy, t = map(int,raw_input().split())\nclass Matrix():\n def __init__(self, n):\n self.n = n\n self.a = [[0] * n for _ in range(n)]\n\n def __mul__(self, b):\n res = Matrix(self.n)\n for i in range(self.n):\n for j in range(self.n):\n for k in range(self.n):\n res.a[i][j] += self.a[i][k] * b.a[k][j] % mod\n res.a[i][j] %= mod\n return res\n\n def __pow__(self, e):\n res = Matrix(self.n)\n for i in range(self.n):\n res.a[i][i] = 1\n tmp = self\n while e:\n if e & 1:\n res = res * tmp\n e >>= 1\n tmp = tmp * tmp\n return res\nM = Matrix(6)\nM.a = [[2, 1, 1, 0, 1, 2],\n [1, 2, 0, 1, 1, 2],\n [1, 1, 1, 0, 1, 2],\n [1, 1, 0, 1, 1, 2],\n [0, 0, 0, 0, 1, 1],\n [0, 0, 0, 0, 0, 1]]\nsx -= 1\nsy -= 1\nr = M ** t\nf = lambda i: (r.a[i][0] * sx + r.a[i][1] * sy + r.a[i][2] * dx + r.a[i][3] * dy + r.a[i][5]) % mod + 1\nprint(f(0), f(1))", "lang": "Python 2", "bug_code_uid": "426c164d47fe3a717396c44867ca85b5", "src_uid": "ee9fa8be2ae05a4e831a4f608c0cc785", "apr_id": "0b94bf5e9baae001e483def1ee43790c", "difficulty": 2300, "tags": ["matrices", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.998914223669924, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "od, sx, sy, dx, dy, t = map(int, raw_input().split())\nv = (sx - 1, sy - 1, dx + sx + sy, dy + sx + sy, 1, 1)\nA = [\n[1, 0, 1, 0, 0, 0],\n[0, 1, 0, 1, 0, 0],\n[1, 1, 2, 1, 1, 2],\n[1, 1, 1, 2, 1, 2],\n[0, 0, 0, 0, 1, 1],\n[0, 0, 0, 0, 0, 1]\n]\nI = lambda: [[1 if i == j else 0 for j in xrange(6)] for i in xrange(6)]\ndef mul(M, N):\n global mod\n res = [[0] * 6 for i in xrange(6)]\n for i in xrange(6):\n for j in xrange(6):\n for k in xrange(6):\n res[i][j] += M[i][k] * N[k][j]\n res[i][j] %= mod\n return res\ndef power(M, k):\n if k > 1:\n res = power(M, k/2)\n res = mul(res, res)\n if k % 2:\n res = mul(res, M)\n return res\n elif k == 1:\n return M\n else:\n return I()\nB = power(A, t)\nV = [0] * 6\nfor i in xrange(6):\n for j in xrange(6):\n V[i] += B[i][j] * v[j]\n V[i] %= mod\nprint V[0] + 1,V[1] + 1", "lang": "Python 2", "bug_code_uid": "65cd95f8324af0d5de11e4e9bc43d2a0", "src_uid": "ee9fa8be2ae05a4e831a4f608c0cc785", "apr_id": "0b94bf5e9baae001e483def1ee43790c", "difficulty": 2300, "tags": ["matrices", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.49836065573770494, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "n=int(input()\nx=input()\nc=0\nd=0\nfor i in range(x):\n if x[i]=='S' and x[i+1]=='F':\n c+=1\n elif x[i]=='F' and x[i+1]=='C':\n d+=1\n \nif c>d:\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "PyPy 3", "bug_code_uid": "a08b2adc268cb79f4e436e5725e629dd", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "b6be1e95a2563ee44999eed21ca70dcc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.41251778093883357, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "#\n# Uian Sol Gorgonio \n# Feb 11 2015\n# Lecture\n# http://codeforces.com/contest/499/problem/B\n#\n# ad-hoc\n#\n\nlen_lecture, num_words = map(int, raw_input().split())\n\ndictionary = {}\nfor i in xrange(num_words):\n a, b = raw_input().split()\n if len(a) <= len(b):\n dictionary[a] = a\n else:\n dictionary[a] = b\n\nlecture = raw_input().split()\nprint ' '.join(dictionary[word] for word in lecture)\n", "lang": "Python 2", "bug_code_uid": "9d8bc79f30af27ef6d67ce15887e6fc2", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "4dfd155f74267c69defb6fccd14da0c4", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9585798816568047, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from math import ceil\n\nr,x1,y1,x2,y2 = map(float,raw_input().split())\n\n\nxd = x2 -x1\nyd = y2 -y1\n\ndt = (xd**2 + yd**2)**(1/2.0)\n\nppm = 2.0*r\n\n\nprint int(ceil(mov))", "lang": "Python 2", "bug_code_uid": "569d686cacffdc9d64b82ff592f23157", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "178810865433a6e56924e7cb6ba5488d", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9993114979836727, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "\n# Author : raj1307 - Raj Singh\n# Date : 01.05.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\nfrom math import 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(max(n-r,1)))\n\ndef ceil(x,y):\n if x%y==0:\n return x//y\n else:\n return x//y+1\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 r,x1,y1,x2,y2=mi()\n\n x=2*r\n\n\n d=((x1-x2)**2+abs(y1-y2)**2)**0.5\n\n print(ceil(d/(2*r)))\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": "76ab25dcdf8ddc52f3da81e6644bad75", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "0c251766129099515a1e67cf4a84a57a", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7626339969372129, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n, x = int(input()), int(input())\n\nfor i in range(n, 0, -1):\n if not i&1:\n if x == 1:\n x = 2\n elif x == 2:\n x = 1\n else:\n if x == 1:\n x = 0\n elif x == 0:\n x = 1\n\nprint(x)\n", "lang": "Python 3", "bug_code_uid": "e9bd491525d167462f1824aa9ed7d5aa", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "812fdb3b30b5c09c0ed1c4eadb95103a", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.36, "equal_cnt": 21, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 10, "fix_ops_cnt": 20, "bug_source_code": "list = [0, 1, 2]\nfor i in range(int(input())):\n if i % 2 == 0:\n a = list[1]\n list[1] = list[0]\n list[0] = a\n else:\n a = list[2]\n list[2] = list[1]\n list[1] = a\nprint(list[int(input())])", "lang": "Python 3", "bug_code_uid": "ad7f977b4d4eb991d8da030e0092644d", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "ec444abed41601ed6e9718433011a9ad", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9770992366412213, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nshell=[0,0,0]\n\nmovement=input()\ncurrentshell=input()\n\nshell[currentshell] = 1\nwhile movement>0:\n if movement%2:\n if (shell[0]==1 or shell[1]==1):\n shell=[shell[1],shell[0],0]\n else:\n pass\n else:\n if (shell[1]==1 or shell[2]==1):\n shell=[0,shell[2],shell[1]]\n else:\n pass\n movement=movement-1\n\n\nfor i in range(0,3):\n if shell[i]==1:\n print(i)\n break\n", "lang": "Python 2", "bug_code_uid": "8d55b4a8cf4bc7bcc620c6adc2c2767f", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "354508b13d9ce2e459817509fb95155b", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9203075847605732, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 7, "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\n\ndef getpow(n):\n l = 0\n while (1 << l) < n:\n l += 1\n return l - 1\n\ncache = {1: 0, 2: 1, 3: 2, 4: 2}\ndef get(n):\n if n not in cache:\n l = 1\n r = n-1\n res = get(n//2)\n while l <= r:\n mid = (l + r) / 2\n a, b = get(mid), get(n - mid)\n epr(\"n\", n, \"mid\", mid, \"a b\", a, b)\n if abs(a - b) <= 1:\n res = max(res, a)\n res = max(res, b)\n l = mid + 1\n else:\n r = mid - 1\n cache[n] = res + 1\n # a, b = get(n//2), get(n-n//2)\n # cache[n] = max(a, b) + 1\n # if a == b:\n # cache[n] = a + 1\n # else:\n return cache[n]\n\ndef todigits(n, d):\n res = []\n while n:\n res.append(n % d)\n n //= d\n return res[::-1]\n\ndef solve(n1, n2):\n # epr(n1, n2)\n if n1 == 1 and n2 == 0:\n return 0\n if n1 == 0:\n return 1 + solve(n2, 0)\n if n2 > n1:\n return 1 + solve(n2-n1, n1)\n elif n2 == n1:\n return 2 + solve(n1, 0)\n else:\n left = n1 - n2\n if left == 1:\n return 1 + solve(2, n2 - 1)\n elif left == 2:\n return 1 + solve(1, n2)\n else:\n if left % 3 == 0:\n return 2 + solve(n2 + n1 // 3, 0)\n elif left % 3 == 1:\n return 1 + solve(2, n2 + n1 // 3 - 1)\n elif left % 3 == 2:\n return 1 + solve(1, n2 + n1 // 3)\n\n\n\nn = read_int()\nprint get(n)\n# print solve(n, 0)\n", "lang": "PyPy 2", "bug_code_uid": "7ae88e939ddcdc1b6838862d82cdc60b", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "apr_id": "84ee0d20e635d85fcec40690a86ba575", "difficulty": 1600, "tags": ["dp", "combinatorics", "dfs and similar", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9924812030075187, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n x = input()\nfor i in range(10):\n if list(x) == list(x)[::-1]:\n print(\"YES\") \n break\n x = \"0\"+x\nelse: print(\"NO\")", "lang": "Python 3", "bug_code_uid": "46e3abb3e75500acebd5de10cabe06e0", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "ea2ba1268451a95537cf01a19ab1919f", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8602620087336245, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def p(x):\n \n x=x.strip(\"0\")\n for i in range(len(x)):\n if (x[i]!=x[-i-1]):\n print(\"NO\")\n return\n \n print(\"YES\")\n \nx=input()\np(x)\n if (plin(strip(x)))cout<<\"YES\";else cout<<\"NO\";\n return 0;\n", "lang": "Python 3", "bug_code_uid": "81c065f7ae4ea6751e2964331cdc9585", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "1aa89acf4d8985dfe67bfa67fb497ae1", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.13876843018213356, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n = int(raw_input())\nstring = raw_input()\n\nresult = 0\nfor i in range(n):\n count = 0\n if(string[i] == 'R'):\n count += 1\n elif(string[i] == 'L'):\n count -= 1\n elif(string[i] == 'U'):\n count += 2\n elif(string[i] == 'D'):\n count -= 2\n \n for j in range(i+1, n):\n if(string[j] == 'R'):\n count += 1\n elif(string[j] == 'L'):\n count -= 1\n elif(string[j] == 'U'):\n count += 2\n elif(string[j] == 'D'):\n count -= 2\n if(count == 0):\n result += 1\n\nprint(result)", "lang": "Python 2", "bug_code_uid": "1fa1775d546cac05594665a3c73d2543", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "bbb3d1bb76f06ce91a74b4453287669d", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.84765625, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "l,d,v,g,r=map(int,input().split())\nt=d/v\nc=0\ni1=0\ni2=g\nwhile(not(i1t)):\n c+=1\n if(c%2!=0):\n i1=i2\n i2=i2+r\n else:\n i1=i2\n i2=i2+g\nif(c%2!=0):\n t=i2\nt+=(l-d)/v\nprint(t)", "lang": "PyPy 3", "bug_code_uid": "95b9ad81a2d8a8835d948d4f711076f5", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "02299f6aca2503b17e2c254227ab63c7", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "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": "l,d,v,g,r=map(int,input().split())\nt=d/v\nc=0\ni1=0\ni2=g\nwhile(not(i1<=t and i2>=t)):\n c+=1\n if(c%2!=0):\n i1=i2\n i2=i2+r\n else:\n i1=i2\n i2=i2+g\nif(i1==t or i2==t):\n c+=1\n\nif(c%2!=0 and (i1==t or i2==t)):\n t=i2+g\nelif(c%2!=0):\n t=i2\nt+=(l-d)/v\nprint(t)", "lang": "PyPy 3", "bug_code_uid": "0731f5aaf58f44cc8efe8bf97a1a6c6d", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "02299f6aca2503b17e2c254227ab63c7", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9813829787234043, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from sys import stdin,stdout\nfrom math import gcd, ceil, sqrt\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\n\nl, d, v, g, r = iia()\nt = d / v\nif t % (g + r) >= g:\n t += g + r - t\nt += (l - d) / v\nprint(t)", "lang": "PyPy 3", "bug_code_uid": "7be5b09d1336b91fd7c6dead3370939b", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "ac23f0600705fe0ed989164b3aaed13b", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9751908396946565, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "# arr=list(map(int,input().split()))\n# arr=sorted([(n-int(x),i) for i,x in enumerate(input().split())])\n# arr=[int(q)-1 for q in input().split()]\n# from collections import Counter\n# n=int(input())\n# n,k=map(int,input().split())\n# arr=list(map(int,input().split()))\n# for i in range(m):\n#for _ in range(int(input())):\n#n=int(input())\n\nl,d,v,g,r=map(int,input().split())\nt1=d/v\n#print(t1)\nslot=t1//(r+g)\nt1=t1-slot*(r+g)\nif t1<=g:\n wait=0\nelse:\n wait=(r+g)-t1\n\n#print(wait)\ntotal=wait+l/v\nprint(\"%.8f\"%total)", "lang": "PyPy 3", "bug_code_uid": "f8ed74703aae8cc90b8554afcd51f870", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "cf6841f83c6f9fb97de64dcea8ada257", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8440944881889764, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "l,d,v,g,r=map(int,input().split()) \n\ns=0\ni=0\nt=0\nwhile(s<=d):\n if i%2==0:\n if (s+g*v)<=d:\n t+=g\n i+=1 \n else:\n break \n else:\n if (s+r*v)<=d:\n t+=r\n s=d\n break\nprint(t+(l-s)/v)", "lang": "PyPy 3", "bug_code_uid": "0c5f1c74431720a6ad400f104ef72cb4", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "af70a3ebf6d2aec07bc3be1b31d66f97", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.909433962264151, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n,m,r=input().split()\nn=int(n)\nm=int(m)\nr=int(r)\ns=list(map(int,input().split()))\nb=list(map(int,input().split()))\nif(s>b):\n print(r)\nelse:\n z=min(s)\n rem=int(r/z)\n #print(rem)\n total=r-(z*rem)\n k=max(b)\n j=k*rem\n total=total+j\n print(total)\n", "lang": "PyPy 3", "bug_code_uid": "4742d02d19d7ea2f0e4aafefcf95931f", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "6c5985f78b9337638cd819ea8dec29d6", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6519823788546255, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "s = input()\nk = 0\ni = 0\nwhile s != '':\n s = s.replace(s[i],'')\n i += 1\n k += 1\nprint(k)", "lang": "PyPy 3", "bug_code_uid": "5403468d98b76df2767962b206e03e22", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "c26481c13d2b06e3795f49d696ab36a1", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9854014598540146, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#!/usr/bin/env python3\n\ndef main():\n try:\n while True:\n s = input()\n a = { }\n for i in range(len(s)):\n a.add(s)\n s = s[1:] + s[0]\n\n print(len(a))\n\n except EOFError:\n pass\n\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "f76635bf4eac15f0fd3eb80e62654e2a", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "0a728839a9c870b5b2be8e6d8cbfc266", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2972427706792199, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "import math\n#525 63\n#20190929 1605\n#947 987654321987654321\ndef prime_factorization(n):\n sqrt_n = int(math.sqrt(n))\n bs = [False, False] + [True] * (sqrt_n-1)\n ps = []\n for i in range(2, sqrt_n+1):\n if bs[i]:\n if n % i == 0:\n ps.append(i)\n for j in range(2*i, sqrt_n+1, i):\n bs[j] = False\n ck = True\n # 자기자신이 소수일 경우\n for i in range(2, n):\n if n % i == 0:\n ck = False\n if ck:\n ps.append(n)\n return ps\nx, n = map(int, input().split())\nps = prime_factorization(x) # 이 부분에서 시간이 많이 걸림, 수정필요\n# 에라토스테네스의 체를 응용함\nz = 1\nmodulo = (10**9+7)\nfor i in ps:\n c = 0\n for j in range(int(math.log(n, i)), 0, -1):\n f = i ** j\n nf = n//f\n z *= pow(f, (nf - c), modulo)\n # pow(x, y, z) == pow(x, y) % z (but more faster!!)\n # prevent overflow\n # a*b%c == ((a%c) * (b%c)) % c\n c = nf\nprint(z % modulo)", "lang": "Python 3", "bug_code_uid": "9a995d20f252d313e67964f847337c77", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "63040c51d6c049c6c64bb543aa18b0e4", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.058031088082901555, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "def prime(x):\n\ta = set()\n\tif not x % 2: \n\t\ta.add(2)\n\tfor i in range(3, int(x/2) + 1, 2):\n\t\tif not x % i:\n\t\t\tif all([i % j for j in a if j < sqrt(i + 1)]): \n\t\t\t\ta.add(i)\n\treturn sorted(a)\n\ndef ge(x, p):\n\tk, l, m = 1, p, 1\n\twhile l <= x:\n\t\tif not x % l: m = l\n\t\tk += 1\n\t\tl = p ** k\n\treturn m\n\ndef fa(y, a):\n\tf = 1\n\tfor p in a:\n\t\tif p > y: break\n\t\tf *= ge(y, p)\n\treturn f\n\n\nfrom math import sqrt\n\nwith open('1.txt') as f:\n\tg = f.readline()\n\tx, n = list(map(int, g.split()))\n\na = prime(x)\nf0 = 1\nfor i in range(2, n + 1):\n\tf0 *= fa(i, a)\nprint(f0 % (10 ** 9 + 7))", "lang": "Python 3", "bug_code_uid": "812dda2e3f5244f3f95b868b2cf5690a", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "87af0e5b8d7c760b0eaf076b784a2782", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3517417162276975, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "x, n = list(map(int, input().split()))\n\na = []\nif not x % 2:\n\ta.append(2)\nfor i in range(3, int(x ** 0.5 + 1), 2):\n if not x % i:\n b = sorted(a[:])\n for j in b:\n if j * j - 1 > i:\n a.append(i)\n break\n if not i % j:\n break\n else:\n a.append(i)\n\nb = sorted(a[:])\nfor i in b:\n\tif x < 10:\n\t\tbreak\n k = x // i\n for j in b:\n if j * j - 1 > k:\n a.append(k)\n break\n if not k % j:\n break\n else:\n a.append(k)\nif not len(a):\n a.append(x)\na = sorted(a)\n\nf, mod = 1, int(1e9 + 7)\nfor p in a:\n\tm, c = n, 0\n\tk, l = 1, p\n\twhile l <= m:\n\t\tc += m // l\n\t\tk += 1\n\t\tl = p ** k\n\tf *= pow(p, c, mod)\nf = int(f)\t\nprint(f % mod)\n", "lang": "Python 3", "bug_code_uid": "4fbfa59790e7afadb4582777e2f443b2", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "87af0e5b8d7c760b0eaf076b784a2782", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9914738124238733, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import math\n\ndivisor = int(math.pow(10, 9)) + 7\n\ndef solution():\n x, n = map(int, input().split())\n primes = get_primes(x)\n print(primes)\n res = 1\n for prime in primes:\n res = (res * (helper(prime, n) % divisor)) % divisor\n print(res)\n\n\ndef get_primes(x):\n primes = []\n i = 2\n limit = int(math.sqrt(x)) + 1\n while i < limit:\n if x % i == 0:\n primes.append(i)\n while x % i == 0:\n x = x / i\n else:\n i += 1\n if x > 1:\n primes.append(x)\n return primes\n\n\ndef helper(p, n):\n k = 1\n count = 0\n p_k = p\n # res = 1\n while n >= p_k:\n count += n // p_k\n p_k = p_k * p\n # res = res * p_k\n res = pow(p, count, divisor)\n return res\n\n\nif __name__ == '__main__':\n solution()", "lang": "Python 3", "bug_code_uid": "997e5c068f36a1d3e3e4f108dc0b3faf", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "b8720a81993f43185e9b0c7f4db63d95", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9602446483180428, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "import math\nr, x, y, xn, yn = map(int,input().split(' '))\nD = pow(((x-xn)*(x-xn)+(y-yn)(y-yn)),0.5)\nif(D==0.0):\n print(0)\nelse:\n print(math.ceil(D/(2*r)))", "lang": "Python 3", "bug_code_uid": "bf32978af8d1ee74324262bb45df2e03", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "d513bb19cf8310315c791097a849dfd4", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7048260381593715, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "def solve(x,y,ind):\n\tif x==0 and y==0 and ind!=0:\n\t\treturn 0\n\tif ind==n:\n\t\treturn -ind\n\tans=0\n\tans=solve(x,y,ind+1)\n\tif c[ind]=='L':\n\t\tans=max(ans,1+solve(x-1,y,ind+1))\n\telif c[ind]=='R':\n\t\tans=max(ans,1+solve(x+1,y,ind+1)) \n\telif c[ind]=='U':\n\t\tans=max(ans,1+solve(x,y-1,ind+1))\n\telse:\n\t\tans=max(ans,1+solve(x,y+1,ind+1))\n\treturn ans\nn=int(input())\nc=input()\nprint(solve(0,0,0))\n", "lang": "PyPy 3", "bug_code_uid": "e8965586633a4bc0004946c5dc892dbc", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "f0fb4106d9066dd689a4d8f6a75e767d", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9113300492610837, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#http://codeforces.com/contest/888/problem/B\nn=int(input())\ns=input()\nl=r=u=d=0\nfor i in s:\n\tif i=='L':\n\t\tl++\n\telif i=='R':\n\t\tr++\n\telif i=='D':\n\t\td++\n\telse:\n\t\tu++\n\nans=min(l,r)*2+min(u,d)*2\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "196fd0486e5b086c6973351dc0e7a283", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "f0fb4106d9066dd689a4d8f6a75e767d", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9427860696517413, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import sys\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 \n sys.stdin = io.BytesIO(sys.stdin.read())\n input = lambda: sys.stdin.readline().rstrip()\n\nRS = raw_input\nRI = lambda x=int: map(x,RS().split())\nRN = lambda x=int: x(RS())\n''' ...................................................................... '''\n\ndef valid(a,b,c,n):\n a,b,c = sorted([a,b,c])\n\n if c>n: return 0\n if (a,b,c) in memo: return 0\n\n if a+b<=c: return 0\n if a+c <=b: return 0\n if b+c<=a: return 0\n memo.add((a,b,c))\n return 1\n\nn = RN()\nmemo = set()\nans = 0\nfor i in xrange(1,n+1):\n for j in xrange(1,i+1):\n k = i^j\n\n ans += valid(k,j,i,n)\n\nprint ans\n", "lang": "PyPy 2", "bug_code_uid": "b29e5926311f01243074fc4a8f2e7c68", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "e32020e4290152512a3280099049e58a", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.815657715065999, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "n, k, x = map(int, input().split())\n\nballs = list(map(int, input().split()))\n\n\ndef conta_pares(vet, num):\n pares = []\n for i in range(n-1):\n if balls[i] == balls[i+1] == num:\n pares.append(i)\n pares.append(i+1)\n return pares\n\n\n\nif n < 2:\n\tprint(0)\n\texit()\nlista_pares = conta_pares(balls, x)\n\nif lista_pares == []:\n\tprint(0)\n\texit()\n\npar = False\nmaximo = 2\nfor i in range(0, len(lista_pares)-1, 2):\n\t\n il, ir = lista_pares[i], lista_pares[i+1]\n pontos = 2\n while True:\n\t\n if il>0 and ir < n-1 and balls[il-1] == balls[ir+1]:\n\t\t\n if il-2 >= 0 and balls[il-2] == balls[il-1]:\n pontos += 3\n il -= 2\n if ir+2 < n and balls[ir+2] == balls[ir+1]:\n pontos += 1\n ir += 2\n elif ir+2 < n and balls[ir+2] == balls[ir+1]:\n pontos += 3\n ir += 2\n else:\n if pontos > maximo:\n maximo = pontos\n break\nprint(maximo)\n", "lang": "Python 3", "bug_code_uid": "a79507cf3204066e3c32cb6d029192e6", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "7fc64ef639ec7c543dc948cee972c6e6", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9976019184652278, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n, k, x = map(int, input().split())\nballs = list(map(int, input().split()))\nresp = 0\nfor c in range(n):\n\ts = balls.copy()\n\ts.insert(c, x)\n\twhile len(s) > 2:\n\t\tl = len(s)\n\t\tfor i in range(2, len(s)):\n\t\t\tif s[i-2] == s[i-1] == s[i]:\n\t\t\t\tp = i + 1\n\t\t\t\twhile p < len(s):\n\t\t\t\t\tif s[i] != s[p]:\n\t\t\t\t\t\tbreak\n\t\t\t\t\tp += 1\n\t\t\t\ts = s[:i-2] + s[p:]\n\t\t\t\tbreak\n\t\tif len(s) == l:\n\t\t\tbreak\n\tresp = max(resp, n - len(s))\nprint(resp)\n.\n", "lang": "Python 3", "bug_code_uid": "b3dff7b7329c4cbf7725c9b272331de1", "src_uid": "d73d9610e3800817a3109314b1e6f88c", "apr_id": "268ebe8fee244e64762ec254f43876ed", "difficulty": 1400, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9983726606997559, "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 *\n#from fractions import *\nfrom bisect 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\")\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\ns=input()\nat=s.index('at')\ns=list(s)\ns[at:at+2]=['@']\n#print(s)\n\n\nn=len(s)\nfor i in range(1,n):\n #print(s[i:i+3])\n if(s[i:i+3]==['d','o','t']):\n #print()\n if(i!=len(s)-3):\n s[i:i+3]=['.']\nprint(*s,sep=\"\")", "lang": "PyPy 3", "bug_code_uid": "38feac37b8627fa0ea6be08c14b9aa06", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "aa0fd0d85b3baedd29d5c9c69a3daa45", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8905775075987842, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "s=input()\n\ngk=s.replace(\"at\", \"@\")\ngk=gk.replace(\"dot\", \".\")\n#print(gk)\nn=len(gk)\nk=list(gk)\nif(k[0]=='.'):\n\tk[0]=\"dot\"\nif(k[n-1]=='.'):\n\tk[n-1]=\"dot\"\nif(k[0]=='@'):\n\tk[0]=\"at\"\nif(k[n-1]=='@'):\n\tk[n-1]=\"at\"\n#s=string(k)\nfor x in range(len(k)):\n\tprint(k[x],end=\"\")\n#print(k)\t\n\n#//print(len(gk))", "lang": "PyPy 3", "bug_code_uid": "d8f75c70d8b237bf2a2491ad8ece5079", "src_uid": "a11c9679d8e2dca51be17d466202df6e", "apr_id": "febb800f74b29e715dff61e99f71feb0", "difficulty": 1300, "tags": ["implementation", "expression parsing"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9427017984107068, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "MAX = 101 \nNINF = -22222222222\nbase = [-1]*MAX\ndp = [ [ base[:] for i in range(MAX)] for j in range(MAX)] \ns1 = \"\"\ns2 = \"\"\ns3 = \"\"\nrev_s3 = \"\"\nl1 = \"\"\nl2 = \"\"\nl3 = \"\"\n\n\n\ndef foo(i, j, k):\n\tif k == l3 :\n\t\treturn \"\", NINF\n\tif i == l1:\n\t\treturn \"\", 0\n\tif j == l2:\n\t\treturn \"\", 0\n\tif dp[i][j][k] != -1:\n\t\treturn dp[i][j][k]\n\tans1, len1 = foo( i + 1, j, k )\n\tans2, len2 = foo( i , j + 1, k )\n\tlen3 = NINF\n\tans3 = \"\"\n\tif s1[i] == s2[j]:\n\t\tif s1[i] == s3[k]:\n\t\t\tif s1[i] == s3[0]:\n\t\t\t\tans3, len3 = foo(i+1, j + 1, 1 )\n\t\t\telse:\n\t\t\t\tans3, len3 = foo(i+1, j + 1, 0 )\n \n\t\t\tans3 += s1[i]\n\t\t\tlen3 += 1\n\t\telse:\n\t\t\tif s1[i] == s3[0]:\n\t\t\t\tans3, len3 = foo(i+1, j + 1, 1 )\n\t\t\telse:\n\t\t\t\tans3, len3 = foo(i+1, j + 1, 0 )\n\t\t\tans3 += s1[i]\n\t\t\tlen3 += 1\n\n\tif rev_s3 in ans1:\n\t\tlen1 = NINF\n\tif rev_s3 in ans2:\n\t\tlen2 = NINF\n\tif rev_s3 in ans3:\n\t\tlen3 = NINF\n\n\tif len1 > len2:\n\t\tif len1 > len3:\n\t\t\tdp[i][j][k] = ans1, len1 \n\t\telse:\n\t\t\tdp[i][j][k] = ans3, len3\n\telse:\n\t\tif len2 > len3:\n\t\t\tdp[i][j][k] = ans2, len2\n\t\t\t\n\t\telse:\n\t\t\tdp[i][j][k] = ans3, len3\n\treturn dp[i][j][k]\n\ns1 = raw_input()\ns2 = raw_input()\ns3 = raw_input()\nrev_s3 = s3[::-1]\nl1 = len(s1)\nl2 = len(s2)\nl3 = len(s3)\n\nans = foo(0,0,0)\nif ans[1] <= 0 :\n\tprint(0)\nelse:\n\tprint(ans[0][::-1]\t)", "lang": "Python 2", "bug_code_uid": "3db13cc259f192aaf0689167588b3bdc", "src_uid": "391c2abbe862139733fcb997ba1629b8", "apr_id": "d95b6d4a7bedb867dbe4602a5cc2c63d", "difficulty": 2000, "tags": ["dp", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.057007125890736345, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n=int(input())\nm=int(input())\na=int(input())\nb=int(input())\ni=0\ns=0\nwhile i<=n:\n\ts+=b\n\ti+=m\n\tif i==n:\n\t\tprint(s)\n\t\texit(0)\ni-=m\ns-=b\nwhile i<=n:\n\ts+=a\n\ti+=1\n\tif i==n:\n\t\tprint(s)\n\t\texit(0)\n", "lang": "Python 3", "bug_code_uid": "337d53606cd4cc78d72ef170b1011b53", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "8bb899c18fcae4c2f0422d301c1a4ede", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4337748344370861, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "nmab = [int(x) for x in input().split()]\nprice = 0\nif nmab[1] * nmab[3] < nmab[2]:\n\twhile nmab[0] > 0:\n\t\tprice += nmab[3]\n\t\tnmab[0] -= nmab[1]\nelse:\n\twhile nmab[0] > 0:\n\t\tprice += nmab[2]\n\t\tnmab[0] += 1\nprint(price)", "lang": "Python 3", "bug_code_uid": "d771634522bd5a34e8f20e26f6bae432", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "dd64bcdaf3bdcd73db3fabe214281ec4", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9742268041237113, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nk = int(raw_input())\na = [0] * 10\n\nfor i in range(4):\n\ts = str(raw_input())\n\tfor si in s:\n\t\tif si == '.': a[0] += 1\n\t\telse: a[int(si)] += 1\nif max(a) > 2 * k: print 'NO'\nelse: print 'YES'\n", "lang": "Python 2", "bug_code_uid": "32ca281259d77141902d3b99e2ffda93", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "683a4c487de9479dae25e82f2d3f7a8f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6854990583804144, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n=int(raw_input())*2\na=[]\nfor i in range(4):\n tmp=(raw_input()).replace('.','')\n for x in tmp:a.append(int(x))\nwhile len(a)-n>0:\n a=sorted(a)\n for x in range(0,n):\n del a[0]\n a=map(lambda x:x-1,a)\n if 0 in a:\n print 'NO'\n exit()\nprint 'YES'", "lang": "Python 2", "bug_code_uid": "03c1f2c060790821ba00157019fd7cc6", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "apr_id": "725570ab8028dc5a71c516abdb652e44", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5428973277074542, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import math\n(x,y,l,r) = (int(i) for i in input().split())\n\nvvrs = []\n\nfor i in range(60):\n\tfor j in range(60):\n\t\tcur = x**i + y**j\n\t\tif cur>=10**18:\n\t\t\tbreak\n\t\tvvrs.append(cur)\n\n\nmaxcnt = 0\ncurcnt = 0\nfor i in range(l,r+1):\n\tif i not in vvrs:\n\t\tcurcnt+=1\n\telse:\n\t\tif curcnt>maxcnt:\n\t\t\tmaxcnt = curcnt\n\t\tcurcnt = 0\n\nprint(max(maxcnt,curcnt))", "lang": "Python 3", "bug_code_uid": "3f13879289d41bba7c90a92b7134fdc5", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "566e7076a04817f1794ce66db2de11fc", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3127147766323024, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "from math import log,pow\nimport enum\nx,y,l,r= [int(x) for x in input().split()]\ns1 = [x for x in range(l,r+1)]\ns3 = [l-1,r+1]\nfor b in range(60):\n\tfor c in range(60):\n\t\ts3.append(x**b+y**c)\nans = 0\ns3.sort()\nfor i in range(len(s3)-1):\n\tans = max(ans, min(r,s3[i+1]-1)-max(l,s3[i]+1) +1)\n\tif s3[i]>r: break\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "c90a3218419f23630c2946cabc4b4a2c", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "fcec48e6b298d41043e441410e87125f", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8147100424328148, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/env python3\n\nimport sys\ndef get_ints():\n return map(int, sys.stdin.readline().strip().split())\n\nn, m, a, b = get_ints()\n\n# n Nombre de billets à acheter\n# m Nombre de billets dans un lot\n# a Prix d'un billet unitaire\n# b Prix de m billets en lot\n\nif (a <= m/b):\n prix = n*a\nelif (a < b):\n prix = min(b, (n%m)*a) + int(n/m)*b\n\nprint(prix)\n", "lang": "PyPy 3", "bug_code_uid": "f7c03897a047261881c355f17b4c06ac", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "28c388c85e6267a6e009bf998e0f2a17", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9844020797227037, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l1 = input()\nl2 = set(input().split())\nl3 = set(input().split())\nl2 = [int(x) for x in l2]\nl3 = [int(x) for x in l3]\nl2.sort()\nl3.sort()\nfor x in l2:\n if x in l3:\n print(x)\n done=1\n break\nif not done: print(str(min(min(l2),min(l3)))+str(max(min(l2),min(l3))))", "lang": "PyPy 3", "bug_code_uid": "bbcdc2d332ca4696cf9e2f7e9401da23", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "e491ad320b7060bd3beac0391d2e8615", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.509090909090909, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "print(eval(\"{0}*{1}*{2}-({0}-1)*({1}-1)*({2}-1)\".format(int(input()),int(input()),int(input())))))", "lang": "PyPy 3", "bug_code_uid": "ca1abb8520c467acc3d8b4492fc4a8c8", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "7bccd4eaf622770d165cb15f673d8890", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9261744966442953, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def arr_inp(n):\n if n == 1:\n return [int(x) for x in stdin.readline().split()]\n elif n == 2:\n return [float(x) for x in stdin.readline().split()]\n else:\n return [str(x) for x in stdin.readline().split()]\n\n\nfrom sys import stdin\n\na, ans = sorted(arr_inp(1)), 0\n\nfor i in range(a[1]):\n ans += (a[0] + i) * 2\n\n\nfor i in range(a[2] - a[1] - 1):\n ans += (a[0] + a[1] - 1)\n\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "ad956009d6370152967dda722453f932", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "96033311a89da112520f1d4c52732a31", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.891566265060241, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "from sys import stdin\na,b,c=map(int,stdin.readline().split())\nprint(2*(a+b+c))", "lang": "PyPy 3", "bug_code_uid": "86d82a40ac808d2901ac8673681e8c24", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "667bf2d01f70cfa16d6ada80c6d20b7e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.34965034965034963, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n, m = input()\na = list(map(int, input().split(' ')))\nb = list(map(int, input().split(' ')))\nmin_a = min(a)\nmin_b = min(b)\nif min_a == min_b:\n print(min_a)\nelse:\n print(str(min(min_a, min_b))+str(max(min_a, min_b)))", "lang": "Python 3", "bug_code_uid": "773903da4f6e073b14f7e8d793148659", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "69c651da566a75e9765b7355bfb5ac26", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6784810126582278, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "n=int(input())\nl=list(map(int,input().split()))\nif x[0]==1:\n maxim=0\nelse:\n maxim=1\nfor i in range(n):\n for j in range(i+1,n):\n maxim=max(maxim,l[:i].count(1)+l[j+1:].count(1)+l[i:j+1].count(0))\nprint(maxim)", "lang": "Python 3", "bug_code_uid": "44ba5895371ab360d471473bfaa032f6", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "f1681a8a725605ceb76fe9ba4ffdf149", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8700564971751412, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\nlist1=input()\nsum1=list1.count('1')\nlist1=list1.split()\nfor a in range(1,n+1):\n for i in range(n):\n list2=list1[i:a+i]\n suma=sum1-int(list2.count('1'))+int(list2.count('0'))\n ans=max(sum1,suma,ans)\nprint(ans) ", "lang": "Python 3", "bug_code_uid": "308814371615310abb4d34554ef5fc83", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "0640867200448494916ac1b0fe0f301f", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8532110091743119, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "n=int(raw_input())\na=map(int,raw_input().split())\nk=[0 for i in xrange(10**9+1)]\nd={}\nfor i in a:\n if str(i) not in d:\n d[str(i)]=1\n else:\n d[str(i)]+=1\n \n \n k[i]+=1\n#print k,d \nc=0\nfor j in set(a):\n #print \"j\",j\n if d[str(j)]==1:\n c=c+int(j)\n else:\n c=c+int(j)\n d[str(j)]-=1\n p=int(j)-1\n while d[str(j)]!=0:\n #print d,d[str(j)]\n if k[p]==0:\n #print\"p\",p\n c=c+p\n d[str(j)]-=1\n #d[str(p-1)]=1\n k[p]=1\n #print k\n else:\n p-=1\n \nprint c \n \n \n \n", "lang": "Python 2", "bug_code_uid": "3bce840b29bcb6921e52566c7ed02427", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "3dbb86ca040375024fe4d25f89d7899a", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9355432780847146, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=raw_input()\nl=raw_input().split()\nl2=[]\nfor i in l:\n l2.append(int(i))\nl2=sorted(l2)\nsu=0\ns=set()\nfor i in l2[::-1]:\n q=True\n for j in xrange(i, 0, -1):\n if q and (not j in s):\n su+=j\n s.add(j)\n q=False\nprint su\n", "lang": "Python 2", "bug_code_uid": "5832c12671283927827fc34a15482a45", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "ceefbef303355b3a9073399f47915c5c", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9690721649484536, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\na = list(map(int, input().split()))\nfor i in range(n - 2, -1, -1):\n a[i] = max(min(a[i], a[i + 1] - 1), 0)\nprint(sum(a))\n", "lang": "PyPy 3", "bug_code_uid": "4e3d94d8ea8983418d23313824d13cfa", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "c04c9f9ab55aca34aecff0b25a2b58f7", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.42735042735042733, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nballs = list(map(int,input().split()))\nballs.sort()\n\ndef answer(balls):\n for i in range(n-2):\n if balls[i+2] == balls[i+1] + 1 == balls[i] + 2:\n return \"YES\"\n return \"NO\"\n\nprint(answer(balls))\n", "lang": "PyPy 3", "bug_code_uid": "eb5ba126f36034d3b97db49002bde745", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "7d95190855417153361e377113db7e3a", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.15254237288135594, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": " Print(hii)", "lang": "PyPy 3", "bug_code_uid": "1b376df1979814bca12e0674b5ae5d45", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "32c5bb1bb22b5b201ea37274ab9541cf", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9635036496350365, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "__author__ = 'zhan'\n\nprint(\"black\" if input()&1 else \"white\\n1 2\")", "lang": "Python 3", "bug_code_uid": "03f8b8ba6884f8dde6aed2adab0da6eb", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "0afb2769da02c16ce4f2522632f35bb8", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9723756906077348, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n = input()\nif n % 2 == 1:\n print(\"black\")\nelse:\n print(\"white\")\n print(\"1 2\")\n", "lang": "Python 3", "bug_code_uid": "0d11e7afca508ab7fbdb8ded1f5d4662", "src_uid": "52e07d176aa1d370788f94ee2e61df93", "apr_id": "fb692bf8a5d4903efdbfec6cdd35e395", "difficulty": 1700, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7515527950310559, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n = int(input())\ncount = 0\n\nfor k in range(3, n+1):\n for i in range(k//2+1, k):\n for j in range(k-i+1, i):\n if not k^i^j: count+=1\n\nprint(count)\n ", "lang": "Python 3", "bug_code_uid": "ff6986ebc4d6266042ffc8b65a8fb709", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "a356c3af767a8a6acc46dd135c81cbc9", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9891696750902527, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "import time,os\na=0:b=0\nprint (sum(0 < (i ^ j) <= j <= i and (i ^ j) + j > i for i in range(1, int(input()) + 1) for j in range(1, i + 1)))", "lang": "Python 3", "bug_code_uid": "e36ab3ed5aa8335bc0ffe68e6a9f41dd", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "66e83fd7e62a37b631e81e2860e6dbbe", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8266666666666667, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "n=int(input())\nk=0\nfor i in range(1,n+1):\n for j in range(i+1,n+1):\n if i^j<=n and i^jj-i:\n k+=1\nprint(k//3)", "lang": "Python 3", "bug_code_uid": "4199770b851c7a49360c8364ed5d84df", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "b0162e078b0bbdfcffaef81c0649ae08", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7128712871287128, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "t = input()\ni = t.rfind('0')\nif i != -1: t = t[:i]\nk = len(t) // 2\nprint(['YES', 'NO'][t[:k] == t[-k:][::-1]]", "lang": "Python 3", "bug_code_uid": "c8a461f48b0afbcd22c143f077a37945", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "528b5994926332882766c67dd03bbc47", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.29343629343629346, "equal_cnt": 6, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "n=eval(input())\ns=input()\ni=0\nc=0\nwhile(i1:\n ans+=1\n else:\n pass\n x=0\n y=0\n\nprint(ans)", "lang": "Python 3", "bug_code_uid": "b6ad961b241723c7880c478fad1135d0", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "d092dd874b826e49cf3498d65f29257f", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.999315537303217, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\n\ntask = input()\nl = [[0,0]]\ndrp = {}\n\ndrp[(0,0)] = 1\nc = 0 \n\nfor i in task :\n\tif i == 'U' :\n\t\tl.append([ l[-1][0] , l[-1][1]+1 ])\n\t\tif tuple(l[-1]) not in drp :\n\t\t\tdrp[tuple(l[-1])] = 1\n\t\telse:\n\t\t\tdrp[tuple(l[-1])] += 1\n\telif i == 'D' :\n\t\tl.append([ l[-1][0] , l[-1][1]-1 ])\n\t\tif tuple(l[-1]) not in drp :\n\t\t\tdrp[tuple(l[-1])] = 1\n\t\telse:\n\t\t\tdrp[tuple(l[-1])] += 1\n\telif i == 'L' :\n\t\tl.append([ l[-1][0]-1 , l[-1][1] ])\n\t\tif tuple(l[-1]) not in drp :\n\t\t\tdrp[tuple(l[-1])] = 1\n\t\telse:\n\t\t\tdrp[tuple(l[-1])] += 1\n\t else :\n\t\tl.append([ l[-1][0]+1 , l[-1][1] ])\n\t\tif tuple(l[-1]) not in drp :\n\t\t\tdrp[tuple(l[-1])] = 1\n\t\telse:\n\t\t\tdrp[tuple(l[-1])] += 1\nfor k,v in drp.items() :\n\tif v >=2 :\n\t\tc += (v*(v-1))//2\n\nprint(c)\n", "lang": "Python 3", "bug_code_uid": "8556c85e8d5ba38dcf8d3961e8b472d3", "src_uid": "7bd5521531950e2de9a7b0904353184d", "apr_id": "01b01a58e67382893ec64f43b8d4b7c8", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9941812136325852, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "def get_input():\n num = input()\n line = input()\n test_cases = line.split()\n result = []\n for i in test_cases:\n result.append(int(i))\n return result\n\ndef send_balls(n,l):\n l = sorted(l)\n l2 = l.copy();\n for x in range(0,n-2):\n if l[x]==l[x+1]:\n l2.remove(l[x+1])\n else:\n for i in range(0,len(l2)-2):\n if l2[i+1]-l[i]<2 and l2[i+2]-l[i+1]<2 and l2[i+1]!=l[i] and l2[i+2]!=l[i+1]:\n return \"YES\";\n return \"NO\";\n\n\ntest_cases = get_input()\nprint(send_balls(len(test_cases),test_cases))\n \n \n", "lang": "Python 3", "bug_code_uid": "5f277f8adf231b214391f7d54b117e92", "src_uid": "d6c876a84c7b92141710be5d76536eab", "apr_id": "61256f78d5f73eb45999e2058bb42b3d", "difficulty": 900, "tags": ["brute force", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6544622425629291, "equal_cnt": 23, "replace_cnt": 10, "delete_cnt": 14, "insert_cnt": 0, "fix_ops_cnt": 24, "bug_source_code": "a,b,c=[int(x) for x in input().split()]\na1 = list(map(int,input().strip().split()))[:a]\nb1 = list(map(int,input().strip().split()))[:b]\nc1=max(a1)\nc2=min(a1)\nc3=max(b1)\ns=c1*c2\nk=c3*c3\nz=0\nif(s<=k):\n z = c + k-s\nelse:\n z=c+0;\nprint(z)\n", "lang": "Python 3", "bug_code_uid": "c5f27a1f7e21a541049029c770358eef", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "dc3433108c64e169e62f6e21b01c2cec", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8365019011406845, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "datos =input()\nd = datos.split()\n\nn = int(d[0])\nm= int(d[1])\nr = int(d[2])\n\ns = input()\ns1 = s.split()\nsf = sorted(s1)\n\n\nb = input()\nb1 = b.split()\nbf = sorted(b1)\n\nC = int(sf[0]) #Valor Menor Compra\nV = int(bf[-1]) #Valor Mayor Venta\n\nif C < V:\n I = r// C\n Rinv = r - (C*I)\n G = I*V\n rf = G + Rinv\n print(rf)\n\nelse:\n print(r)\n", "lang": "Python 3", "bug_code_uid": "489680a64926ee79fd2de9d6847b7fea", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "9ff0efd747552b4e339eebea0b198413", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.31808278867102396, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "n, m, r = map(int, input().split())\ns = [int(c) for c in input() if c != ' ']\nb = [int(c) for c in input() if c != ' ']\n\nif min (s) > max(b):\n print(r)\nh = r - r // min(s) * min(s)\nprint(r // min(s) * max(b) + h)", "lang": "Python 3", "bug_code_uid": "ce4064c731b99acd352e180d6d2f0982", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "apr_id": "8100922aa722fe1137279fc41786e720", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.30116358658453113, "equal_cnt": 11, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "# cook your dish here\nn=int(input())\na=list(map(int,input().rstrip().split()))\ntillnoq=0\ncount1=0\ncount0=0\nif n==1 and a[i]==1:\n print(1)\nelse:\n for i in range (n):\n for j in range (i,n):\n if a[j]==1:\n count1+=1\n else:\n count0+=1\n #print(count0,count1,i,j)\n numzeroabs=count0-count1\n if numzeroabs>tillnoq:\n left=i\n right=j\n tillnoq=numzeroabs\n #print(numzeroabs)\n count0=0\n count1=0\n cntr=0 \n for i in range (left):\n if a[i]==1:\n cntr+=1\n for i in range (right,n):\n if a[i]==1:\n cntr+=1\n\n print(cntr+tillnoq)\n", "lang": "Python 3", "bug_code_uid": "9ba755015e85b726e1c3d254da0e6b7f", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "febc3c2210684353e23cf9226f138714", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9158878504672897, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "s = raw_input()\nfor i in s:\n\tif i=='h':\n\t\tf = 1\n\tif f==1 and i=='e':\n\t\tf=2\n\tif f==2 and i=='l':\n\t\tf=3\n\telif f==3 and i=='l':\n\t\tf = 4\n\tif f==4 and i=='o':\n\t\tf=5\nif f==5:\n\tprint(\"YES\")\nelse:\n\tprint\"NO\"\n", "lang": "Python 2", "bug_code_uid": "42d59c05e04188ced7fd4479580320d2", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "db43ef4f89f56cc3582d443bee42c488", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9935483870967742, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\nm = (((n-1)*n*(2*n-1)) // 6) + ((n*(n-1)) // 2) - 2)\nprint(m)", "lang": "Python 3", "bug_code_uid": "d09b21a37272824544409bc2aeb37135", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "3264216236d6268ffd7628bf27a78f85", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5553047404063205, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "#codeforces_1140D_live\ngi = lambda : list(map(int,input().strip().split()))\nn, = gi()\nans = 0\nx = 1\nstep = 1\nwhile 1:\n\tx = 1\n\twhile x + 2*step <= n + 1:\n\t\tif x + 2*step == n+1:\n\t\t\tans += x*(x+step)\n\t\telse:\n\t\t\tans += x*(x+step)*(x+2*step)\n\t\tx += 2*step\n\tstep += 1\n\tif step >= n//2:\n\t\tbreak;\nprint(ans)\n", "lang": "Python 3", "bug_code_uid": "173766cdc5471d8751e01a0e442a0976", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "49dc92ec925810bde20c8d8066a4ea3a", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8591549295774648, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "n=int(input()\nsu =0\nfor i in range(2,n-1)\n su=su+(i)*(i+1\nprint(su)\n \n\n", "lang": "Python 3", "bug_code_uid": "a4acfd27510494ddcc7e9e6a6724007c", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "fb2d27223e476c97bed87314d683fccd", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6305418719211823, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "//f = open('Text.txt',\"r\")\nn = int(f.read())\nres = 0\n\nfor x in range(3, n+1):\n res += 1*(x-1)*(x)\n\nprint(res)\n", "lang": "Python 3", "bug_code_uid": "5dc0fb3dec3684bf970744467db054ad", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "5b2c6bddb0919ea48b5d7e49352acd2c", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9880478087649402, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def main():\n\tx = int(input())\n\tans = 0\n\tfor i in range(2, x):\n\t\tans += i*(i+1)\n\tprint ans\n\nif __name__ == '__main__':\n\tmain()", "lang": "Python 3", "bug_code_uid": "234a60fbb4949495108b46ee6de4a17d", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "a91ed519605cdb586a36633de2a2a58c", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8143712574850299, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\ni=2\nj=3\nsum=0\nwhile(j<=n):\n sum+=(i*j)\nprint(sum) \n \n ", "lang": "Python 3", "bug_code_uid": "04a41938b1f89b33258ca33cf7681f55", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "e5a23cd8ad0e8e6c17bea929ac1da428", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.43155452436194897, "equal_cnt": 27, "replace_cnt": 12, "delete_cnt": 10, "insert_cnt": 5, "fix_ops_cnt": 27, "bug_source_code": "n = int(input())\n\n\ndef cost(i, j, k):\n return i * j* k\n\n\ndef min_tri(i, j, n):\n if j < i + 2:\n return 0\n\n res = n * (n + 1) *(n + 2) + 1\n\n for k in range(i + 1, j):\n res = min(res, (min_tri(i, k, n) + min_tri(k, j, n) + cost(i, k, j)))\n\n return res\n\nprint(min_tri(1, n, n))", "lang": "Python 3", "bug_code_uid": "8113093d4a2f5c313bf5474283ae0be2", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "3b03fb74fa7f57b223d8fb459b74cf31", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.864406779661017, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "a,b,c = map(int,raw_input().split())\n\nprint 2*(a+b+c)", "lang": "Python 2", "bug_code_uid": "436d4fdcf60fadb24cc6752d4b90fae1", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "13fdd324d49b45b28ca8360fdc6e85e0", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.16910569105691056, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "def middle(a, b, c) :\n x = a - b\n y = b - c\n z = a - c \n if x * y > 0:\n return b\n elif (x * z > 0) :\n return\n else :\n return a\na,b,c=map(int,raw_input().split())\nfirst=min(a,b,c)\nthird=max(a,b,c)\nsecond=middle(a,b,c)\nans=0\nwhile(first>0):\n\t# print first,second,third\n\tans=ans+(first+(second-1)+(third-2))*2\n\tsecond=second-1\n\tthird=third-1\n\tfirst=first-1\nprint ans", "lang": "Python 2", "bug_code_uid": "bbcc1d29737603f9c221e9eea9dab637", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "7cf9a471ee9a96cf6c16e7dd28aebb52", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9680851063829787, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "#Ya Hassan Mojtaba\nn=int(input())\nif(n>=1)\n print(int(3**(n-1)%1000003))\nelse\n print(1)", "lang": "PyPy 3", "bug_code_uid": "324d4a6860f4164c0b19620a5348b90d", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "60a2e882e4558c59c68fed859782fbd1", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.837378640776699, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "def findSame(a):\n notFound = True\n res = 0\n for i in range(1, len(a)):\n curA = a[0:i]\n if notFound:\n if a[i] in curA:\n notFound = False;\n res = i\n return res\n\nn = input()\nai = list(map(int, input().split()))\n\nmodif = ai\ninx = 1\nwhile inx != 0:\n inx = findSame(modif)\n if inx > 0 and modif[inx] > 0:\n modif[inx] -= 1\n\nprint(sum(modif))\n", "lang": "Python 3", "bug_code_uid": "7a6f1f47f7369decb7b6effdbf1b0087", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "apr_id": "29697fb358b9f185cb5f80ef5b77949c", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.52, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "import math\n\ndef solve():\n n = int(input())\n print(math.ceil(n / 2), end = \" \")\n if n % 2 != 0:\n print(math.floor(n / 2), end = \"\")\n print()\n\nt = 1\n# t = int(input())\nwhile t--:\n solve()", "lang": "PyPy 3", "bug_code_uid": "3a802138a912771eb6c621a15d8b1b9f", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "24423218aa54be9d937f5abe6754d171", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2692307692307692, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "n=int(input())\nif n==1:\n print(1)\n exit()\nif n==2:\n print(2)\n exit()\nif n%2==0:\n print(n//2)\nelse:\n print(n-1,n-(n-1))", "lang": "PyPy 3", "bug_code_uid": "8194a595e27c90f621a0feded0f7b043", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "0121ff0347ccba50e33e51cc5b4c498e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9951219512195122, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import sys\nimport math\nimport bisect\n\ndef main():\n n = int(input())\n A = []\n for i in range(n):\n val = 1\n while len(A) and A[-1] == val:\n A.pop()\n val <<= 1\n A.append(val)\n print(' '.join(list(str(a) for a in A)))\n\nif __name__ == \"__main__\":\n main()\n", "lang": "PyPy 3", "bug_code_uid": "4ba3764ad4c47c568da676fd7bdcb953", "src_uid": "757cd804aba01dc4bc108cb0722f68dc", "apr_id": "5b97ea3d968faa81f189c4ec0e27c623", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9922480620155039, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input()\na=(n*(n+1)*(2*n+1))//6\nb=(n*(n+1)//2)\nprint(a-b-2)", "lang": "PyPy 3", "bug_code_uid": "2344315994c9b3ec24e638a9e187bd18", "src_uid": "1bd29d7a8793c22e81a1f6fd3991307a", "apr_id": "99fa8dff44b68c6c2387b73e45c6b0a9", "difficulty": 1200, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2033898305084746, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "R = lambda:map(int,raw_input().split())\n\nn,k = R()\n\na = R()\nb = R()\n\nb.sort()\nk=0\nfor i in xrange(len(a)):\n if a[i]==0:\n\ta[i]=b[k]\n\tk += 1\n\n#print a\n\ns = True\nfor i in xrange(len(a)):\n prev,nxt = True,True\n if i>0: prev = a[i-1]a[i]\n s = prev and nxt\n if not s:\n\tbreak\n\nif s: \n if k>1:\n\tprint \"Yes\"\n else:\n\tprint \"No\"\nelse: \n print \"Yes\"\n", "lang": "PyPy 2", "bug_code_uid": "db613f6d5274223b6b4f6e5fab59fdf2", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "a5f1622cd27f2d6b63f7845f8b3a7170", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8011869436201781, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "a,b,c,d=map(int,input().split())\nx,y=map(int,input().split())\nif abs(a-c)%x==0 and abs(b-d)%y==0 (abs((a-c)//x)-abs((b-d)//y))%2==0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "lang": "PyPy 3", "bug_code_uid": "859e108512bd519b8ceec35f319cd7a0", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "9bea1dde2082df1e401d2496f1917735", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8369230769230769, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "int a, b, c, d = tuple(map(int, input().split()))\nint x, y = tuple(map(int, input().split()))\n\nprint(['NO', 'YES'][int(a%x == c%x and b%y == d%y)])", "lang": "PyPy 3", "bug_code_uid": "6ad68fc46e6c0bbf9bdfdfd036a0fd9b", "src_uid": "1c80040104e06c9f24abfcfe654a851f", "apr_id": "caa9c21e42e3268e4cf070723fad29ff", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7046843177189409, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import sys\n\n_gcd = lambda s, m, n : m if n==0 else s(s, n, m % n)\ngcd = lambda m, n : _gcd(_gcd, m, n)\nlcm = lambda m, n : m // gcd(m, n) * n\n\ndef gcd(m, n): m if n==0 else gcd(n, m%n)\ndef lcm(m, n): m // gcd(m,n) * n\n\n\n(x, y, a, b) = list(map(int, input().split()))\n\nz = lcm(x, y)\n\nprint(b//z-(a-1)//z)\n", "lang": "Python 3", "bug_code_uid": "cddb4b1d5025c19e325b76cfada64f5d", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "83661c5159862211c501d5fd5c8aedb8", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9325153374233128, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "def lcm(a,b):\n for i in range(b,b*b):\n if(i%a==0 and i%b==0):\n return i\n\na,b,c,d=map(int,input().split())\ne=lcm(a,b)\nif(a==1 and b==1):\n print(d-c+1)\nelse:\n value=((d)//e) -((c-1)//e)\n print(value)\n", "lang": "Python 3", "bug_code_uid": "028dc987ff4505f64b13bd33237a511c", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "376567fc57a01dc9bfc6b9610c1f7ab7", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7485069674850697, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "Fact=[]\nL=[]\n\ndef initFact():\n Fact.append(1)\n for i in xrange(1, 10):\n Fact.append(Fact[i-1]*i)\n \ndef parse(L, res):\n ret=0;\n for i in L:\n ret*=10\n ret+=i\n if res[0]=2:\n if curr*Fact[int(i)]<=target:\n L.append(i)\n search(curr*Fact[int(i)], target, res)\n L.pop()\n i-=1\n\nn=raw_input()\ns=str(raw_input())\ninitFact()\ntarget=1\nfor c in s:\n target*=Fact[int(c)]\nres=[0]\nsearch(1, target, res)\nprint res[0]", "lang": "Python 2", "bug_code_uid": "4671ca62cbb3e524290c47bc4c299d2f", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "6b4167a5e759821ba33adc1515086b6f", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.76797829036635, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "ans = 0\nfact = {}\nans = 0\noriginalVal = 1\n\n\n# (originalVal,0,1)\ndef recurse(cur,ansSoFar,valueSoFar):\n\t# print cur,ansSoFar,valueSoFar\n\tglobal ans\n\tglobal originalVal\n\tif valueSoFar > originalVal:\n\t\treturn\n\tif valueSoFar == originalVal:\n\t\tans = max(ans,ansSoFar)\n\t\treturn\n\telse :\n\t\tfor x in xrange(2,10):\n\t\t\tif cur % fact[x] == 0:\n\t\t\t\trecurse(cur/fact[x],ansSoFar*10 + x,valueSoFar*fact[x])\n\t\treturn\n\nfact[1] = 1\nfact[0] = 1\nfor x in xrange(2,10):\n\tfact[x] = fact[x-1]*x\nn = raw_input()\ndigitString = raw_input()\ndigits = list(digitString)\nfor x in digits:\n\tcurDigit = int(x)\n\toriginalVal = originalVal*fact[curDigit]\nrecurse(originalVal,0,1)\nprint ans", "lang": "Python 2", "bug_code_uid": "c5cdb6ca0e733ed24836c0a132e7ac63", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "907e8dfcd9912ca2f7fba1cf53c07d0b", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23857868020304568, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "import math\n\nhsh = {1 : 1, 2 : 2, 3 : 6, 4 : 24, 5 : 120, 6 : 720, 7 : 5040, 8 : 40320, 9 : 362880, 0 : 1}\n\nls = []\n\ndef fn(val):\n\tglobal ls\n\tif val == 1:\n\t\treturn True\n\tfor i in range(2, 10):\n\t\tif val % hsh[i] == 0 and fn(val / hsh[i]):\n\t\t\tls = ls + [i]\n\t\t\treturn True\n\treturn False\n\t\nif __name__ == '__main__':\n\t\n\tt = input()\n\ta = [int(x) for x in raw_input()]\n\tans = 1\n\tfor i in a:\n\t\tans = (hsh[i] * ans)\n\tfn(ans)\n\tls.sort(reverse=True)\n\tst = \"\"\n\tfor i in ls:\n\t\tst=st+str(i)\n\tprint st\n\t\n\t\n", "lang": "Python 2", "bug_code_uid": "3885226fde3b0976ba8f84a7fff654a9", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "117e05fb832111b7e9de28e62f20e901", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9988640666414237, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "n,m,capacity = [int(x) for x in raw_input().split()]\n\nclass Planet:\n def __init__(self):\n self.a = []\n self.b = []\n self.c = []\n self.n = \"\"\n def __repr__(self):\n return \"%s: a:%r, b:%r, c:%r\" % (self.n, self.a, self.b,self.c)\n\ndef calc_profit(p1, p2):\n #print \"%s -> %s\" % (p1.n, p2.n)\n profits = []\n for j in range(m):\n if p1.c[j] == 0:\n continue\n profit = p2.b[j] - p1.a[j]\n if profit > 0:\n profits.append((profit, p1.c[j]))\n profits.sort(reverse=True)\n load = 0\n total_profit = 0\n for p in profits:\n if load + p[1] > capacity:\n c = capacity - load\n else: \n c = p[1]\n total_profit += p[0]*c\n load += c\n if c != p[1]:\n break\n #print \"profit: %d\" % total_profit\n return total_profit \n\nps = []\n\nfor i in range(n):\n p = Planet()\n p.n = raw_input()\n for j in range(n):\n a,b,c = [int(x) for x in raw_input().split()]\n p.a.append(a)\n p.b.append(b)\n p.c.append(c)\n ps.append(p) \n \nmax_profit = -1\n\nfor n1 in range(n):\n for n2 in range(n):\n if n1 != n2:\n profit = calc_profit(ps[n1], ps[n2])\n max_profit = max(max_profit, profit)\n\nprint max_profit \n", "lang": "Python 2", "bug_code_uid": "e1d6011ab84c2c113079844264f38586", "src_uid": "7419c4268a9815282fadca6581f28ec1", "apr_id": "a3201d63384ec2440b29547865ab82e5", "difficulty": 1200, "tags": ["games", "greedy", "graph matchings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.958312405826218, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n, m, l = map(int, raw_input().split())\n\nplanet = []\n\nfor i in xrange(n):\n nome = raw_input()\n op = []\n for j in xrange(m):\n \n a, b, c = map(int, raw_input().split())\n\n op.append([a, b, c])\n\n planet.append(op)\n\n\nmaximo = 0\n\nfor i in xrange(n):\n for j in xrange(n):\n if i != j:\n pft = []\n for k in xrange(m):\n luc = planet[j][k][1] - planet[i][k][0]\n pft.append([luc, planet[i][k][2]])\n \n pft.sort(reverse=True, key=lambda tup:tup[0])\n\n qtd = 0\n ganho = 0\n for r in xrange(len(pft)):\n if qtd + pft[r][1] < l:\n ganho += pft[r][0]*pft[r][1]\n qtd += pft[r][1]\n else:\n ganho += pft[r][0]*(l-qtd)\n break\n \n if ganho > maximo:\n maximo = ganho\n\nprint maximo\n", "lang": "Python 2", "bug_code_uid": "9284684268b15d4f2eb2775bbbdc8159", "src_uid": "7419c4268a9815282fadca6581f28ec1", "apr_id": "69a34cf2916a2e8cc42ff2273972b475", "difficulty": 1200, "tags": ["games", "greedy", "graph matchings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7985611510791367, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "n = input()\na = input()\nif a[0]%2 == 0 or a[-1]%2 == 0:\n print 'No'\nelif n%2 != 0:\n print 'Yes'\nelse:\n print 'No'", "lang": "Python 3", "bug_code_uid": "ee7e1a61641e9a95c8077e2b6f3854a6", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "apr_id": "af92544a8be59912d52d4dbd07f283e0", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6411483253588517, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "a=input().split()\na[0]=int(a[0])\na[1]=int(a[1])\ns=input()\nc=set(s)\nk=0\nfor i in c:\n e=s.coint(i)\n c.get(i,e)\n continue\nfor j in c:\n k+=j.values()\nif k%a[1]==0:\n print('Yes')\nelse:\n print('NO')\n\n", "lang": "Python 3", "bug_code_uid": "def5482926093f29776e4ba447ce675a", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "51b548b33351ac623717f66d691bc2f8", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9563812600969306, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "s,k=input().split()\ns=list(s)\nk=int(k)\nn=len(s)\nfor i in range(n):\n maxi=s[i]\n maxj=0 \n for j in range(i+1,n):\n if s[j]>maxi:\n maxi=s[j]\n maxj=j \n while maxj>i:\n s[maxj],s[maxj-1]=s[maxj-1],s[maxj]\n maxj-=1 \nprint(''.join(s))\n ", "lang": "PyPy 3", "bug_code_uid": "5ea660ef8a87e5955b7a0aac0682df20", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "80a4ffdcf4f3448708fba79b4cefa287", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9904397705544933, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from math import sqrt\nn=int(input())\nif n%2==0:\n\tprint(\"NO\")\n\texit()\nmi=10000000000\nn-=1\nb=0\nfor i in range(1,int(sqrt(n))):\n\tif n%i==0:\n\t\ty=(n-i-i**2)/(2*i)\n\t\tif y==int(y):\n\t\t\tif i 0): \n a /= 10\n count+=1\n return count \n \ndef required_number(num, n, d): \n flag = 0\n power=0\n a=0\n for i in range(num,0,-1): \n power = pow(10, i) \n a = n % power \n \n if (d > a): \n flag = 1\n break\n if(flag): \n \n for j in range(0,i): \n t += 9 * pow(10, j) \n \n if(n % power ==t): \n print(n,end=\"\") \n else: \n print((n - (n % power) - 1),end=\"\") \n else: \n print(n,end=\"\") \n# Driver Code \nn,d = map(int,input().split())\n\nnum = dig(n) \nrequired_number(num, n, d) \nprint(required_number)", "lang": "PyPy 3", "bug_code_uid": "e005db9ef7e5ab61cc380ff36007d41a", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "1627e080573f732f52febc7bf9bead6f", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9032258064516129, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p,d=map(int,input().split())\np+=1\nans=p\ni=10\nwhile True:\n if p%i<=d:\n ans=p-p%i\n i*=10\nprint(ans-1)", "lang": "PyPy 3", "bug_code_uid": "6e44850686abbc8a798547dcff87eb41", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "90bdfc304270644e0582377697690b7e", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3575418994413408, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "p, d = map(int, input().split())\np = str(p)\n\ni = len(p)-1\nwhile True:\n if int(p[i:])-1 <= d:\n d -= int(p[i:])-1\n p = str(int(p)-int(p[i:])-1)\n i -= 1\n else:\n break\n \nprint(p)", "lang": "PyPy 3", "bug_code_uid": "ed487513a5382ba8415ec4b1ef643f97", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "apr_id": "7db85e46b9263e43dfc66a79cf18a5bd", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.17365269461077845, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 21 20:36:12 2017\n\n@author: MetaMemeLord-\n\"\"\"\n\nn = input()\ni = len(n)-1\nwhile i>0:\n if n[i] == '0':\n del n[i]\nfor i in range(len(n)//2):\n if(n[i]!=n[n-i-1])\n print('NO')\n else:\n print('YES')\n ", "lang": "Python 3", "bug_code_uid": "e6368aa56314cff1e97e9dd35064cca7", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "2134fd587620403dd2d45098b92e4dd7", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9994340690435767, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "p = input()\nif p == p[::-1] or len(p) == 1:\n print(\"YES\")\nelse:\n if p[0] != p[len(p) - 1] and '0' not in [p[0], p[len(p) - 1]]:\n print(\"NO\")\n else:\n cl, cr = '', ''\n for i in p:\n if i == '0':\n cl+='0'\n else:\n break\n for i in p[::-1]:\n if i == '0':\n cr+='0'\n else:\n break\n if cl == cr and p != p[::-1]:\n print(\"NO)\n else:\n if len(cl) > len(cr):\n p += ('0' * (len(cl) - len(cr)))\n if p == p[::-1]:\n print(\"YES\")\n else:\n print(\"NO\")\n else: \n p = ('0' * (len(cr) - len(cl))) + p\n if p == p[::-1]:\n print(\"YES\")\n else:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "08dfde23a501b261805f6d249a3b0316", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "d1c7e2e6757b3338acc449ae484f53f1", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6753246753246753, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "s = input()\n print( \"YES\" if s == s[::-1] else \"NO\")", "lang": "Python 3", "bug_code_uid": "acbc037b49dc9d432f5f36d466142eea", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "40126ab310a921b3c7e7e4e294c144f5", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8025889967637541, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "n=int(input())\nans=0\nfor a in range(1,n):\n for b in range(a ,n):\n for c in range(b,min(a+b,n+1)):\n if a^b^c==0:\n ans+=1\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "3d369cc7386ae3870686632b5ce069e9", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d", "apr_id": "be413ae0918468deaea27386ad01f485", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9948186528497409, "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.count('FS')< s.count('SF'):\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "c57931b33ccee1add64051fa2b02a2b0", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "c7bdc02875e85ac0429f0d253ed601ce", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.23497267759562843, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "n, m, c, d = map(int, input().split())\nt = [(d / c, 1000, 1, c, d)] + [0] * m\nfor i in range(1, m + 1):\n a, b, c, d = map(int, input().split())\n t[i] = (d / c, a, b, c, d)\nt.sort(reverse = True)\ni = p = 0\nwhile i < m + 1:\n u, a, b, c, d = t[i]\n i += 1\n if n < c: continue\n k = a // b\n p += d * k\n n -= c * k\n if n < 0:\n k = (- 1 - s) // c + 1\n n += c * k\n p -= d * k\nprint(p)", "lang": "Python 3", "bug_code_uid": "5c783e233d0773b94b6ceeb3a30c17bd", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "b522b9e473b0091fc7449d0ddaefe027", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.23497267759562843, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "n, m, c, d = map(int, input().split())\nt = [(d / c, 1000, 1, c, d)] + [0] * m\nfor i in range(1, m + 1):\n a, b, c, d = map(int, input().split())\n t[i] = (d / c, a, b, c, d)\nt.sort(reverse = True)\ni = p = 0\nwhile i < m + 1:\n u, a, b, c, d = t[i]\n i += 1\n if n < c: continue\n k = a // b\n p += d * k\n n -= c * k\n if n < 0:\n k = (- 1 - n) // c + 1\n n += c * k\n p -= d * k\nprint(p)", "lang": "Python 3", "bug_code_uid": "4b0f248d746ff2c767bf392f2859231f", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "b522b9e473b0091fc7449d0ddaefe027", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8950276243093923, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "str = raw_input()\narr = [int(s) for s in str.split(' ')]\npir = range(arr[1])\nans = range(arr[0]+1)\nfor i in range(0, arr[1]):\n str = raw_input()\n pir[i] = [int(s) for s in str.split(' ')]\nfor i in range (0, arr[0]+1):\n ans[i] = (i / arr[2])*arr[3]\n\nfor j in range(0, arr[1]):\n am = pir[j][0]/pir[j][1]\n for i in range(arr[0],-1, -1):\n if i / pir[j][2] < am:\n am = i / pir[j][2]\n k = am * pir[j][2]\n if ans[i] < ans[i-k]+am*pir[j][3]:\n ans[i] = ans[i-k]+am*pir[j][3] \nprint ans[arr[0]]\n\n\n\n", "lang": "Python 2", "bug_code_uid": "26b4822c503669b60d04fa9e6b394a2b", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "c0d8466ef5eb2bb266656c94aab37333", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.799347471451876, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "n, m, c, d = map(int, raw_input().split())\narr = [0] * 50\nfor i in range(c, n + 1):\n arr[i] = arr[i - c] + d\n\nfor l in range(0, m):\n a, b, c, d = map(int, raw_input().split())\n for i in range(0, a/b):\n j = n\n while(j >= c):\n arr[j] = max(arr[j], arr[j - c] + d)\n j -= 1\nprint arr[n]", "lang": "Python 2", "bug_code_uid": "acba03de1cafe4efd01a51842f4efa84", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "apr_id": "adaf590a1dbd0ef13d7d1f1de53e5f89", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.02830188679245283, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "a,b,c=map(int,input().split())\nx=c//a\ns=2*c\nfor _ in range(x):\n s+=(c+1)\nprint(s) ", "lang": "Python 3", "bug_code_uid": "0bd9e566943bbf84e489d330b56b8855", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "3c697fd1d2ed6ba256cf6d99098e5beb", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7151515151515152, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "q=input().split()\na=int(q[0])\nb=int(q[1])\nc=int(q[2])\nprint((a+c)*b)\n", "lang": "Python 3", "bug_code_uid": "6a49c66e2fb8d4b7c6c52fb776f3f567", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "apr_id": "cb563cf20482dfcd12f2807c6cda1797", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7391304347826086, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\nprint(pow(3,n)-1,pow(10,6)+3) if n > 0 else 0)", "lang": "Python 3", "bug_code_uid": "58e796136a7bb95043809b97dbfe1fd2", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "1dea4aed78398ba58983764c621df9c8", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9679144385026738, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\ndef powmod(a,b,m):\n r = 1\n while(b):\n if b&1:\n r = (r*a)%m\n a = (a*a)%m\n b //= 2\n \n\n return r%m\n\na = int(input())\nprint(powmod(3,a-1,1000003))", "lang": "Python 3", "bug_code_uid": "bee9aeeadf54d16e31145bcf7bd78784", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "a062b8ed24a760917cec50eb6d90a5f1", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.05909389363099146, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "class Node:\n def __init__(self,string,count):\n self.string = string\n self.count = count\n\nn = int(input())\nstring = input()\nqueue = [Node(string,0)]\nmax = 0\nwhile queue != []:\n node = queue.pop(0)\n if node.count > max:\n max = node.count\n string = list(node.string)\n if len(string) > 1:\n for i in range(len(string)):\n if i > 0 and i < len(string)-1:\n if ord(string[i]) == ord(string[i+1])+1 or ord(string[i]) == ord(string[i-1])+1:\n temp1 = string[:i]\n temp2 = string[i+1:]\n queue.append(Node(''.join(temp1)+''.join(temp2),node.count+1))\n elif i == 0:\n if ord(string[i]) == ord(string[i+1])+1:\n temp1 = string[:i]\n temp2 = string[i+1:]\n queue.append(Node(''.join(temp1)+''.join(temp2),node.count+1))\n else:\n if ord(string[i]) == ord(string[i-1])+1:\n temp1 = string[:i]\n temp2 = string[i+1:]\n queue.append(Node(''.join(temp1)+''.join(temp2),node.count+1))\n \nprint(max)", "lang": "Python 3", "bug_code_uid": "23d6acb66e5ef7c94e180652f1d5eb5d", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "c83b4f47daf41e3202a925c8932ebcac", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7909774436090226, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "n = int(input())\ns = input()\n \n \nfor i in range(25):\n ch = chr(ord('z') - i)\n\tprev = chr(ord(ch) - 1)\n j = 0\n\twhile j < len(s):\n \tif s[j] == ch and (j-1 >= 0 and s[j-1] == prev or j+1 < len(s) and s[j+1] == prev):\n \t\ts = s[:j] + s[(j+1):]\n\t\t\tj = 0\n \telse:\t\t\t\n \t\tj+=1\n \nprint(n-len(s))", "lang": "Python 3", "bug_code_uid": "d1c9bc7c3c11d11427a0d26c2230ff29", "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38", "apr_id": "c83b4f47daf41e3202a925c8932ebcac", "difficulty": 1600, "tags": ["strings", "brute force", "greedy", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9960159362549801, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\nhuman = n+1\nif human - 1 = 0:\n print(0)\nelif human % 2 == 0:\n print(human // 2)\nelse:\n print(human)", "lang": "Python 3", "bug_code_uid": "00ba61db841e29825046445b89a1b6a1", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "a426b5bf452ce9e1a3bdc9507dcbadb7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8522099447513812, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 18 10:23:17 2018\n\n@author: ThinhDo\n\"\"\"\n\ndef myprod(mylist):\n result = 1\n for i in range(len(mylist)):\n result *= mylist[i]\n return result\n\nfrom itertools import combinations\n\nfrom itertools import compress\n\ndef rwh_primes1v1(n):\n \"\"\" Returns a list of primes < n for n > 2 \"\"\"\n sieve = bytearray([True]) * (n//2)\n for i in range(3,int(n**0.5)+1,2):\n if sieve[i//2]:\n sieve[i*i//2::i] = bytearray((n-i*i-1)//(2*i)+1)\n return [2,*compress(range(3,n,2), sieve[1:])]\n\nmylist = list(map(int,input().split(\" \")))\n[l,r,x,y] = mylist\n#print(l,r,x,y)\n\nif y % x == 0:\n myvalue = int(y/x)\n result = []\n\n primes_list = rwh_primes1v1(myvalue)\n myidx = 0\n \n value = primes_list[myidx]\n current = 1\n while value <= myvalue:\n if myvalue % value == 0:\n myvalue = int(myvalue/value)\n current *= value\n else:\n if current != 1:\n result.append(current)\n myidx += 1\n value = primes_list[myidx]\n if value > myvalue:\n value = myvalue\n current = 1\n \n result.append(current)\n #print(result)\n\n mylist = []\n for myr in range(1,len(result)+1):\n mylist += list(combinations(result,myr))\n \n #print(mylist)\n\n lb = int(l/x)\n ub = int(r/x)\n\n count = 0\n \n# print('x',x)\n# print('l',l)\n# print('r',r)\n# print('lb',lb)\n# print('ub',ub)\n# if (lb <= 1 <= ub):\n# print('hahaha')\n# else:\n# print('nooo')\n# \n# print('myprod(result)',myprod(result))\n# if (lb <= myprod(result) <= ub):\n# print('haaaaa')\n# else:\n# print('no')\n \n \n if (lb <= 1 <= ub) and (lb <= myprod(result) <= ub):\n #print('aaaa')\n count += 1\n #else:\n # print('bbb')\n\n #print(1,myprod(result))\n for i in range(len(mylist)):\n #print(myprod(mylist[i]),int(myprod(result)/myprod(mylist[i])))\n if (lb <= myprod(mylist[i]) <= ub) and (lb <= int(myprod(result)/myprod(mylist[i])) <= ub):\n count += 1\n \n print(count)\n \n \nelse:\n print(0)\n \n\n \n \n \n", "lang": "Python 3", "bug_code_uid": "2dfb8753cbd739b7cc3c2975d02181de", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "91adda006a42af77f8ece8b684114ef0", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.3187817258883249, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "def gcd(a, b):\n if b > a:\n c = a\n a = b\n b = c\n while b != 0:\n c = a\n a = b\n b = c % b\n return a\n\n\nimport math\nl, r, x, y = map(int, input().split())\nc = 0\nfor i in range(l, int(math.sqrt(x * y)) + 1):\n if (x * y) % i == 0 and x * y // i <= r and (x * y // i) % i != 0 and gcd(i, x * y // i) == abs(1):\n c += 1\nif l == 1 and r >= x * y :\n c += 1\nprint(2 * c)", "lang": "Python 3", "bug_code_uid": "4ad0d4771b1131640ff7ba6f34f3027c", "src_uid": "d37dde5841116352c9b37538631d0b15", "apr_id": "058deed80bad0504b50fa94d8f5af12c", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7608695652173914, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "from math import gcd, factorial\n\nA, B = map(int, input().split())\nprint(gcd(factorial(A), factorial(B)))\n", "lang": "PyPy 3", "bug_code_uid": "a34646f7a08d7bbf879d545186c5d19a", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "d1e919f5b85e5802c2ebedd9bc92c790", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6740331491712708, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "import math\na,b=map(int,input().split())\nA=math.factorial(a)\nB=math.factorial(b)\nprint(math.gcd(A,B))\n", "lang": "PyPy 3", "bug_code_uid": "edb8c7fc37075683873d4277112a1054", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "9cd3d6826b7d26d78ec25082d96e986d", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.955109349021614, "equal_cnt": 30, "replace_cnt": 18, "delete_cnt": 5, "insert_cnt": 7, "fix_ops_cnt": 30, "bug_source_code": "## necessary imports\nimport sys\ninput = sys.stdin.readline\nfrom math import log2, log, ceil\n\n# swap_array function\ndef swaparr(arr, a,b):\n temp = arr[a];\n arr[a] = arr[b];\n arr[b] = temp\n\n## gcd function\ndef gcd(a,b):\n if a == 0:\n return b\n return gcd(b%a, a)\n\n## nCr function efficient using Binomial Cofficient\ndef nCr(n, k): \n if(k > n - k): \n k = n - k \n res = 1\n for i in range(k): \n res = res * (n - i) \n res = res / (i + 1) \n return res \n\n## upper bound function code -- such that e in a[:i] e < x;\ndef upper_bound(a, x, lo=0):\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if a[mid] < x:\n lo = mid+1\n else:\n hi = mid\n return lo\n\n## prime factorization\ndef primefs(n):\n ## if n == 1 ## calculating primes\n primes = {}\n while(n%2 == 0):\n primes[2] = primes.get(2, 0) + 1\n n = n//2\n for i in range(3, int(n**0.5)+2, 2):\n while(n%i == 0):\n primes[i] = primes.get(i, 0) + 1\n n = n//i\n if n > 2:\n primes[n] = primes.get(n, 0) + 1\n ## prime factoriazation of n is stored in dictionary\n ## primes and can be accesed. O(sqrt n)\n return primes\n\n## MODULAR EXPONENTIATION FUNCTION\ndef power(x, y, p): \n res = 1\n x = x % p \n if (x == 0) : \n return 0\n while (y > 0) : \n if ((y & 1) == 1) : \n res = (res * x) % p \n y = y >> 1 \n x = (x * x) % p \n return res \n\n## DISJOINT SET UNINON FUNCTIONS\ndef swap(a,b):\n temp = a\n a = b\n b = temp\n return a,b\n\n# find function\ndef find(x, link):\n while(x != link[x]):\n x = link[x]\n return x\n\n# the union function which makes union(x,y)\n# of two nodes x and y\ndef union(x, y, link, size):\n x = find(x, link)\n y = find(y, link)\n if size[x] < size[y]:\n x,y = swap(x,y)\n if x != y:\n size[x] += size[y]\n link[y] = x\n\n## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES\ndef sieve(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 return prime\n\n#### PRIME FACTORIZATION IN O(log n) using Sieve ####\nMAXN = int(1e6 + 5)\ndef spf_sieve():\n spf[1] = 1;\n for i in range(2, MAXN):\n spf[i] = i;\n for i in range(4, MAXN, 2):\n spf[i] = 2;\n for i in range(3, ceil(MAXN ** 0.5), 2):\n if spf[i] == i:\n for j in range(i*i, MAXN, i):\n if spf[j] == j:\n spf[j] = i;\n ## function for storing smallest prime factors (spf) in the array\n\n################## un-comment below 2 lines when using factorization #################\n# spf = [0 for i in range(MAXN)] \n# spf_sieve() \ndef factoriazation(x):\n ret = {};\n while x != 1:\n ret[spf[x]] = ret.get(spf[x], 0) + 1;\n x = x//spf[x]\n return ret\n ## this function is useful for multiple queries only, o/w use\n ## primefs function above. complexity O(log n)\n\n## taking integer array input\ndef int_array():\n return list(map(int, input().strip().split()))\n## taking string array input\ndef str_array():\n return input().strip().split();\n\n#defining a couple constants\nMOD = int(1e9)+7;\nCMOD = 998244353;\nINF = float('inf'); NINF = -float('inf');\n\n\n################### ---------------- TEMPLATE ENDS HERE ---------------- ###################\n\nn = int(input()); string = input().strip(); ans = '';\nnum = 1;\nfor i in string:\n if int(i) > 1:\n for j in range(int(i), 1, -1):\n num *= j\nwhile(num > 1):\n while(num % 5040 == 0):\n ans += '7'; num //=5760;\n while(num % 120 == 0):\n ans += '5'; num //= 120;\n while(num % 6 == 0):\n ans += '3'; num //= 6;\n while(num % 2 == 0):\n ans += '2'; num //= 2;\nprint(ans);", "lang": "Python 3", "bug_code_uid": "9f64e25e5254a7c643d817ef4eb2e454", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "3697ed025737beba7f87f9e58424bd13", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.971830985915493, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "\n#import sympy as sp\n#import time as t\nimport math\nimport numpy as np\n\nx,n = map(int, input().split())\n \ndef pfactors(x):\n prime_factors=[] \n if(x&1==0):\n prime_factors.append(2)\n while(x&1==0):\n x=x>>1\n \n i=3\n limit= math.sqrt(x)\n \n while(i<=limit):\n if(x%i==0):\n prime_factors.append(i)\n x=x//i\n while(x%i==0):\n x=x//i \n i+=2\n \n if(x>2):\n prime_factors.append(x)\n return prime_factors\n\npfacts= pfactors(x) \nres=1\nl=len(pfacts)\nM=10**9+7\n\nfor p in pfacts:\n k=math.floor(math.log(n,p))\n h=0\n for i in range(1,k+1):\n h = h + n//pow(p,i)\n \n g = pow(p,h,M)\n res = (res*g)%M\n\nprint(res)\n\n \n", "lang": "PyPy 3", "bug_code_uid": "69ed56dcd4a78b478402d26e149010e0", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "7a2c8ac3d810d5c55bc8d64b536e9a23", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.13893376413570274, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "x,y,a,b=map(int,raw_input().split(' '))\nm=[]\nn=[]\nfor i in range(b+1):\n if i*x>=a and i*x<=b:\n m.append(i*x)\n elif i*x>b:\n break\nfor i in range(b+1):\n if i*y>=a and i*y<=b:\n n.append(i*y)\n elif i*y>b:\n break\n\nprint len(set(m).intersection(set(n)))\n", "lang": "Python 2", "bug_code_uid": "02868faa8a9363aa729ef1caebdd99bc", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "54cba9ed8a79821c049627cd641c70ec", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8421052631578947, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a, b, c = map(int, raw_input().split())\nfor i in reversed(range(1,a+1)):\n\tif 2 * i <= b and 4 * i <= c:\n\t\tprint 7 * i\n\t\texit(0)\nprint 0", "lang": "Python 2", "bug_code_uid": "5b87f8088191ead1efff22aa85801868", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "fdd56ea6366a8aa60838c293119474c6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.07692307692307693, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "import itertools as it\nimport math as m\n\ndef move(start,moves):\n pos=start\n for m in moves:\n x,y=pos\n if m=='U':\n pos=(x,y+1)\n if m=='D':\n pos=(x,y-1)\n if m=='L':\n pos=(x-1,y)\n if m=='R':\n pos=(x+1,y)\n return pos \n\ndef choose_iter(elements, length):\n for i in xrange(len(elements)):\n if length == 1:\n yield (elements[i],)\n else:\n for next in choose_iter(elements[i+1:len(elements)], length-1):\n yield (elements[i],) + next\ndef choose(l, k):\n return list(choose_iter(l, k))\n\nn=int(raw_input())\n\ndata=raw_input()\n\n#n=6\n#data=\"LLRRRR\"\n\ndp={}\nmx=0\nstop=False\nfor i in range(len(data),0,-1):\n for v in choose(data,i):\n if move((0,0),v)==(0,0):\n mx=i\n stop=True\n break\n if stop:\n break\nprint mx\n", "lang": "Python 2", "bug_code_uid": "8b1c185fbecbf3a54878917747aa44cc", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "724875bd055d8a8eb50a37027662ba58", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9633204633204633, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "bug_source_code": "s=input()\nss=\"h\"\nl=[]\ns=s.lower()\nh=s.count(\"h\")\nii=s.index('h')\nfor i in range(h):\n l.append(s[ii::])\n if i int(e):\n m1 = int(e)\nfor e in l2:\n if m2 > int(e):\n m2 = int(e)\nif x == '1' and y != 1:\n print m1\nelif y == '1' and x != 1:\n print m1\nelif m1 == m2:\n print m1\nelif m1 < m2:\n print (m1 * 10) + m2\nelif m2 < m1:\n print (m2 * 10) + m1", "lang": "Python 2", "bug_code_uid": "8d923ace1c38f3606715a1e4bdffec26", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "apr_id": "29ba958a4f1ccfbffe8ec0456232065c", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.989247311827957, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "tab = list(map(int , input().split()))\ntab.sort()\nprint((tab[1] - tab[0]) + (tab[2] - tab[1]", "lang": "PyPy 3", "bug_code_uid": "c08f2c50baa8b0f89b6566c896ce861b", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "06d73dd3087ff12d81fa70e21a2a0806", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.8065395095367848, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "a=[int(i) for i in input().split()]\nb=(a[1]*a[2])//a[0]\ncount=0\nwhile(b>0 and (a[4]*a=[3])>0 and a[5]>=a[7]):\n count+=1\n b-=1\n a[4]-=1\n a[5]-=a[7]\nprint(count//a[0])\n \n", "lang": "Python 3", "bug_code_uid": "f46eac7bcf99a9775bf5f7dcd158592c", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "73f7584ff21341e17cf104bd9a8f7b1d", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7234927234927235, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "x = [int(n) for n in input().split()]\ntotal_drinks = x[1] * x[2]\ntotal_limes = x[3] * x[4]\nsalt = x[5]\ndrinks_per_shot = x[6] * x[0]\nsalt_per_shot = x[7] * x[0]\nprint(min([drinks_per_shot//total_drinks,salt,salt_per_shot//total_limes])", "lang": "Python 3", "bug_code_uid": "98fd7cfa815f3849b5a38c5f4ca770e0", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "4678fadc18714f842ac574208b948ba9", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5881057268722467, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "from math import log, trunc\nx, n = map(int, input().split())\nd = {}\ni = 2\nwhile x != 1:\n if x % i == 0:\n d[i] = 0\n while x % i == 0:\n d[i] += 1\n x //= i\n i += 1\nr = {}\np = 1\nfor key in d.keys():\n i = 1\n temp = key\n while temp <= n:\n if r.get(key):\n r[key] += n // temp\n else:\n r[key] = n // temp\n temp *= key\n p *= pow(key, r[key], 10 ** 9 + 7)\n p %= 1000000007\nprint(p)\n", "lang": "PyPy 3", "bug_code_uid": "9ca65a6ecefb72052029a384c4ee389e", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "594e0c1ffa04a04c2838c0859d325cf8", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9789739276703112, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import sys\nimport math\ndef primeFactors(n):\n while n % 2 == 0:\n n = n / 2\n l.add(2)\n for i in range(3,int(math.sqrt(n))+1,2):\n while n % i== 0:\n count+=1\n n = n / i\n l.add(int(i))\n if n > 2: \n l.add(int(n))\n return(l)\nl=set()\ninput=sys.stdin.readline\nx,n=map(int,input().split())\nprima=primeFactors(x)\nmod=10**9+7\nres=1\nfor i in prima:\n h=0\n b=i\n while b <= n:\n h+=n//b\n b*=i\n res=(res*pow(i,h,mod))%mod\nprint(res)\n \n \n \n\n\n", "lang": "PyPy 3", "bug_code_uid": "68ea562c401060e3a951d9af881f2700", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "f1c0e692618be4d4dec5135a9537f823", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.2134646962233169, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "\nx, n = map(int, input().split())\np = 2\nans = 1\nwhile x > 1:\n if x % p:\n p += 1\n if p ** 2 > x:\n p = x\n else:\n n1 = n\n while n1:\n n1 //= p\n ans = (ans * pow(p, n1, MOD)) % MOD\n while not x % p:\n x //= p\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "9c288c9ca91525dad600a861ed949768", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "4892893e200b85e6b645473504404e92", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9903846153846154, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "x, n = [int(x) for x in input().split()]\n\ndef primes(x):\n res = set()\n p = 2\n while p*p <= x:\n while x % p == 0:\n res.add(p)\n x //= p\n p += 1\n if x != 1:\n res.add(x)\n return res\n\nMOD = 10**9+7\n\ndef prod_f(prime_lst, n):\n res = 1\n for p in prime_lst:\n pw = 0\n i = 1\n while pw**i <= n:\n pw += n // pw**i\n i += 1\n res *= pow(p, pw, MOD)\n res %= MOD\n return res\n\nprint(prod_f(list(primes(x)), n))\n ", "lang": "PyPy 3", "bug_code_uid": "bab8bcacf0186b18dd68c4e24f6e634a", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "92b7e7f8f2fdbcda06e7d6da132522de", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9875930521091811, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\nx = int(input())\nfor i in range(n, 0, -1):\n if i % 2 == 0:\n if x == 1 or x == 2:\n x = 3 - x\n else:\n if x == 0 or x == 1:\n x = 1 - x\nprint(x)", "lang": "Python 3", "bug_code_uid": "bf2ba4077d312f960e6ed6926ee2f7e0", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "7f5d47448e474dace5ca769f9a271317", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.12422360248447205, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "n = input()\nn = 2**n/2\ncount = 0\nwhile 2 != n :\n count = count + n*2\n count = count + n/4\n n = n / 2\nprint count \n", "lang": "Python 2", "bug_code_uid": "4fa96ab84195a86aa57a331e9d1cb421", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "f2976abf91e4e1b9dcf834ae0c570abe", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.5535714285714286, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "v = [0 for x in range(1001)]\n\ndef cal():\n\tv[1] = 1\n\tv[2] = 3\n\tN = 1000000+3\n\tfor i in range(3,1001):\n\t\tv[i] = ((2**i)/2)%N\n\t\tfor j in range(1,i+1):\n\t\t\tv[i] += ((v[i-j]%N*((2**(j-1))%N))%N)\n\t\tv[i] = v[i]%N\n\ndef main():\n\tcal()\n\tt = int(raw_input())\n\tprint v[t]%(1000000+3)\n\n\n\nif __name__ == \"__main__\":\n\tmain()\n", "lang": "Python 2", "bug_code_uid": "4065a591e2081a72bc942e695a9db7b9", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "0146690770f781aa5dadfdb9137216d1", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3582089552238806, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def IKNOWRECURSION(n):\n if n > 1: return 3*IKNOWRECURSION(n-1)\n else: return 1\n\n\nn = int(raw_input())\n\n\nprint IKNOWRECURSION(n)\n\n", "lang": "Python 2", "bug_code_uid": "0796ff210ac713200491eadabaa2f55a", "src_uid": "1a335a9638523ca0315282a67e18eec7", "apr_id": "0ed4ae106be4b4b12fa9d494b8258210", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2648809523809524, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "from math import log, ceil\n\ndef f(n,m):\n## if n == 1 or m == 1:\n## if n == 1 and m != 1:\n## a = 0\n## b = ceil(log(m-1,x))\n## c = 0\n## d = ceil(log(m-1,y))\n## elif n != 1 and m == 1: \n## a = int(log(n-1,x))\n## b = 0\n## c = int(log(n-1,y))\n## d = 0\n## else:\n## a,b,c,d = 0,0,0,0\n## else:\n## a = int(log(n-1,x))\n## b = ceil(log(m-1,x))\n## c = int(log(n-1,y))\n## d = ceil(log(m-1,y))\n## print(a,b,c,d)\n res = []\n for i in range(0,60):\n for h in range(0,60):\n res.append(x**i+y**h)\n return res\n\nx,y,l,r = map(int, input().split(' '))\nunhappy = f(l,r)\ncount = 0\nres = 0\nfor i in range(l,r+1):\n if i in unhappy:\n count = 0\n else:\n count += 1\n if res < count:\n res = count\nprint(res)\n", "lang": "Python 3", "bug_code_uid": "03784f0afd49555200e9573485c9cc0a", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "605742a9203895cc249c7e2fcbaedbb7", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9722222222222222, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "\n#k=int(input())\n#n,m=map(int,input().split())\n\n#a=list(map(int,input().split()))\n\n#b=list(map(int,input().split()))\n\nx,y,l,r=map(int,input().split())\n\ni=0\na=list()\n\nfor i in range(200):\n for j in range(200):\n a.append(x**i+y**j)\n\na.sort()\n\nm=0\n\nfor i in range(len(a)-1):\n if a[i]<=r:\n m=max(m,min(r,a[i+1]-1)-max(a[i]+1,l)+1)\n\n\nprint(m)\n\n'''\n\na=list(map(int,input().split()))\n\ns=sum(a)\n\nm=int(input())\nss=10**10;\n\nfor i in range(m):\n l,r=map(int,input().split())\n\n if r 0 < a and a ^ b == x:\n res += 1\n print(res)\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "dce5f8f7dba112207d5783c34630274b", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "fd8415f8b8c43bf927d7c7cd9286535d", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.914572864321608, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "print (lambda s, x:\n 2 ** (sum(1 for i in bin(x) if i == '1'))\n - (0 if [1 for i in bin(x)[2:] if i == '0'] else 2)\n if ((s - x) / 2) & x == 0 and (s ^ x) & 1 == 0 else 0) \\\n(*map(int, raw_input().split(\" \")))", "lang": "Python 2", "bug_code_uid": "e3e02b0d60fa5676f2de6eec79e8e10f", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "302e1a93435c8bdcbec0d38f94abcdf0", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9929453262786596, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "# coding: utf-8\n\ni = raw_input().split(\" \")\nm = long(i[0])\np = long(i[1])\nx = p\ndif = m-x\nif (dif%2==1):\n\tprint(0)\nelse:\n\tdif = dif/2\n\ts = \"\"\n\twhile (dif != 0):\n\t\tif (dif%2==1):\n\t\t\tdif -= 1\n\t\t\ts += \"1\"\n\t\telse:\n\t\t\ts += \"0\"\n\t\tdif /= 2\n\tind = 0\n\tst = \"\"\n\tn = long(1)\n\tth = True\n\twhile (x != 0):\n\t\tif (x%2==1):\n\t\t\tx -= 1\n\t\t\tst += \"1\"\n\t\t\tn = long(n*long(2))\n\t\telse:\n\t\t\tst += \"0\"\n\t\tx /= 2\n\t\tif (ind < len(s) and s[ind] == \"1\" and \"1\" == st[ind]):\n\t\t\tth = False\n\t\t\tbreak\n\t\tind += 1\n\tif (th):\n\t\tif (m == p):\n\t\t\tprint(long(n-2))\n\t\telse:\n\t\t\tprint(long(n))\n\telse:\n\t\tprint(0)", "lang": "Python 2", "bug_code_uid": "4c64a2771e2db0802e23e6ce77e85a99", "src_uid": "18410980789b14c128dd6adfa501aea5", "apr_id": "351e557424ef2d94bcf18987e6cb819f", "difficulty": 1700, "tags": ["dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7796208530805687, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "s = raw_input()\n\nsum = 1\nmulA=10\n\nusedChars = {}\n\nif s[0] >= 'A' and s[0] <= 'Z':\n usedChars[ s[0] ] = True\n mulA -= 1\n sum *= 9\n \nif s[0] == '?':\n sum *= 9\n\nfor ch in s[1:]:\n if ch == '?':\n sum *= 10\n if ch not in usedChars:\n sum *= mulA\n mulA -= 1\n usedChars[ch] = True\n\nprint sum\n", "lang": "Python 2", "bug_code_uid": "64d573bbe348621f891e9ce05f989ddb", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "afceeeaedc8fb806b5dbaf68f65311d7", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6454689984101749, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "s = raw_input()\n\nk = 1\nbuk = ''\nbu = ['A','B','C','D','E','F','G','H','I','J']\n\nif s[0] in bu:\n k = k*9\n buk = s[0]\nelif s[0] == '?':\n k = k*9\n\nb = list(set(s[1:]))\n\nfor i in range(len(b)):\n if b[i] in bu and b[i] != buk:\n k = k*10\n elif b[i] == '?':\n k = k*10\nprint k", "lang": "Python 2", "bug_code_uid": "9e8169f1b8493730e84b1f5437a76d91", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "b78086876e892f4e3c57f8e5e38f98e7", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9689737470167065, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "import sys\nfrom collections import defaultdict\n\ndef main():\n\tS = sys.stdin.readline().strip()\n\tqmarks = 0\n\tused = set()\n\tans = 1\n\tfor pos, char in enumerate(S):\n\t\tif(char == '?'): \n\t\t\tif(pos == 0): ans *= 9\n\t\t\telse: ans *= 10\n\t\telif(char in '0123456789'): pass\n\t\telse:\n\t\t\tif(pos == 0): ans *= 9\n\t\t\telse:\n\t\t\t\tif(char in used): pass\n\t\t\t\telse:\n\t\t\t\t\tans *= 10 - len(used)\n\t\t\t\t\tused.add(char)\n\tprint ans\n\nmain()\n\n", "lang": "Python 2", "bug_code_uid": "6a06c5cdc2a44528439ec82b88027226", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82", "apr_id": "d92a3a6d9c385aadf3c18d40ee282b2c", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7542857142857143, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "n = input()\nif n%2 == 0 and n!= 2 :\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "b80e9ec8c4aa269f0583d9ddee77eb0d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "b7a090f02c9b3ab6bc4420e65fb16af7", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6995515695067265, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "k=list(map(int,input().split()))\nif(k[1]>k[2]):\n c=abs(k[0]-k[1])\n print(c)\nelse:\n \nc=abs(k[0]-k[2])\nd=abs(k[0]-k[1])\nprint(c+d)", "lang": "Python 3", "bug_code_uid": "0a64a49dbcd72c819a00ee5b4d09fb7d", "src_uid": "7bffa6e8d2d21bbb3b7f4aec109b3319", "apr_id": "a561330bd33f872eeebf2fca7f8d9a74", "difficulty": 800, "tags": ["math", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.4316546762589928, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 13, "bug_source_code": "even = list(range(2, 101, 2))\nw = input()\nif w in even:\n print ('YES')\nelif w > 3:\n print('YES')\n ", "lang": "Python 3", "bug_code_uid": "8693c69e10a1557ae36f7e398fdc31c3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "2f59f5264e914d549ae555a8f8ba128c", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6315205327413984, "equal_cnt": 38, "replace_cnt": 19, "delete_cnt": 1, "insert_cnt": 18, "fix_ops_cnt": 38, "bug_source_code": "import math\n\ndef divide(b):\n divs = []\n\n x = b\n for i in range(2, math.sqrt(x)):\n if x % i == 0:\n divs.append(i)\n while x%i==0:\n x = x / i\n\n if x > 1:\n divs.append(x)\n return divs\n\ndef pow_(n, k, mod):\n\n ret = 1\n while(k > 0):\n if(k & 1):\n ret = ret * n % mod\n a = a * a %mod\n b = b / 2\n return ret\n\nmod = 100000007\nx = input()\nn = input()\n\nif n>1:\n listdiv = divide(x)\n ans = 1\n kk = []\n for i in range(listdiv.size()):\n nn = n\n temp = 0\n while nn > 0:\n temp = (temp + (nn / listdiv[i]))%mod\n ans *= pow_(listdiv[i], temp, mod)\n ans %= mod\n print(ans)\nelse:\n print(0)\n", "lang": "Python 3", "bug_code_uid": "5367abd339803c79de613a283964f5c3", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "9cfc2855da6d10add8a145adf3aeeaa7", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.881447963800905, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "from sys import stdin\n#import nltk\nimport math\nfrom collections import defaultdict\n\n#stdin=open('input.txt','r')\n#nltk.download('words')\nI=stdin.readline\n\nx,n=map(int,I().split())\n\nprimes=[]\nif(x%2==0):\n\tprimes.append(2)\n\twhile(x%2==0):x/=2\n\nfor i in range(3,int(x**0.5)+1,2):\n\tif(x%i==0):\n\t\tprimes.append(i)\n\t\twhile(x%i==0):x/=i\n\nif(x>2):primes.append(x)\n\n\nprod=1\nmod=pow(10,9)+7\nfor p in primes:\n\ty=math.floor(math.log(n,p))\n\tnow=0\n\tfor i in range(y,0,-1):\n\t\tpo=pow(p,i)\n\t\tnow+=n//po\n\tprod*=pow(p,now,mod)\n\tprod%=mod\n\t\t\n\nprint(prod)\n\n\n", "lang": "Python 3", "bug_code_uid": "d4d5778d172dcadc46e050550ebcca6b", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "68b491a1e719b12239b27f6a86f4a719", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9644416718652526, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "import sys\ndef is_prime(n):\n\tif n == 1:\n\t\treturn false;\n\ti = 2;\n\twhile i * i <= n:\n\t\tif n % i == 0:\n\t\t\treturn (False, i)\n\t\ti += 1\n\treturn (True, n)\n\ndef fact(n):\n\tif n == 1:\n\t\treturn []\n\tans = []\n\ttmp = is_prime(n)\n\twhile(not tmp[0]):\n\t\twhile(n % tmp[1] == 0):\n\t\t\tn = n // tmp[1]\n\t\tans.append(tmp[1])\n\t\ttmp = is_prime(n)\n\tans.append(n)\n\treturn ans\n\ndef legendre(x, n):\n\tans = 0;\n\ttmpx = x\n\twhile n // tmpx > 0:\n\t\tans += n // tmpx;\n\t\ttmpx *= x\n\treturn ans\n\ndef fastpow(x, pow):\n\tif pow == 0:\n\t\treturn 1;\n\tif pow % 2 == 0:\n\t\ttmp = fastpow(x, pow // 2)\n\t\treturn (tmp ** 2) % 1000000007\n\telse:\n\t\treturn (x * fastpow(x, pow - 1)) % 1000000007\n\nx, n = input().split()\nx = int(x)\nn = int(n)\nans = 1\n\nfor i in fact(x):\n\tans = (ans * fastpow(i, (legendre(i, n)))) % (10**9 + 7)\nprint(ans)", "lang": "Python 3", "bug_code_uid": "e3a12dfd958413eef2be1b30d9cedc58", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "99612a472eebf462c6f54ba667bcdfbf", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9989888776541962, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#!/bin/python\nfrom math import sqrt\n\nx, n = (int(x) for x in input().split(' '))\n\ndef factorize(n):\n\tfactors = []\n\n\tif (n % 2) == 0:\n\t\tfactors.append(2)\n\n\t\twhile (n % 2) == 0:\n\t\t\tn /= 2\n\n\tfactor = 3\n\tsqrtt = sqrt(n) + 10\n\n\twhile n >= factor and factor <= sqrtt:\n\t\tif (n % factor) == 0:\n\t\t\tfactors.append(factor)\n\n\t\t\twhile (n % factor) == 0:\n\t\t\t\tn /= factor\n\n\t\tfactor += 2\n\n\tif n != 1:\n\t\tfactors.append(n)\n\n\treturn factors\n\nM = 1_000_000_007\n\ndef mod_mul(a, b):\n\treturn ((a % M) * (b % M)) % M\n\ndef fast_pow(x, p):\n\tresult = 1\n\tcurrent_power = 1\n\tcurrent_factor = x\n\n\twhile p >= current_power:\n\t\tif p & current_power:\n\t\t\tresult = mod_mul(result, current_factor)\n\n\t\tcurrent_factor = mod_mul(current_factor, current_factor)\n\t\tcurrent_power *= 2\n\n\treturn result\n\nfactors_of_x = factorize(x)\nresult = 1\n\nfor factor in factors_of_x:\n\tpower = 0\n\tcurrent = factor\n\n\twhile current <= n:\n\t\tpower += n // current\n\t\tcurrent *= factor\n\n\tresult = mod_mul(result, fast_pow(factor, power))\n\nprint(result)", "lang": "Python 3", "bug_code_uid": "e1e8bb9a09a5cd4df4597b62fd43f07f", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "899452f0c39ec596e84f9e367c1d6acc", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9885286783042394, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "from math import *\nfrom sys import *\nfrom heapq import *\nfrom collections import defaultdict\nimport os, sys\nfrom io import IOBase, BytesIO\nM=10**9+7\n\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\n\ndef primefactorisation(nn):\n lst=[]\n if nn%2==0:\n lst+=[2]\n while nn%2==0:\n nn/=2\n for i in range(3,int(nn**0.5)+1,2):\n if nn%i==0:\n lst+=[i]\n while nn%i==0:\n nn/=i\n if nn>2:\n lst+=[int(nn)]\n \n return lst\n \n\n\n\ndef main():\n x,n=list(map(int,input().split()))\n \n lst=primefactorisation(x)\n #print(lst)\n res=1\n for p in lst:\n \n \n val=p\n V=0\n while n>=val:\n V+=n//val\n val*=p\n \n res*=powmod(p,V,M)\n res%=M\n \n \n print(res)\n \n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n main()\n#threading.Thread(target=main).start()\n\n", "lang": "Python 3", "bug_code_uid": "d56b07f9a8e917ed8a383497b22130ca", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "884c077ff931d3aab444a8f15d9f2298", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.99000999000999, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "from math import *\nfrom sys import *\nfrom heapq import *\nfrom collections import defaultdict\nimport os, sys\nfrom io import IOBase, BytesIO\nM=10**9+7\n\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\n\ndef primefactorisation(nn):\n lst=[]\n if nn%2==0:\n lst+=[2]\n while nn%2==0:\n nn/=2\n for i in range(3,int(nn**0.5)+1,2):\n if nn%i==0:\n lst+=[i]\n while nn%i==0:\n nn/=i\n if nn>2:\n lst+=[int(nn)]\n \n return lst\n \n\n\n\ndef main():\n x,n=list(map(int,input().split()))\n \n lst=primefactorisation(x)\n #print(lst)\n res=1\n for p in lst:\n \n \n val=p\n V=0\n while n>=val:\n V+=n//val\n val*=p\n \n res*=pow(p,V,M)\n res%=M\n \n \n print(res)\n \n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n main()\n#threading.Thread(target=main).start()\n\n", "lang": "Python 3", "bug_code_uid": "72bf707ef3f820ce82583fa3e90a1b68", "src_uid": "04610fbaa746c083dda30e21fa6e1a0c", "apr_id": "884c077ff931d3aab444a8f15d9f2298", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.8243559718969555, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "s = input()\nind1 = 0\nwhile s[ind1] == “0”:\n ind1 += 1\nind2 = len(s) - 1\nwhile s[ind2] == “0”:\n ind2 -= 1\ns1 = s[ind1:ind2+1]\nif s == s1 and ind1 <= len(s) - ind2:\n print(“YES”)\nelse:\n print(”NO”)", "lang": "Python 3", "bug_code_uid": "53883023c310f8115da0f6ce3f88a930", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "66bbd35579301e3ee33f979e64ccc1c2", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6216216216216216, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "x=input()\nwhile x % 10 == 0: x /= 10\nx=str(x)\nprint \"YES\" if x==x[::-1] else \"NO\"", "lang": "Python 3", "bug_code_uid": "e59f329fe1a1c0b44358b22599c084e4", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "35e9a9417c2c497bb93d82281219f306", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9668508287292817, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "x = str(input())\n\nwhile x[:-1] == '0':\n\tx = x[:-1]\n\nfound = False\nfor i in range(len(x)/2):\n\tif x[i] != x[:-(i+1)]:\n\t\tprint('NO')\n\t\tfound = True\n\t\tbreak\n\nif !found:\n\tprint('YES')", "lang": "Python 3", "bug_code_uid": "88a2fd0a40c922ad5efec1dc8c7c8dce", "src_uid": "d82278932881e3aa997086c909f29051", "apr_id": "e708ea7d663b6a3d4a3cd4622dc6be8c", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9857549857549858, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nx=int(input())\narr=[0,1,2]\nwhile n:\n if n%2:\n arr[0],arr[1]=arr[1],arr[0]\n else:\n arr[1],arr[2]=arr[2],arr[1]\n n-=1\nprint(arr.index(x))", "lang": "Python 3", "bug_code_uid": "4c4fd630316d1f4336d9bc14f118390c", "src_uid": "7853e03d520cd71571a6079cdfc4c4b0", "apr_id": "f8a0b560159086addaacf9b75db0a489", "difficulty": 1000, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9544072948328267, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "import sys\n\ndef main():\n w = int(sys.argv[1])\n #w= int(input())\n print(w)\n if w >= 4 and w % 2 == 0:\n print('YES')\n else:\n print('NO')\n\nmain()", "lang": "PyPy 3", "bug_code_uid": "1d4804f9cd8e862674b2e3ddad7cb3a2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "77d0c50e80ada6c151199a124322b9a3", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9896193771626297, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "mappings = {\n\n '0':''\n '1': '',\n '2': '2',\n '3': '3',\n '4': '322',\n '5': '5',\n '6': '53',\n '7': '7',\n '8': '7222',\n '9': '7332'\n}\nn = int(input())\na = list(input())\n\n\nx = \"\"\nfor i in a:\n x += mappings[i]\nx = list(x)\nx.sort(reverse=True)\nprint(\"\".join(x))\n", "lang": "Python 3", "bug_code_uid": "f777410408c06caa020da395e7527100", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "f9b871c35f88836d4fee795b4b8624a5", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.874274661508704, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\ns=input()\narray = list(string)\nleft = 0\nright = 0\nup = 0\ndown = 0\n\nfor i in array:\n if i == \"U\":\n up += 1\n elif i == \"D\":\n down += 1\n elif i == \"L\":\n left += 1\n else:\n right += 1\n\nreturn 2*min(left, right) + 2*min(up, down)", "lang": "PyPy 3", "bug_code_uid": "f84af76aec4c15e486a61a3323ac4558", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "apr_id": "901a1dfa06a22111b924c7d44918c617", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9577464788732394, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "x = input().split()\nans = 0\nfor i in range(61):\n for j in range(i - 1):\n y = 2 ** i - 1 - 2 ** j\n if y >= x[0] and y <= x[1]:\n ans++\nprint(ans)", "lang": "Python 3", "bug_code_uid": "7d9d309e5ab20cee9ce73e551937db33", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "ce45073ac85db28a617922182be345f5", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6884272997032641, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 18, "bug_source_code": "a,b=map(int,input().split())\ncount=0\nfor i in range(a,b+1):\n c=str(bin(i))[2:]\n k=c.count('0')\n if k==1:\n count+=1\nprint(count)\n", "lang": "Python 3", "bug_code_uid": "87b15c8d4e666685daccacb90cab500f", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "00a9b0c2afd13c8d892f39012ff33993", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5247148288973384, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "a1=input().split()\na=int(a1[0])\nb=int(a1[1])\nn=0\nfor i in range(a,b+1):\n\tif bin(i).count('0')==2:\n\t\tn+=1\nprint(n)", "lang": "Python 3", "bug_code_uid": "18ae22a549b84f8a0ca3eb0f97010472", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "7ec0c4b7e11da3819e79927fac1aa114", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9894875164257556, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "input_ = input().split(\" \")\ninput_numbers = list(map(int, input_))\n\nshifted_ = []\n\na = input_numbers[0]\nb = input_numbers[1]\na_ = len(bin(a)[2:]) \nb_ = len(bin(b)[2:])\n\nall_ = []\nanswers = []\n\ndef generate_answers(mask):\n binaries = []\n \n for i in range(2, len(mask)):\n aux = '0b'\n aux += mask[2:]\n aux = list(aux)\n aux[i] = '0'\n aux = \"\".join(aux)\n binaries.append(aux)\n \n return binaries\n\n\nfor i in range(a_, b_+1):\n shifted = ((1 << i) - 1)\n shifted_.append(bin(mask))\n\nfor i in shifted_:\n all_ += generate_answers(i)\n\nfor i in all_:\n number = int(i,2)\n if !(number < input_numbers[0] or number > input_numbers[1] or i[2] == '0'): \n answers.append(i)\n\n\nprint(len(answers))", "lang": "Python 3", "bug_code_uid": "e66b79a77c78c07a9f9967eb75e3718e", "src_uid": "581f61b1f50313bf4c75833cefd4d022", "apr_id": "f593f90e0b159abcd87298a92c048725", "difficulty": 1300, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8446550816219063, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "from functools import reduce\ndef count_choices(a, x):\n left_b, right_b = 0, 0\n left = 0\n right = a\n while left < right:\n middle = int((left + right) / 2)\n if middle <=x:\n left = middle + 1\n #choosing right_b means middle < x\n right_b+=1\n else:\n right = middle\n #choosing left means middle > x\n left_b+=1\n # subtract 1 from right to account for middle == x\n return [left_b, right_b - 1]\n\n\nif __name__ == \"__main__\":\n n, x, pos = map(int, input().split(\" \"))\n lower_bound = 1 if (x == 1 ) else x-1 \n upper_bound = 1 if ((n - x) == 0) else n-x\n [gt_x, lt_x] = count_choices(n, pos)\n print(reduce(lambda a,b: (a*b)%(10**9 + 7),\n # permutations for mids lt x\n [*range(lower_bound, lower_bound - lt_x, -1)]\n #permutations for mids gt x\n + [*range(upper_bound, upper_bound - gt_x, -1)]\n #permutations for other positions\n + [*range(1, n - gt_x - lt_x)]))", "lang": "PyPy 3", "bug_code_uid": "76a9f8705fd14f55d2cd5e5486914da9", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "9766b8b34fcff891f55b0113148e66a1", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4342629482071713, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "# HEY STALKER\nhp_y, at_y, df_y = map(int, input().split())\nhp_m, at_m, df_m = map(int, input().split())\ncst_hp, cst_at, cst_df = map(int, input().split())\nans = 2e18\nfor ati in range(102):\n for dfi in range(102):\n for hpi in range(102):\n yank_hp = hp_y + hpi\n yank_at = at_y + ati\n yank_df = df_y + dfi\n m_k = max(0.01, at_m - yank_df)\n y_k = max(0.01, yank_at - df_m)\n yi = 0\n mi = 0\n if m_k > yank_hp:\n yi = 1\n else:\n yi = yank_hp // m_k\n if yank_hp % m_k != 0:\n yi += 1\n if y_k > hp_m:\n mi = 1\n else:\n mi = hp_m // y_k\n if hp_m % y_k != 0:\n mi += 1\n if yi > mi:\n cost = ((yank_hp - hp_y) * cst_hp) + ((yank_at - at_y) * cst_at) + ((yank_df - df_y) * cst_df)\n ans = min(ans, cost)\nprint(ans)", "lang": "Python 3", "bug_code_uid": "1ee1b74ac4efb2296c4f5c34c1f16b52", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "a377eb5bab15be16743ee7c52ecb9f3b", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8367203924316748, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 10, "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\nINF = 999999\n\ndef ceildiv(a, b):\n try:\n return a / b + bool(a % b)\n except ZeroDivisionError:\n return INF\n\nMOD = 10**9 + 7\nINF = float(\"+inf\")\n\nhp1, atk1, def1 = map(int, raw_input().split())\nhp2, atk2, def2 = map(int, raw_input().split())\nprice_hp, price_atk, price_def = map(int, raw_input().split())\n\ndmg1 = max(0, atk1 - def2)\ndmg2 = max(0, atk2 - def1)\n\nnrounds1 = ceildiv(hp2, dmg1)\nnrounds2 = ceildiv(hp1, dmg2)\n\nif nrounds1 < nrounds2:\n print 0\n quit()\n\nfrom Queue import PriorityQueue\n\nprice = 0\nnatk = 0\nif atk1 - def2 <= 0:\n natk = def2 - atk1 + 1\n price = natk * price_atk\n\nqueue = PriorityQueue()\nqueue.put((price, 0, natk, 0))\nwhile queue:\n price, nhp, natk, ndef = queue.get()\n dmg1 = max(0, natk + atk1 - def2)\n dmg2 = max(0, atk2 - def1 - ndef)\n\n nrounds1 = ceildiv(hp2, dmg1)\n nrounds2 = ceildiv(hp1 + nhp, dmg2)\n if nrounds1 < nrounds2:\n print price\n quit()\n\n need_hp = nrounds1 * dmg2 - (hp1 + nhp) + 1\n price_test = price + need_hp * price_hp\n queue.put((price_test, nhp + need_hp, natk, ndef))\n\n queue.put((price + price_atk, nhp, natk + 1, ndef))\n queue.put((price + price_def, nhp, natk, ndef + 1))\n\n\n", "lang": "Python 2", "bug_code_uid": "03366e83fbcc0bd997e3158bb61db659", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "c25088256ccc3378ab1687175662294e", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4226289517470882, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "hpy,atky,defy = raw_input().split(\" \")\nhpm,atkm,defm = raw_input().split(\" \")\nh,a,d = raw_input().split(\" \")\nhpy,atky,defy = int(hpy),int(atky),int(defy)\nhpm,atkm,defm = int(hpm),int(atkm),int(defm)\nh,a,d = int(h),int(a),int(d)\n\ndef test(hpy,atky,defy,hpm,atkm,defm):\n while hpm > 0:\n hpm -= max(0,atky-defm)\n hpy -= max(0,atkm-defy)\n if hpy <= 0:\n return -hpy + 1\n else:\n return 0\ncost = h*test(hpy,atky,defy,hpm,atkm,defm)\nfor i in range(0,100-atky+defm):\n for j in range(0,atkm-defy):\n cs = h*test(hpy,atky+i,defy+j,hpm,atkm,defm)+i*a+j*d\n if cs mtime:\n cost = (hp - y[0]) * h + (at - y[1]) * a + (de - y[2]) * d\n #print 'hui', hp, at, de, cost\n if ans > cost:\n ans = cost\n'''\nfor at in xrange(y[1], m[0] + m[2] + 1):\n for de in xrange(y[2], m[1] + 1):\n mloss = at - m[2]\n yloss = m[1] - de\n if mloss == 0:\n mtime = inf\n else:\n mtime = m[0] / mloss\n if yloss == 0:\n ytime = inf\n else:\n ytime = y[0] / yloss\n if ytime > mtime:\n cost = (at - y[1]) * a + (de - y[2]) * d\n if ans > cost:\n ans = cost\n else:\n hp = (mtime + 1) * yloss - y[0]\n cost = (hp - y[0]) * h + (at - y[1]) * a + (de - y[2]) * d\n if ans > cost:\n ans = cost\n'''\nif ans == inf:\n print 0\nelse:\n print ans\n #print 'ppc', hp, at, de\n \n", "lang": "Python 2", "bug_code_uid": "e18d68d579eb44fd3069082404156269", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "3fae8c2cc972dd40592a575b12c58159", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9753581661891118, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "\n\n\n\nlistwhite = []\nlistblack = []\n\nfor i in range(1,9):\n\n if i%2 == 0:\n k = 2\n else:\n k = 1\n\n for j in range(k,9,2):\n listwhite.append([i,j])\n\nfor i in range(1,9):\n\n if i%2 == 0:\n k = 1\n else:\n k = 2\n\n for j in range(k,9,2):\n listblack.append([i,j])\n\n\n# print(listwhite)\n# print(listblack)\nx1,y1,x2,y2 = map(int,input().split())\n\n\nif x1 == x2 and y1!=y2:\n rook = 1\n\n\nelif y1 == y2 and x1!=x2:\n rook = 1\n\n\nelif x1 != x2 and y1!=y2:\n rook = 2\nelse:\n rook = 0\n\n\n\nif [x1,y1] in listwhite and [x2,y2] in listwhite:\n\n if abs(x1 - x2) == abs(y1 - y2):\n bishop = 1\n\n else:\n bishop = 2\n\n\nelif [x1,y1] in listblack and [x2,y2] in listblack:\n\n if abs(x1 - x2) == abs(y1 - y2):\n bishop = 1\n\n else:\n bishop = 2\n\nelse:\n bishop = 0\n\nif abs(x1-x2) <= 1 and abs(y1-y2) <= 1:\n count = 1\n\nelse:\n count = 0\n if x1!=x2 and y1!=y2:\n if x1 >=x2 and y1 >=y2:\n count1 = 0\n count2 = 0\n while y1 != y2:\n count1+=1\n y1-=1\n x1-=1\n count1+=abs(x1-x2)\n\n while x1 != x2:\n count2+=1\n y1-=1\n x1-=1\n count2+=abs(y1-y2)\n\n count = min(count1,count2)\n\n\n elif x1 <=x2 and y1 >=y2:\n\n count1 = 0\n count2 = 0\n temp1,temp2,temp3,temp4 = x1,x2,y1,y2\n while y1 != y2:\n count1+=1\n y1-=1\n x1+=1\n count1+=abs(x1-x2)\n\n x1,x2,y1,y2 = temp1,temp2,temp3,temp4\n while x1 != x2:\n count2+=1\n y1-=1\n x1+=1\n count2+=abs(y1-y2)\n\n count = min(count1,count2)\n\n elif x1 <=x2 and y1 <=y2:\n\n count1 = 0\n count2 = 0\n temp1,temp2,temp3,temp4 = x1,x2,y1,y2\n while y1 != y2:\n count1+=1\n y1+=1\n x1+=1\n count1+=abs(x1-x2)\n x1,x2,y1,y2 = temp1,temp2,temp3,temp4\n while x1 != x2:\n count2+=1\n y1+=1\n x1+=1\n count2+=abs(y1-y2)\n\n count = min(count1,count2)\n elif x1 >=x2 and y1 <=y2:\n\n count1 = 0\n count2 = 0\n temp1,temp2,temp3,temp4 = x1,x2,y1,y2\n while y1 != y2:\n count1+=1\n y1-=1\n x1+=1\n count1+=abs(x1-x2)\n x1,x2,y1,y2 = temp1,temp2,temp3,temp4\n\n while x1 != x2:\n count2+=1\n y1+=1\n x1-=1\n count2+=abs(y1-y2)\n\n count = min(count1,count2)\n\n else:\n count+=abs(y1-y2) + abs(x2-x1)\n\n\nprint(rook,bishop,count)\n\n\n\n\n\n", "lang": "PyPy 3", "bug_code_uid": "3d8938662732cfcb537cb8f7dbc7cffe", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "868d6ff45b2b1d177915e45122a6ab0b", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9689578713968958, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "a,b,c,d = map(int,input().split())\nr_move = b_move = k_move = 0\nif(a==c or b==d):\n r_move = 1\nelse:\n r_move = 2\nif(abs(a-c)!=abs(b-d) and (a+b)%2==(c+d)%2):\n b_move = 2\nelif(abs(a-c)==abs(b-d)):\n b_move = 1\nelse:\n b_move = 0\nif(a==c or b==d):\n k_move = max(abs(a-c),abs(b-d))\nelif(abs(a-c)==abs(b-d)):\n k_move = min(abs(a-c), abs(b-d))\nelse:\n k_move = min(abs(a-c), abs(b-d)) + max(abs(a-c),abs(b-d)) - 1\nprint(r_move, b_move, k_move)\n\n\n ", "lang": "PyPy 3", "bug_code_uid": "ff895ca4a5d04fc956f92df3dddac4e4", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "apr_id": "6b51efabadccf3ecbdf30fb739c0a0d0", "difficulty": 1100, "tags": ["graphs", "math", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.47419804741980476, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "har = Str()\nvij = set()\nchk = ''\nvij.add(har)\nhar1 = har[:]\nfor i in xrange(len(har)):\n\tchk = har1[-1] + har1[:-1]\n\t#print chk\n\tvij.add(chk)\n\thar1 = chk[:]\nprint len(vij)", "lang": "PyPy 2", "bug_code_uid": "83171449deff91d40f6aa4e21a298d19", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "2fc30cafb9efe75bb621db93ae7eb69a", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4986690328305235, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "n, m = map(int, input().split())\na = [0] * m\nfor i in range(m):\n b, c = map(int, input().split())\n a[i] = [b -1, c - 1]\ncol = [0] * 7\nz = set()\nans = 0\nfor i in range(n):\n for i1 in range(6):\n for i2 in range(6):\n for i3 in range(6):\n for i4 in range(6):\n for i5 in range(6):\n for i6 in range(6):\n for i7 in range(7):\n col[0]= i1 + 1\n col[1] = i2 + 1\n col[2] = i3 + 1\n col[3] = i4 + 1\n col[4] = i5 + 1\n col[5] = i6 + 1\n col[6] = i7 + 1\n for j in range(m):\n z.add(max(col[a[j][0]], col[a[j][1]]) * 10 + min(col[a[j][0]], col[a[j][1]]))\n #print(z)\n #if len(z) > ans:\n #print(col)\n ans = max(ans, len(z))\n z = set()\nprint(ans)\n", "lang": "PyPy 3", "bug_code_uid": "ede4622405c6b9ffff78b15a6ccbacca", "src_uid": "11e6559cfb71b8f6ca88242094b17a2b", "apr_id": "c02aa6c415130739466d7c33d2b64248", "difficulty": 1700, "tags": ["graphs", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3518930957683742, "equal_cnt": 22, "replace_cnt": 16, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 22, "bug_source_code": "from math import ceil, floor\n\nx, y, a, b = map(int, input().split())\n\nx_bot = int(ceil(a/x)) * x\nx_top = int(floor(b/x) + 1) * x\n\ny_bot = int(ceil(a/y)) * y\ny_top = int(floor(b/y) + 1) * y\n\nx_vals = set(range(x_bot, x_top, x))\ny_vals = set(range(y_bot, y_top, y))\n\nprint(len(list(x_vals.intersection(y_vals))))\n", "lang": "Python 3", "bug_code_uid": "3f14dbe8e77ae787061b5995c9490160", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "8795b42150560c28074afd32f90f98b5", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9862937062937063, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "import time,math,bisect,sys\nfrom sys import stdin,stdout\nfrom collections import deque\nfrom fractions import Fraction\nfrom collections import Counter\npi=3.14159265358979323846264338327950\ndef II(): # to take integer input\n return int(stdin.readline())\ndef IO(): # to take string input\n return stdin.readline()\ndef IP(): # to take tuple as input\n return map(int,stdin.readline().split())\ndef L(): # to take list as input\n return list(map(int,stdin.readline().split()))\ndef P(x): # to print integer,list,string etc..\n return stdout.write(str(x)+\"\\n\")\ndef PI(x,y): # to print tuple separatedly\n return stdout.write(str(x)+\" \"+str(y)+\"\\n\")\ndef lcm(a,b): # to calculate lcm\n return (a*b)//gcd(a,b)\ndef gcd(a,b): # to calculate gcd\n if a==0:\n return b\n elif b==0:\n return a\n if a>b:\n return gcd(a%b,b)\n else:\n return gcd(a,b%a)\ndef readTree(): # to read tree\n v=int(input())\n adj=[set() for i in range(v+1)]\n for i in range(v-1):\n u1,u2=In()\n adj[u1].add(u2)\n adj[u2].add(u1)\n return adj,v\ndef bfs(adj,v): # a schema of bfs\n visited=[False]*(v+1)\n q=deque()\n while q:\n pass\ndef sieve():\n li=[True]*1000001\n li[0],li[1]=False,False\n for i in range(2,len(li),1):\n if li[i]==True:\n for j in range(i*i,len(li),i):\n li[j]=False\n prime=[]\n for i in range(1000001):\n if li[i]==True:\n prime.append(i)\n return prime\ndef setBit(n):\n count=0\n while n!=0:\n n=n&(n-1)\n count+=1\n return count\n#####################################################################################\ndef solve():\n x,y,a,b=L()\n lm=lcm(x,y)\n if strt>b:\n print(0)\n else:\n print(math.floor(b/lm)-math.floor((a-1)/lm))\n\n\n\n\nsolve()", "lang": "Python 3", "bug_code_uid": "8cf206a0389473411ab3697d1bcb5d5c", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "e49ff43e40af2edddf9248d9a865e18c", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.3175355450236967, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "x, y, a, b = (int(i) for i in input().split(' '))\n\nr = range(a, b + 1)\n\nprint(len(tuple(i for i in r if i % lcm(x, y) == 0)))", "lang": "Python 3", "bug_code_uid": "ed827915227fa351e75e3d8bfa5d840f", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "596c1ccdcc28f6e9dd4be80d67be286b", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.948905109489051, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())\nif n%2==1:\n print(\"Ehab\")\nelse print(\"Mahmoud\")\n\n", "lang": "PyPy 3", "bug_code_uid": "339468cf4a61e0c7f3cf766e12b24d8f", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "52920538979881c5b847196cc6250c13", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9836065573770492, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "input(); s = input(); print('NYOE S'[s[-1] != s[0] == 'S'::2", "lang": "Python 3", "bug_code_uid": "74deef91fddb5ca2ae0f2af4ddf39dcf", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "000e85fbf10ae8ed0de4a47c1f374429", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9841269841269841, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n input(); s = input(); print('NYOE S'[s[-1] != s[0] == 'S'::2])", "lang": "Python 3", "bug_code_uid": "d7dfddab13cfeee7c534ced3a3872193", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "e5a7f206f4e4a238cd7e67b6b93509eb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9959349593495935, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\ns=str(input())\ncountsf=0\ncountfs=0\nfor i in range(n):\n\tif \"SF\" in s[i:i+2]:\n\t\tcountsf+=1\n\telse:\n\t\tcontinue\nfor j in range(n):\n\tif \"FS\" in s[j:j+2]:\n\t\tcountfs+=1\n\telse:\n\t\tcontinue\nif countsf>countfs:\n\tprint(\"YES\")\nelse:\n\tprint(\"NO\"\n", "lang": "Python 3", "bug_code_uid": "184de49b820368312d15e34517e346ef", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "bb1a0fc8bf8896e660972173a5f4485e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9787928221859706, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "n=int(input())-1\nfor val in range(1,10**6):\n x=n\n Bool = False\n A,B=val,0\n if x%val == 0 x > 0:\n x = x//val\n x -= (val+1)\n if x%2 == 0:\n B=x//2\n Bool=True\n print(A,B)\n break\nif Bool==False:\n print(\"NO\")\n \n ", "lang": "Python 3", "bug_code_uid": "4f6ff2dd6f11942908d45e35fba099fb", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "c32f48655cdd59eecb4b67e97639aaa9", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9826589595375722, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "r = int(input())\n\nif (r<5 or r%2==0)\n print(\"NO\")\n exit()\n\nprint(1, (r-3) // 2)", "lang": "Python 3", "bug_code_uid": "cbdecd64189b67470b68e0bbda77ab04", "src_uid": "3ff1c25a1026c90aeb14d148d7fb96ba", "apr_id": "bd691f604e96be7719cb9abf9986e29e", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7400130975769482, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "\n\n\nn,k = map(int, raw_input().split())\nmod =1000000007\ndef div(a,b):\n return (a%mod*(pow(b,mod-2,mod)))%mod\n\ndic={}\n\ni=2\nn1=n\nwhile i*i<=n1:\n while n1%i==0:\n dic[i]=dic.get(i,0)+1\n n1/=i\n i+=1\nif n1!=1:\n dic[n1]=dic.get(n1,0)+1\n\npdt=1\nfor key in dic:\n #print key, dic[key]\n m=dic[key]\n ans=[[0]*(m+1) for i in range(k)]\n for idx in range(m+1):\n\n ans[0][idx]=div(1,m+1)\n for i in range(1,k):\n for j in range(m,-1,-1):\n for kxx in range(m,j-1,-1):\n ans[i][j]=(ans[i][j]+div(ans[i-1][kxx],kxx+1))%mod\n #print ans\n ax=0\n for i in range(m+1):\n ax=(ax+pow(key,i)*ans[k-1][i])%mod\n pdt=(pdt*ax)%mod\nprint pdt\nexit()\n", "lang": "PyPy 2", "bug_code_uid": "78f19b40cafa9dabdacb8118de2e15c7", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "2740de4f0d7171b42cd0a880f90a8ca2", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5373537353735374, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "import sys\nrange = xrange\ninput = raw_input\n\nMOD = 10**9 + 7\n\nn,k = [int(x) for x in input().split()]\n\ndef coef(n,k):\n prod = 1\n for j in range(k,n+k):\n prod *= j\n for j in range(1,n+1):\n prod //= j\n return prod\n\n# This is a multiplicative property\nEXP = 1\n\ni = 2\nwhile n>1 and i*i<=n:\n if n%i==0:\n count = 0\n while n%i==0:\n n//=i\n count += 1\n \n arr = [0]*(count+1)\n arr[-1] = 1\n\n for _ in range(k):\n val = 0\n for j in reversed(range(count+1)):\n val += arr[j]*pow(j+1,MOD-2,MOD)\n arr[j] = val\n tmp = 0\n for j in range(count+1):\n tmp += (i**j)*arr[j]\n EXP *= tmp\n\n i += 1\n\nif n>1:\n i=n\n count = 0\n while n%i==0:\n n//=i\n count += 1\n \n arr = [0]*(count+1)\n arr[1] = 1\n\n for _ in range(k):\n val = 0\n for j in reversed(range(count+1)):\n val += arr[j]*pow(j+1,MOD-2,MOD)\n arr[j] = val\n tmp = 0\n for j in range(count+1):\n tmp += (i**j)*arr[j]\n EXP *= tmp\n\nprint EXP%MOD\n", "lang": "PyPy 2", "bug_code_uid": "993667c4fd625657cde7aa649c253877", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "d888cb3753d8bf4b14bf1bc7038b5e61", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8888888888888888, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "MOD = 1000000007\n\nA, K = 50, 10002\n\ndp = [[0 for i in xrange(K)] for j in xrange(A)]\n\nn, kk = map(int, raw_input().strip().split())\ndivi = []\nN = n\n\ni = 2\nwhile i * i <= n:\n if n % i == 0:\n isprime = 1\n for p in divi:\n if i % p == 0:\n isprime = 0\n break\n if isprime:\n while n % i == 0: n //= i\n divi.append(i)\n \nif n > 1: divi.append(n)\n \nfor i in xrange(K): dp[0][i] = 1\n\nans = 1\n \nfor p in divi:\n al = 0\n while N % p == 0:\n N //= p\n al += 1\n \n for k in xrange(al + 1): dp[k][0] = pow(p, k, MOD)\n for i in xrange(1, al + 1):\n for j in xrange(1, kk + 1):\n dp[i][j] = 0\n for k in xrange(i + 1):\n dp[i][j] += dp[k][j - 1]\n if dp[i][j] >= MOD: dp[i][j] %= MOD;\n \n dp[i][j] = dp[i][j] * pow(i + 1, MOD - 2, MOD)\n \n if dp[i][j] >= MOD: dp[i][j] %= MOD\n \n ans *= dp[al][kk]\n \n if ans >= MOD: ans %= MOD\n \nprint ans", "lang": "PyPy 2", "bug_code_uid": "430b353a91055e82c5871e5de9513171", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "4ef1decb79283b15d2545a950d210f6a", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.24763619990995048, "equal_cnt": 19, "replace_cnt": 17, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "from collections import defaultdict\nfrom math import sqrt\n\nn, k = [int(i) for i in input().split()]\np = 10 ** 9 + 7\n\ndef factorize(n):\n res = [] \n for i in range(1, int(sqrt(n)) + 1):\n if n % i == 0:\n res.append(i)\n res.append(n // i)\n return tuple(sorted(list(set(res))))\n\nd = factorize(n)\nD = {n: d}\nDP = [[0] * len(d) for i in range(k + 1)]\nDP[0][-1] = 1\nind = {d[i]: i for i in range(len(d))}\n# mod = [pow(len(d), p-2, p)]\n\n# for i in range(k):\n# mod.append(pow(mod[-1], 2, p))\nmod = [1, 1]\nfor i in range(2, len(d) + 1):\n mod.append(p - (p // i) * mod[p % i] % p)\n\ndef get_d(n):\n res = []\n for d_ in d:\n if d_ > n:\n break\n if n % d_ == 0:\n res.append(d_)\n return tuple(res)\n \n\nfor i in range(k):\n for j in range(len(d)):\n if not d[j] in D:\n D[d[j]] = get_d(d[j])\n for d_ in D[d[j]]:\n DP[i+1][ind[d_]] += DP[i][j] * mod[len(D[d[j]])]\nans = 0\ns = 0\nfor d_ in d:\n ans += DP[k][ind[d_]] * d_\n s += DP[k][ind[d_]]\n\nprint((ans % p))", "lang": "PyPy 3", "bug_code_uid": "a9ae786ea213a3c0c60aedafbcb3b1e2", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "0496ad0abde1b8d42db82f228b0a5025", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7453294001966568, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "from collections import defaultdict\nfrom math import sqrt\n\nn, k = [int(i) for i in input().split()]\np = 10 ** 9 + 7\n\ndef factorize(n): \n i = 2\n A = defaultdict(int)\n \n while n % i == 0:\n n //= i\n A[i] += 1\n i += 1\n\n while n != 1 and i <= sqrt(n):\n while n % i == 0:\n n //= i\n A[i] += 1\n i += 2\n if n != 1:\n A[n] += 1\n\n return A\n\nD = dict(factorize(n))\nans = 1\nmod = [1, 1]\nfor i in range(2, 50):\n mod.append(p - (p // i) * mod[p % i] % p) \n\nfor key, v in D.items():\n DP = [[0] * (v+1) for i in range(k+1)]\n DP[0][v] = 1\n for i in range(k):\n for j in range(v+1):\n for l in range(j+1):\n DP[i+1][l] += DP[i][j] * mod[j+1]\n res = 0\n pk = 1\n for i in range(v+1):\n res += DP[k][i] * pk\n pk *= key\n ans *= res\n ans %= p\n\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "3473f15e3c638cd579d791dda6752b83", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "0496ad0abde1b8d42db82f228b0a5025", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5109489051094891, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "# import time\n\nmod = int(1e9 + 7)\n\ndef fast_expo(x, k):\n ans = 1\n while k > 0:\n if (k & 1) > 0:\n ans = (ans * x) % mod\n x = (x * x) % mod\n k >>= 1\n return ans\n\ndef inverse(x):\n return fast_expo(x, mod - 2)\n\nN, K = [int(_) for _ in input().split()]\n# start_time = time.time()\nprime_factors = {}\ni = 2\ncurr = N\nwhile i * i <= curr:\n if curr % i == 0:\n prime_factors[i] = 0\n while curr % i == 0:\n prime_factors[i] += 1\n curr //= i\n i += 1\n\nif curr > 1:\n prime_factors[curr] = 1\n\ndpCurr = {p: {e: fast_expo(p, e) for e in range(60)} for p in prime_factors.keys()}\n# after 0 steps, EV = itself\nfor it in range(K):\n dpNext = {p: {e: 0 for e in range(60)} for p in prime_factors.keys()}\n for p in prime_factors.keys():\n prefix = 0\n divisors = 0\n for e in range(prime_factors[p] + 1):\n prefix += dpCurr[p][e]\n divisors += 1\n assert divisors == e + 1 # yup\n dpNext[p][e] = inverse(divisors) * prefix\n dpCurr = dpNext\n # print(dpCurr)\n\n# because the dp is multiplicative, we can merge the answer\nans = 1\nfor p, e in prime_factors.items():\n ans = (ans * dpCurr[p][e]) % mod\nprint(ans)\n# print(time.time() - start_time)", "lang": "PyPy 3", "bug_code_uid": "304e52d8dfc64dfc68c26988709f6cef", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "878170a63ee8d6df971228084989b8a9", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7347083926031295, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "x,k=map(int,input().split())\n#x=60\n#k=5\nif x==1:\n print(1)\n import sys\n sys.exit()\n\nimport math \nL=int(math.sqrt(x))\nmod=10**9+7\nFACT=dict()\n\nfor i in range(2,L+2):\n while x%i==0:\n FACT[i]=FACT.get(i,0)+1\n x=x//i\n\nif x!=1:\n FACT[x]=FACT.get(x,0)+1\n\n\ndef prod(A,B,k,l,m):#A:k*l,B:l*m\n C=[[None for i in range(m)] for j in range(k)]\n\n for i in range(k):\n for j in range(m):\n ANS=0\n for pl in range(l):\n ANS=(ANS+A[i][pl]*B[pl][j])%mod\n\n C[i][j]=ANS\n\n return C\n\n#XX=[[1,1],[1,1],[1,1]]\n#YY=[[2,2,2],[2,3,4]]\n#print(prod(XX,YY,3,2,3))\n\nMAT_index=max(FACT.values())+1\nMAT=[[0 for i in range(MAT_index)] for j in range(MAT_index)]\n\nfor m in range(MAT_index):\n for l in range(m+1):\n x=pow(m+1,mod-2,mod)\n MAT[m][l]=x\n\n#print(MAT)\nMAT_ini=MAT\nfor i in range(k-1):\n MAT=prod(MAT,MAT_ini,MAT_index,MAT_index,MAT_index)\n\n#print(MAT)\n\nANS=1\nfor fa in FACT:\n x=FACT[fa]\n ANS_fa=0\n\n for i in range(x+1):\n ANS_fa=(ANS_fa+pow(fa,i,mod)*MAT[x][i])%mod\n\n ANS=ANS*ANS_fa%mod\n\nprint(ANS)\n", "lang": "PyPy 3", "bug_code_uid": "9668e2f3ec9f58bfbef8023af4cd7e68", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "apr_id": "60fc3a37a3e0af5f570ee8a54079a87f", "difficulty": 2200, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9801980198019802, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a = input()\nb = {}\nb[a] = 1\nfor i in range(0,len(a)-1):\n\ta = a[1:] + a[0:1]\n\tb[a] = 1\n\nprint len(b)", "lang": "Python 2", "bug_code_uid": "dcd45791513e791cede4383981e09852", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e", "apr_id": "5f3043c8bfacd2bffbf0d6a3c32d4f38", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.935251798561151, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "m,b = map(int,input().split())\nans=0\nfor x in range(m*b+1):\n y = int(-x/m+b)\n t = ((x+1)*(y+1)*(x+y))//2\n ans = max(ans,t)\nprint(ans)", "lang": "Python 3", "bug_code_uid": "ffe2f97b55e7cb9f21c84b430272701e", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "d05b14fc6009f5ed1c0891f3bed77b9c", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.39588688946015427, "equal_cnt": 25, "replace_cnt": 11, "delete_cnt": 10, "insert_cnt": 5, "fix_ops_cnt": 26, "bug_source_code": "#include \nusing namespace std;\n\nint main()\n{\n int m,b;\n cin >> m >> b;\n\n long long t = 0;\n long long ans = 0;\n for(int x=0;x<=m*b;x++)\n {\n int y = int(-float(x)/m+b);\n t=((x+1)*(y+1)*(x+y))/2;\n ans = max(ans,t);\n }\n cout << ans;\n}\n", "lang": "Python 3", "bug_code_uid": "ae030387a4412a3c22a10aec82fe241e", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "d05b14fc6009f5ed1c0891f3bed77b9c", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.0825147347740668, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "\nn = int(input())\nm = 1\nl = []\ncounter = 0\nwhile m < n + 1:\n command = input()\n if command != \"remove\":\n l += [int(command.split()[1])]\n else:\n if l[-1] != m:\n l.sort(reverse=True)\n counter += 1\n l.pop()\n m += 1\n\nprint(counter)", "lang": "Python 3", "bug_code_uid": "1e464193bcd886a8535aba6c5b260343", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "5c77114a1a2ce7419db8992ff78b494f", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6796116504854369, "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()))\nm,b=A[0],A[1]\ndef banana(x,y):\n s=0\n for i in range(x+1):\n s+=i\n banan=0\n for i in range(y+1):\n banan+=s+i*(x+1)\n return banan\nmx=0\nfor y in range(b+1):\n x=(b-y)*m\n mx=max(mx,banana(x,y))\nprint(mx)\n \n \n \n \n\n \n", "lang": "Python 3", "bug_code_uid": "c78d4376930ba6d18b63064b0edab625", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "25df923758ac87d199dc91b96053a95c", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6836734693877551, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n,k,l,c,d,p,nl,np=map(int,input().split())\nprint(min((k*l)//nl),(min((c*d),(p//np))))//n)", "lang": "PyPy 3", "bug_code_uid": "b64e2e8d2757bcc395fb360cd618ae5b", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "1c3c566b58f6de658d4ecb8cb4f3482e", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9932885906040269, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n,k,l,c,d,p,nl,np=map(int,input().split())\nprint(min(k*l//nl,p//np,c*d)//n", "lang": "PyPy 3", "bug_code_uid": "b94317da75d05badcb31873ab50512f5", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "90c75b2ecbed48a55cf035b2cca43269", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9901269393511989, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "(a, k) = input().split()\na = list(a)\nk = int(k)\nsorted_a = reversed(sorted(a))\ni = 0\n\nwhile k > 0 and a != sorted_a:\n for j in range(9, 0, -1):\n c = str(j)\n if c in a[i:] and a[i:].index(c) <= k:\n l = a[i:].index(c)\n k -= l\n a.insert(int(i), a.pop(i+l))\n break\n i += 1\n\nprint(''.join(a))\n", "lang": "Python 3", "bug_code_uid": "76058445b1eb20141c7326bf218ac118", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "31a44b57c7d3c5fad6c221a34db98a20", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9317443120260022, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "(x, a), b = list(input().split()), 0\n\na = int(a)\nx = list(map(int, list(str(x))))\n\nfor i in range(len(x) - 1):\n m = [-1, -1]\n\n if a > 0:\n if i + 1 + a > len(x):\n b = len(x)\n else:\n b = i + 1 + a\n else:\n break\n\n for j in range(i, b):\n if x[j] > m[0]:\n m[0] = x[j]\n m[1] = j\n\n x[i], x[m[1]] = x[m[1]], x[i]\n a = a - (m[1] - i)\n\nx = list(map(str, x))\n\nprint( ''.join(x) )\n", "lang": "Python 3", "bug_code_uid": "1d0853f5c6c40d5065965821b23dfe59", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "66539ebf970906f3028cb7e949c45b0b", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "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": "n, k = map(int, input().split())\ns = list(str(n))\nres = ''\nwhile(len(s) > 0):\n mx = max(s[:k+1])\n idx = s.index(mx)\n k -= idx\n s.pop(idx)\n res += mx\nprint(res", "lang": "Python 3", "bug_code_uid": "1c114c33557ff9e55b8af0920e6a2046", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "d68653b0cadf80ee817003de2578c21b", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.35359116022099446, "equal_cnt": 21, "replace_cnt": 8, "delete_cnt": 10, "insert_cnt": 4, "fix_ops_cnt": 22, "bug_source_code": "n = int(raw_input())\na = [map(int, raw_input().split()) for i in range(n)]\n\nres = 1\nfor i in range(n):\n for j in range(n):\n if a[i][j] != 1:\n d = 0\n for x in range(n):\n for y in range(n):\n if a[i][j] == a[i][x] + a[y][j]: d+= 1\n if d > 0: break\n if d == 0: res = 0 \nprint [\"No\", \"Yes\"][res]\n \n", "lang": "Python 2", "bug_code_uid": "4664569bc0a86c78c5230d88944ca0af", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "ac2d138e2f03781119b8bd08c3c434d0", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9855769230769231, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "sf=0\nfs=0\nn=int(input())\nc=input()\nn-=1\nd=c[0]\ns=c[1::]\nfor t in s:\n if(d=='S' and t=='F'):\n sf++\n elif(d=='F' and t=='S'):\n fs++\n d=t\nif(sf>fs):\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "e7ed7f163e1daa7ffb0f384ec5757975", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "8261bfaf870aff107e2ed32898fa1085", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9951219512195122, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nstr1=input()\nif str1[0]=='S' and str1[n-1]='F':\n print('YES')\nelse:\n print('NO')\n", "lang": "Python 3", "bug_code_uid": "8b54f83df0206ad8fa69a25a91cde5c2", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "2aa38330628a10cb8d8feabada2ed547", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9465648854961832, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "x=int(input())x=int(input())\ny=input()\ncount1=y.count('FS')\ncount2=y.count('SF')\nif(count2>count1):\n print(\"YES\")\nelse:\n print(\"NO\")", "lang": "Python 3", "bug_code_uid": "17105ca54a91ea7e704a763a2d88b3a5", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "apr_id": "492582ce537807b17e78ab201b0d1023", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9833333333333333, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def answer():\n n = int(input())\n elif n%2:\n print(\"ehab\")\n elif n%2==0:\n print(\"Mahmoud\")\nanswer()", "lang": "Python 3", "bug_code_uid": "74cd8a3215b62644ea4b54901713210c", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "b49e1e8472b585426f4427e9c1afd63f", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7396351575456053, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "v = list(map(int, input().split()))\n found = False\n\n for i in range(v[0] + 1):\n a = i\n b = v[0] - i\n\n if (v[1] - a) < 0 or (v[2] - b) < 0:\n continue\n\n if (v[1] - a) == v[2] - b:\n print(a, v[1] - a, b)\n found = True\n break\n if not found:\n print(\"Impossible\")", "lang": "Python 3", "bug_code_uid": "0151f84cf997e76cf9d5f6b7f8d5ed67", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "a0c77d0f0adad1f15ce65a8cf4b911d2", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.18278427205100956, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "atoms=input().split(' ')\nattoms=[]\nout=''\nfor atom in atoms:\n\tattoms.append(int(atom))\nif (attoms[0]+attoms[1]+attoms[2])%2 !=0:\n print('Impossible')\n quit()\nif attoms[0]==attoms[1]==attoms[2]:\n print(str(int(attoms[0]/2))+' '+str(int(attoms[0]/2))+' '+str(int(attoms[0]/2)))\n quit()\nfor q in range(attoms[0]+1):\n for w in range(attoms[1]+1):\n for e in range(attoms[2]+1):\n if q + w +e == (attoms[0]+attoms[2]+attoms[1])/2 and attoms[0]==(q+e)and attoms[1]==(q+w)and attoms[2]==(e+w):\n out=str(q)+' '+str(w)+' '+str(e)\n print(out)\n quit()\nprint('Impossible')\n\n", "lang": "Python 3", "bug_code_uid": "73e82edd180cfa2402022a1e9cb63514", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "92c84b718fe9460dc105a8c57d6cbdcf", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9023696682464455, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "a, b, c = map(int, input().split())\nx = a\ny = b\nz = c\nif a > b + c or b > a + c or c > a + b or (a + b + c) % 2 != 0:\n print('Impossible')\n exit(0) \nif a >= b and a >= c:\n while x <> y + z:\n g += 1\n y -= 1\n z -= 1\n print(x - y, g, x - z)\n exit(0)\nif b >= a and b >= c:\n while y <> x + z:\n g += 1\n x -= 1\n z -= 1\n print(y - x, y - z, g)\n exit(0)\nif c >= a and c >= b:\n while y <> x + z:\n g += 1\n x -= 1\n y -= 1\n print(g, z - y, z - x)\n exit(0) \n ", "lang": "Python 3", "bug_code_uid": "3ded3d843ac67987c5efc954dedac74b", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "06819d694efba50a303584dfe8d8d260", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8047619047619048, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "n, k = map(int, input().split())\nname = input()[:n]\nname = list(name)\nif n % 2 == 0:\n for i in set(name):\n if name.count(i) > n // 2:\n print('NO')\n break\n else:\n print('YES')\nelse:\n print('NO')\n", "lang": "Python 3", "bug_code_uid": "e53c3322f824c332b55c6fc92fcd51e1", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "ed1c1ca027a7253cc68b17dbc92a2a9d", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.027598102630444158, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "# # --- Система регистрации (словарь)---\n# keys = int(input())\n# names = [input() for row in range(keys)]\n# database = dict()\n# for i in names:\n# if i not in database:\n# database[i] = 0\n# print('OK')\n# else:\n# for k, val in database.items():\n# if val >= 0 and k == i:\n# val += 1\n# database[i] = val\n# print(k + str(val))\n# # print(k + f'{val}')\n\n\n# # --- Система регистрации (правильное решение)---\n# keys = int(input())\n# names = [input() for row in range(keys)]\n# database = dict()\n# for i in names:\n# if i in database:\n# database[i] += 1\n# print(i + str(database[i]))\n# else:\n# database[i] = 0\n# print('OK')\n\n\n# # --- Single number ---\n# nums = [2, 2, 1, 1, 1, 7]\n# count = {}\n# for i in nums:\n# \tif i in count:\n# \t\tcount[i] += 1\n# \telse:\n# \t\tcount[i] = 1\n# for i in count:\n# \tif count[i] == 1:\n# \t\tprint(i)\n\n\n# # --- Persons ---\n# contacts = {\n# \"John Kennedy\": {\n# 'birthday': '29 may 1917',\n# 'city': 'Brookline',\n# 'phone': None,\n# 'children': 3\n# },\n# \"Arnold Schwarzenegger\": {\n# 'birthday': '30 july 1947',\n# 'city': 'Gradec',\n# 'phone': '555-555-555',\n# 'children': 5\n# },\n# \"Donald John Trump\": {\n# 'birthday': '14 july 1946',\n# 'city': 'New York',\n# 'phone': '777-777-333',\n# 'children': 4\n# }\n# }\n\n# persons = list(contacts.keys())\n\n# for person in persons:\n# print(person)\n# for data in contacts[person]:\n# print(data, contacts[person][data], sep=': ')\n# print()\n\n\nballs, friends = map(int, input().split())\ncolours = input().lower()\ni = 0\nlucky = 0\nwhile len(colours) > 0:\n for j in range(1, len(colours)):\n if colours[i] != colours[j]:\n colours = colours[1:j] + colours[j + 1:]\n lucky += 1\n break\n if j == len(colours) - 1:\n i = 1\n if i == 1:\n break\nif len(colours) == 0 or lucky == friends:\n print('YES')\nelse:\n print('NO')\n", "lang": "Python 3", "bug_code_uid": "733bb0ca6998ff4cbc6e7acda4d23bd3", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "975b0cd8181cf9a21a1ec46cb4c631e0", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9851851851851852, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "a, k = input().split()\na = [int(i) for i in a]\nk = int(k)\n\nn = 0\nfor i in range(len(a)):\n if n >= k: break\n max_i = i + a[i:i + k - n].index(max(a[i:i + k - n]))\n t = a.pop(max_i)\n a.insert(i, t)\n n += max_i - i\n \nprint(''.join(str(i) for i in a))\n", "lang": "Python 3", "bug_code_uid": "8e151339409176fe7bc2f086c626979e", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "f4e02eef9111b04b5402e81393b46517", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9774964838255977, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "import sys\ninput = sys.stdin.readline\ndef multi_input():\n return map(int, input().split())\n\ndef array_print(arr):\n print(''.join(map(str, arr)))\n\nn, k = multi_input()\nk1 = k\nn1 = n\nlen = 0\nwhile n1:\n n1 = n1//10\n len +=1\n\na = [0]*len\ni = len\nwhile n:\n temp = n%10\n a[i-1] = temp\n n //= 10\n i-=1\n\ni = 0\nwhile k>0:\n max1 = a[i]\n indx = i\n for j in range(i, min(len, i+k+1)):\n # print(j)\n if a[j]>max1:\n max1 = a[j]\n indx = j\n\n if i!=indx:\n for j in range(i+1, indx+1):\n a[i], a[j] = a[j], a[i]\n k-=1\n i = (i+1)%len\n # array_print(a)\n if i==len-1 and k==k1:\n break\n\narray_print(a)\n", "lang": "Python 3", "bug_code_uid": "feb5b07338da2ee5081e3d699eb62120", "src_uid": "e56f6c343167745821f0b18dcf0d0cde", "apr_id": "d3806d76026bc46bb6b2a8c23c97c769", "difficulty": 1400, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.925531914893617, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "n, k, l, c, d, p, nl, np = list(map(int, input().split()))\n\nreturn min(k*l/nl, c*d, p/np)//n", "lang": "Python 3", "bug_code_uid": "10c5f60601f83027ce30943970e7c255", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "cdb197f9b05f066a9ccc0e2d7f37abe3", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9866666666666667, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\n\nif (n+1) % 2 ==0 and (n!=0):\n print((n+1)//2)\nelse if n==0:\n print(0)\nelse:\n print(n+1)", "lang": "Python 3", "bug_code_uid": "26fbb989855ed1e45b8ba473c25c54a6", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "d94648f1248bb94d4862bfe4f0473e4c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9468085106382979, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "l = list(map(int, input().split()))\nn = l[0]\nk = l[1]\nm = input(str())\nm = sorted(m)\nmaxx = 0\nindex = m[0]\nFlag = 0\n\nfor i in m:\n if i == index:\n Flag += 1\n else:\n if Flag > maxx:\n maxx = Flag\n Flag = 0\n index = i\n if i == index:\n Flag += 1\n \nif maxx > k:\n print(\"NO\")\nelse:\n print(\"YES\")\n", "lang": "Python 3", "bug_code_uid": "7cb3e99f48bb7812939cdfcdbb25e3a6", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "6341c5dfcdd5929ce9c934260329e1ca", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7584541062801933, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "from collections import defaultdict\n\nn, k = map(int, input().split())\n\ncolors = input()\ncount = defaultdict(lambda:0)\n\nfor color in colors:\n count[color] zz\n \nprint(0)", "lang": "Python 3", "bug_code_uid": "0348bd7e4ea3f4f90df28a0f16f09cef", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be", "apr_id": "bbc2c98e0055a0e462d50ce69d75bc75", "difficulty": 900, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.49469964664310956, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "x,y,a,b=map(int, raw_input().split())\nif a%x:\n ax = a-a%x+x\nif a%y:\n ay = a - a%y+y\n\nprint len(set(range(ax,b+1, x))&set(range(ay,b+1,y)))", "lang": "Python 2", "bug_code_uid": "8e510c433597fa349dde375289e642b7", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "990286f4fedfd0066c04027324160fb6", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9273356401384083, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "import fractions\n\n\nx,y,a,b=map(int, raw_input().split())\ncd = fractions.gcd(x, y)\n\nr=x*y/cd\nar=a\nif a%r:\n ar = a-a%r+r\n\nprint len(range(ar,b+1, r))", "lang": "Python 2", "bug_code_uid": "61688994bb174b8b6d04ca9f2053da30", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "apr_id": "990286f4fedfd0066c04027324160fb6", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9203821656050956, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "import math\n\nif __name__ == \"__main__\":\n n, x, pos = map(int, input().split())\n l = 0\n r = n\n a = 0 # a&n1 -> smaller\n b = 0\n p = 1000000007\n while l < r:\n m = math.floor((l+r)/2)\n if m < pos:\n a = a + 1\n l = m + 1\n elif m > pos:\n b = b + 1\n r = m\n elif m == pos:\n l = m + 1\n n1 = x - 1\n n2 = n - x\n ans = math.factorial(n1) // math.factorial(n1-a) % p\n ans = ans * math.factorial(n2) // math.factorial(n2-b) % p\n ans = ans * math.factorial(n-a-b-1) % p\n print(ans)\n", "lang": "PyPy 3", "bug_code_uid": "718f8d0f1fff62bd79773ce206a885a7", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "1f70323061394ae99ab79ec07072cfd4", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9949849548645938, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, x, p = map(input().split())\nmod = 10 ** 9 + 7\nans = 1\nleft, right = 0, n\nc1, c2 = 0, 0\nwhile left < right:\n mid = left + (right - left) // 2\n if mid <= p:\n c1 += 1\n left = mid + 1\n else:\n c2 += 1\n right = mid\nans = 1\nfor i in range(1, n - c1 - c2 + 1):\n ans = ans * i % mod\nc1 -= 1\np1, p2 = x - 1, n - x\nfor i in range(p1, p1 - c1, -1):\n ans = ans * p1 % mod\n p1 -=1\nfor i in range(p2, p2 - c2, -1):\n ans = ans * p2 % mod\n p2 -= 1\nprint(ans)", "lang": "PyPy 3", "bug_code_uid": "49bd3468374d5b6bf5e6f7ebe8ecc14a", "src_uid": "24e2f10463f440affccc2755f4462d8a", "apr_id": "a3b2650c9a58cbe185cb98aa2ec34ef0", "difficulty": 1500, "tags": ["combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9929078014184397, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "a,b,c = sorted(map(int,input().split()))\nprint(max(0, c - a - b + 1)))", "lang": "Python 3", "bug_code_uid": "24606a445fc46ca2af3135018d2d95f1", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "d5f56f12166363b9fe8bb1ab6d01f81b", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9659863945578231, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "l=list(map(int,input.split())\nl.sort()\nprint max(0,l[2]-(l[0]+l[1]-1))\n", "lang": "Python 3", "bug_code_uid": "4e37eec42616688c7f37913a290904ae", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "29c599a3e8b4a1c28609119bc2b8439e", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.2145922746781116, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "x=0\nz=[]\ny=int(input())\ncount=0\nfor i in range (y):\n\tz.append(input())\nfor i in z:\n if i== \"++X\" or i ==\"X++\":\n count+=1\n else:\n count-=1\n print(count)", "lang": "Python 3", "bug_code_uid": "7744c0d9fafdab5a764276141830c32b", "src_uid": "3dc56bc08606a39dd9ca40a43c452f09", "apr_id": "fd8bba1e322b87f943c15857c9003219", "difficulty": 800, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.6802325581395349, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 8, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "l,d,v,g,r=map(float,raw_input().split())\ns,S=d/v,0.0\nwhile True:\n\tS += g\n\tif s <= S:\n\t\ts = 0.0\n\t\tbreak\n\tS += r\n\tif s <= S:\n\t\ts = S-s\n\t\tbreak\nprint l/v + s\n", "lang": "Python 2", "bug_code_uid": "768e639177af6ae7b6e6adcd09eeda48", "src_uid": "e4a4affb439365c843c9f9828d81b42c", "apr_id": "a9341378d500fbe33681cf38808477e5", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9952153110047847, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n m, b = map(int, input().split())\nx, y = m * b, b\ns = 1\n\nfor j in range(y+1):\n i = m * (b - j)\n a1 = i * (1 + i) >> 1\n d = i + 1\n n = j + 1\n s = max(s, n * (2 * a1 + (n - 1) * d) >> 1)\n\nprint(s)", "lang": "Python 3", "bug_code_uid": "835ae6e16602c9e4f27c6289e255efa0", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "09777ce1a5aeee567548cfc7eb234002", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7058823529411765, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "from math import floor\ndef summa(n):\n return (n*(n+1))/2\nm,b = map(int,raw_input().split())\ny = b\nans = 0\nwhile y>=0 :\n x = (b-y)*m\n temp = summa(floor(y))*(x+1) + summa(floor(x))*(y+1)\n if temp>ans :\n ans = temp\n y -= 1\nx = m*b\nwhile x>=0 :\n y = ((-1*x)/(m))+b\n temp = summa(floor(y))*(x+1) + summa(floor(x))*(y+1)\n if temp>ans :\n ans = temp\n x -= 1\nprint int(ans)\n", "lang": "Python 2", "bug_code_uid": "64b8e9f4d9fa6192223a20c681f315aa", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "b7d1c2f602f1e43e8b4458d8e5c6ea47", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3691460055096419, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "def main():\n m, b = map(int, raw_input().split())\n ans = tmp = (1 + b) * b / 2\n j = 0\n for i in xrange(1, m * b + 1):\n if j == 0:\n tmp -= b * i + i * (i - 1) / 2\n b -= 1\n tmp += (1 + b) * b / 2 + (b + 1) * i\n if ans < tmp:\n ans = tmp\n j += 1\n if j == m:\n j = 0\n print ans\nmain()\n", "lang": "Python 2", "bug_code_uid": "a11658a7f9d76d0780e4c40846155beb", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "4ac36e37ce0eb1eada3ff921bfb3c4a6", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7072072072072072, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "\nm,b = map(lambda x:int(x),raw_input().strip().split())\nsign1 = -m*b/abs(m*b)\nmaxs = 0\nfor x in range(int(b*m)+1):\n\tfor y in range(b+1):\n\t\tif (m*y+x-m*b)*sign1>=0:\n\t\t\ts = (x+y)*(x+1)*(y+1)/2\n\t\t\tmaxs = max(s,maxs)\nprint maxs\n\t\n\n", "lang": "Python 2", "bug_code_uid": "1adceefaf36c06c203f18cc256e38a03", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "67c40bfe6553ab9997247cc21e1c7d20", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4226190476190476, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 9, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "def count(a, b):\n return (a + 1) * (b + 1) * (a + b) / 2\n\nm, b = map(int, raw_input().split())\nfoo = 0\n\nfor i in range(m * b + 1):\n if count(i, (b * m - i) / m) > foo:\n foo = count(i, (b * m - i) / m)\n\nprint foo", "lang": "Python 2", "bug_code_uid": "98e9384af7861a46aa03d190f93d834e", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "apr_id": "b59db020a5951b60b8a41230d6a4e3fb", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.6898839137645107, "equal_cnt": 10, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "c,d,a,b=temp.split()\nc=int(c)\nd=int(d)\na=int(a)\nb=int(b)\nif(c=0:\n st-=1\n if res[-1] * n > ma:\n break\n res.append(res[-1] * n)\n return res\ntry: \n x,y,l,r = map(int,stdin.readline().split())\n a = get(x,r)\n b = get(y,r)\n c = set()\n for i in a:\n for j in b:\n if i + j >=l and i + j <=r:\n c.add(i+j)\n c = list(c)\n c.sort()\n ans = max(c[0]-l,r-c[-1])\n pr = l\n for i in c:\n ans = max(ans, i-pr-1)\n pr = i\n print ans\nexcept:\n while True:\n n = 1\n", "lang": "Python 2", "bug_code_uid": "29cb324a3c1aedfb53877517135570be", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "b97a670ad2363214e4fbf5a6377fe666", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5209876543209877, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "count = 0\nx,y,l,r = map(int, raw_input().strip().split())\nlist1 = []\ndone = False\nwhile not done:\n temp = list1[:]\n for i in range(count+1):\n a = i\n b = count -i\n ans = x**a + y**b\n if ans<=r and ans>=l:\n list1.append(ans)\n count += 1\n if temp == list1 and len(list1)!= 0:\n done = True\n break\nlist1 = sorted(list(set([l-1]+list1+[r+1])))\nlist3 = [abs(list1[n]-list1[n+1]) for n in range(len(list1)-1)]\nprint max(list3) - 1\n", "lang": "Python 2", "bug_code_uid": "caf8bbce52d843505ecb41e5029a93e7", "src_uid": "68ca8a8730db27ac2230f9fe9b120f5f", "apr_id": "e8b2dd0e9ef2590cb3216c4f2b60c96c", "difficulty": 1800, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.37635467980295567, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "#!/usr/bin/env python3\n\"\"\"\nCodeforces\n327 A. Flipping Game\n\n@author yamaton\n@date 2015-08-05\n\"\"\"\n\nimport itertools\n\ndef solve(xs):\n consecutive_zeros = max(sum(1 for _ in ite) for (i, ite) in itertools.groupby(xs) if i == 0) \n return xs.count(1) + consecutive_zeros\n\n\ndef main():\n n = int(input())\n xs = [int(i) for i in input().strip().split()]\n assert len(xs) == n\n result = solve(xs)\n print(result)\n\n\nif __name__ == '__main__':\n main()\n", "lang": "Python 3", "bug_code_uid": "70e07ed16ebf5fcf25cb7ad8964ad7e5", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "e997e9f88ab5e2dfed579794c438d4c7", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9411764705882353, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "def main():\n n,m,a,b = map(int,input().split())\n if n<=1:\n print(min(a,b))\n else: \n nOt=n//m\n if n%m!=0:\n nOt=nOt+1\n collection = []\n for i in range(nOt,1,-1):\n first = b*i\n second = a*(n-(i*m))\n if second<0:\n second = 0\n collection.append(first+second)\n print(min(collection)) \n\nif __name__ == \"__main__\":\n main()", "lang": "Python 3", "bug_code_uid": "48f3eedce25da7c1f04a18d544a5d6ac", "src_uid": "faa343ad6028c5a069857a38fa19bb24", "apr_id": "37997c722b5f8ca9a63980e1f1e4d3be", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7236180904522613, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "import math\nn,m=[int(x) for x in input().split()]\nd=math.factorial(n)\ne=math.factorial(m)\nf=math.gcd(d,e)\nprint(f)", "lang": "Python 3", "bug_code_uid": "cfba77ab6117497f39c27ecee04244ab", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "98e54b392e1745945692dbbb16a4f206", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5642105263157895, "equal_cnt": 21, "replace_cnt": 13, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "import sys\n\nfacto=[1,1,2,6]\n\ndef factorial(n):\n for i in range(4,n+1):\n facto.append(facto[i-1]*i)\n\ndef gcd(a,b):\n if(0==a%b):\n return b\n return gcd(b,a%b)\n\nA,B=[int(x)for x in sys.stdin.readline().strip().split()]\nfactorial(max(A,B))\nprint(gcd(facto[A],facto[B]))\n", "lang": "Python 3", "bug_code_uid": "032c49968073b9276150e41ce4013881", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "de3873f398b34bcb0171de4df22ce4ab", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.64, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "a,b= map(int, input().split())\nimport math\na1= math.factorial(a)\nb1= math.factorial(b)\nGCD = math.gcd(a1,b1)\nprint(GCD)\n \n", "lang": "Python 3", "bug_code_uid": "88e3d4c738a475f550b64e78436de272", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "3d2be33a712ff29ba73516a08ea56f27", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5223880597014925, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "a, b = map(int, input().split())\nfor i in range(1, a+1):\n a = a * i\nfor y in range(1, b+1):\n b = b * y\n\nwhile b != 0:\n a, b = b, a % b\nprint(a)", "lang": "Python 3", "bug_code_uid": "70477bddc5d3ae5ef95d460cc1667ace", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "apr_id": "337029e2b5d66c358d220812b7f29483", "difficulty": 800, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9594594594594594, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "n, k, l, c, d, p, nl, np,=input().split()\nn=int(n)\nk=int(k)\nl=int(l)\nc=int(c)\nd=int(d)\np=int(p)\nnl=int(nl)\nnp=int(np)\nprint((min(k*l,c*d,p)/n)", "lang": "PyPy 3", "bug_code_uid": "b01d7d870e6418d294dcfd5b7e1ab96f", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "e6538b35ca60bfbfbea0702856806a91", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9473684210526315, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "n,k,l,c,d,p,nl,np = map(int,input().strip().split())\nans1 = (k*l)/nl\nans2 = c*d\nans3 = p/np\nreturn min(ans1, ans2, ans3)/n", "lang": "PyPy 3", "bug_code_uid": "9c2bd85d667fd0763cd3a58539c07d3b", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "49e7c3611fec962362ccbbcdd74a6181", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.995260663507109, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n, k, l, c, d, p, nl, np = [int(i) for i in input().split()]\nprint(min((k*l)//(n*nl), c*d//n, p//(n*np))\n", "lang": "PyPy 3", "bug_code_uid": "13375aa5144cd016ba74a91e2d41738b", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "apr_id": "018206d698b0449f6c748ecfad5926ef", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9873556899395272, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "l=[]\nfor _ in xrange(8):\n a,b=map(int,raw_input().split())\n l.append((a,b))\n \na=[element[0] for element in l]\nb=[element[1] for element in l] \nl.sort()\na.sort()\nb.sort()\nmid=(l[3][0],l[1][1])\nq=a.count(a[0])==3 and b.count(b[0])==3 and a.count(a[3])==2 and b.count(b[3])==2\nq=q and a.count(a[5])==3 and b.count(b[5])==3\nif len(set(a))==3 and len(set(b))==3 and q and not(mid in l):\n b=(l[3][0]-l[0][0])+(l[5][0]-l[3][0])\n k=(l[3][0]-l[0][0]==l[4][0]-l[2][0]) and (l[5][0]-l[3][0]==l[7][0]-l[4][0])\n k=k and ((l[6][0]-l[1][0])==b)\n \n if k:\n b=l[1][1]-l[0][1]+(l[2][1]-l[1][1])\n m=(l[1][1]-l[0][1]==l[6][1]-l[5][1]) and (l[2][1]-l[1][1]==l[7][1]-l[6][1])\n m=m and ((l[4][1]-l[3][1])==b)\n if m:\n print 'respectable'\n else:\n print 'ugly'\n else:\n print 'ugly' \nelse:\n print 'ugly' ", "lang": "Python 2", "bug_code_uid": "730441c12789402ba37ea70e1b68248d", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "69ae9e5d21294503b56cbd26615a860d", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.6985446985446986, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "inp = []\nfor i in xrange(8):\n xy = map(int, raw_input().split())\n inp.append(xy)\nx_set = set([i[0] for i in inp])\ny_set = set([i[1] for i in inp])\nif len(x_set) == 3 and len(y_set) == 3:\n x_ls = sorted(list(x_set))\n y_ls = sorted(list(y_set))\n if [x_ls[1], y_ls[1]] in inp:\n print \"ugly\"\n else:\n print \"respectable\"\nelse:\n print \"ugly\"\n", "lang": "Python 2", "bug_code_uid": "e276169911ff9e901bea848a24f02335", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "09154b6644fe6f142530fcf16a845b0d", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7142042213348545, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "def strToInt(str_list):\n return map(int, str_list.split(' '))\n\n\ndef readInp():\n\n input_data = []\n for i in range(8):\n input_data.append(raw_input())\n\n return input_data\n\n\n\npoints = readInp()\n\nif len(set(points)) != len(points):\n print 'ugly'\nelse:\n \n x_list = []\n y_list = []\n for x,y in map(strToInt, points):\n x_list.append(x)\n y_list.append(y)\n\n X_min = min(x_list)\n X_max = max(x_list)\n\n Y_min = min(y_list)\n Y_max = max(y_list)\n\n if (x_list.count(X_min) == 3) & (x_list.count(X_max) == 3) &\\\n (y_list.count(Y_min) == 3) & (y_list.count(Y_max) == 3):\n print 'respectable'\n else:\n print 'ugly'", "lang": "Python 2", "bug_code_uid": "b07c82bb524b9b1041e93af194b2b13e", "src_uid": "f3c96123334534056f26b96f90886807", "apr_id": "1cae33fe24b3d2144bfc9f4fa94ae5c3", "difficulty": 1400, "tags": ["sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9117647058823529, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "r, x1, y1, x2, y2 = map(int, input().split())\nprint(ceil(((x1-x2)**2+(y1-y2)**2)**0.5/(2*r)))", "lang": "Python 3", "bug_code_uid": "da29c68fbf4189c86bbc1b3289466f8f", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "6fc8a6ce8868392e22ceb9f2eb3ddd94", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9797101449275363, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "from math import *\nx = [int(q) for q in input().split()]\nr = x[0]\nx1 = x[1]\ny1 = x[2]\nx2 = x[3]\ny2 = x[4]\n\nans = math.sqrt(((x1 - x2)**2 + (y1 - y2)**2))\nprint(ceil(ans/2*r))", "lang": "Python 3", "bug_code_uid": "07da9c14c625cb3500a807e833a0feeb", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "apr_id": "4c75b5ac6d4743fcf7fc23918846e723", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9411764705882353, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "a, b, c = map(int, input().split())\nx = a+b-c\ny = b+c-a\nz = c+a-b\nif x&1 or y&1 or z&1 or x<0 or y<0 or z<0:\n print('IMPOSSIBLE')\nelse\n print(x//2, y//2, z//2)", "lang": "PyPy 3", "bug_code_uid": "5a75dddb306868d659a31e6d35ae859d", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "apr_id": "2ee79c1ebea2e28ffc5a3cfdd3bc9c90", "difficulty": 1200, "tags": ["graphs", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9665071770334929, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "n = int(input())\nif n == 0:\n print(0)\nelif (n+1)%2 == 0:\n print((n+1)//2)\nelse n != 0:\n print(n+1)\n", "lang": "Python 3", "bug_code_uid": "2c61718edd4e03c70523f6bc0ef229c8", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "df3fdb521561b2da03c791accb0438bf", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5688073394495413, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "n = int(input())\nif (n+1) % 2 == 0 and n !+ 0:\n print((n+1)//2)\nelif n == 0:\n print(0)\nelse:\n print(n+1)\n", "lang": "Python 3", "bug_code_uid": "d01897d46f82b88bc03ed8c7ddaddd92", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "8cf802227efb223c2ed7fc3f0bd08b74", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.7864077669902912, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "n=int(input())\nif(n%2==0):\n if(n==0):\n print(0)\n break\n print(n+1)\nelse:\n print((n+1)//2)\n", "lang": "Python 3", "bug_code_uid": "a6b2fc7125907f6bafbf6b26ddc9d2af", "src_uid": "236177ff30dafe68295b5d33dc501828", "apr_id": "4d116b9ad3c1bdc1d0647ad82d2353d7", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9375, "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())\nif b<=a:\n\tc=b\n\t# d=a\nelif a<=b:\n\tc=a\n\t# d=b\ny=int(abs(a-b)/2", "lang": "Python 3", "bug_code_uid": "badbf60464759415de5e7cedcb0c039d", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "efa4c20678f54178f0370dce2e37d39f", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7494736842105263, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "\nnumbers = input ()\nredsock = int (numbers[0])\nbluesock = int (numbers [2])\ndays = 0\ncounter = 0\n \nwhile counter == 0:\n if (redsock >= 1) and (bluesock >= 1):\n days = days + 1\n redsock = (redsock - 1)\n bluesock = (bluesock - 1)\n else:\n if redsock == 0:\n days = days + (bluesock/2)\n if bluesock == 0:\n days = days + (redsock/2)\n counter = 1\n \nreturn (days)", "lang": "Python 3", "bug_code_uid": "3ea2a77e9fe6a7090e689ef84d05fb7e", "src_uid": "775766790e91e539c1cfaa5030e5b955", "apr_id": "9ca212d279078622c4f09f0cd72ce64c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.22495274102079396, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "n, k = map(int, raw_input().split());\ntotal = k * (k - 1) / 2;\nif total < n - 1: \n print -1;\nelse:\n ans = 0;\n tmp = n- 1;\n for i in range(k - 1):\n j = k - 1 - i;\n if tmp - j >= 0:\n tmp -= j;\n ans += 1;\n if tmp == 0:\n break;\n print ans;\n \n ", "lang": "Python 2", "bug_code_uid": "2c2bf8bbce4b5313c8f328d85d6a4dec", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "37b16eb2566ec82773223530882a63bf", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.19271948608137046, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "# encoding: utf-8\n\nif __name__ == '__main__':\n n, k = [int(x) for x in raw_input().rstrip().split()]\n \n ans = 0\n pipe = 1\n splitter = range(1, k)\n while (splitter):\n if pipe >= n:\n break\n s = splitter.pop()\n ans += 1\n pipe += s\n \n if pipe >= n:\n print ans\n else:\n print -1", "lang": "Python 2", "bug_code_uid": "84b8605b699bb9af629dc5ad6849c5ec", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "16d4be29f9cc2e982fc94df741b104a9", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3480278422273782, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "import math\nsl = raw_input().split()\nn = int(sl[0])\nk = int(sl[1])\n\nprint int((2*k-3 - math.sqrt((3-2*k)*(3-2*k) - 8*(n-k)))/2 + 1)", "lang": "Python 2", "bug_code_uid": "bcdfb5706a1f28c6bd09ee186b1dc815", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "d71ee700113a7a0bdc2fdcc54b733e33", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.24133148404993066, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "#!/usr/bin/env python\n# coding=utf-8\ndef solve(n, max_val):\n if n <= max_val:\n return 1\n return 1 + solve(n - max_val, max_val - 1)\n\nn, k = map(int, raw_input().split())\nn -= 1\nk -= 1\nif n > (k + 1) * k / 2:\n print -1\n exit(0)\nprint solve(n, k)\n\n", "lang": "Python 2", "bug_code_uid": "5e03f3f44f933ac2f70d007e9dd9203d", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "151b7372721b0cb39be3f9c2de11311a", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9855072463768116, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "import math\nn,k = map(int,raw_input().strip().split())\np=math.ceil((2*k-1 -((2*k-1)**2-8*(n-1))**(0.5))/2.0)\nprint int(0 if(n==1) else 1 if(n<=k) else -1 if(((2*k-1)**2-8*(n-1))<0) else 2 if(p==1) else p)", "lang": "Python 2", "bug_code_uid": "39824fab1309cd369f3d326acd49d249", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "apr_id": "e3236fa5e5e9321f3233dcc92afcd852", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9556756756756757, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "n = int(input())\na = list(map(int,list(input())))\nlst = []\nfor j in a:\n for i in range(i):\n if i==2:\n lst.append(i)\n elif i==3:\n lst.append(i)\n elif i==4:\n lst.extend([2,2,3])\n elif i==5:\n lst.append(i)\n elif i==6:\n lst.extend([2,3,5])\n elif i==7:\n lst.append(i)\n elif i==8:\n lst.extend([2,2,2,7])\n elif i==9:\n lst.extend([3,3,2,2,2,7])\nlst.sort(reverse=True)\nprint(''.join(list(map(str,lst))))", "lang": "Python 3", "bug_code_uid": "e2f78992d91afa4900ca78e6f5c27ca2", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "a05f41f576395cde0977278f3de56d3a", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.0584958217270195, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "input()\nd = {}\ns = ''\n\nfor i in range(0,10):\n d[i]=0\n\nfor i in (tuple(int(x) for x in input())):\n if i==9:\n d[7]+=1\n d[3]+=2\n d[2]+=3\n elif i==8:\n d[7]+=1\n d[2]+=3\n elif i==6;\n d[5]+=1\n d[3]+=1\n d[2]+=1\n elif i==4:\n d[3]+=1\n d[2]+=2\n else:\n d[i]+=1\n\nfor i in range(9,1,-1):\n s+=str(i)*d[i]\n\nprint(s)\n", "lang": "Python 3", "bug_code_uid": "8d56920bcdad1e0e374f33d41d9e4ea3", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "91e34c9623586864d25dcb1e95a2818e", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8329317269076305, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "import fileinput\nfrom math import ceil\n\n# args = [ 'line 1', 'line 2', ... ]\ndef proc_input(args):\n\t(hy, ay, dy) = [ int(x) for x in args[0].split() ]\n\t(hm, am, dm) = [ int(x) for x in args[1].split() ]\n\t(h, a, d) = [ int(x) for x in args[2].split() ]\n\treturn(hy, ay, dy, hm, am, dm, h, a, d)\n\ndef to_win(hy, ay, dy, hm, am, dm):\n\tdmgy = max(0, am - dy)\n\tdmgm = max(0, ay - dm)\n\tif dmgy == 0:\n\t\treturn 0\n\tif dmgm == 0:\n\t\treturn float('inf')\n\tnturns = ceil(hm / dmgm)\n\treturn max(0, (dmgy * nturns - hy + 1))\n\ndef solve(args, verbose=False):\n\t(a, b, c, i, j, k, x, y, z) = proc_input(args)\n\tlookup = {}\n\tmin = float('inf')\n\tfor a_y in xrange(b, 200 + 1):\n\t\tfor d_y in xrange(c, 100 + 1):\n\t\t\tr = (a_y - b) * y + (d_y - c) * z\n\t\t\tr += to_win(a, b, c, i, j, k) * x\n\t\t\tif min > r:\n\t\t\t\tmin = r\n\tassert(min >= 0)\n\tif verbose:\n\t\tprint int(min)\n\treturn int(min)\n\t\t\t\t\n\ndef test():\n\tassert(proc_input([ '1 2 3', '4 5 6', '7 8 9' ]) == (1, 2, 3, 4, 5, 6, 7, 8, 9))\n\tassert(solve([ '1 2 1', '1 100 1', '1 100 100' ]) == 99)\n\tassert(solve([ '100 100 100', '1 1 1', '1 1 1' ]) == 0)\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": "c3976ecf9398790304a460478d92fd7d", "src_uid": "bf8a133154745e64a547de6f31ddc884", "apr_id": "d45dc98b267c618d38f218f58349371a", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9906191369606003, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "l, r = raw_input().split()\nm = len(l)\nn = len(r)\n\nl = int(l)\nr = int(r)\n\nm9 = int('9' * m)\nn9 = int('9' * n)\nhm = int('4' + '9' * (m - 1))\nhn = int('4' + '9' * (n - 1))\n\nans = 0\n\nif m == n:\n ans = max(ans, max(l * (m9 - l), r * (n9 - r)))\n if (l <= hm and hm <= r):\n ans = max(ans, hm * (m9 - hm))\nelse:\n if l <= hm:\n ans = max(ans, hm * (m9 - hm))\n else:\n ans = max(ans, l * (m9 - l))\n\n if r <= hm:\n ans = max(ans, hn * (n9 - hn))\n else:\n ans = max(ans, r * (n9 - r))\n\nprint ans\n", "lang": "Python 2", "bug_code_uid": "e47361864099bc350a717836c104e289", "src_uid": "2c4b2a162563242cb2f43f6209b59d5e", "apr_id": "a3693f7892fbfa488d95763ba33ea7c0", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8600252206809584, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "def weight(num):\n p = str(num)\n st = \"\"\n count=0\n for character in p:\n reflection = str(9-int(character))\n st += reflection\n if st[0]==\"0\":\n#\n#we need to eliminate all d zeroesu #from d start till a non zejro is #encountered or d string lasts den #return 0 since unidigit 0 is allowedj\n#\n for r in range(1 , len(st)+1):\n if st[0:r] == (\"0\") * r:\n count+=1\n else:\n break \n#jaisa hi pehla non zero mila break d \n#loop\n#max r ki value store \n#ho jaayegi a mein loop ke end mein\n#\n if count == len(st):\n return 0\n else:\n return ((int(st[count:])) * num)\n else:\n return ((int(st)) * num)\n# \ndef max_weight(l , r):\n m = len(str(l))\n n=len(str(r)) #since r > l so m>=n\n p=int((int(\"9\" * n)) / 2)\n mp=weight(p)\n ml=weight(l)\n mr=weight(r)\n#\n if m==n :\n if rq:\n return ml\n else:\n return mp\n#bich mein p aayega hi\n else:\n if r < p :\n return mr\n else:\n return mp\n#\nL , R = map(int , raw_input().split(\" \"))\nprint max_weight(L , R)", "lang": "Python 2", "bug_code_uid": "f65301b4ebc6fb8844d2537105212a9a", "src_uid": "2c4b2a162563242cb2f43f6209b59d5e", "apr_id": "8cade2989b8426825cec47a75c9d862f", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9520295202952029, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "def weight(num):\n p = str(num)\n st = \"\"\n count=0\n for character in p:\n reflection = str(9-int(character))\n st += reflection\n if st[0]==\"0\":\n#\n#we need to eliminate all d zeroesu #from d start till a non zejro is #encountered or d string lasts den #return 0 since unidigit 0 is allowedj\n#\n for r in range(1 , len(st)+1):\n if st[0:r] == (\"0\") * r:\n count+=1\n else:\n break \n#jaisa hi pehla non zero mila break d \n#loop\n#max r ki value store \n#ho jaayegi a mein loop ke end mein\n#\n if count == len(st):\n return 0\n else:\n return ((int(st[count:])) * num)\n else:\n return ((int(st)) * num)\n# \ndef max_weight(l , r):\n m = len(str(l))\n n=len(str(r)) #since r > l so m>=n\n p=int((int(\"9\" * n)) / 2)\n q=p+1\n#\n if m==n :\n if l==p or r==p or l==q or r==q:\n return weight(p)\n elif rq:\n return weight(l)\n else:\n return weight(min((p-l) , (r-q)))\n else:\n if r < p :\n return weight(r)\n else:\n return weight(p)\n#\nL , R = map(int , raw_input().split(\" \"))\nprint max_weight(L , R)", "lang": "Python 2", "bug_code_uid": "3fc44b2d83a4a99a413c3c6d65c74c87", "src_uid": "2c4b2a162563242cb2f43f6209b59d5e", "apr_id": "8cade2989b8426825cec47a75c9d862f", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.12600229095074456, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "def check(msg,hmsg):\n l = msg.split(hmsg[0])\n for i in l :\n if len(i)=hmsg[1:].count(g):\n a+=1\n else:a=0\n if a:\n b=[x.index(i) for i in hmsg[1:]]\n b.sort()\n if b == [x.index(i) for i in hmsg[1:]]:\n return True\n return False\nst = raw_input()\nif check(st,list(\"hello\")):\n print \"YES\"\nelse:\n print \"NO\"\n", "lang": "Python 2", "bug_code_uid": "c94431160b91d50788385b2fff5888c7", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "apr_id": "ee1ef3d36b19486b18dc9148d7886a34", "difficulty": 1000, "tags": ["strings", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.2691511387163561, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "w = input()\n\nw = int(w)\n\nif(w % 2 == 0):\n if(w / 2 != 1):\n e = True\nelse:\n e = False\n if(e == False):\n if(w % 3 == 0):\n w = w / 3 \n if(w % 2 != 0):\n e = False\n else:\n e = True\n\nif(e == True):\n print(\"YES\")\nelse:\n print(\"NO\") \n \n", "lang": "Python 3", "bug_code_uid": "d121bffd41ac09f424d08fc3c4e4167c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "790887589698b7e4846a843fddae08c8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.0021691973969631237, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "def a(ans, n, pf):\n if n == 1:\n return ans\n for i in pf:\n if n % i == 0:\n m = a(ans + [i], n // i, pf[:i+1])\n if m != None:\n return m\n else:\n return None\n return None \nn = int(input())\ns = input()\npf1 = [1, 2, 6, 24, 120, 720, 5040, 40320, 362880]\npf = [2, 6, 120, 5040]\npfo = {2:2, 6:3, 120:5, 5040:7}\nsumm = 1\nfor i in s:\n if int(i) != 0:\n summ *= pf1[int(i)-1]\nfor i in pf:\n if summ % i == 0:\n m = a([i], summ // i, pf[:i+1])\n if m != None:\n break\n else:\n break\nm.sort(reverse = True)\nfor i in m:\n print(pfo[i], end = '')", "lang": "PyPy 3", "bug_code_uid": "96307712191b3f6efee3c6e607b442d6", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "5519866af5fe7adb3beca1d237ad9c24", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5714285714285714, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "import sys\nimport os\n\n# Your code here\n\nasdasdasdas", "lang": "PyPy 3", "bug_code_uid": "367056849acf2b4430b8225244d4551e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "apr_id": "3c868bfa1d14fac95eb50a6b9b0afc36", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.13953488372093023, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "n=int(input())\na=input().split()\nb={}\nc={}\ndef skaicius(i,j):\n return a[i:j].count(\"0\")\ndef skaicius1(i,j):\n return a[i:j].count(\"1\")\n\ndef maksimumas(i,j):\n if (i,j) in b:\n return b[(i,j)]\n if j==i+1 and a[i]==\"0\":\n return 1\n elif j==i+1 and a[i]==\"1\":\n return 0\n else:\n b[(i,j-1)]=maksimumas(i,j-1)\n b[(i+1,j)]=maksimumas(i+1,j)\n if max(maksimumas(i+1,j), maksimumas(i,j-1), skaicius(i,j)-skaicius1(i,j))==maksimumas(i+1,j):\n c[(i+1,j)]=maksimumas(i+1,j)\n elif max(maksimumas(i+1,j), maksimumas(i,j-1), skaicius(i,j)-skaicius1(i,j))==maksimumas(i,j-1):\n c[(i,j-1)]=maksimumas(i,j-1)\n else:\n c[(i,j)]=skaicius(i,j)-skaicius1(i,j)\n return max(maksimumas(i+1,j), maksimumas(i,j-1), skaicius(i,j)-skaicius1(i,j))\n \nmaksimumas(0,n)\nm=[i for i in c.keys() if c[i]==maksimumas(0,n)]\nlo=a[m[0][0]:m[0][1]].count(\"0\")\nmo=a[m[0][0]:m[0][1]].count(\"1\")\npopp=a.count(\"1\")-mo+lo\nprint(popp)", "lang": "Python 3", "bug_code_uid": "6c463960908ab43f0dee2c566cef70e1", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "apr_id": "c666fe14b4dbcde6f0fa0841ac62ef0b", "difficulty": 1200, "tags": ["dp", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9928057553956835, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "n=int(input())\nif n%2==0:\n print(\"Mahmoud)\nelse:\n print(\"Ehab\")", "lang": "Python 3", "bug_code_uid": "a25505a370a1473575ae7bc166bfd0a2", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "5d90cf8b35148759aebda7c6117464a5", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.7191011235955056, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "#print(['Mahmoud', 'Ehab'][int(input())%2])\nif (int(input()%2==0):\n print(\"Mahmoud\")\nelse:\n print(\"Ehab\")", "lang": "Python 3", "bug_code_uid": "902a9972f0d86fad9593845a464b41b9", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "0eee34d2fb2b359a340da26a892f5153", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9514563106796117, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "print(\"Mahmoud\" if int(input()) % 2 == 0 : \"Ehab\")", "lang": "Python 3", "bug_code_uid": "a0b8bd0277587d66962fa32a15972b51", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "apr_id": "1c1cf25fe36f9b936b273701de5bdca5", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8737864077669902, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "\ndef compote(lemons,apples,pears):\n\tfor i in xrange(lemons,0,-1):\n\t\tif 2 * i <= apples and 4 * i <= pears:\n\t\t\tprint i + 2 * i + 4 * i\n\t\t\texit()\n\tprint 0\n\n\na,b,c = map(int, raw_input().split())\ncompote(a,b,c)", "lang": "PyPy 2", "bug_code_uid": "8b2d6ec70b0aaf4177e8775137beff2a", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "apr_id": "c64585a9bd5c35b9a7c8520a5d6c3d21", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.710867006669282, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "Skip to content\nFeatures\nBusiness\nExplore\nMarketplace\nPricing\nThis repository\nSearch\nSign in or Sign up\n1 3 1 shahed-shd/Online-Judge-Solutions\n Code Issues 0 Pull requests 0 Projects 0 Insights\nOnline-Judge-Solutions/Codeforces/515C - Drazil and Factorial.py\na01faf7 on Mar 7, 2017\n@shahed-shd shahed-shd Codeforces 515C - Drazil and Factorial.py\n \n51 lines (40 sloc) 1.08 KB\n# ==================================================\n# Problem : 515C - Drazil and Factorial\n# Run time : 0.061 sec.\n# Language : Python 3\n# ==================================================\n\n\ndef main():\n from sys import stdin, stdout\n\n # stdin = open(\"in.txt\", \"r\")\n\n num = stdin.read().split()[1]\n\n ans = []\n\n for d in num:\n if d == '2':\n ans.append('2')\n elif d == '3':\n ans.append('3')\n elif d == '4':\n ans.append('3')\n ans.append('2')\n ans.append('2')\n elif d == '5':\n ans.append('5')\n elif d == '6':\n ans.append('5')\n ans.append('3')\n elif d == '7':\n ans.append('7')\n elif d == '8':\n ans.append('7')\n ans.append('2')\n ans.append('2')\n ans.append('2')\n elif d == '9':\n ans.append('7')\n ans.append('3')\n ans.append('3')\n ans.append('2')\n\n ans.sort(reverse=True)\n\n stdout.write(''.join(ans))\n\n\nif __name__ == '__main__':\n main()\n© 2018 GitHub, Inc.\nTerms\nPrivacy\nSecurity\nStatus\nHelp\nContact GitHub\nAPI\nTraining\nShop\nBlog\nAbout\nPress h to open a hovercard with more details.", "lang": "Python 3", "bug_code_uid": "68d7d5e8059b99ad6ac4fd9e15cd794b", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398", "apr_id": "485853527d69e53d04be34cf9674458f", "difficulty": 1400, "tags": ["greedy", "math", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.5134431916738942, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "from scipy.special import binom, comb\r\ndef D(m,n):\r\n tmp=0\r\n for k in range(m+1):\r\n print('(m,k)=(%d, %d)='%(m,k),binom(m,k))\r\n print('(n+k, m)=(%d, %d)='%(n+k, m), binom(n+k,m))\r\n print('product=', binom(m,k)*binom(n+k,m))\r\n tmp+=binom(m,k)*binom(n+k,m)\r\n print(tmp)\r\n return tmp\r\ndef t(m,n,k):\r\n print('(m,k)(n+k,m)=', binom(m,k)*binom(n+k,m))\r\n\r\ndef prob(n,k):\r\n p1=binom(k,3)/binom(n,3)\r\n p2=binom(k,2)*(n-k)/binom(n,3)\r\n p3=1/2*k*binom(n-k,2)/binom(n,3)\r\n ptot=p1+p2+p3\r\n return ptot\r\nnp=input()\r\nnp=np.split(' ')\r\nn=int(np[0])\r\np=float(np[1])\r\nleft=0\r\nright=n\r\nwhile(left0:\r\n# y-=1\r\n# else:\r\n# x-=1\r\n# arr2=[]\r\n# for __ in range(x): arr2.append(1)\r\n# for __ in range(y): arr2.append(0)\r\n# succeedCnts+=arr2[randint(0,1)]\r\n# return succeedCnts/cnts\r\n \r\n\r\ndef main():\r\n \r\n eps=0\r\n \r\n n,p=input().split()\r\n n=int(n)\r\n p=float(p)\r\n \r\n x=0\r\n bb=n\r\n while bb>0:\r\n while x+bb<=n and getP(n,x+bb)+eps= p\r\n\r\nl = 0\r\nr = n-1\r\nwhile l<=r:\r\n m = (l+r)//2\r\n if check(m):\r\n r = m - 1\r\n else:\r\n l = m + 1\r\nprint(l)", "lang": "PyPy 3", "bug_code_uid": "345822ed445b71d3fe57f443b19bd32c", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "38268940e0786319daa9e07787dce468", "difficulty": 2000, "tags": ["probabilities", "math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.3868312757201646, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "i=int(input())\r\nxm=3+2*i-1\r\nl=[]\r\nfor j in range (1,i+1):\r\n for k in range (1,k+1):\r\n l.append(j**2+k**2)\r\nl.sort()\r\nprint(l[i-1])", "lang": "Python 3", "bug_code_uid": "b975a3b659eee5797638fca33b9c8f31", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "a58c9f15ad99125e578c3bb37810043c", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.5112781954887218, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "n=int(input())\r\nif n==1:\r\n print( 3)\r\nl=[3]\r\nwhile len(l)6)*10+[1,2,3,5,6,7,9,0,1,3,4,5,7,8,9][b])\r\n \r\n \r\n\r\n \r\n \r\n \r\n", "lang": "Python 3", "bug_code_uid": "bc24fff840dd01fe9c8dc5e209da9bc5", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "3f37254066325818c3e29b53d166f815", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.11673151750972763, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "n=int(input())\r\nlst=[]\r\nx=3\r\nwhile(len(lst)2:\r\n print(math.floor(4N/3+3))", "lang": "Python 3", "bug_code_uid": "fd347018f0885cd5e2bff2548fcfc3ca", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "8b954cd94b077c911d8afa843d7e2764", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.4025974025974026, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "n = int(input())\r\na=set()\r\nfor i in range(2,n+2):\r\n for j in range(i-1,0,-1):\r\n a.add(i**2 - j**2)\r\nl = list(a)\r\nl.sort()\r\nprint(l[n-1]) \r\n", "lang": "Python 3", "bug_code_uid": "59d1e528f799a1a0c311a6c13d5cd331", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "884e07b55cd05d8129a90433081864be", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9985111662531018, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import typing\n\n\ndef rit(*args) -> typing.Iterator:\n \"\"\"Read input and yield split cast values.\n \"\"\"\n func, funcs = int, (int, float, str)\n sep = \" \"\n for a in args:\n if a in funcs:\n func = a\n elif isinstance(a, str):\n sep = a\n return map(func, input().strip().split(sep))\n\n\ndef pit(itr: typing.Iterable, sep:str=\" \") -> None:\n print(sep.join(map(str, itr)))\n\ndef rank(n):\n eps = 0.5 if n in (0, 1, 2, 4) or n % 4 == 2 else 0\n if n == 3:\n return 1\n return (n // 4 - 1) + (n - 1) // 2 + eps\n\n\ndef main():\n n = int(input())\n\n B = 1\n T = int(1e9)\n k = T // 2\n\n while True:\n if rank(k) == n:\n print(k)\n break\n elif n > rank(k):\n B = k\n if T - k == 1:\n k = T\n else:\n k += (T - k) // 2\n else:\n T = k\n if k - B == 1:\n k = B\n else:\n k -= (k - B) // 2\n\nmain()\n", "lang": "PyPy 3", "bug_code_uid": "869024704e54e34896260fbbe73988e1", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "6e67d4fef4e46b0f73d30dfd4b52b275", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9980478554297507, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "######################################################################################\r\n#------------------------------------Template---------------------------------------#\r\n######################################################################################\r\nimport collections\r\nimport heapq\r\nimport re\r\nimport sys\r\nimport math\r\nimport itertools\r\nimport bisect\r\nfrom io import BytesIO, IOBase\r\nimport os\r\nfrom textwrap import indent\r\nfrom typing import Counter\r\n\r\ndef vsInput():\r\n sys.stdin = open('input.txt', 'r')\r\n sys.stdout = open('output.txt', 'w')\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):\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\ndef input(): return sys.stdin.readline().rstrip(\"\\r\\n\")\r\n\r\n\r\n######################################################################################\r\n#--------------------------------------Input-----------------------------------------#\r\n######################################################################################\r\n\r\ndef value(): return tuple(map(int, input().split()))\r\ndef inlt(): return [int(i) for i in input().split()]\r\ndef inp(): return int(input())\r\ndef insr(): return input()\r\ndef stlt(): return [i for i in input().split()]\r\n\r\n\r\n######################################################################################\r\n#------------------------------------Functions---------------------------------------#\r\n######################################################################################\r\n\r\n\r\ndef printprimesSieve(n):\r\n prime = [True for i in range(n+1)]\r\n p = 2\r\n l = []\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 for p in range(2, n+1):\r\n if prime[p]:\r\n l.append(p)\r\n # print(p)\r\n else:\r\n continue\r\n return l\r\n\r\n\r\ndef isPrime(n):\r\n prime_flag = 0\r\n\r\n if n > 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\ndef printDivisors(n):\r\n i = 1\r\n ans = []\r\n while i <= math.sqrt(n):\r\n if (n % i == 0):\r\n if (n / i == i):\r\n ans.append(i)\r\n else:\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 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 countOdd(L, R):\r\n N = (R - L) // 2\r\n if (R % 2 != 0 or L % 2 != 0):\r\n N += 1\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(a):\r\n test_list = a.copy()\r\n test_list.reverse()\r\n n = len(test_list)\r\n for i in range(1, n):\r\n test_list[i] = test_list[i] + test_list[i - 1]\r\n return test_list\r\n\r\n\r\ndef prsum(b):\r\n a = b.copy()\r\n for i in range(1, len(a)):\r\n a[i] += a[i - 1]\r\n return a\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\ndef chotabadachotabada(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 == 1:\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\ndef primeFactors(n):\r\n ans = []\r\n while n % 2 == 0:\r\n ans.append(2)\r\n n = n // 2\r\n\r\n for i in range(3, int(math.sqrt(n))+1, 2):\r\n while n % i == 0:\r\n ans.append(i)\r\n n = n / i\r\n if n > 2:\r\n ans.append(n)\r\n return ans\r\n\r\n\r\ndef closestMultiple(n, x):\r\n if x > n:\r\n return x\r\n z = (int)(x / 2)\r\n n = n + z\r\n n = n - (n % x)\r\n return n\r\n\r\n\r\ndef getPairsCount(arr, n, sum):\r\n m = [0] * 1000\r\n for i in range(0, n):\r\n m[arr[i]] += 1\r\n twice_count = 0\r\n for i in range(0, n):\r\n twice_count += m[int(sum - arr[i])]\r\n if (int(sum - arr[i]) == arr[i]):\r\n twice_count -= 1\r\n return int(twice_count / 2)\r\n\r\n\r\ndef remove_consec_duplicates(test_list):\r\n res = [i[0] for i in itertools.groupby(test_list)]\r\n return res\r\n\r\n\r\ndef BigPower(a, b, mod):\r\n if b == 0:\r\n return 1\r\n ans = BigPower(a, b//2, mod)\r\n ans *= ans\r\n ans %= mod\r\n if b % 2:\r\n ans *= a\r\n return ans % mod\r\n\r\n\r\ndef nextPowerOf2(n):\r\n count = 0\r\n if (n and not(n & (n - 1))):\r\n return n\r\n while(n != 0):\r\n n >>= 1\r\n count += 1\r\n return 1 << count\r\n\r\n\r\n# This function multiplies x with the number\r\n# represented by res[]. res_size is size of res[]\r\n# or number of digits in the number represented\r\n# by res[]. This function uses simple school\r\n# mathematics for multiplication. This function\r\n# may value of res_size and returns the new value\r\n# of res_size\r\ndef multiply(x, res, res_size):\r\n\r\n carry = 0 # Initialize carry\r\n\r\n # One by one multiply n with individual\r\n # digits of res[]\r\n i = 0\r\n while i < res_size:\r\n prod = res[i] * x + carry\r\n res[i] = prod % 10 # Store last digit of\r\n # 'prod' in res[]\r\n # make sure floor division is used\r\n carry = prod//10 # Put rest in carry\r\n i = i + 1\r\n\r\n # Put carry in res and increase result size\r\n while (carry):\r\n res[res_size] = carry % 10\r\n # make sure floor division is used\r\n # to avoid floating value\r\n carry = carry // 10\r\n res_size = res_size + 1\r\n\r\n return res_size\r\n\r\n\r\ndef Kadane(a, size):\r\n\r\n max_so_far = -1e18 - 1\r\n max_ending_here = 0\r\n\r\n for i in range(0, size):\r\n max_ending_here = max_ending_here + a[i]\r\n if (max_so_far < max_ending_here):\r\n max_so_far = max_ending_here\r\n\r\n if max_ending_here < 0:\r\n max_ending_here = 0\r\n return max_so_far\r\n\r\n\r\ndef highestPowerof2(n):\r\n res = 0\r\n for i in range(n, 0, -1):\r\n if ((i & (i - 1)) == 0):\r\n res = i\r\n break\r\n return res\r\n\r\n\r\ndef lower_bound(numbers, length, searchnum):\r\n answer = -1\r\n start = 0\r\n end = length - 1\r\n\r\n while start <= end:\r\n middle = (start + end)//2\r\n if numbers[middle] == searchnum:\r\n answer = middle\r\n end = middle - 1\r\n elif numbers[middle] > searchnum:\r\n end = middle - 1\r\n else:\r\n start = middle + 1\r\n return answer\r\n\r\n\r\ndef MEX(nList, start):\r\n nList = set(nList)\r\n mex = start\r\n while mex in nList:\r\n mex += 1\r\n return mex\r\n\r\n\r\ndef MinValue(N, X):\r\n N = list(N)\r\n ln = len(N)\r\n position = ln + 1\r\n # # If the given string N represent\r\n # # a negative value\r\n # if (N[0] == '-'):\r\n\r\n # # X must be place at the last\r\n # # index where is greater than N[i]\r\n # for i in range(ln - 1, 0, -1):\r\n # if ((ord(N[i]) - ord('0')) < X):\r\n # position = i\r\n\r\n # else:\r\n # # For positive numbers, X must be\r\n # # placed at the last index where\r\n # # it is smaller than N[i]\r\n for i in range(ln - 1, -1, -1):\r\n if ((ord(N[i]) - ord('0')) > X):\r\n position = i\r\n\r\n # Insert X at that position\r\n c = chr(X + ord('0'))\r\n\r\n str = N.insert(position, c)\r\n\r\n # Return the string\r\n return ''.join(N)\r\n\r\n\r\ndef findClosest(arr, n, target):\r\n if (target <= arr[0]):\r\n return arr[0]\r\n if (target >= arr[n - 1]):\r\n return arr[n - 1]\r\n i = 0\r\n j = n\r\n mid = 0\r\n while (i < j):\r\n mid = (i + j) // 2\r\n if (arr[mid] == target):\r\n return arr[mid]\r\n if (target < arr[mid]):\r\n if (mid > 0 and target > arr[mid - 1]):\r\n return getClosest(arr[mid - 1], arr[mid], target)\r\n j = mid\r\n else:\r\n if (mid < n - 1 and target < arr[mid + 1]):\r\n return getClosest(arr[mid], arr[mid + 1], target)\r\n i = mid + 1\r\n return arr[mid]\r\n\r\n\r\ndef getClosest(val1, val2, target):\r\n\r\n if (target - val1 >= val2 - target):\r\n return val2\r\n else:\r\n return val1\r\n\r\n\r\ndef ncr(n, r, p):\r\n\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, p - 2, p)) % p\r\n# #####################################################################################################\r\n# #------------------------------------------GRAPHS---------------------------------------------------#\r\n# #####################################################################################################\r\n\r\n\r\nclass Graph:\r\n def __init__(self, edges, n):\r\n self.adjList = [[] for _ in range(n)]\r\n for (src, dest) in edges:\r\n self.adjList[src].append(dest)\r\n self.adjList[dest].append(src)\r\n\r\n\r\ndef BFS(graph, v, discovered):\r\n q = collections.deque()\r\n discovered[v] = True\r\n q.append(v)\r\n ans = []\r\n while q:\r\n v = q.popleft()\r\n ans.append(v)\r\n # print(v, end=' ')\r\n for u in graph.adjList[v]:\r\n if not discovered[u]:\r\n discovered[u] = True\r\n q.append(u)\r\n return ans\r\n#############################################################################################################\r\n#--------------------------------------------Fenwick Tree---------------------------------------------------#\r\n#############################################################################################################\r\n\r\n\r\ndef getsumFT(BITTree, i):\r\n s = 0 # initialize result\r\n\r\n # index in BITree[] is 1 more than the index in arr[]\r\n i = i+1\r\n\r\n # Traverse ancestors of BITree[index]\r\n while i > 0:\r\n\r\n # Add current element of BITree to sum\r\n s += BITTree[i]\r\n\r\n # Move index to parent node in getSum View\r\n i -= i & (-i)\r\n return s\r\n\r\n# Updates a node in Binary Index Tree (BITree) at given index\r\n# in BITree. The given value 'val' is added to BITree[i] and\r\n# all of its ancestors in tree.\r\n\r\n\r\ndef updatebit(BITTree, n, i, v):\r\n\r\n # index in BITree[] is 1 more than the index in arr[]\r\n i += 1\r\n\r\n # Traverse all ancestors and add 'val'\r\n while i <= n:\r\n\r\n # Add 'val' to current node of BI Tree\r\n BITTree[i] += v\r\n\r\n # Update index to that of parent in update View\r\n i += i & (-i)\r\n\r\n\r\n# Constructs and returns a Binary Indexed Tree for given\r\n# array of size n.\r\ndef construct(arr, n):\r\n\r\n # Create and initialize BITree[] as 0\r\n BITTree = [0]*(n+1)\r\n\r\n # Store the actual values in BITree[] using update()\r\n for i in range(n):\r\n updatebit(BITTree, n, i, arr[i])\r\n\r\n # Uncomment below lines to see contents of BITree[]\r\n # for i in range(1,n+1):\r\n # print BITTree[i],\r\n return BITTree\r\n#############################################################################################################\r\n#--------------------------------------------Segment Tree---------------------------------------------------#\r\n#############################################################################################################\r\n\r\n\r\ndef getMid(s, e):\r\n return s + (e - s) // 2\r\n\r\n\r\n\"\"\" A recursive function to get the sum of values\r\n in the given range of the array. The following\r\n are parameters for this function.\r\n \r\n st --> Pointer to segment tree\r\n si --> Index of current node in the segment tree.\r\n Initially 0 is passed as root is always at index 0\r\n ss & se --> Starting and ending indexes of the segment\r\n represented by current node, i.e., st[si]\r\n qs & qe --> Starting and ending indexes of query range \"\"\"\r\n\r\n\r\ndef getSumUtil(st, ss, se, qs, qe, si):\r\n\r\n # If segment of this node is a part of given range,\r\n # then return the sum of the segment\r\n if (qs <= ss and qe >= se):\r\n return st[si]\r\n\r\n # If segment of this node is\r\n # outside the given range\r\n if (se < qs or ss > qe):\r\n return 0\r\n\r\n # If a part of this segment overlaps\r\n # with the given range\r\n mid = getMid(ss, se)\r\n\r\n return getSumUtil(st, ss, mid, qs, qe, 2 * si + 1) + getSumUtil(st, mid + 1, se, qs, qe, 2 * si + 2)\r\n\r\n\r\ndef updateValueUtil(st, ss, se, i, diff, si):\r\n\r\n # Base Case: If the input index lies\r\n # outside the range of this segment\r\n if (i < ss or i > se):\r\n return\r\n\r\n # If the input index is in range of this node,\r\n # then update the value of the node and its children\r\n st[si] = st[si] + diff\r\n\r\n if (se != ss):\r\n\r\n mid = getMid(ss, se)\r\n updateValueUtil(st, ss, mid, i,\r\n diff, 2 * si + 1)\r\n updateValueUtil(st, mid + 1, se, i,\r\n diff, 2 * si + 2)\r\n\r\n# The function to update a value in input array\r\n# and segment tree. It uses updateValueUtil()\r\n# to update the value in segment tree\r\n\r\n\r\ndef updateValue(arr, st, n, i, new_val):\r\n\r\n # Check for erroneous input index\r\n if (i < 0 or i > n - 1):\r\n\r\n print(\"Invalid Input\", end=\"\")\r\n return\r\n\r\n # Get the difference between\r\n # new value and old value\r\n diff = new_val - arr[i]\r\n\r\n # Update the value in array\r\n arr[i] = new_val\r\n\r\n # Update the values of nodes in segment tree\r\n updateValueUtil(st, 0, n - 1, i, diff, 0)\r\n\r\n# Return sum of elements in range from\r\n# index qs (query start) to qe (query end).\r\n# It mainly uses getSumUtil()\r\n\r\n\r\ndef getSum(st, n, qs, qe):\r\n\r\n # Check for erroneous input values\r\n if (qs < 0 or qe > n - 1 or qs > qe):\r\n\r\n print(\"Invalid Input\", end=\"\")\r\n return -1\r\n\r\n return getSumUtil(st, 0, n - 1, qs, qe, 0)\r\n\r\n# A recursive function that constructs\r\n# Segment Tree for array[ss..se].\r\n# si is index of current node in segment tree st\r\n\r\n\r\ndef constructSTUtil(arr, ss, se, st, si):\r\n\r\n # If there is one element in array,\r\n # store it in current node of\r\n # segment tree and return\r\n if (ss == se):\r\n\r\n st[si] = arr[ss]\r\n return arr[ss]\r\n\r\n # If there are more than one elements,\r\n # then recur for left and right subtrees\r\n # and store the sum of values in this node\r\n mid = getMid(ss, se)\r\n\r\n st[si] = constructSTUtil(arr, ss, mid, st, si * 2 + 1) + \\\r\n constructSTUtil(arr, mid + 1, se, st, si * 2 + 2)\r\n\r\n return st[si]\r\n\r\n\r\n\"\"\" Function to construct segment tree\r\nfrom given array. This function allocates memory\r\nfor segment tree and calls constructSTUtil() to\r\nfill the allocated memory \"\"\"\r\n\r\n\r\ndef constructST(arr, n):\r\n\r\n # Allocate memory for the segment tree\r\n\r\n # Height of segment tree\r\n x = (int)(math.ceil(math.log2(n)))\r\n\r\n # Maximum size of segment tree\r\n max_size = 2 * (int)(2**x) - 1\r\n\r\n # Allocate memory\r\n st = [0] * max_size\r\n\r\n # Fill the allocated memory st\r\n constructSTUtil(arr, 0, n - 1, st, 0)\r\n\r\n # Return the constructed segment tree\r\n return st\r\n\r\n\r\ndef tobinary(a): return bin(a).replace('0b', '')\r\n\r\n\r\ndef nextPerfectSquare(N):\r\n\r\n nextN = math.floor(math.sqrt(N)) + 1\r\n\r\n return nextN * nextN\r\n\r\n\r\n# #####################################################################################################\r\n# ########################################################################\r\n# #-----------------------------Code Here--------------------------------#\r\n# ########################################################################\r\nalphabets = list(\"abcdefghijklmnopqrstuvwxyz\")\r\nvowels = list(\"aeiou\")\r\nMOD = 998244353\r\nINF = int(1e18)\r\n\r\nvsInput()\r\n\r\n# for _ in range(inp()):\r\nn = inp()\r\nif n == 1:\r\n print(3)\r\nelse:\r\n print(4 + (4 * n - 3) // 3)", "lang": "PyPy 3", "bug_code_uid": "c8ab118fe4cb085ad5284bdb12893587", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "720320ce26855df286879008bc8a0420", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9993297587131368, "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\r\nfrom collections import deque\r\nimport bisect\r\nimport heapq\r\n\r\ndef ri():\r\n return int(input())\r\n\r\ndef rl():\r\n return list(map(int, input().split()))\r\n\r\n\r\n# x is good if x = a^2 - b^2\r\n# = (a + b) * (a - b) // these terms differ by an even amount!\r\n# = (c + 2d) * c \r\n# So, x must be a product of terms which differ by an even amount.\r\n# If x is odd (and not 1), then we get 1 * x == x\r\n#\r\n# If x is even, then so are c and c + 2d, so x is in fact divisible by 4\r\n# When x is 8 or greater, then we can do (2)*(x//2) == x, and both terms are \r\n# even, so we have\r\n# 1) odd and >=3\r\n# 2) 0 mod 4 >= 8\r\n# \r\n# Then, just binary search, because problem asks the \"reverse\" question,\r\n# of the n'th such number\r\ndef solve():\r\n n = ri()\r\n def valid_below(x):\r\n if x < 3: return 0\r\n odds_below = (x - 1) // 2\r\n if x < 8: return odds_below\r\n evens_below = (x - 4) // 4\r\n return odds_below + evens_below\r\n\r\n # want valid_below(x - 1) == n - 1\r\n # valid_below(x) == n\r\n lo = 1\r\n hi = 10**10 # density of these numbers is 3/4, so don't need to inflate\r\n # that much\r\n while lo < hi - 1:\r\n mid = (lo + hi) // 2\r\n if valid_below(mid) >= n:\r\n hi = mid\r\n else:\r\n lo = mid\r\n print (hi)\r\n\r\n\r\n\r\n\r\nmode = 'T'\r\n\r\nif mode == 'T':\r\n t = ri()\r\n for i in range(t):\r\n solve()\r\nelse:\r\n solve()\r\n", "lang": "PyPy 3", "bug_code_uid": "a7be8b40faad06ac7f598228c581e0d6", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "056bad8f175f193e20c761a489af8bf0", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.7972508591065293, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "for t in range(int(input())):\r\n n = int(input())\r\n if n == 1:\r\n print(3)\r\n elif n == 2:\r\n print(5)\r\n else:\r\n print(4 * (n // 3) + 3 + n % 3)\r\n", "lang": "PyPy 3", "bug_code_uid": "5e36850c81f9d8f158e1a6ae930068b9", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "c7356bd12697d608198702b9a82e9959", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "Python"} {"similarity_score": 0.9868421052631579, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "x = int(input())\r\nls = [3, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17]\r\nif x < 12:\r\n print(ls[x-1])\r\nelse:\r\n k = ((n-12) // 3) + n - 12 + 19\r\n print(k)", "lang": "PyPy 3", "bug_code_uid": "f8febfbf855b061a4446cd61afa221dd", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "apr_id": "66f678e91238ee09712dc0f7cd0374cb", "difficulty": 1500, "tags": ["geometry", "math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9548872180451128, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "from decimal import Decimal\nn, p = input().split()\nn = int(n)\np = Decimal(p)\nN = n * (n - 1) * (n - 2) // 6\n\ndef f(m):\n if m == n:\n return N * 2\n A3 = m * (m - 1) * (m - 2) // 6\n A2 = m * (m - 1) * (n - m) // 2\n A1 = m * (n - m) * (n - m - 1) // 2\n return (A1 + A2 * 2 + A3 * 2)\n\nfor i in range(1, n+1):\n if f(i) >= N * p * 2:\n print(i)\n break\n", "lang": "Python 3", "bug_code_uid": "7b039b45c7255999fc982b2ca51fc266", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "a2b6de94b811273024fcdf5d5bcb8f6d", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.8422273781902552, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "from math import factorial\r\n\r\n\r\ndef binomial(n, k):\r\n if n < k:\r\n return 0\r\n return factorial(n)/(factorial(k) * factorial(n - k))\r\n\r\nn, p = list(input().split())\r\n\r\nn = int(n)\r\np = float(p)\r\n\r\nl, r = 0, n\r\n\r\nwhile l < r:\r\n k = (l + r)//2\r\n cur = binomial(k, 3)/binomial(n, 3) + binomial(k, 2)/binomial(n, 3) + k * binomial(n - k, 2)/binomial(n, 3)*(1/6 + 1/3)\r\n if cur < p:\r\n l = k + 1\r\n else:\r\n r = k\r\n\r\nprint(l)\r\n", "lang": "Python 3", "bug_code_uid": "90594c6edaea5347d2a465e18f9b143b", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "bb1c980dc37df91497c86e522b011311", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.4827586206896552, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "import math\nimport random\nimport sys\n\ndef main(n,p):\n tot=math.comb(n,3)*9;\n for i in range(0,n):\n b=0;\n b+=2*math.comb(n-i,2)*2\n\n b+=9*math.comb(n-i,3);\n if (1-b/tot)>=p:\n return i\n return \"WHAT\" \n\nn,p=list(map(float,input().split()))\nn=int(n) \nprint(main(n,p))\n \n", "lang": "Python 3", "bug_code_uid": "f6cbe9008a18bc78be4dc48491458593", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "6237d40e3a78177a01f9d07d83781529", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9972972972972973, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "import math\r\n\r\ndef probCalc(studied, numMaps):\r\n total = math.comb(numMaps, 3)\r\n return (math.comb(studied, 3) + math.comb(studied, 2)*math.comb(numMaps - studied, 1) + 1/3*math.comb(studied, 1) * math.comb(numMaps - studied, 2))/total\r\n\r\n\r\n\r\n[n,p] = input().split(' ')\r\nn = int(n); p = float(p);\r\nfor i in range(n):\r\n if probCalc(i, n) >= p:\r\n print(i)\r\n break", "lang": "Python 3", "bug_code_uid": "3af41d3829b39b92fa20dbf60c9072c6", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "2fd6aaa7f5fb781c7b94355cc0157151", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.28679962013295346, "equal_cnt": 21, "replace_cnt": 19, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 22, "bug_source_code": "n, a = [int(v) for v in input().split()]\nexp2 = -9 * n ** 2 + 45 * n - 57\nexp1 = (\n 108 * a * n ** 3\n - 324 * a * n ** 2\n + (\n (\n 108 * a * n ** 3\n - 324 * a * n ** 2\n + 216 * a * n\n - 54 * n ** 3\n - 81 * n ** 2\n + 783 * n\n - 810\n )\n ** 2\n + 4 * exp2 ** 3\n )\n ** 0.5\n + 216 * a * n\n - 54 * n ** 3\n - 81 * n ** 2\n + 783 * n\n - 810\n) ** (1 / 3)\np1 = round(\n abs(1 / (3 * 2 ** (1 / 3)) * exp1 - (2 ** (1 / 3) * exp2) / (3 * exp1) + 2 * n - 3)\n)\np2 = round(\n abs(\n -1 / (6 * 2 ** (1 / 3)) * complex(1, 3 ** 0.5) * exp1\n + complex(1, -(3 ** 0.5)) * exp2 / (3 * 2 ** (2 / 3) * exp1)\n + 2 * n\n - 3\n )\n)\np3 = round(\n abs(\n -1 / (6 * 2 ** (1 / 3)) * complex(1, -(3 ** 0.5)) * exp1\n + complex(1, (3 ** 0.5)) * exp2 / (3 * 2 ** (2 / 3) * exp1)\n + 2 * n\n - 3\n )\n)\nprint(min(p1, p2, p3))\n", "lang": "PyPy 3", "bug_code_uid": "15921d6bf1b18cba7b2fbadfc742cc61", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "1272960815930f57a6c504d7fce2f155", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9836065573770492, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "import math\n\nclass Rational : \n \n def __init__ (self, a, b) :\n a, b = int(a), int(b)\n g = math.gcd(a, b)\n self.a = a / g\n self.b = b / g\n\n def __mul__ (self, t) :\n return Rational(self.a * t.a, self.b * t.b)\n\n def __add__ (self, t) : \n a = self.a * t.b + self.b * t.a\n b = self.b * t.b\n return Rational(a, b) \n\n def __sub__ (self, t) : \n a = self.a * t.b - self.b * t.a\n b = self.b * t.b\n return Rational(a, b) \n \n def __le__ (self, t) : \n return self.a * t.b <= self.b * t.a\n\n def __repr__ (self) :\n return f'{self.a / self.b}' \n\ndef nC3 (n) :\n if n >= 3 : \n return (n * (n - 1) * (n - 2)) // 6\n return 0\n\ndef nC2 (n) :\n if n >= 2 : \n return (n * (n - 1)) // 2\n return 0\n\nstuff = input().split()\nn, p = stuff\nn = int(n)\np = float(p) \np = Rational(1e9 * p, 1e9)\n\none = Rational(1, 1)\nnc3 = nC3(n)\n\nfor k in range(0, n + 1) : \n t = Rational(nC3(k), nc3) + (Rational(1, 3) * Rational(nC2(n - k), nc3)) + Rational(nC2(k), nc3)\n if p <= t: \n break\nprint(k)\n", "lang": "PyPy 3", "bug_code_uid": "224e2fa721484453b7b9576bb04efa6c", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "7fbd9f4b3cc0e2a68539cc4c37f88749", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "Python"} {"similarity_score": 0.9946164199192463, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "def binom(x,y):\r\n if y == 2:\r\n return x * (x-1) / 2\r\n if y == 3:\r\n return x * (x-1) * (x-2) / 6\r\n\r\nn,prob = map(float,input().split())\r\nif prob == 0.0:\r\n print(0)\r\n exit()\r\n\r\nn = int(n)\r\n\r\ndef p(m):\r\n ans = 0\r\n if n-m >= 2 and m >= 1:\r\n ans += m * (binom(n-m,2)) * .75\r\n\r\n if n-m >= 1 and m >= 2:\r\n ans += m * (m-1) * (n-m) / 2\r\n\r\n if m >= 3:\r\n ans += binom(m,3)\r\n \r\n if ans == binom(n,3):\r\n return 1.0\r\n\r\n return ans / binom(n,3)\r\n\r\nlo,hi = 1.0, float(n)\r\nif p(lo) >= prob:\r\n print(1)\r\n exit()\r\n\r\nwhile lo+1 < hi:\r\n mid = (hi+lo) // 2\r\n case = p(float(mid))\r\n\r\n if case >= prob:\r\n hi = mid\r\n else:\r\n lo = mid\r\n\r\nprint(int(hi))\r\nexit()\r\n", "lang": "PyPy 3", "bug_code_uid": "04f04617b900198d2b97b397e7972678", "src_uid": "788ed59a964264bd0e755e155a37e14d", "apr_id": "a8034f61b6e027968d14dbd1bd35831f", "difficulty": 2000, "tags": ["probabilities", "math", "combinatorics", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "Python"} {"similarity_score": 0.9057043073341094, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "\nn,target = map(float,input().split())\nn = int(n)\n\n\n\ndef getprob(study):\n\n tot = n*(n-1)*(n-2)//6\n case1 = study*(study-1)*(study-2)//6\n case2 = study*(study-1)//2 *(n-study)\n\n\n return (case1+case2)*1.0/tot\n\n\n\nfront = 0\nrear = n\n\n\nwhile front