{"user_id": "u732870425", "problem_id": "p03371", "language": "python", "submission_id_v0": "s504204235", "submission_id_v1": "s825991485", "cpu_time_v0": 104, "cpu_time_v1": 26, "memory_v0": 9176, "memory_v1": 9180, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 75.0, "input": "A, B, C, X, Y = list(map(int, input().split()))\n\n\n\nans = 5000 * 2 * 10 ** 5\n\nfor i in range(10 ** 5 + 1):\n\n s = i * 2 * C + max(0, X - i) * A + max(0, Y - i) * B\n\n ans = min(ans, s)\n\n\n\nprint(ans)", "target": "A, B, C, X, Y = list(map(int, input().split()))\n\n\n\nif X > Y:\n\n v = A\n\nelse:\n\n v = B\n\n\n\nans = min(A*X+B*Y, C*max(X, Y)*2, C*min(X,Y)*2+(max(X,Y)-min(X,Y))*v)\n\n\n\nprint(ans)", "code_v0_loc": 8, "code_v1_loc": 10, "code_v0_num_chars": 195, "code_v1_num_chars": 170, "code_v0_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nans = 5000 * 2 * 10**5\nfor i in range(10**5 + 1):\n s = i * 2 * C + max(0, X - i) * A + max(0, Y - i) * B\n ans = min(ans, s)\nprint(ans)\n", "code_v1_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nif X > Y:\n v = A\nelse:\n v = B\nans = min(\n A * X + B * Y, C * max(X, Y) * 2, C * min(X, Y) * 2 + (max(X, Y) - min(X, Y)) * v\n)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-ans = 5000 * 2 * 10**5", "-for i in range(10**5 + 1):", "- s = i * 2 * C + max(0, X - i) * A + max(0, Y - i) * B", "- ans = min(ans, s)", "+if X > Y:", "+ v = A", "+else:", "+ v = B", "+ans = min(", "+ A * X + B * Y, C * max(X, Y) * 2, C * min(X, Y) * 2 + (max(X, Y) - min(X, Y)) * v", "+)"], "diff_only_import_comment": false, "measured_runtime_v0": 1.5409223008, "measured_runtime_v1": 0.2907806964, "runtime_lift": 5.2992592696, "key": ["s504204235", "s825991485"]} {"user_id": "u102461423", "problem_id": "p02612", "language": "python", "submission_id_v0": "s840955881", "submission_id_v1": "s608348800", "cpu_time_v0": 35, "cpu_time_v1": 29, "memory_v0": 9152, "memory_v1": 9160, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.14, "input": "import sys\n\n\n\nread = sys.stdin.buffer.read\n\nreadline = sys.stdin.buffer.readline\n\nreadlines = sys.stdin.buffer.readlines\n\n\n\nN = int(read())\n\nx = N + (-N) % 1000\n\nprint((x - N))", "target": "import math\n\nN = int(input())\n\nx = math.ceil(N/1000) * 1000\n\nprint((x-N))", "code_v0_loc": 9, "code_v1_loc": 4, "code_v0_num_chars": 174, "code_v1_num_chars": 71, "code_v0_no_empty_lines": "import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nN = int(read())\nx = N + (-N) % 1000\nprint((x - N))\n", "code_v1_no_empty_lines": "import math\n\nN = int(input())\nx = math.ceil(N / 1000) * 1000\nprint((x - N))\n", "code_same": false, "relative_loc_diff_percent": 55.5555555556, "diff": ["-import sys", "+import math", "-read = sys.stdin.buffer.read", "-readline = sys.stdin.buffer.readline", "-readlines = sys.stdin.buffer.readlines", "-N = int(read())", "-x = N + (-N) % 1000", "+N = int(input())", "+x = math.ceil(N / 1000) * 1000"], "diff_only_import_comment": false, "measured_runtime_v0": 0.260022393, "measured_runtime_v1": 0.1385840868, "runtime_lift": 1.8762788639, "key": ["s840955881", "s608348800"]} {"user_id": "u761320129", "problem_id": "p03559", "language": "python", "submission_id_v0": "s241549796", "submission_id_v1": "s763191935", "cpu_time_v0": 368, "cpu_time_v1": 263, "memory_v0": 23328, "memory_v1": 29344, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 28.53, "input": "N = int(input())\n\nA = list(map(int,input().split()))\n\nB = list(map(int,input().split()))\n\nC = list(map(int,input().split()))\n\nA.sort()\n\nC.sort()\n\n\n\nans = 0\n\nfrom bisect import bisect, bisect_left\n\nfor b in B:\n\n i = bisect_left(A, b)\n\n j = bisect(C, b)\n\n ans += i * (N-j)\n\nprint(ans)", "target": "N = int(input())\n\nA = list(map(int,input().split()))\n\nB = list(map(int,input().split()))\n\nC = list(map(int,input().split()))\n\nA.sort()\n\nC.sort()\n\n\n\nfrom bisect import bisect_left, bisect\n\nans = 0\n\nfor b in B:\n\n i = bisect_left(A,b)\n\n j = bisect(C,b)\n\n ans += i * (N-j)\n\nprint(ans)", "code_v0_loc": 14, "code_v1_loc": 14, "code_v0_num_chars": 291, "code_v1_num_chars": 289, "code_v0_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nA.sort()\nC.sort()\nans = 0\nfrom bisect import bisect, bisect_left\n\nfor b in B:\n i = bisect_left(A, b)\n j = bisect(C, b)\n ans += i * (N - j)\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nA.sort()\nC.sort()\nfrom bisect import bisect_left, bisect\n\nans = 0\nfor b in B:\n i = bisect_left(A, b)\n j = bisect(C, b)\n ans += i * (N - j)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["+from bisect import bisect_left, bisect", "+", "-from bisect import bisect, bisect_left", "-"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2898341594, "measured_runtime_v1": 0.1261365476, "runtime_lift": 2.2977809758, "key": ["s241549796", "s763191935"]} {"user_id": "u671060652", "problem_id": "p02952", "language": "python", "submission_id_v0": "s923935687", "submission_id_v1": "s007434774", "cpu_time_v0": 222, "cpu_time_v1": 60, "memory_v0": 40940, "memory_v1": 61860, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 72.97, "input": "n = int(input())\n\n\n\n\n\ndef countKeta(num):\n\n count = 1\n\n while num / 10 >= 1:\n\n count += 1\n\n num = num // 10\n\n return count\n\n\n\n\n\ncount = 0\n\n\n\nfor i in range(1, n+1):\n\n if(countKeta(i) % 2 == 1):\n\n count += 1\n\n\n\nprint(count)", "target": "n = int(input())\n\n\n\nif n < 10:\n\n print(n)\n\nelif n < 100:\n\n print((9))\n\nelif n < 1000:\n\n print((n-90))\n\nelif n < 10000:\n\n print((909))\n\nelif n < 100000:\n\n print((n-9090))\n\nelif n < 1000000:\n\n print((90909))", "code_v0_loc": 18, "code_v1_loc": 14, "code_v0_num_chars": 255, "code_v1_num_chars": 213, "code_v0_no_empty_lines": "n = int(input())\n\n\ndef countKeta(num):\n count = 1\n while num / 10 >= 1:\n count += 1\n num = num // 10\n return count\n\n\ncount = 0\nfor i in range(1, n + 1):\n if countKeta(i) % 2 == 1:\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "n = int(input())\nif n < 10:\n print(n)\nelif n < 100:\n print((9))\nelif n < 1000:\n print((n - 90))\nelif n < 10000:\n print((909))\nelif n < 100000:\n print((n - 9090))\nelif n < 1000000:\n print((90909))\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["-", "-", "-def countKeta(num):", "- count = 1", "- while num / 10 >= 1:", "- count += 1", "- num = num // 10", "- return count", "-", "-", "-count = 0", "-for i in range(1, n + 1):", "- if countKeta(i) % 2 == 1:", "- count += 1", "-print(count)", "+if n < 10:", "+ print(n)", "+elif n < 100:", "+ print((9))", "+elif n < 1000:", "+ print((n - 90))", "+elif n < 10000:", "+ print((909))", "+elif n < 100000:", "+ print((n - 9090))", "+elif n < 1000000:", "+ print((90909))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2693535981, "measured_runtime_v1": 0.1929554205, "runtime_lift": 1.3959369341, "key": ["s923935687", "s007434774"]} {"user_id": "u837286475", "problem_id": "p02996", "language": "python", "submission_id_v0": "s244057022", "submission_id_v1": "s796254109", "cpu_time_v0": 1201, "cpu_time_v1": 941, "memory_v0": 53532, "memory_v1": 53600, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.65, "input": "\n\n\n\nn = int(input())\n\n\n\nabn = [list(map(int,input().split())) for _ in range(n)]\n\n\n\n\n\nabn.sort()\n\nabn.sort(key = lambda x:x[1])\n\n\n\n\n\n#print(abn)\n\n\n\nts = 0 # time_stamp\n\nenable = True\n\nfor abi in abn:\n\n a, b = abi\n\n\n\n if not ts + a <= b:\n\n enable = False\n\n break\n\n else:\n\n ts += a\n\n\n\nprint(('Yes' if enable else 'No'))", "target": "\n\nn = int(input())\n\n\n\nabn = [list(map(int,input().split())) for _ in range(n)]\n\n\n\n\n\n#abn.sort()\n\nabn.sort(key = lambda x:x[1])\n\n\n\n\n\n#print(abn)\n\n\n\nts = 0 # time_stamp\n\nenable = True\n\nfor abi in abn:\n\n a, b = abi\n\n\n\n if not ts + a <= b:\n\n enable = False\n\n break\n\n else:\n\n ts += a\n\n\n\nprint(('Yes' if enable else 'No'))", "code_v0_loc": 25, "code_v1_loc": 24, "code_v0_num_chars": 345, "code_v1_num_chars": 344, "code_v0_no_empty_lines": "n = int(input())\nabn = [list(map(int, input().split())) for _ in range(n)]\nabn.sort()\nabn.sort(key=lambda x: x[1])\n# print(abn)\nts = 0 # time_stamp\nenable = True\nfor abi in abn:\n a, b = abi\n if not ts + a <= b:\n enable = False\n break\n else:\n ts += a\nprint((\"Yes\" if enable else \"No\"))\n", "code_v1_no_empty_lines": "n = int(input())\nabn = [list(map(int, input().split())) for _ in range(n)]\n# abn.sort()\nabn.sort(key=lambda x: x[1])\n# print(abn)\nts = 0 # time_stamp\nenable = True\nfor abi in abn:\n a, b = abi\n if not ts + a <= b:\n enable = False\n break\n else:\n ts += a\nprint((\"Yes\" if enable else \"No\"))\n", "code_same": false, "relative_loc_diff_percent": 4.0, "diff": ["-abn.sort()", "+# abn.sort()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.205832685, "measured_runtime_v1": 0.0061624551, "runtime_lift": 33.4010847824, "key": ["s244057022", "s796254109"]} {"user_id": "u546285759", "problem_id": "p00053", "language": "python", "submission_id_v0": "s431311473", "submission_id_v1": "s975765781", "cpu_time_v0": 360, "cpu_time_v1": 100, "memory_v0": 8104, "memory_v1": 9480, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 72.22, "input": "def isPrime(x):\n\n if x == 2:\n\n return True\n\n if x < 2 or x % 2 == 0:\n\n return False\n\n i, root_x = 3, int(pow(x, 0.5))\n\n while i <= root_x:\n\n if x % i == 0:\n\n return False\n\n i += 2\n\n return True\n\n\n\nprimes = [2]\n\nfor i in range(3, 104730):\n\n if isPrime(i):\n\n primes.append(primes[-1]+i)\n\nwhile True:\n\n n = int(input())\n\n if n == 0:\n\n break\n\n print((primes[n-1]))", "target": "primes = [0, 0] + [1] * 150000\n\nfor i in range(2, 388):\n\n if primes[i]:\n\n for j in range(i*i, 150001, i):\n\n primes[j] = 0\n\n\n\nvalues = [i for i, v in enumerate(primes) if v]\n\nwhile True:\n\n n = int(input())\n\n if n == 0:\n\n break\n\n print((sum(values[:n])))", "code_v0_loc": 21, "code_v1_loc": 12, "code_v0_num_chars": 438, "code_v1_num_chars": 287, "code_v0_no_empty_lines": "def isPrime(x):\n if x == 2:\n return True\n if x < 2 or x % 2 == 0:\n return False\n i, root_x = 3, int(pow(x, 0.5))\n while i <= root_x:\n if x % i == 0:\n return False\n i += 2\n return True\n\n\nprimes = [2]\nfor i in range(3, 104730):\n if isPrime(i):\n primes.append(primes[-1] + i)\nwhile True:\n n = int(input())\n if n == 0:\n break\n print((primes[n - 1]))\n", "code_v1_no_empty_lines": "primes = [0, 0] + [1] * 150000\nfor i in range(2, 388):\n if primes[i]:\n for j in range(i * i, 150001, i):\n primes[j] = 0\nvalues = [i for i, v in enumerate(primes) if v]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print((sum(values[:n])))\n", "code_same": false, "relative_loc_diff_percent": 42.8571428571, "diff": ["-def isPrime(x):", "- if x == 2:", "- return True", "- if x < 2 or x % 2 == 0:", "- return False", "- i, root_x = 3, int(pow(x, 0.5))", "- while i <= root_x:", "- if x % i == 0:", "- return False", "- i += 2", "- return True", "-", "-", "-primes = [2]", "-for i in range(3, 104730):", "- if isPrime(i):", "- primes.append(primes[-1] + i)", "+primes = [0, 0] + [1] * 150000", "+for i in range(2, 388):", "+ if primes[i]:", "+ for j in range(i * i, 150001, i):", "+ primes[j] = 0", "+values = [i for i, v in enumerate(primes) if v]", "- print((primes[n - 1]))", "+ print((sum(values[:n])))"], "diff_only_import_comment": false, "measured_runtime_v0": 1.4180367088, "measured_runtime_v1": 0.5017841969, "runtime_lift": 2.8259891756, "key": ["s431311473", "s975765781"]} {"user_id": "u714300041", "problem_id": "p03835", "language": "python", "submission_id_v0": "s859897716", "submission_id_v1": "s908338086", "cpu_time_v0": 324, "cpu_time_v1": 265, "memory_v0": 40684, "memory_v1": 40684, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 18.21, "input": "import sys\n\ninput = sys.stdin.readline\n\nsys.setrecursionlimit(10 ** 7)\n\n\n\nK, S = list(map(int, input().split()))\n\n\n\nans = 0\n\nfor z in range(K+1):\n\n for y in range(K+1):\n\n x = S - (z + y)\n\n if x >= 0 and x <= K:\n\n ans += 1\n\nprint(ans)", "target": "import sys\n\ninput = sys.stdin.readline\n\nsys.setrecursionlimit(10 ** 7)\n\n\n\nK, S = list(map(int, input().split()))\n\n\n\nans = 0\n\nfor z in range(K+1):\n\n for y in range(K+1):\n\n x = S - (z + y)\n\n if 0 <= x <= K:\n\n ans += 1\n\nprint(ans)", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 255, "code_v1_num_chars": 249, "code_v0_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nK, S = list(map(int, input().split()))\nans = 0\nfor z in range(K + 1):\n for y in range(K + 1):\n x = S - (z + y)\n if x >= 0 and x <= K:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nK, S = list(map(int, input().split()))\nans = 0\nfor z in range(K + 1):\n for y in range(K + 1):\n x = S - (z + y)\n if 0 <= x <= K:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- if x >= 0 and x <= K:", "+ if 0 <= x <= K:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.450106571, "measured_runtime_v1": 0.2041984936, "runtime_lift": 2.2042599977, "key": ["s859897716", "s908338086"]} {"user_id": "u994988729", "problem_id": "p02996", "language": "python", "submission_id_v0": "s348750359", "submission_id_v1": "s832149929", "cpu_time_v0": 885, "cpu_time_v1": 774, "memory_v0": 30828, "memory_v1": 41916, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.54, "input": "n=int(input())\n\ntask=[] \n\nfor _ in range(n):\n\n a,b=list(map(int,input().split()))\n\n task.append((b, -a))\n\n\n\ntask.sort()\n\n\n\ntime=0\n\nflag=True\n\nfor i in task:\n\n time-=i[1]\n\n if time>i[0]:\n\n flag=False\n\n break\n\n\n\nif flag:\n\n print(\"Yes\")\n\nelse:\n\n print(\"No\")\n\n\n", "target": "import sys\n\nfrom collections import defaultdict\n\nfrom operator import itemgetter\n\ninput = sys.stdin.readline\n\n\n\nN = int(input())\n\nd = defaultdict(int)\n\nfor _ in range(N):\n\n a, b = list(map(int, input().split()))\n\n d[b] += a\n\ntask = list(d.items())\n\ntask.sort()\n\n\n\nnow = 0\n\nans = \"Yes\"\n\nfor limit, time in task:\n\n now += time\n\n if now > limit:\n\n ans = \"No\"\n\n break\n\n\n\nprint(ans)\n", "code_v0_loc": 21, "code_v1_loc": 22, "code_v0_num_chars": 283, "code_v1_num_chars": 398, "code_v0_no_empty_lines": "n = int(input())\ntask = []\nfor _ in range(n):\n a, b = list(map(int, input().split()))\n task.append((b, -a))\ntask.sort()\ntime = 0\nflag = True\nfor i in task:\n time -= i[1]\n if time > i[0]:\n flag = False\n break\nif flag:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_v1_no_empty_lines": "import sys\nfrom collections import defaultdict\nfrom operator import itemgetter\n\ninput = sys.stdin.readline\nN = int(input())\nd = defaultdict(int)\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n d[b] += a\ntask = list(d.items())\ntask.sort()\nnow = 0\nans = \"Yes\"\nfor limit, time in task:\n now += time\n if now > limit:\n ans = \"No\"\n break\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 4.5454545455, "diff": ["-n = int(input())", "-task = []", "-for _ in range(n):", "+import sys", "+from collections import defaultdict", "+from operator import itemgetter", "+", "+input = sys.stdin.readline", "+N = int(input())", "+d = defaultdict(int)", "+for _ in range(N):", "- task.append((b, -a))", "+ d[b] += a", "+task = list(d.items())", "-time = 0", "-flag = True", "-for i in task:", "- time -= i[1]", "- if time > i[0]:", "- flag = False", "+now = 0", "+ans = \"Yes\"", "+for limit, time in task:", "+ now += time", "+ if now > limit:", "+ ans = \"No\"", "-if flag:", "- print(\"Yes\")", "-else:", "- print(\"No\")", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3182171457, "measured_runtime_v1": 0.1977030051, "runtime_lift": 1.6095716175, "key": ["s348750359", "s832149929"]} {"user_id": "u367130284", "problem_id": "p03081", "language": "python", "submission_id_v0": "s141729674", "submission_id_v1": "s328617225", "cpu_time_v0": 599, "cpu_time_v1": 524, "memory_v0": 40892, "memory_v1": 40892, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.52, "input": "n,q=list(map(int,input().split()));s=\"_\"+input()+\"_\";l,r=0,n+1\n\nfor(m,h)in[input().split()for i in range(q)][::-1]:L=h==\"L\";R=h==\"R\";l,r=[l,l-1,l+1][(m==s[l]and R)-(m==s[l+1]and L)],[r,r-1,r+1][(m==s[r-1]and R)-(m==s[r]and L)]\n\nprint((max(0,r-l-1)))", "target": "n,q=list(map(int,input().split()));s=\"_\"+input()+\"_\";l,r=0,n+1\n\nfor(m,h)in[input().split()for i in range(q)][::-1]:\n\n L=h==\"L\";R=h==\"R\";\n\n l+=(m==s[l+1]and L)-(m==s[l]and R)\n\n r+=(m==s[r]and L)-(m==s[r-1]and R)\n\nprint((max(0,r-l-1)))", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 241, "code_v1_num_chars": 234, "code_v0_no_empty_lines": "n, q = list(map(int, input().split()))\ns = \"_\" + input() + \"_\"\nl, r = 0, n + 1\nfor (m, h) in [input().split() for i in range(q)][::-1]:\n L = h == \"L\"\n R = h == \"R\"\n l, r = [l, l - 1, l + 1][(m == s[l] and R) - (m == s[l + 1] and L)], [\n r,\n r - 1,\n r + 1,\n ][(m == s[r - 1] and R) - (m == s[r] and L)]\nprint((max(0, r - l - 1)))\n", "code_v1_no_empty_lines": "n, q = list(map(int, input().split()))\ns = \"_\" + input() + \"_\"\nl, r = 0, n + 1\nfor (m, h) in [input().split() for i in range(q)][::-1]:\n L = h == \"L\"\n R = h == \"R\"\n l += (m == s[l + 1] and L) - (m == s[l] and R)\n r += (m == s[r] and L) - (m == s[r - 1] and R)\nprint((max(0, r - l - 1)))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["- l, r = [l, l - 1, l + 1][(m == s[l] and R) - (m == s[l + 1] and L)], [", "- r,", "- r - 1,", "- r + 1,", "- ][(m == s[r - 1] and R) - (m == s[r] and L)]", "+ l += (m == s[l + 1] and L) - (m == s[l] and R)", "+ r += (m == s[r] and L) - (m == s[r - 1] and R)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2496840062, "measured_runtime_v1": 0.1505171778, "runtime_lift": 1.6588406042, "key": ["s141729674", "s328617225"]} {"user_id": "u134019875", "problem_id": "p03796", "language": "python", "submission_id_v0": "s983655328", "submission_id_v1": "s754374761", "cpu_time_v0": 231, "cpu_time_v1": 36, "memory_v0": 3984, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 84.42, "input": "import math\n\n\n\nn = int(input())\n\nprint((math.factorial(n) % (10 ** 9 + 7)))", "target": "n = int(input())\n\np = 1\n\nfor i in range(1, n + 1):\n\n p = p * i % (10 ** 9 + 7)\n\nprint(p)", "code_v0_loc": 4, "code_v1_loc": 5, "code_v0_num_chars": 73, "code_v1_num_chars": 89, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nprint((math.factorial(n) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\np = 1\nfor i in range(1, n + 1):\n p = p * i % (10**9 + 7)\nprint(p)\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-import math", "-", "-print((math.factorial(n) % (10**9 + 7)))", "+p = 1", "+for i in range(1, n + 1):", "+ p = p * i % (10**9 + 7)", "+print(p)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1349290106, "measured_runtime_v1": 0.0997186968, "runtime_lift": 1.3530964092, "key": ["s983655328", "s754374761"]} {"user_id": "u597374218", "problem_id": "p03035", "language": "python", "submission_id_v0": "s085289040", "submission_id_v1": "s328762084", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "a,b=list(map(int,input().split()))\n\nprint((b if 13<=a else b//2 if 6<=a else 0))", "target": "a,b=list(map(int,input().split()))\n\nprint((b if 12=b[i]):\n\n cnt+=b[i]\n\n else:\n\n cnt+=a[i]\n\n d=b[i]-a[i]\n\n cnt+=min(a[i+1],d)\n\n if(d>a[i+1]):\n\n a[i+1]=0\n\n else: a[i+1]-=d\n\n \n\n stdout.write(str(cnt)+\"\\n\")\n", "target": "n = int(input())\n\nA = list(map(int, input().split()))\n\nB = list(map(int, input().split()))\n\na1 = sum(A)\n\nfor i in range(n):\n\n b = B[i]\n\n if A[i] >= b:A[i] -= b\n\n else:\n\n if A[i+1]+A[i] >= b:\n\n A[i+1] = A[i+1]+A[i]-b\n\n A[i] = 0\n\n else:A[i], A[i+1] = 0, 0\n\na2 = sum(A)\n\nprint((a1-a2))", "code_v0_loc": 22, "code_v1_loc": 14, "code_v0_num_chars": 499, "code_v1_num_chars": 299, "code_v0_no_empty_lines": "from sys import stdin, stdout\n\nif __name__ == \"__main__\":\n n = int(stdin.readline())\n a = [int(x) for x in stdin.readline().split()]\n b = [int(x) for x in stdin.readline().split()]\n cnt = 0\n for i in range(n):\n if a[i] >= b[i]:\n cnt += b[i]\n else:\n cnt += a[i]\n d = b[i] - a[i]\n cnt += min(a[i + 1], d)\n if d > a[i + 1]:\n a[i + 1] = 0\n else:\n a[i + 1] -= d\n stdout.write(str(cnt) + \"\\n\")\n", "code_v1_no_empty_lines": "n = int(input())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\na1 = sum(A)\nfor i in range(n):\n b = B[i]\n if A[i] >= b:\n A[i] -= b\n else:\n if A[i + 1] + A[i] >= b:\n A[i + 1] = A[i + 1] + A[i] - b\n A[i] = 0\n else:\n A[i], A[i + 1] = 0, 0\na2 = sum(A)\nprint((a1 - a2))\n", "code_same": false, "relative_loc_diff_percent": 36.3636363636, "diff": ["-from sys import stdin, stdout", "-", "-if __name__ == \"__main__\":", "- n = int(stdin.readline())", "- a = [int(x) for x in stdin.readline().split()]", "- b = [int(x) for x in stdin.readline().split()]", "- cnt = 0", "- for i in range(n):", "- if a[i] >= b[i]:", "- cnt += b[i]", "+n = int(input())", "+A = list(map(int, input().split()))", "+B = list(map(int, input().split()))", "+a1 = sum(A)", "+for i in range(n):", "+ b = B[i]", "+ if A[i] >= b:", "+ A[i] -= b", "+ else:", "+ if A[i + 1] + A[i] >= b:", "+ A[i + 1] = A[i + 1] + A[i] - b", "+ A[i] = 0", "- cnt += a[i]", "- d = b[i] - a[i]", "- cnt += min(a[i + 1], d)", "- if d > a[i + 1]:", "- a[i + 1] = 0", "- else:", "- a[i + 1] -= d", "- stdout.write(str(cnt) + \"\\n\")", "+ A[i], A[i + 1] = 0, 0", "+a2 = sum(A)", "+print((a1 - a2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2530250838, "measured_runtime_v1": 0.0949857178, "runtime_lift": 2.6638224113, "key": ["s078643579", "s464947070"]} {"user_id": "u732159958", "problem_id": "p03416", "language": "python", "submission_id_v0": "s130057185", "submission_id_v1": "s637640023", "cpu_time_v0": 68, "cpu_time_v1": 50, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 26.47, "input": "counter = 0\n\nc = list(map(int, input().split(' ')))\n\nfor i in range(c[0], c[1] + 1):\n\n if str(i)[0] != str(i)[4]:\n\n continue\n\n if str(i)[1] != str(i)[3]:\n\n continue\n\n counter += 1\n\n\n\nprint(counter)", "target": "a = list(map(int, input().split()))\n\ncounter = 0\n\nfor i in range(a[0], a[1] + 1):\n\n stri = str(i)\n\n if (stri[0] == stri[4] and stri[1] == stri[3]):\n\n counter += 1\n\n \n\nprint(counter)", "code_v0_loc": 10, "code_v1_loc": 8, "code_v0_num_chars": 206, "code_v1_num_chars": 189, "code_v0_no_empty_lines": "counter = 0\nc = list(map(int, input().split(\" \")))\nfor i in range(c[0], c[1] + 1):\n if str(i)[0] != str(i)[4]:\n continue\n if str(i)[1] != str(i)[3]:\n continue\n counter += 1\nprint(counter)\n", "code_v1_no_empty_lines": "a = list(map(int, input().split()))\ncounter = 0\nfor i in range(a[0], a[1] + 1):\n stri = str(i)\n if stri[0] == stri[4] and stri[1] == stri[3]:\n counter += 1\nprint(counter)\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["+a = list(map(int, input().split()))", "-c = list(map(int, input().split(\" \")))", "-for i in range(c[0], c[1] + 1):", "- if str(i)[0] != str(i)[4]:", "- continue", "- if str(i)[1] != str(i)[3]:", "- continue", "- counter += 1", "+for i in range(a[0], a[1] + 1):", "+ stri = str(i)", "+ if stri[0] == stri[4] and stri[1] == stri[3]:", "+ counter += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.442622024, "measured_runtime_v1": 0.3161446974, "runtime_lift": 1.4000615148, "key": ["s130057185", "s637640023"]} {"user_id": "u089230684", "problem_id": "p03038", "language": "python", "submission_id_v0": "s817533229", "submission_id_v1": "s906455398", "cpu_time_v0": 826, "cpu_time_v1": 662, "memory_v0": 82456, "memory_v1": 25196, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 19.85, "input": "I=lambda:list(map(int,input().split()))\n\nn,m=I()\n\na=I()\n\na.sort(reverse=True)\n\nqq=[I() for i in range(m)]\n\nqq.sort(key=lambda x:x[1],reverse=True)\n\nans=0\n\nfor x,y in qq:\n\n for j in range(x):\n\n if not a:\n\n break\n\n aa=a.pop()\n\n ans+=max(aa,y)\n\nans+=sum(a)\n\nprint(ans)\n\n ", "target": "I=lambda : list(map(int,input().split()))\n\nn,m = I()\n\nl=I();s=sum(l);l.sort();d=[]\n\nfor _ in range(m):\n\n b,c=I()\n\n d.append([c,b])\n\np=s=0 \n\nfor i in sorted(d,reverse=True):\n\n while i[1]:\n\n if p>=n or l[p]>=i[0]:\n\n break\n\n i[1]-=1\n\n s+=i[0]\n\n p+=1\n\n if p>=n:\n\n break\n\ns+=sum(l[p:])\n\nprint(s)", "code_v0_loc": 16, "code_v1_loc": 18, "code_v0_num_chars": 310, "code_v1_num_chars": 351, "code_v0_no_empty_lines": "I = lambda: list(map(int, input().split()))\nn, m = I()\na = I()\na.sort(reverse=True)\nqq = [I() for i in range(m)]\nqq.sort(key=lambda x: x[1], reverse=True)\nans = 0\nfor x, y in qq:\n for j in range(x):\n if not a:\n break\n aa = a.pop()\n ans += max(aa, y)\nans += sum(a)\nprint(ans)\n", "code_v1_no_empty_lines": "I = lambda: list(map(int, input().split()))\nn, m = I()\nl = I()\ns = sum(l)\nl.sort()\nd = []\nfor _ in range(m):\n b, c = I()\n d.append([c, b])\np = s = 0\nfor i in sorted(d, reverse=True):\n while i[1]:\n if p >= n or l[p] >= i[0]:\n break\n i[1] -= 1\n s += i[0]\n p += 1\n if p >= n:\n break\ns += sum(l[p:])\nprint(s)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-a = I()", "-a.sort(reverse=True)", "-qq = [I() for i in range(m)]", "-qq.sort(key=lambda x: x[1], reverse=True)", "-ans = 0", "-for x, y in qq:", "- for j in range(x):", "- if not a:", "+l = I()", "+s = sum(l)", "+l.sort()", "+d = []", "+for _ in range(m):", "+ b, c = I()", "+ d.append([c, b])", "+p = s = 0", "+for i in sorted(d, reverse=True):", "+ while i[1]:", "+ if p >= n or l[p] >= i[0]:", "- aa = a.pop()", "- ans += max(aa, y)", "-ans += sum(a)", "-print(ans)", "+ i[1] -= 1", "+ s += i[0]", "+ p += 1", "+ if p >= n:", "+ break", "+s += sum(l[p:])", "+print(s)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3493785617, "measured_runtime_v1": 0.2761461248, "runtime_lift": 1.2651945122, "key": ["s817533229", "s906455398"]} {"user_id": "u062691227", "problem_id": "p03723", "language": "python", "submission_id_v0": "s522426109", "submission_id_v1": "s794063832", "cpu_time_v0": 61, "cpu_time_v1": 29, "memory_v0": 61360, "memory_v1": 9172, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 52.46, "input": "a,b,c=list(map(int,input().split()))\n\ne=(a-b)|(b-c)\n\nprint((bool(e|(a|b|c)%2)*(e^~-e).bit_length()-1))", "target": "a,b,c=list(map(int,input().split()))\n\ne=(a-b)|(b-c)\n\nprint((bool(e|b%2)*(e^~-e).bit_length()-1))", "code_v0_loc": 3, "code_v1_loc": 3, "code_v0_num_chars": 94, "code_v1_num_chars": 88, "code_v0_no_empty_lines": "a, b, c = list(map(int, input().split()))\ne = (a - b) | (b - c)\nprint((bool(e | (a | b | c) % 2) * (e ^ ~-e).bit_length() - 1))\n", "code_v1_no_empty_lines": "a, b, c = list(map(int, input().split()))\ne = (a - b) | (b - c)\nprint((bool(e | b % 2) * (e ^ ~-e).bit_length() - 1))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-print((bool(e | (a | b | c) % 2) * (e ^ ~-e).bit_length() - 1))", "+print((bool(e | b % 2) * (e ^ ~-e).bit_length() - 1))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2914967289, "measured_runtime_v1": 0.0905496902, "runtime_lift": 3.2191907898, "key": ["s522426109", "s794063832"]} {"user_id": "u298297089", "problem_id": "p03037", "language": "python", "submission_id_v0": "s092044899", "submission_id_v1": "s679810914", "cpu_time_v0": 352, "cpu_time_v1": 284, "memory_v0": 4760, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 19.32, "input": "N, M =list(map(int, input().split()))\n\nL = [0 for i in range(N+1)]\n\nR = [0 for i in range(N+1)]\n\nfor i in range(M):\n\n l,r = list(map(int, input().split()))\n\n L[l] += 1\n\n R[r] += 1\n\ncnt = 0\n\ntmp = 0\n\nfor i in range(N+1):\n\n tmp += L[i]\n\n if tmp == M:\n\n cnt += 1\n\n tmp -= R[i]\n\nprint(cnt)\n", "target": "n,m = list(map(int, input().split()))\n\nll = 1\n\nrr = n\n\nfor i in range(m):\n\n l,r = list(map(int,input().split()))\n\n if l > ll:\n\n ll = l\n\n if r < rr:\n\n rr = r\n\nprint((max(rr - ll + 1, 0)))\n", "code_v0_loc": 15, "code_v1_loc": 10, "code_v0_num_chars": 299, "code_v1_num_chars": 196, "code_v0_no_empty_lines": "N, M = list(map(int, input().split()))\nL = [0 for i in range(N + 1)]\nR = [0 for i in range(N + 1)]\nfor i in range(M):\n l, r = list(map(int, input().split()))\n L[l] += 1\n R[r] += 1\ncnt = 0\ntmp = 0\nfor i in range(N + 1):\n tmp += L[i]\n if tmp == M:\n cnt += 1\n tmp -= R[i]\nprint(cnt)\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\nll = 1\nrr = n\nfor i in range(m):\n l, r = list(map(int, input().split()))\n if l > ll:\n ll = l\n if r < rr:\n rr = r\nprint((max(rr - ll + 1, 0)))\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-N, M = list(map(int, input().split()))", "-L = [0 for i in range(N + 1)]", "-R = [0 for i in range(N + 1)]", "-for i in range(M):", "+n, m = list(map(int, input().split()))", "+ll = 1", "+rr = n", "+for i in range(m):", "- L[l] += 1", "- R[r] += 1", "-cnt = 0", "-tmp = 0", "-for i in range(N + 1):", "- tmp += L[i]", "- if tmp == M:", "- cnt += 1", "- tmp -= R[i]", "-print(cnt)", "+ if l > ll:", "+ ll = l", "+ if r < rr:", "+ rr = r", "+print((max(rr - ll + 1, 0)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2886495962, "measured_runtime_v1": 0.2151292083, "runtime_lift": 1.3417499114, "key": ["s092044899", "s679810914"]} {"user_id": "u305366205", "problem_id": "p03307", "language": "python", "submission_id_v0": "s023207655", "submission_id_v1": "s158622460", "cpu_time_v0": 36, "cpu_time_v1": 17, "memory_v0": 5176, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 52.78, "input": "import math\n\n\n\n\n\ndef lcm(x, y):\n\n return (x * y) // math.gcd(x, y)\n\n\n\n\n\nN = int(input())\n\nprint((lcm(N, 2)))", "target": "N = int(input())\n\nif N % 2 == 0:\n\n print(N)\n\nelse:\n\n print((2 * N))", "code_v0_loc": 9, "code_v1_loc": 5, "code_v0_num_chars": 119, "code_v1_num_chars": 71, "code_v0_no_empty_lines": "import math\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\nN = int(input())\nprint((lcm(N, 2)))\n", "code_v1_no_empty_lines": "N = int(input())\nif N % 2 == 0:\n print(N)\nelse:\n print((2 * N))\n", "code_same": false, "relative_loc_diff_percent": 44.4444444444, "diff": ["-import math", "-", "-", "-def lcm(x, y):", "- return (x * y) // math.gcd(x, y)", "-", "-", "-print((lcm(N, 2)))", "+if N % 2 == 0:", "+ print(N)", "+else:", "+ print((2 * N))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2764545197, "measured_runtime_v1": 0.1953277736, "runtime_lift": 1.4153364608, "key": ["s023207655", "s158622460"]} {"user_id": "u254871849", "problem_id": "p03037", "language": "python", "submission_id_v0": "s133611442", "submission_id_v1": "s023877292", "cpu_time_v0": 105, "cpu_time_v1": 71, "memory_v0": 25076, "memory_v1": 25076, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 32.38, "input": "import sys\n\n\n\nn, m, *lr = list(map(int, sys.stdin.read().split()))\n\nlr = list(zip(*[iter(lr)] * 2))\n\n\n\ndef main():\n\n cnt = [0] * (n + 1)\n\n for l, r in lr:\n\n cnt[l-1] += 1\n\n cnt[r] -= 1\n\n \n\n for i in range(n):\n\n cnt[i+1] += cnt[i]\n\n \n\n res = 0\n\n for i in range(n):\n\n res += (cnt[i] == m) & 1\n\n \n\n return res\n\n\n\nif __name__ == '__main__':\n\n ans = main()\n\n print(ans)", "target": "import sys\n\n\n\nn, m, *lr = list(map(int, sys.stdin.read().split()))\n\nl, r = lr[::2], lr[1::2]\n\n\n\ndef main():\n\n ans = max(min(r) - max(l) + 1, 0)\n\n return ans\n\n\n\nif __name__ == '__main__':\n\n ans = main()\n\n print(ans)", "code_v0_loc": 23, "code_v1_loc": 12, "code_v0_num_chars": 413, "code_v1_num_chars": 220, "code_v0_no_empty_lines": "import sys\n\nn, m, *lr = list(map(int, sys.stdin.read().split()))\nlr = list(zip(*[iter(lr)] * 2))\n\n\ndef main():\n cnt = [0] * (n + 1)\n for l, r in lr:\n cnt[l - 1] += 1\n cnt[r] -= 1\n for i in range(n):\n cnt[i + 1] += cnt[i]\n res = 0\n for i in range(n):\n res += (cnt[i] == m) & 1\n return res\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "code_v1_no_empty_lines": "import sys\n\nn, m, *lr = list(map(int, sys.stdin.read().split()))\nl, r = lr[::2], lr[1::2]\n\n\ndef main():\n ans = max(min(r) - max(l) + 1, 0)\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "code_same": false, "relative_loc_diff_percent": 47.8260869565, "diff": ["-lr = list(zip(*[iter(lr)] * 2))", "+l, r = lr[::2], lr[1::2]", "- cnt = [0] * (n + 1)", "- for l, r in lr:", "- cnt[l - 1] += 1", "- cnt[r] -= 1", "- for i in range(n):", "- cnt[i + 1] += cnt[i]", "- res = 0", "- for i in range(n):", "- res += (cnt[i] == m) & 1", "- return res", "+ ans = max(min(r) - max(l) + 1, 0)", "+ return ans"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3223134096, "measured_runtime_v1": 0.2034767451, "runtime_lift": 1.5840306928, "key": ["s133611442", "s023877292"]} {"user_id": "u392319141", "problem_id": "p03208", "language": "python", "submission_id_v0": "s260498412", "submission_id_v1": "s755290756", "cpu_time_v0": 275, "cpu_time_v1": 243, "memory_v0": 7384, "memory_v1": 7484, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.64, "input": "N, K = list(map(int, input().split()))\n\n\n\nheight = []\n\nfor _ in range(N) :\n\n height.append(int(input()))\n\n\n\nheight.sort()\n\nans = float('inf')\n\n\n\nfor i in range(N-K+1) :\n\n diff = height[i + K - 1] - height[i]\n\n ans = min(ans, diff)\n\n\n\nprint(ans)", "target": "N, K = list(map(int, input().split()))\n\nH = [int(input()) for _ in range(N)]\n\nH.sort()\n\n\n\nans = 10**18\n\nfor i in range(N - K + 1):\n\n ans = min(ans, H[i + K - 1] - H[i])\n\nprint(ans)", "code_v0_loc": 14, "code_v1_loc": 8, "code_v0_num_chars": 247, "code_v1_num_chars": 177, "code_v0_no_empty_lines": "N, K = list(map(int, input().split()))\nheight = []\nfor _ in range(N):\n height.append(int(input()))\nheight.sort()\nans = float(\"inf\")\nfor i in range(N - K + 1):\n diff = height[i + K - 1] - height[i]\n ans = min(ans, diff)\nprint(ans)\n", "code_v1_no_empty_lines": "N, K = list(map(int, input().split()))\nH = [int(input()) for _ in range(N)]\nH.sort()\nans = 10**18\nfor i in range(N - K + 1):\n ans = min(ans, H[i + K - 1] - H[i])\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 42.8571428571, "diff": ["-height = []", "-for _ in range(N):", "- height.append(int(input()))", "-height.sort()", "-ans = float(\"inf\")", "+H = [int(input()) for _ in range(N)]", "+H.sort()", "+ans = 10**18", "- diff = height[i + K - 1] - height[i]", "- ans = min(ans, diff)", "+ ans = min(ans, H[i + K - 1] - H[i])"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2545773742, "measured_runtime_v1": 0.0892174052, "runtime_lift": 2.8534496549, "key": ["s260498412", "s755290756"]} {"user_id": "u867069435", "problem_id": "p03399", "language": "python", "submission_id_v0": "s852784971", "submission_id_v1": "s460322800", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3316, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "a, b, c, d = int(input()), int(input()), int(input()), int(input()),\n\nprint((min(a, b)+min(c, d)))", "target": "print((min(int(input()), int(input())) + min(int(input()), int(input()))))", "code_v0_loc": 2, "code_v1_loc": 1, "code_v0_num_chars": 96, "code_v1_num_chars": 72, "code_v0_no_empty_lines": "a, b, c, d = (\n int(input()),\n int(input()),\n int(input()),\n int(input()),\n)\nprint((min(a, b) + min(c, d)))\n", "code_v1_no_empty_lines": "print(\n (\n min(int(input()), int(input()))\n + min(int(input()), int(input()))\n )\n)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-a, b, c, d = (", "- int(input()),", "- int(input()),", "- int(input()),", "- int(input()),", "+print(", "+ (", "+ min(int(input()), int(input()))", "+ + min(int(input()), int(input()))", "+ )", "-print((min(a, b) + min(c, d)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2959700694, "measured_runtime_v1": 0.2359499116, "runtime_lift": 1.2543766912, "key": ["s852784971", "s460322800"]} {"user_id": "u021019433", "problem_id": "p02837", "language": "python", "submission_id_v0": "s475579950", "submission_id_v1": "s165212154", "cpu_time_v0": 219, "cpu_time_v1": 58, "memory_v0": 3064, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 73.52, "input": "def popcount(x):\n\n r = 0\n\n while x:\n\n if x & 1:\n\n r += 1\n\n x >>= 1\n\n return r\n\n\n\nn = int(input())\n\nr = list(range(n))\n\na = [[0, 0] for _ in r]\n\nfor i in r:\n\n for _ in range(int(input())):\n\n x, y = list(map(int, input().split()))\n\n a[i][y] |= 1 << (x - 1)\n\n\n\nm = 0\n\nl = (1 << n) - 1\n\nfor x in range(1, l + 1):\n\n if all(a[i][0] & x == a[i][1] & l - x == 0 for i in r if x >> i & 1):\n\n m = max(m, popcount(x))\n\nprint(m)\n", "target": "from itertools import combinations\n\n \n\nn = int(input())\n\nr = list(range(n))\n\na = [(set(), set()) for _ in r]\n\nfor i in r:\n\n for _ in range(int(input())):\n\n x, y = list(map(int, input().split()))\n\n a[i][y].add(x - 1)\n\n \n\nfail = lambda x: not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x)\n\n \n\nwhile all(map(fail, list(map(set, combinations(r, n))))):\n\n n -= 1\n\nprint(n)", "code_v0_loc": 22, "code_v1_loc": 15, "code_v0_num_chars": 430, "code_v1_num_chars": 365, "code_v0_no_empty_lines": "def popcount(x):\n r = 0\n while x:\n if x & 1:\n r += 1\n x >>= 1\n return r\n\n\nn = int(input())\nr = list(range(n))\na = [[0, 0] for _ in r]\nfor i in r:\n for _ in range(int(input())):\n x, y = list(map(int, input().split()))\n a[i][y] |= 1 << (x - 1)\nm = 0\nl = (1 << n) - 1\nfor x in range(1, l + 1):\n if all(a[i][0] & x == a[i][1] & l - x == 0 for i in r if x >> i & 1):\n m = max(m, popcount(x))\nprint(m)\n", "code_v1_no_empty_lines": "from itertools import combinations\n\nn = int(input())\nr = list(range(n))\na = [(set(), set()) for _ in r]\nfor i in r:\n for _ in range(int(input())):\n x, y = list(map(int, input().split()))\n a[i][y].add(x - 1)\nfail = lambda x: not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x)\nwhile all(map(fail, list(map(set, combinations(r, n))))):\n n -= 1\nprint(n)\n", "code_same": false, "relative_loc_diff_percent": 31.8181818182, "diff": ["-def popcount(x):", "- r = 0", "- while x:", "- if x & 1:", "- r += 1", "- x >>= 1", "- return r", "-", "+from itertools import combinations", "-a = [[0, 0] for _ in r]", "+a = [(set(), set()) for _ in r]", "- a[i][y] |= 1 << (x - 1)", "-m = 0", "-l = (1 << n) - 1", "-for x in range(1, l + 1):", "- if all(a[i][0] & x == a[i][1] & l - x == 0 for i in r if x >> i & 1):", "- m = max(m, popcount(x))", "-print(m)", "+ a[i][y].add(x - 1)", "+fail = lambda x: not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x)", "+while all(map(fail, list(map(set, combinations(r, n))))):", "+ n -= 1", "+print(n)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2279194756, "measured_runtime_v1": 0.0067682672, "runtime_lift": 33.6747161436, "key": ["s475579950", "s165212154"]} {"user_id": "u644907318", "problem_id": "p03241", "language": "python", "submission_id_v0": "s205255104", "submission_id_v1": "s496579949", "cpu_time_v0": 180, "cpu_time_v1": 73, "memory_v0": 38640, "memory_v1": 63824, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 59.44, "input": "N,M = list(map(int,input().split()))\n\nif N==1:\n\n nmax=M\n\nelse:\n\n nmax = 1\n\n for i in range(2,int(M**0.5)+1):\n\n if M%i==0 and M//i>=N:\n\n nmax = max(nmax,i)\n\n if M%i==0 and i>=N:\n\n nmax = max(nmax,M//i)\n\nprint(nmax)", "target": "N,M = list(map(int,input().split()))\n\namax = 1\n\nfor i in range(1,int(M**0.5)+1):\n\n if M%i==0:\n\n a = i\n\n b = M//i\n\n if b>=N:\n\n amax = max(amax,a)\n\n a,b = b,a\n\n if b>=N:\n\n amax = max(amax,a)\n\nprint(amax)", "code_v0_loc": 11, "code_v1_loc": 12, "code_v0_num_chars": 252, "code_v1_num_chars": 255, "code_v0_no_empty_lines": "N, M = list(map(int, input().split()))\nif N == 1:\n nmax = M\nelse:\n nmax = 1\n for i in range(2, int(M**0.5) + 1):\n if M % i == 0 and M // i >= N:\n nmax = max(nmax, i)\n if M % i == 0 and i >= N:\n nmax = max(nmax, M // i)\nprint(nmax)\n", "code_v1_no_empty_lines": "N, M = list(map(int, input().split()))\namax = 1\nfor i in range(1, int(M**0.5) + 1):\n if M % i == 0:\n a = i\n b = M // i\n if b >= N:\n amax = max(amax, a)\n a, b = b, a\n if b >= N:\n amax = max(amax, a)\nprint(amax)\n", "code_same": false, "relative_loc_diff_percent": 8.3333333333, "diff": ["-if N == 1:", "- nmax = M", "-else:", "- nmax = 1", "- for i in range(2, int(M**0.5) + 1):", "- if M % i == 0 and M // i >= N:", "- nmax = max(nmax, i)", "- if M % i == 0 and i >= N:", "- nmax = max(nmax, M // i)", "-print(nmax)", "+amax = 1", "+for i in range(1, int(M**0.5) + 1):", "+ if M % i == 0:", "+ a = i", "+ b = M // i", "+ if b >= N:", "+ amax = max(amax, a)", "+ a, b = b, a", "+ if b >= N:", "+ amax = max(amax, a)", "+print(amax)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3445633175, "measured_runtime_v1": 0.2717220852, "runtime_lift": 1.26807255, "key": ["s205255104", "s496579949"]} {"user_id": "u144913062", "problem_id": "p03457", "language": "python", "submission_id_v0": "s956976175", "submission_id_v1": "s285518014", "cpu_time_v0": 628, "cpu_time_v1": 555, "memory_v0": 62040, "memory_v1": 46056, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.62, "input": "N = int(input())\n\ntxy = [(0, 0, 0)] + [tuple(map(int, input().split())) for _ in range(N)]\n\nfor i in range(N):\n\n t1, x1, y1 = txy[i]\n\n t2, x2, y2 = txy[i+1]\n\n if abs(x2-x1) + abs(y2-y1) <= t2 - t1 and (x1+y1+x2+y2) % 2 == (t2-t1) % 2:\n\n continue\n\n else:\n\n print('No')\n\n exit()\n\nprint('Yes')", "target": "N = int(input())\n\nt0 = x0 = y0 = 0\n\nfor _ in range(N):\n\n t1, x1, y1 = list(map(int, input().split()))\n\n d = abs(x1 - x0) + abs(y1 - y0)\n\n if d > t1 - t0 or d % 2 != (t1 - t0) % 2:\n\n print('No')\n\n exit()\n\n t0, x0, y0 = t1, x1, y1\n\nprint('Yes')\n", "code_v0_loc": 11, "code_v1_loc": 10, "code_v0_num_chars": 323, "code_v1_num_chars": 263, "code_v0_no_empty_lines": "N = int(input())\ntxy = [(0, 0, 0)] + [tuple(map(int, input().split())) for _ in range(N)]\nfor i in range(N):\n t1, x1, y1 = txy[i]\n t2, x2, y2 = txy[i + 1]\n if (\n abs(x2 - x1) + abs(y2 - y1) <= t2 - t1\n and (x1 + y1 + x2 + y2) % 2 == (t2 - t1) % 2\n ):\n continue\n else:\n print(\"No\")\n exit()\nprint(\"Yes\")\n", "code_v1_no_empty_lines": "N = int(input())\nt0 = x0 = y0 = 0\nfor _ in range(N):\n t1, x1, y1 = list(map(int, input().split()))\n d = abs(x1 - x0) + abs(y1 - y0)\n if d > t1 - t0 or d % 2 != (t1 - t0) % 2:\n print(\"No\")\n exit()\n t0, x0, y0 = t1, x1, y1\nprint(\"Yes\")\n", "code_same": false, "relative_loc_diff_percent": 9.0909090909, "diff": ["-txy = [(0, 0, 0)] + [tuple(map(int, input().split())) for _ in range(N)]", "-for i in range(N):", "- t1, x1, y1 = txy[i]", "- t2, x2, y2 = txy[i + 1]", "- if (", "- abs(x2 - x1) + abs(y2 - y1) <= t2 - t1", "- and (x1 + y1 + x2 + y2) % 2 == (t2 - t1) % 2", "- ):", "- continue", "- else:", "+t0 = x0 = y0 = 0", "+for _ in range(N):", "+ t1, x1, y1 = list(map(int, input().split()))", "+ d = abs(x1 - x0) + abs(y1 - y0)", "+ if d > t1 - t0 or d % 2 != (t1 - t0) % 2:", "+ t0, x0, y0 = t1, x1, y1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3724059272, "measured_runtime_v1": 0.2797260373, "runtime_lift": 1.3313237867, "key": ["s956976175", "s285518014"]} {"user_id": "u729133443", "problem_id": "p02537", "language": "python", "submission_id_v0": "s897150427", "submission_id_v1": "s003067542", "cpu_time_v0": 1389, "cpu_time_v1": 1137, "memory_v0": 275544, "memory_v1": 157144, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 18.14, "input": "d=[0]*6**8\n\nn,k,*a=list(map(int,open(0).read().split()+d))\n\nfor i in range(n):d[i]=max(d[j]for j in range(i-99,i+1)if abs(a[i]-a[j])<=k)+1\n\nprint((max(d)))", "target": "d=[0]*6**8\n\nn,k,*a=list(map(int,open(0).read().split()))\n\na=d+a\n\nwhile n:d[n]=max(d[j]for j in range(n,n+99)if abs(a[-n]-a[-j])<=k)+1;n-=1\n\nprint((max(d)))", "code_v0_loc": 4, "code_v1_loc": 5, "code_v0_num_chars": 147, "code_v1_num_chars": 147, "code_v0_no_empty_lines": "d = [0] * 6**8\nn, k, *a = list(map(int, open(0).read().split() + d))\nfor i in range(n):\n d[i] = max(d[j] for j in range(i - 99, i + 1) if abs(a[i] - a[j]) <= k) + 1\nprint((max(d)))\n", "code_v1_no_empty_lines": "d = [0] * 6**8\nn, k, *a = list(map(int, open(0).read().split()))\na = d + a\nwhile n:\n d[n] = max(d[j] for j in range(n, n + 99) if abs(a[-n] - a[-j]) <= k) + 1\n n -= 1\nprint((max(d)))\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-n, k, *a = list(map(int, open(0).read().split() + d))", "-for i in range(n):", "- d[i] = max(d[j] for j in range(i - 99, i + 1) if abs(a[i] - a[j]) <= k) + 1", "+n, k, *a = list(map(int, open(0).read().split()))", "+a = d + a", "+while n:", "+ d[n] = max(d[j] for j in range(n, n + 99) if abs(a[-n] - a[-j]) <= k) + 1", "+ n -= 1"], "diff_only_import_comment": false, "measured_runtime_v0": 1.750332129, "measured_runtime_v1": 0.822091434, "runtime_lift": 2.1291209914, "key": ["s897150427", "s003067542"]} {"user_id": "u118019047", "problem_id": "p03416", "language": "python", "submission_id_v0": "s640144582", "submission_id_v1": "s252292470", "cpu_time_v0": 78, "cpu_time_v1": 54, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 30.77, "input": "a , b = input().split()\n\na = int(a)\n\nb = int(b)\n\ncount=0\n\nfor i in range(a,b+1):\n\n test = list(str(i))\n\n if (test[0] == test[4]) and (test[1]==test[3]):\n\n count=count+1\n\nprint(count)", "target": "A,B=list(map(int,input().split()))\n\nct=0\n\nfor i in range(A,B+1):\n\n s=str(i)\n\n if s==s[::-1]:\n\n ct+=1\n\nprint(ct)", "code_v0_loc": 9, "code_v1_loc": 7, "code_v0_num_chars": 195, "code_v1_num_chars": 118, "code_v0_no_empty_lines": "a, b = input().split()\na = int(a)\nb = int(b)\ncount = 0\nfor i in range(a, b + 1):\n test = list(str(i))\n if (test[0] == test[4]) and (test[1] == test[3]):\n count = count + 1\nprint(count)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\nct = 0\nfor i in range(A, B + 1):\n s = str(i)\n if s == s[::-1]:\n ct += 1\nprint(ct)\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["-a, b = input().split()", "-a = int(a)", "-b = int(b)", "-count = 0", "-for i in range(a, b + 1):", "- test = list(str(i))", "- if (test[0] == test[4]) and (test[1] == test[3]):", "- count = count + 1", "-print(count)", "+A, B = list(map(int, input().split()))", "+ct = 0", "+for i in range(A, B + 1):", "+ s = str(i)", "+ if s == s[::-1]:", "+ ct += 1", "+print(ct)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4764800201, "measured_runtime_v1": 0.3351052109, "runtime_lift": 1.4218818588, "key": ["s640144582", "s252292470"]} {"user_id": "u562016607", "problem_id": "p03835", "language": "python", "submission_id_v0": "s390314187", "submission_id_v1": "s016239384", "cpu_time_v0": 1476, "cpu_time_v1": 282, "memory_v0": 2940, "memory_v1": 41180, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 80.89, "input": "K,S=list(map(int,input().split()))\n\nO=0\n\nfor X in range(K+1):\n\n for Y in range(K+1):\n\n Z=S-X-Y\n\n if 0<=Z<=K:\n\n O+=1\n\nprint(O)\n", "target": "K,S=list(map(int,input().split()))\n\nans=0\n\nfor X in range(K+1):\n\n for Y in range(K+1):\n\n Z=S-X-Y\n\n if 0<=Z<=K:\n\n ans+=1\n\nprint(ans)\n", "code_v0_loc": 8, "code_v1_loc": 8, "code_v0_num_chars": 132, "code_v1_num_chars": 154, "code_v0_no_empty_lines": "K, S = list(map(int, input().split()))\nO = 0\nfor X in range(K + 1):\n for Y in range(K + 1):\n Z = S - X - Y\n if 0 <= Z <= K:\n O += 1\nprint(O)\n", "code_v1_no_empty_lines": "K, S = list(map(int, input().split()))\nans = 0\nfor X in range(K + 1):\n for Y in range(K + 1):\n Z = S - X - Y\n if 0 <= Z <= K:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-O = 0", "+ans = 0", "- O += 1", "-print(O)", "+ ans += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2257852338, "measured_runtime_v1": 0.0060590109, "runtime_lift": 37.2643715379, "key": ["s390314187", "s016239384"]} {"user_id": "u812576525", "problem_id": "p03309", "language": "python", "submission_id_v0": "s649374585", "submission_id_v1": "s527849910", "cpu_time_v0": 249, "cpu_time_v1": 171, "memory_v0": 26180, "memory_v1": 30980, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 31.33, "input": "n = int(input())\n\na = list(map(int,input().split()))\n\naa = []\n\nfor i in range(n):\n\n aa.append(a[i]-(i+1))\n\nb = (sorted(aa)[n//2])\n\n\n\nans = 0\n\nfor i in range(n):\n\n ans += abs(a[i]-(b+i+1))\n\nprint(ans)", "target": "N= int(input())\n\nA = list(map(int,input().split()))\n\n\n\nB = []\n\nfor i in range(N):\n\n B.append(A[i]-(i+1))\n\n#print(B)\n\nb= (sorted(B)[N//2])\n\n#print(b)\n\nans = 0\n\nfor i in range(N):\n\n ans += abs(B[i]-b)\n\nprint(ans)", "code_v0_loc": 11, "code_v1_loc": 13, "code_v0_num_chars": 205, "code_v1_num_chars": 216, "code_v0_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\naa = []\nfor i in range(n):\n aa.append(a[i] - (i + 1))\nb = sorted(aa)[n // 2]\nans = 0\nfor i in range(n):\n ans += abs(a[i] - (b + i + 1))\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nB = []\nfor i in range(N):\n B.append(A[i] - (i + 1))\n# print(B)\nb = sorted(B)[N // 2]\n# print(b)\nans = 0\nfor i in range(N):\n ans += abs(B[i] - b)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 15.3846153846, "diff": ["-n = int(input())", "-a = list(map(int, input().split()))", "-aa = []", "-for i in range(n):", "- aa.append(a[i] - (i + 1))", "-b = sorted(aa)[n // 2]", "+N = int(input())", "+A = list(map(int, input().split()))", "+B = []", "+for i in range(N):", "+ B.append(A[i] - (i + 1))", "+# print(B)", "+b = sorted(B)[N // 2]", "+# print(b)", "-for i in range(n):", "- ans += abs(a[i] - (b + i + 1))", "+for i in range(N):", "+ ans += abs(B[i] - b)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.277994447, "measured_runtime_v1": 0.0063325391, "runtime_lift": 43.8993653214, "key": ["s649374585", "s527849910"]} {"user_id": "u944325914", "problem_id": "p02773", "language": "python", "submission_id_v0": "s220148525", "submission_id_v1": "s009987907", "cpu_time_v0": 1010, "cpu_time_v1": 521, "memory_v0": 104656, "memory_v1": 50176, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 48.42, "input": "import collections\n\nn = int(input())\n\na=[input() for _ in range(n)]\n\nanslist=[]\n\nb=collections.Counter(a)\n\nc=max(list(b.values()))\n\nfor i in b:\n\n if b[i]==c:\n\n anslist.append(i)\n\nd=sorted(anslist)\n\nfor i in tuple(d):\n\n print(i)", "target": "from collections import Counter\n\nn=int(input())\n\na=[]\n\nfor i in range(n):\n\n a.append(input())\n\nac=Counter(a)\n\nacs=sorted(list(ac.items()),key=lambda x:x[1],reverse=1)\n\nz=len(acs)\n\ni=0\n\ntemp=[]\n\n\n\nwhile i<=z-1 and acs[i][1]==acs[0][1] :\n\n temp.append(acs[i][0])\n\n i+=1\n\ntemp.sort()\n\nfor i in temp:\n\n print(i)", "code_v0_loc": 12, "code_v1_loc": 17, "code_v0_num_chars": 240, "code_v1_num_chars": 305, "code_v0_no_empty_lines": "import collections\n\nn = int(input())\na = [input() for _ in range(n)]\nanslist = []\nb = collections.Counter(a)\nc = max(list(b.values()))\nfor i in b:\n if b[i] == c:\n anslist.append(i)\nd = sorted(anslist)\nfor i in tuple(d):\n print(i)\n", "code_v1_no_empty_lines": "from collections import Counter\n\nn = int(input())\na = []\nfor i in range(n):\n a.append(input())\nac = Counter(a)\nacs = sorted(list(ac.items()), key=lambda x: x[1], reverse=1)\nz = len(acs)\ni = 0\ntemp = []\nwhile i <= z - 1 and acs[i][1] == acs[0][1]:\n temp.append(acs[i][0])\n i += 1\ntemp.sort()\nfor i in temp:\n print(i)\n", "code_same": false, "relative_loc_diff_percent": 29.4117647059, "diff": ["-import collections", "+from collections import Counter", "-a = [input() for _ in range(n)]", "-anslist = []", "-b = collections.Counter(a)", "-c = max(list(b.values()))", "-for i in b:", "- if b[i] == c:", "- anslist.append(i)", "-d = sorted(anslist)", "-for i in tuple(d):", "+a = []", "+for i in range(n):", "+ a.append(input())", "+ac = Counter(a)", "+acs = sorted(list(ac.items()), key=lambda x: x[1], reverse=1)", "+z = len(acs)", "+i = 0", "+temp = []", "+while i <= z - 1 and acs[i][1] == acs[0][1]:", "+ temp.append(acs[i][0])", "+ i += 1", "+temp.sort()", "+for i in temp:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3929853504, "measured_runtime_v1": 0.3037585902, "runtime_lift": 1.2937423435, "key": ["s220148525", "s009987907"]} {"user_id": "u857759499", "problem_id": "p03371", "language": "python", "submission_id_v0": "s203363465", "submission_id_v1": "s893730989", "cpu_time_v0": 85, "cpu_time_v1": 17, "memory_v0": 7096, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 80.0, "input": "a,b,c,x,y = list(map(int,input().split()))\n\nxy = max(x,y)*2+1\n\nprint((min([c*i + max(0,a*(x-i//2)) +max(0,b*(y-i//2)) for i in range(0,xy,2)])))", "target": "a,b,c,x,y = list(map(int,input().split()))\n\nif x < y:\n\n a, b, x, y = b, a, y, x\n\nprint((min(a*x+b*y,2*c*y + a*(x-y),2*c*x)))", "code_v0_loc": 3, "code_v1_loc": 4, "code_v0_num_chars": 136, "code_v1_num_chars": 119, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nxy = max(x, y) * 2 + 1\nprint(\n (\n min(\n [\n c * i + max(0, a * (x - i // 2)) + max(0, b * (y - i // 2))\n for i in range(0, xy, 2)\n ]\n )\n )\n)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nif x < y:\n a, b, x, y = b, a, y, x\nprint((min(a * x + b * y, 2 * c * y + a * (x - y), 2 * c * x)))\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-xy = max(x, y) * 2 + 1", "-print(", "- (", "- min(", "- [", "- c * i + max(0, a * (x - i // 2)) + max(0, b * (y - i // 2))", "- for i in range(0, xy, 2)", "- ]", "- )", "- )", "-)", "+if x < y:", "+ a, b, x, y = b, a, y, x", "+print((min(a * x + b * y, 2 * c * y + a * (x - y), 2 * c * x)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2887920134, "measured_runtime_v1": 0.2046661584, "runtime_lift": 1.4110394, "key": ["s203363465", "s893730989"]} {"user_id": "u628732336", "problem_id": "p02412", "language": "python", "submission_id_v0": "s343999289", "submission_id_v1": "s206971885", "cpu_time_v0": 1010, "cpu_time_v1": 530, "memory_v0": 7716, "memory_v1": 7724, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 47.52, "input": "while True:\n\n n, x = [int(i) for i in input().split()]\n\n\n\n if n == x == 0:\n\n break\n\n\n\n count = 0\n\n for s in range(1, n - 1):\n\n for m in range(s + 1, n):\n\n for e in range(m + 1, n + 1):\n\n if x == sum([s, m, e]):\n\n count += 1\n\n\n\n print(count)", "target": "while True:\n\n n, x = [int(i) for i in input().split()]\n\n\n\n if n == x == 0:\n\n break\n\n\n\n count = 0\n\n for s in range(1, n - 1):\n\n for m in range(s + 1, n):\n\n for e in range(m + 1, n + 1):\n\n if x == s+m+e:\n\n count += 1\n\n\n\n print(count)", "code_v0_loc": 14, "code_v1_loc": 14, "code_v0_num_chars": 314, "code_v1_num_chars": 305, "code_v0_no_empty_lines": "while True:\n n, x = [int(i) for i in input().split()]\n if n == x == 0:\n break\n count = 0\n for s in range(1, n - 1):\n for m in range(s + 1, n):\n for e in range(m + 1, n + 1):\n if x == sum([s, m, e]):\n count += 1\n print(count)\n", "code_v1_no_empty_lines": "while True:\n n, x = [int(i) for i in input().split()]\n if n == x == 0:\n break\n count = 0\n for s in range(1, n - 1):\n for m in range(s + 1, n):\n for e in range(m + 1, n + 1):\n if x == s + m + e:\n count += 1\n print(count)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- if x == sum([s, m, e]):", "+ if x == s + m + e:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3385973902, "measured_runtime_v1": 0.2597145021, "runtime_lift": 1.3037292389, "key": ["s343999289", "s206971885"]} {"user_id": "u102461423", "problem_id": "p03000", "language": "python", "submission_id_v0": "s091839409", "submission_id_v1": "s096312338", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "N,X = list(map(int,input().split()))\n\nL = [0] + [int(x) for x in input().split()]\n\n\n\nD = [0] * (N+2)\n\nanswer = 1\n\nfor n in range(2,N+2):\n\n D[n] = D[n-1] + L[n-1]\n\n if D[n] <= X:\n\n answer += 1\n\n \n\nprint(answer)", "target": "import sys\n\nread = sys.stdin.buffer.read\n\nreadline = sys.stdin.buffer.readline\n\nreadlines = sys.stdin.buffer.readlines\n\n\n\nimport itertools\n\n\n\nN,X,*L = list(map(int,read().split()))\n\n\n\nanswer = sum(x <= X for x in itertools.accumulate([0]+L))\n\nprint(answer)", "code_v0_loc": 11, "code_v1_loc": 11, "code_v0_num_chars": 211, "code_v1_num_chars": 250, "code_v0_no_empty_lines": "N, X = list(map(int, input().split()))\nL = [0] + [int(x) for x in input().split()]\nD = [0] * (N + 2)\nanswer = 1\nfor n in range(2, N + 2):\n D[n] = D[n - 1] + L[n - 1]\n if D[n] <= X:\n answer += 1\nprint(answer)\n", "code_v1_no_empty_lines": "import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nimport itertools\n\nN, X, *L = list(map(int, read().split()))\nanswer = sum(x <= X for x in itertools.accumulate([0] + L))\nprint(answer)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-N, X = list(map(int, input().split()))", "-L = [0] + [int(x) for x in input().split()]", "-D = [0] * (N + 2)", "-answer = 1", "-for n in range(2, N + 2):", "- D[n] = D[n - 1] + L[n - 1]", "- if D[n] <= X:", "- answer += 1", "+import sys", "+", "+read = sys.stdin.buffer.read", "+readline = sys.stdin.buffer.readline", "+readlines = sys.stdin.buffer.readlines", "+import itertools", "+", "+N, X, *L = list(map(int, read().split()))", "+answer = sum(x <= X for x in itertools.accumulate([0] + L))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4454345685, "measured_runtime_v1": 0.3287086122, "runtime_lift": 1.3551046487, "key": ["s091839409", "s096312338"]} {"user_id": "u133936772", "problem_id": "p02983", "language": "python", "submission_id_v0": "s915950177", "submission_id_v1": "s423283368", "cpu_time_v0": 97, "cpu_time_v1": 51, "memory_v0": 3060, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 47.42, "input": "mod = 2019\n\nl, r = list(map(int, input().split()))\n\n\n\nif r//mod - l//mod > 0:\n\n print((0))\n\nelse:\n\n l %= mod\n\n r %= mod\n\n ans = mod\n\n for i in range(l+1, r+1):\n\n for j in range(l, i):\n\n ans = min(i*j%mod, ans)\n\n if ans == 0:\n\n break\n\n print(ans)", "target": "mod = 2019\n\nl, r = list(map(int, input().split()))\n\n\n\nif r//mod - l//mod > 0:\n\n print((0))\n\nelse:\n\n l %= mod\n\n r %= mod\n\n ans = mod\n\n for i in range(l, r):\n\n for j in range(i+1, r+1):\n\n ans = min(i*j%mod, ans)\n\n if ans == 0:\n\n break\n\n print(ans)", "code_v0_loc": 15, "code_v1_loc": 15, "code_v0_num_chars": 259, "code_v1_num_chars": 259, "code_v0_no_empty_lines": "mod = 2019\nl, r = list(map(int, input().split()))\nif r // mod - l // mod > 0:\n print((0))\nelse:\n l %= mod\n r %= mod\n ans = mod\n for i in range(l + 1, r + 1):\n for j in range(l, i):\n ans = min(i * j % mod, ans)\n if ans == 0:\n break\n print(ans)\n", "code_v1_no_empty_lines": "mod = 2019\nl, r = list(map(int, input().split()))\nif r // mod - l // mod > 0:\n print((0))\nelse:\n l %= mod\n r %= mod\n ans = mod\n for i in range(l, r):\n for j in range(i + 1, r + 1):\n ans = min(i * j % mod, ans)\n if ans == 0:\n break\n print(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- for i in range(l + 1, r + 1):", "- for j in range(l, i):", "+ for i in range(l, r):", "+ for j in range(i + 1, r + 1):"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3490325066, "measured_runtime_v1": 0.2693671175, "runtime_lift": 1.2957502381, "key": ["s915950177", "s423283368"]} {"user_id": "u661290476", "problem_id": "p00053", "language": "python", "submission_id_v0": "s978814614", "submission_id_v1": "s421101567", "cpu_time_v0": 420, "cpu_time_v1": 210, "memory_v0": 18368, "memory_v1": 51028, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 50.0, "input": "prim=[True]*1000000\n\nprim[0],prim[1]=False,False\n\nfor i in range(2,1000):\n\n if prim[i]:\n\n for j in range(i*2,1000000,i):\n\n prim[j]=False\n\nprime=[i for i,j in enumerate(prim) if j==True]\n\n\n\nwhile True:\n\n n=int(input())\n\n if n==0:\n\n break\n\n print((sum(prime[:n])))", "target": "prim=[True]*1000000\n\nprim[0]=prim[1]=False\n\nfor i in range(2,350):\n\n if prim[i]:\n\n for j in range(i*2,110000,i):\n\n prim[j]=False\n\nprime=[i for i,j in enumerate(prim) if j==True]\n\n\n\nwhile True:\n\n n=int(input())\n\n if n==0:\n\n break\n\n print((sum(prime[:n])))", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 297, "code_v1_num_chars": 289, "code_v0_no_empty_lines": "prim = [True] * 1000000\nprim[0], prim[1] = False, False\nfor i in range(2, 1000):\n if prim[i]:\n for j in range(i * 2, 1000000, i):\n prim[j] = False\nprime = [i for i, j in enumerate(prim) if j == True]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print((sum(prime[:n])))\n", "code_v1_no_empty_lines": "prim = [True] * 1000000\nprim[0] = prim[1] = False\nfor i in range(2, 350):\n if prim[i]:\n for j in range(i * 2, 110000, i):\n prim[j] = False\nprime = [i for i, j in enumerate(prim) if j == True]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print((sum(prime[:n])))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-prim[0], prim[1] = False, False", "-for i in range(2, 1000):", "+prim[0] = prim[1] = False", "+for i in range(2, 350):", "- for j in range(i * 2, 1000000, i):", "+ for j in range(i * 2, 110000, i):"], "diff_only_import_comment": false, "measured_runtime_v0": 1.0302433112, "measured_runtime_v1": 0.6551637814, "runtime_lift": 1.5724973516, "key": ["s978814614", "s421101567"]} {"user_id": "u347600233", "problem_id": "p03037", "language": "python", "submission_id_v0": "s661845965", "submission_id_v1": "s817506416", "cpu_time_v0": 279, "cpu_time_v1": 195, "memory_v0": 7088, "memory_v1": 16564, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 30.11, "input": "n, m = list(map(int, input().split()))\n\ngate = []\n\nl, r = list(map(int, input().split()))\n\nfor i in range(1, m):\n\n m, s = list(map(int, input().split()))\n\n if l < m:\n\n l = m\n\n if s < r:\n\n r = s\n\nprint((len([i for i in range(l, r + 1)])))", "target": "n, m = list(map(int, input().split()))\n\nl, r = [0] * m, [0] * m\n\nfor i in range(m):\n\n l[i], r[i] = list(map(int, input().split()))\n\nprint((max(min(r) - max(l) + 1, 0)))", "code_v0_loc": 10, "code_v1_loc": 5, "code_v0_num_chars": 240, "code_v1_num_chars": 157, "code_v0_no_empty_lines": "n, m = list(map(int, input().split()))\ngate = []\nl, r = list(map(int, input().split()))\nfor i in range(1, m):\n m, s = list(map(int, input().split()))\n if l < m:\n l = m\n if s < r:\n r = s\nprint((len([i for i in range(l, r + 1)])))\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\nl, r = [0] * m, [0] * m\nfor i in range(m):\n l[i], r[i] = list(map(int, input().split()))\nprint((max(min(r) - max(l) + 1, 0)))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-gate = []", "-l, r = list(map(int, input().split()))", "-for i in range(1, m):", "- m, s = list(map(int, input().split()))", "- if l < m:", "- l = m", "- if s < r:", "- r = s", "-print((len([i for i in range(l, r + 1)])))", "+l, r = [0] * m, [0] * m", "+for i in range(m):", "+ l[i], r[i] = list(map(int, input().split()))", "+print((max(min(r) - max(l) + 1, 0)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.317712152, "measured_runtime_v1": 0.2449507949, "runtime_lift": 1.2970447884, "key": ["s661845965", "s817506416"]} {"user_id": "u585963734", "problem_id": "p02596", "language": "python", "submission_id_v0": "s961921352", "submission_id_v1": "s631804156", "cpu_time_v0": 290, "cpu_time_v1": 180, "memory_v0": 48468, "memory_v1": 9168, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 37.93, "input": "K=int(input())\n\n\n\nif K%2==0:\n\n print((-1))\n\n exit(0)\n\n \n\nans=[0]*(pow(10,6)+1)\n\nans[0]=0\n\n\n\nfor i in range(1,pow(10,6)):\n\n ans[i]=(ans[i-1]*10+7)%K\n\n if ans[i]==0:\n\n print(i)\n\n exit(0)\n\n\n\nprint((-1))", "target": "import functools\n\n\n\nK=int(input())\n\n \n\nif K%2==0:\n\n print((-1))\n\n exit(0)\n\n\n\nmod=0\n\n\n\nfor i in range(1,pow(10,6)):\n\n mod=(mod*10+7)%K\n\n if mod==0:\n\n print(i)\n\n exit(0)\n\n \n\nprint((-1))", "code_v0_loc": 16, "code_v1_loc": 17, "code_v0_num_chars": 224, "code_v1_num_chars": 212, "code_v0_no_empty_lines": "K = int(input())\nif K % 2 == 0:\n print((-1))\n exit(0)\nans = [0] * (pow(10, 6) + 1)\nans[0] = 0\nfor i in range(1, pow(10, 6)):\n ans[i] = (ans[i - 1] * 10 + 7) % K\n if ans[i] == 0:\n print(i)\n exit(0)\nprint((-1))\n", "code_v1_no_empty_lines": "import functools\n\nK = int(input())\nif K % 2 == 0:\n print((-1))\n exit(0)\nmod = 0\nfor i in range(1, pow(10, 6)):\n mod = (mod * 10 + 7) % K\n if mod == 0:\n print(i)\n exit(0)\nprint((-1))\n", "code_same": false, "relative_loc_diff_percent": 5.8823529412, "diff": ["+import functools", "+", "-ans = [0] * (pow(10, 6) + 1)", "-ans[0] = 0", "+mod = 0", "- ans[i] = (ans[i - 1] * 10 + 7) % K", "- if ans[i] == 0:", "+ mod = (mod * 10 + 7) % K", "+ if mod == 0:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7143074386, "measured_runtime_v1": 0.5444337668, "runtime_lift": 1.3120189858, "key": ["s961921352", "s631804156"]} {"user_id": "u188827677", "problem_id": "p03037", "language": "python", "submission_id_v0": "s698380012", "submission_id_v1": "s714478978", "cpu_time_v0": 302, "cpu_time_v1": 221, "memory_v0": 11020, "memory_v1": 9144, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 26.82, "input": "N,M = list(map(int, input().split()))\n\nL = []\n\nR = []\n\nfor _ in range(M):\n\n l,r = list(map(int, input().split()))\n\n L.append(l)\n\n R.append(r)\n\n\n\nans = min(R)-max(L)+1\n\nif ans < 0:\n\n print((0))\n\nelse:\n\n print(ans)\n\n ", "target": "n,m = list(map(int, input().split()))\n\nmax_l = float(\"-inf\")\n\nmin_r = float(\"inf\")\n\nfor _ in range(m):\n\n l,r = list(map(int, input().split()))\n\n max_l = max(max_l, l)\n\n min_r = min(min_r, r)\n\nans = min_r - max_l + 1\n\nif ans > 0:\n\n print(ans)\n\nelse:\n\n print((0))", "code_v0_loc": 14, "code_v1_loc": 12, "code_v0_num_chars": 207, "code_v1_num_chars": 252, "code_v0_no_empty_lines": "N, M = list(map(int, input().split()))\nL = []\nR = []\nfor _ in range(M):\n l, r = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nans = min(R) - max(L) + 1\nif ans < 0:\n print((0))\nelse:\n print(ans)\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\nmax_l = float(\"-inf\")\nmin_r = float(\"inf\")\nfor _ in range(m):\n l, r = list(map(int, input().split()))\n max_l = max(max_l, l)\n min_r = min(min_r, r)\nans = min_r - max_l + 1\nif ans > 0:\n print(ans)\nelse:\n print((0))\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-N, M = list(map(int, input().split()))", "-L = []", "-R = []", "-for _ in range(M):", "+n, m = list(map(int, input().split()))", "+max_l = float(\"-inf\")", "+min_r = float(\"inf\")", "+for _ in range(m):", "- L.append(l)", "- R.append(r)", "-ans = min(R) - max(L) + 1", "-if ans < 0:", "+ max_l = max(max_l, l)", "+ min_r = min(min_r, r)", "+ans = min_r - max_l + 1", "+if ans > 0:", "+ print(ans)", "+else:", "-else:", "- print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2637555127, "measured_runtime_v1": 0.1756164875, "runtime_lift": 1.5018835444, "key": ["s698380012", "s714478978"]} {"user_id": "u803617136", "problem_id": "p03325", "language": "python", "submission_id_v0": "s116805601", "submission_id_v1": "s513357045", "cpu_time_v0": 184, "cpu_time_v1": 27, "memory_v0": 40560, "memory_v1": 4148, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 85.33, "input": "N = int(input())\n\n\n\nseq = list(map(int, input().split()))\n\n\n\ncnt = 0\n\n\n\nfor num in seq:\n\n while num % 2 == 0:\n\n cnt += 1\n\n num /= 2\n\n\n\nprint(cnt)\n", "target": "n = int(input())\n\na = list(map(int, input().split()))\n\nans = 0\n\nfor num in a:\n\n ans += format(num, 'b')[::-1].find('1')\n\nprint(ans)", "code_v0_loc": 12, "code_v1_loc": 6, "code_v0_num_chars": 163, "code_v1_num_chars": 134, "code_v0_no_empty_lines": "N = int(input())\nseq = list(map(int, input().split()))\ncnt = 0\nfor num in seq:\n while num % 2 == 0:\n cnt += 1\n num /= 2\nprint(cnt)\n", "code_v1_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\nans = 0\nfor num in a:\n ans += format(num, \"b\")[::-1].find(\"1\")\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-N = int(input())", "-seq = list(map(int, input().split()))", "-cnt = 0", "-for num in seq:", "- while num % 2 == 0:", "- cnt += 1", "- num /= 2", "-print(cnt)", "+n = int(input())", "+a = list(map(int, input().split()))", "+ans = 0", "+for num in a:", "+ ans += format(num, \"b\")[::-1].find(\"1\")", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1574799829, "measured_runtime_v1": 0.0061847587, "runtime_lift": 25.4625913758, "key": ["s116805601", "s513357045"]} {"user_id": "u186838327", "problem_id": "p03796", "language": "python", "submission_id_v0": "s155084707", "submission_id_v1": "s301395968", "cpu_time_v0": 231, "cpu_time_v1": 177, "memory_v0": 4104, "memory_v1": 38640, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 23.38, "input": "import math\n\nn = int(input())\n\nprint((math.factorial(n)%(10**9+7)))", "target": "n = int(input())\n\nans = 1\n\nmod = 10**9+7\n\nfor i in range(1, n+1):\n\n ans *= i\n\n ans %= mod\n\n\n\nans %= mod\n\nprint(ans)\n", "code_v0_loc": 3, "code_v1_loc": 9, "code_v0_num_chars": 65, "code_v1_num_chars": 122, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nprint((math.factorial(n) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\nans = 1\nmod = 10**9 + 7\nfor i in range(1, n + 1):\n ans *= i\n ans %= mod\nans %= mod\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-import math", "-", "-print((math.factorial(n) % (10**9 + 7)))", "+ans = 1", "+mod = 10**9 + 7", "+for i in range(1, n + 1):", "+ ans *= i", "+ ans %= mod", "+ans %= mod", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5786725054, "measured_runtime_v1": 0.2556207638, "runtime_lift": 2.2637930378, "key": ["s155084707", "s301395968"]} {"user_id": "u014333473", "problem_id": "p03845", "language": "python", "submission_id_v0": "s045706452", "submission_id_v1": "s705375036", "cpu_time_v0": 29, "cpu_time_v1": 25, "memory_v0": 9180, "memory_v1": 9164, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.79, "input": "n,t=int(input()),list(map(int,input().split()));T=sum(t)\n\nprint(*[T-t[i-1]+j for i,j in [list(map(int,input().split())) for _ in range(int(input()))]],sep='\\n')\n", "target": "input();t=list(map(int,input().split()));T=sum(t)\n\nprint(*[T-t[i-1]+j for i,j in [list(map(int,input().split())) for _ in range(int(input()))]],sep='\\n')\n", "code_v0_loc": 2, "code_v1_loc": 2, "code_v0_num_chars": 160, "code_v1_num_chars": 153, "code_v0_no_empty_lines": "n, t = int(input()), list(map(int, input().split()))\nT = sum(t)\nprint(\n *[\n T - t[i - 1] + j\n for i, j in [list(map(int, input().split())) for _ in range(int(input()))]\n ],\n sep=\"\\n\"\n)\n", "code_v1_no_empty_lines": "input()\nt = list(map(int, input().split()))\nT = sum(t)\nprint(\n *[\n T - t[i - 1] + j\n for i, j in [list(map(int, input().split())) for _ in range(int(input()))]\n ],\n sep=\"\\n\"\n)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-n, t = int(input()), list(map(int, input().split()))", "+input()", "+t = list(map(int, input().split()))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.308619008, "measured_runtime_v1": 0.2417461898, "runtime_lift": 1.2766240837, "key": ["s045706452", "s705375036"]} {"user_id": "u906501980", "problem_id": "p03363", "language": "python", "submission_id_v0": "s203042500", "submission_id_v1": "s990747122", "cpu_time_v0": 316, "cpu_time_v1": 264, "memory_v0": 52496, "memory_v1": 52544, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.46, "input": "n = int(input())\n\nA = [int(i) for i in input().split()]\n\nS = [0]*(n+1)\n\nnum={}\n\nfor i in range(n):\n\n S[i+1] = S[i] + A[i]\n\nfor i in S:\n\n if str(i) in list(num.keys()):\n\n num[str(i)] += 1\n\n else:\n\n num[str(i)] = 1\n\nout = [i*(i-1)//2 for i in list(num.values()) if i>1]\n\nprint((sum(out)))", "target": "n = int(input())\n\nA = [int(i) for i in input().split()]\n\nS = [0]*(n+1)\n\nnum = {}\n\nfor i in range(n):\n\n S[i+1] = S[i] + A[i]\n\nfor i in S:\n\n s = str(i)\n\n num[s] = 1 if s not in list(num.keys()) else num[s]+1\n\nout = [i*(i-1)//2 for i in list(num.values()) if i > 1]\n\nprint((sum(out)))", "code_v0_loc": 13, "code_v1_loc": 11, "code_v0_num_chars": 295, "code_v1_num_chars": 276, "code_v0_no_empty_lines": "n = int(input())\nA = [int(i) for i in input().split()]\nS = [0] * (n + 1)\nnum = {}\nfor i in range(n):\n S[i + 1] = S[i] + A[i]\nfor i in S:\n if str(i) in list(num.keys()):\n num[str(i)] += 1\n else:\n num[str(i)] = 1\nout = [i * (i - 1) // 2 for i in list(num.values()) if i > 1]\nprint((sum(out)))\n", "code_v1_no_empty_lines": "n = int(input())\nA = [int(i) for i in input().split()]\nS = [0] * (n + 1)\nnum = {}\nfor i in range(n):\n S[i + 1] = S[i] + A[i]\nfor i in S:\n s = str(i)\n num[s] = 1 if s not in list(num.keys()) else num[s] + 1\nout = [i * (i - 1) // 2 for i in list(num.values()) if i > 1]\nprint((sum(out)))\n", "code_same": false, "relative_loc_diff_percent": 15.3846153846, "diff": ["- if str(i) in list(num.keys()):", "- num[str(i)] += 1", "- else:", "- num[str(i)] = 1", "+ s = str(i)", "+ num[s] = 1 if s not in list(num.keys()) else num[s] + 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4443410683, "measured_runtime_v1": 0.2339228122, "runtime_lift": 1.8995200341, "key": ["s203042500", "s990747122"]} {"user_id": "u805332733", "problem_id": "p02555", "language": "python", "submission_id_v0": "s317659277", "submission_id_v1": "s521440898", "cpu_time_v0": 89, "cpu_time_v1": 65, "memory_v0": 64652, "memory_v1": 63416, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 26.97, "input": "def resolve():\n\n base = 10**9+7\n\n S = int(input())\n\n dp = [0] * (S+1)\n\n dp[0] = 1\n\n\n\n for i in range(1, S+1):\n\n for u in range(i-2):\n\n dp[i] += dp[u]\n\n dp[i] %= base\n\n # print(dp)\n\n print((dp[S]%base))\n\n\n\nif __name__ == \"__main__\":\n\n resolve()\n", "target": "def resolve():\n\n base = 10**9+7\n\n S = int(input())\n\n dp = [0] * (S+1)\n\n dp[0] = 1\n\n\n\n for i in range(3, S+1):\n\n dp[i] = dp[i-1] + dp[i-3]\n\n # print(dp)\n\n print((dp[S]%base))\n\n\n\nif __name__ == \"__main__\":\n\n resolve()", "code_v0_loc": 15, "code_v1_loc": 13, "code_v0_num_chars": 263, "code_v1_num_chars": 224, "code_v0_no_empty_lines": "def resolve():\n base = 10**9 + 7\n S = int(input())\n dp = [0] * (S + 1)\n dp[0] = 1\n for i in range(1, S + 1):\n for u in range(i - 2):\n dp[i] += dp[u]\n dp[i] %= base\n # print(dp)\n print((dp[S] % base))\n\n\nif __name__ == \"__main__\":\n resolve()\n", "code_v1_no_empty_lines": "def resolve():\n base = 10**9 + 7\n S = int(input())\n dp = [0] * (S + 1)\n dp[0] = 1\n for i in range(3, S + 1):\n dp[i] = dp[i - 1] + dp[i - 3]\n # print(dp)\n print((dp[S] % base))\n\n\nif __name__ == \"__main__\":\n resolve()\n", "code_same": false, "relative_loc_diff_percent": 13.3333333333, "diff": ["- for i in range(1, S + 1):", "- for u in range(i - 2):", "- dp[i] += dp[u]", "- dp[i] %= base", "+ for i in range(3, S + 1):", "+ dp[i] = dp[i - 1] + dp[i - 3]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5217176821, "measured_runtime_v1": 0.2045270953, "runtime_lift": 2.5508487337, "key": ["s317659277", "s521440898"]} {"user_id": "u450904670", "problem_id": "p03796", "language": "python", "submission_id_v0": "s280545626", "submission_id_v1": "s422534863", "cpu_time_v0": 73, "cpu_time_v1": 40, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 45.21, "input": "n = int(input())\n\nres = 1\n\nfor num in range(1, n+1):\n\n res = res * num\n\n res = res % (pow(10,9) + 7)\n\nprint(res)", "target": "n = int(input())\n\nres = 1\n\nfor num in range(1, n+1):\n\n res = res * num\n\n res = res % (10**9 + 7)\n\nprint(res)\n", "code_v0_loc": 6, "code_v1_loc": 6, "code_v0_num_chars": 114, "code_v1_num_chars": 115, "code_v0_no_empty_lines": "n = int(input())\nres = 1\nfor num in range(1, n + 1):\n res = res * num\n res = res % (pow(10, 9) + 7)\nprint(res)\n", "code_v1_no_empty_lines": "n = int(input())\nres = 1\nfor num in range(1, n + 1):\n res = res * num\n res = res % (10**9 + 7)\nprint(res)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- res = res % (pow(10, 9) + 7)", "+ res = res % (10**9 + 7)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4279417639, "measured_runtime_v1": 0.3313806841, "runtime_lift": 1.2913901876, "key": ["s280545626", "s422534863"]} {"user_id": "u498487134", "problem_id": "p02917", "language": "python", "submission_id_v0": "s303870321", "submission_id_v1": "s766724876", "cpu_time_v0": 162, "cpu_time_v1": 67, "memory_v0": 38256, "memory_v1": 61812, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 58.64, "input": "N = int(input())\n\nB =list(map(int,input().split()))\n\nA=[0]*N\n\n\n\nA[0]=B[0]\n\nfor i in range(1,N-1):\n\n A[i]=min(B[i],B[i-1])\n\nA[-1]=B[-1]\n\nprint((sum(A)))", "target": "import sys\n\ninput = sys.stdin.readline\n\n\n\ndef I(): return int(input())\n\ndef MI(): return list(map(int, input().split()))\n\ndef LI(): return list(map(int, input().split()))\n\n\n\ndef main():\n\n mod=10**9+7\n\n N=I()\n\n B=LI()\n\n A=[0]*N\n\n A[0]=B[0]\n\n A[-1]=B[-1]\n\n for i in range(N-2):\n\n A[i+1]=min(B[i],B[i+1])\n\n \n\n print((sum(A)))\n\n\n\nmain()\n", "code_v0_loc": 9, "code_v1_loc": 20, "code_v0_num_chars": 152, "code_v1_num_chars": 363, "code_v0_no_empty_lines": "N = int(input())\nB = list(map(int, input().split()))\nA = [0] * N\nA[0] = B[0]\nfor i in range(1, N - 1):\n A[i] = min(B[i], B[i - 1])\nA[-1] = B[-1]\nprint((sum(A)))\n", "code_v1_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N = I()\n B = LI()\n A = [0] * N\n A[0] = B[0]\n A[-1] = B[-1]\n for i in range(N - 2):\n A[i + 1] = min(B[i], B[i + 1])\n print((sum(A)))\n\n\nmain()\n", "code_same": false, "relative_loc_diff_percent": 55.0, "diff": ["-N = int(input())", "-B = list(map(int, input().split()))", "-A = [0] * N", "-A[0] = B[0]", "-for i in range(1, N - 1):", "- A[i] = min(B[i], B[i - 1])", "-A[-1] = B[-1]", "-print((sum(A)))", "+import sys", "+", "+input = sys.stdin.readline", "+", "+", "+def I():", "+ return int(input())", "+", "+", "+def MI():", "+ return list(map(int, input().split()))", "+", "+", "+def LI():", "+ return list(map(int, input().split()))", "+", "+", "+def main():", "+ mod = 10**9 + 7", "+ N = I()", "+ B = LI()", "+ A = [0] * N", "+ A[0] = B[0]", "+ A[-1] = B[-1]", "+ for i in range(N - 2):", "+ A[i + 1] = min(B[i], B[i + 1])", "+ print((sum(A)))", "+", "+", "+main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.251366816, "measured_runtime_v1": 0.147175539, "runtime_lift": 1.7079388172, "key": ["s303870321", "s766724876"]} {"user_id": "u047796752", "problem_id": "p02700", "language": "python", "submission_id_v0": "s232689719", "submission_id_v1": "s065315130", "cpu_time_v0": 74, "cpu_time_v1": 57, "memory_v0": 64716, "memory_v1": 61776, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 22.97, "input": "import sys\n\ninput = sys.stdin.readline\n\nfrom collections import *\n\n\n\nA, B, C, D = list(map(int, input().split()))\n\n\n\nwhile True:\n\n C -= B\n\n \n\n if C<=0:\n\n print('Yes')\n\n exit()\n\n \n\n A -= D\n\n \n\n if A<=0:\n\n print('No')\n\n exit()", "target": "A, B, C, D = list(map(int, input().split()))\n\nc1 = (C+B-1)//B\n\nc2 = (A+D-1)//D\n\n\n\nif c1<=c2:\n\n print('Yes')\n\nelse:\n\n print('No')", "code_v0_loc": 18, "code_v1_loc": 8, "code_v0_num_chars": 267, "code_v1_num_chars": 128, "code_v0_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nfrom collections import *\n\nA, B, C, D = list(map(int, input().split()))\nwhile True:\n C -= B\n if C <= 0:\n print(\"Yes\")\n exit()\n A -= D\n if A <= 0:\n print(\"No\")\n exit()\n", "code_v1_no_empty_lines": "A, B, C, D = list(map(int, input().split()))\nc1 = (C + B - 1) // B\nc2 = (A + D - 1) // D\nif c1 <= c2:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_same": false, "relative_loc_diff_percent": 55.5555555556, "diff": ["-import sys", "-", "-input = sys.stdin.readline", "-from collections import *", "-", "-while True:", "- C -= B", "- if C <= 0:", "- print(\"Yes\")", "- exit()", "- A -= D", "- if A <= 0:", "- print(\"No\")", "- exit()", "+c1 = (C + B - 1) // B", "+c2 = (A + D - 1) // D", "+if c1 <= c2:", "+ print(\"Yes\")", "+else:", "+ print(\"No\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2898896478, "measured_runtime_v1": 0.0638447898, "runtime_lift": 4.5405372711, "key": ["s232689719", "s065315130"]} {"user_id": "u086503932", "problem_id": "p02814", "language": "python", "submission_id_v0": "s657535199", "submission_id_v1": "s415753878", "cpu_time_v0": 500, "cpu_time_v1": 202, "memory_v0": 16280, "memory_v1": 91128, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 59.6, "input": "#!/usr/bin/env python3\n\nimport sys\n\nfrom math import gcd\n\nimport math\n\n\n\ndef main():\n\n N, M = list(map(int, input().split()))\n\n a = list(map(int, input().split()))\n\n tmp = 1\n\n count = None\n\n for i in range(N):\n\n tmp = (tmp * a[i]//2) // gcd(tmp,a[i]//2)\n\n c = 0\n\n n = a[i]//2\n\n while n % 2 == 0:\n\n c += 1\n\n n //= 2\n\n if i == 0:\n\n count = c\n\n elif count != c:\n\n print((0))\n\n exit()\n\n print(((M//tmp +1)//2))\n\n\n\nif __name__ == '__main__':\n\n main()\n", "target": "from math import gcd\n\n\n\nN, M = list(map(int, input().split()))\n\nA = list(map(int, input().split()))\n\nB = [a//2 for a in A]\n\nLCM = 1\n\nfor i in range(N):\n\n LCM = LCM * B[i] // gcd(LCM, B[i])\n\nfor i in range(N):\n\n if LCM // B[i] % 2 == 0:\n\n print((0))\n\n exit()\n\nprint(((M//LCM + 1)//2))", "code_v0_loc": 26, "code_v1_loc": 13, "code_v0_num_chars": 527, "code_v1_num_chars": 293, "code_v0_no_empty_lines": "#!/usr/bin/env python3\nimport sys\nfrom math import gcd\nimport math\n\n\ndef main():\n N, M = list(map(int, input().split()))\n a = list(map(int, input().split()))\n tmp = 1\n count = None\n for i in range(N):\n tmp = (tmp * a[i] // 2) // gcd(tmp, a[i] // 2)\n c = 0\n n = a[i] // 2\n while n % 2 == 0:\n c += 1\n n //= 2\n if i == 0:\n count = c\n elif count != c:\n print((0))\n exit()\n print(((M // tmp + 1) // 2))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "from math import gcd\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = [a // 2 for a in A]\nLCM = 1\nfor i in range(N):\n LCM = LCM * B[i] // gcd(LCM, B[i])\nfor i in range(N):\n if LCM // B[i] % 2 == 0:\n print((0))\n exit()\nprint(((M // LCM + 1) // 2))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-#!/usr/bin/env python3", "-import sys", "-from math import gcd", "-import math", "+from math import gcd", "-", "-def main():", "- N, M = list(map(int, input().split()))", "- a = list(map(int, input().split()))", "- tmp = 1", "- count = None", "- for i in range(N):", "- tmp = (tmp * a[i] // 2) // gcd(tmp, a[i] // 2)", "- c = 0", "- n = a[i] // 2", "- while n % 2 == 0:", "- c += 1", "- n //= 2", "- if i == 0:", "- count = c", "- elif count != c:", "- print((0))", "- exit()", "- print(((M // tmp + 1) // 2))", "-", "-", "-if __name__ == \"__main__\":", "- main()", "+N, M = list(map(int, input().split()))", "+A = list(map(int, input().split()))", "+B = [a // 2 for a in A]", "+LCM = 1", "+for i in range(N):", "+ LCM = LCM * B[i] // gcd(LCM, B[i])", "+for i in range(N):", "+ if LCM // B[i] % 2 == 0:", "+ print((0))", "+ exit()", "+print(((M // LCM + 1) // 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4621698339, "measured_runtime_v1": 0.3237110667, "runtime_lift": 1.4277233045, "key": ["s657535199", "s415753878"]} {"user_id": "u433181015", "problem_id": "p02394", "language": "python", "submission_id_v0": "s560769298", "submission_id_v1": "s595626547", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 7680, "memory_v1": 7728, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "a=input().split()\n\nb=list(map(int,a))\n\nW=b[0]\n\nH=b[1]\n\nx=b[2]\n\ny=b[3]\n\nr=b[4]\n\nif (r <= x <= (W - r)) and (r <= y <= (H - r)):\n\n print('Yes')\n\nelse:\n\n print('No')", "target": "W,H,x,y,r = [int(i) for i in input().split()]\n\nif (r <= x <= (W - r)) and (r <= y <= (H - r)):\n\n print('Yes')\n\nelse:\n\n print('No')", "code_v0_loc": 11, "code_v1_loc": 5, "code_v0_num_chars": 164, "code_v1_num_chars": 132, "code_v0_no_empty_lines": "a = input().split()\nb = list(map(int, a))\nW = b[0]\nH = b[1]\nx = b[2]\ny = b[3]\nr = b[4]\nif (r <= x <= (W - r)) and (r <= y <= (H - r)):\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_v1_no_empty_lines": "W, H, x, y, r = [int(i) for i in input().split()]\nif (r <= x <= (W - r)) and (r <= y <= (H - r)):\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_same": false, "relative_loc_diff_percent": 54.5454545455, "diff": ["-a = input().split()", "-b = list(map(int, a))", "-W = b[0]", "-H = b[1]", "-x = b[2]", "-y = b[3]", "-r = b[4]", "+W, H, x, y, r = [int(i) for i in input().split()]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3832537071, "measured_runtime_v1": 0.2996923448, "runtime_lift": 1.2788238128, "key": ["s560769298", "s595626547"]} {"user_id": "u454022848", "problem_id": "p02394", "language": "python", "submission_id_v0": "s949778573", "submission_id_v1": "s992404688", "cpu_time_v0": 40, "cpu_time_v1": 30, "memory_v0": 6724, "memory_v1": 6432, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 25.0, "input": "ia = [int(i) for i in input().split(\" \")]\n\nW=ia[0]\n\nH=ia[1]\n\nx=ia[2]\n\ny=ia[3]\n\nr=ia[4]\n\nprint((\"Yes\" if 0<=x-r and x+r<=W and 0<=y-r and y+r<=H else \"No\"))", "target": "# encoding:utf-8\n\n\n\ninput = list(map(int, input().split()))\n\nW, H, x, y, r = input\n\n\n\nif x - r < 0 or x + r > W:\n\n\tprint(\"No\")\n\nelif y - r < 0 or y + r > H:\n\n\tprint(\"No\")\n\nelse:\n\n\tprint(\"Yes\")", "code_v0_loc": 7, "code_v1_loc": 11, "code_v0_num_chars": 153, "code_v1_num_chars": 190, "code_v0_no_empty_lines": "ia = [int(i) for i in input().split(\" \")]\nW = ia[0]\nH = ia[1]\nx = ia[2]\ny = ia[3]\nr = ia[4]\nprint((\"Yes\" if 0 <= x - r and x + r <= W and 0 <= y - r and y + r <= H else \"No\"))\n", "code_v1_no_empty_lines": "# encoding:utf-8\ninput = list(map(int, input().split()))\nW, H, x, y, r = input\nif x - r < 0 or x + r > W:\n print(\"No\")\nelif y - r < 0 or y + r > H:\n print(\"No\")\nelse:\n print(\"Yes\")\n", "code_same": false, "relative_loc_diff_percent": 36.3636363636, "diff": ["-ia = [int(i) for i in input().split(\" \")]", "-W = ia[0]", "-H = ia[1]", "-x = ia[2]", "-y = ia[3]", "-r = ia[4]", "-print((\"Yes\" if 0 <= x - r and x + r <= W and 0 <= y - r and y + r <= H else \"No\"))", "+# encoding:utf-8", "+input = list(map(int, input().split()))", "+W, H, x, y, r = input", "+if x - r < 0 or x + r > W:", "+ print(\"No\")", "+elif y - r < 0 or y + r > H:", "+ print(\"No\")", "+else:", "+ print(\"Yes\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.354291319, "measured_runtime_v1": 0.2815986323, "runtime_lift": 1.2581428969, "key": ["s949778573", "s992404688"]} {"user_id": "u576432509", "problem_id": "p03371", "language": "python", "submission_id_v0": "s537618501", "submission_id_v1": "s493344814", "cpu_time_v0": 215, "cpu_time_v1": 122, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 43.26, "input": "a,b,c,x,y=list(map(int,input().split()))\n\n\n\nyenmin=a*x+b*y\n\nfor zz in range(2*10**5+1):\n\n xx=max(x-zz//2,0)\n\n yy=max(y-zz//2,0)\n\n yen=a*xx+b*yy+c*zz\n\n if yen (N ** 0.5):\n\n break\n\n if N % i == 0:\n\n p = i\n\n j = N // i\n\n m = i + j - 2\n\n if m < ans:\n\n ans = m\n\n else:\n\n continue\n\n else:\n\n continue\n\nprint(ans)\n", "target": "N = int(input())\n\nans = N - 1\n\nfor i in range(2, int((N ** 0.5) + 1)):\n\n if N % i == 0:\n\n j = N // i\n\n m = i + j - 2\n\n ans = min(ans, m)\n\nprint(ans)\n", "code_v0_loc": 17, "code_v1_loc": 8, "code_v0_num_chars": 330, "code_v1_num_chars": 173, "code_v0_no_empty_lines": "N = int(input())\nans = N - 1\np = 1\nfor i in range(2, int((N**0.5) + 1)):\n if p % 2 == 1 and i > (N**0.5):\n break\n if N % i == 0:\n p = i\n j = N // i\n m = i + j - 2\n if m < ans:\n ans = m\n else:\n continue\n else:\n continue\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nans = N - 1\nfor i in range(2, int((N**0.5) + 1)):\n if N % i == 0:\n j = N // i\n m = i + j - 2\n ans = min(ans, m)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 52.9411764706, "diff": ["-p = 1", "- if p % 2 == 1 and i > (N**0.5):", "- break", "- p = i", "- if m < ans:", "- ans = m", "- else:", "- continue", "- else:", "- continue", "+ ans = min(ans, m)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3775834899, "measured_runtime_v1": 0.2214011464, "runtime_lift": 1.7054269863, "key": ["s987616882", "s695744152"]} {"user_id": "u599547273", "problem_id": "p03494", "language": "python", "submission_id_v0": "s252753387", "submission_id_v1": "s505612116", "cpu_time_v0": 21, "cpu_time_v1": 18, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 14.29, "input": "def two_count(x):\n\n\tif int(str(x)[-1]) % 2 == 0:\n\n\t\treturn 1 + two_count(x//2)\n\n\telse:\n\n\t\treturn 0\n\n\n\nn = int(input())\n\nn_list = [int(n) for n in input().split(\" \")]\n\n\n\nn_two_count_list = [two_count(n) for n in n_list]\n\n\n\nprint((min(n_two_count_list)))", "target": "def two_count(x):\n\n\tif x % 2 == 0:\n\n\t\treturn 1 + two_count(x//2)\n\n\telse:\n\n\t\treturn 0\n\n\n\nn = int(input())\n\nn_list = [int(n) for n in input().split(\" \")]\n\n\n\nn_two_count_list = [two_count(n) for n in n_list]\n\n\n\nprint((min(n_two_count_list)))", "code_v0_loc": 12, "code_v1_loc": 12, "code_v0_num_chars": 250, "code_v1_num_chars": 236, "code_v0_no_empty_lines": "def two_count(x):\n if int(str(x)[-1]) % 2 == 0:\n return 1 + two_count(x // 2)\n else:\n return 0\n\n\nn = int(input())\nn_list = [int(n) for n in input().split(\" \")]\nn_two_count_list = [two_count(n) for n in n_list]\nprint((min(n_two_count_list)))\n", "code_v1_no_empty_lines": "def two_count(x):\n if x % 2 == 0:\n return 1 + two_count(x // 2)\n else:\n return 0\n\n\nn = int(input())\nn_list = [int(n) for n in input().split(\" \")]\nn_two_count_list = [two_count(n) for n in n_list]\nprint((min(n_two_count_list)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- if int(str(x)[-1]) % 2 == 0:", "+ if x % 2 == 0:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3392717605, "measured_runtime_v1": 0.2706325946, "runtime_lift": 1.2536249042, "key": ["s252753387", "s505612116"]} {"user_id": "u923270446", "problem_id": "p02814", "language": "python", "submission_id_v0": "s885010221", "submission_id_v1": "s420231524", "cpu_time_v0": 220, "cpu_time_v1": 172, "memory_v0": 16320, "memory_v1": 20208, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.82, "input": "from math import gcd\n\nn, m = list(map(int, input().split()))\n\na = [int(i) // 2 for i in input().split()]\n\nx = 1\n\nfor i in range(n):\n\n x *= a[i] // gcd(x, a[i])\n\nfor i in a:\n\n if x // i % 2 == 0:\n\n print((0))\n\n exit()\n\nprint(((m // x + 1) // 2))", "target": "from math import gcd, ceil\n\nn, m = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\na = [i // 2 for i in a]\n\nl = 1\n\nfor i in a:\n\n l *= i // gcd(l, i)\n\nfor i in a:\n\n if l // i % 2 == 0:\n\n print((0))\n\n exit()\n\nprint((ceil((m // l) / 2)))", "code_v0_loc": 11, "code_v1_loc": 12, "code_v0_num_chars": 259, "code_v1_num_chars": 266, "code_v0_no_empty_lines": "from math import gcd\n\nn, m = list(map(int, input().split()))\na = [int(i) // 2 for i in input().split()]\nx = 1\nfor i in range(n):\n x *= a[i] // gcd(x, a[i])\nfor i in a:\n if x // i % 2 == 0:\n print((0))\n exit()\nprint(((m // x + 1) // 2))\n", "code_v1_no_empty_lines": "from math import gcd, ceil\n\nn, m = list(map(int, input().split()))\na = list(map(int, input().split()))\na = [i // 2 for i in a]\nl = 1\nfor i in a:\n l *= i // gcd(l, i)\nfor i in a:\n if l // i % 2 == 0:\n print((0))\n exit()\nprint((ceil((m // l) / 2)))\n", "code_same": false, "relative_loc_diff_percent": 8.3333333333, "diff": ["-from math import gcd", "+from math import gcd, ceil", "-a = [int(i) // 2 for i in input().split()]", "-x = 1", "-for i in range(n):", "- x *= a[i] // gcd(x, a[i])", "+a = list(map(int, input().split()))", "+a = [i // 2 for i in a]", "+l = 1", "- if x // i % 2 == 0:", "+ l *= i // gcd(l, i)", "+for i in a:", "+ if l // i % 2 == 0:", "-print(((m // x + 1) // 2))", "+print((ceil((m // l) / 2)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2764406667, "measured_runtime_v1": 0.214073961, "runtime_lift": 1.2913325159, "key": ["s885010221", "s420231524"]} {"user_id": "u780475861", "problem_id": "p03416", "language": "python", "submission_id_v0": "s789877064", "submission_id_v1": "s762526319", "cpu_time_v0": 111, "cpu_time_v1": 17, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 84.68, "input": "a,b = list(map(int, input().split()))\n\nn = 0\n\nfor i in range(a, b + 1):\n\n f = True\n\n s = str(i)\n\n l = len(s)\n\n for j in range(l//2 + 1):\n\n if s[j] != s[- j - 1]:\n\n f = False\n\n break\n\n if f:\n\n n += 1\n\nprint(n)", "target": "a,b = list(map(int, input().split()))\n\nn = 0\n\nfor i in range(1, 10):\n\n for j in range(10):\n\n for k in range(10):\n\n s = 10000 * i + 1000 * j + 100 * k + 10 * j + i\n\n if a <= s <= b:\n\n n += 1\n\nprint(n)", "code_v0_loc": 13, "code_v1_loc": 9, "code_v0_num_chars": 253, "code_v1_num_chars": 240, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\nn = 0\nfor i in range(a, b + 1):\n f = True\n s = str(i)\n l = len(s)\n for j in range(l // 2 + 1):\n if s[j] != s[-j - 1]:\n f = False\n break\n if f:\n n += 1\nprint(n)\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\nn = 0\nfor i in range(1, 10):\n for j in range(10):\n for k in range(10):\n s = 10000 * i + 1000 * j + 100 * k + 10 * j + i\n if a <= s <= b:\n n += 1\nprint(n)\n", "code_same": false, "relative_loc_diff_percent": 30.7692307692, "diff": ["-for i in range(a, b + 1):", "- f = True", "- s = str(i)", "- l = len(s)", "- for j in range(l // 2 + 1):", "- if s[j] != s[-j - 1]:", "- f = False", "- break", "- if f:", "- n += 1", "+for i in range(1, 10):", "+ for j in range(10):", "+ for k in range(10):", "+ s = 10000 * i + 1000 * j + 100 * k + 10 * j + i", "+ if a <= s <= b:", "+ n += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.319382349, "measured_runtime_v1": 0.1601409102, "runtime_lift": 1.99438325, "key": ["s789877064", "s762526319"]} {"user_id": "u347600233", "problem_id": "p02952", "language": "python", "submission_id_v0": "s073920837", "submission_id_v1": "s426081507", "cpu_time_v0": 75, "cpu_time_v1": 58, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 22.67, "input": "import math\n\nn = int(input())\n\ncnt = 0\n\nfor i in range(1, n + 1):\n\n if math.floor(math.log10(i) + 1) % 2:\n\n cnt += 1\n\nprint(cnt)", "target": "n = int(input())\n\ncnt = 0\n\nfor i in range(1, n + 1):\n\n if len(str(i)) % 2:\n\n cnt += 1\n\nprint(cnt)", "code_v0_loc": 7, "code_v1_loc": 6, "code_v0_num_chars": 138, "code_v1_num_chars": 107, "code_v0_no_empty_lines": "import math\n\nn = int(input())\ncnt = 0\nfor i in range(1, n + 1):\n if math.floor(math.log10(i) + 1) % 2:\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "n = int(input())\ncnt = 0\nfor i in range(1, n + 1):\n if len(str(i)) % 2:\n cnt += 1\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-import math", "-", "- if math.floor(math.log10(i) + 1) % 2:", "+ if len(str(i)) % 2:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3655955575, "measured_runtime_v1": 0.2850201683, "runtime_lift": 1.282700658, "key": ["s073920837", "s426081507"]} {"user_id": "u423966555", "problem_id": "p02773", "language": "python", "submission_id_v0": "s252908207", "submission_id_v1": "s096619437", "cpu_time_v0": 859, "cpu_time_v1": 768, "memory_v0": 46080, "memory_v1": 48888, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.59, "input": "from collections import defaultdict\n\nn = int(input())\n\n\n\nd = defaultdict(int)\n\nfor _ in range(n):\n\n key = input()\n\n d[key] += 1\n\n\n\ndict = sorted(list(d.items()), key=lambda x:x[1], reverse=True)\n\nmax_v = max(d.values())\n\n\n\ndict_li = []\n\nfor a in dict:\n\n if a[1]==max_v:\n\n dict_li.append(a[0])\n\n\n\ndict_li.sort()\n\nfor s in dict_li:\n\n print(s)\n", "target": "from collections import defaultdict\n\nn = int(input())\n\n\n\nd = defaultdict(int)\n\nfor _ in range(n):\n\n key = input()\n\n d[key] += 1\n\n\n\ndict = sorted(d.items(), key=lambda x:x[1], reverse=True)\n\nmax_v = max(d.values())\n\n\n\ndict_li = []\n\nfor a in dict:\n\n if a[1]==max_v:\n\n dict_li.append(a[0])\n\n\n\ndict_li.sort()\n\nprint(*dict_li, sep='\\n')\n", "code_v0_loc": 19, "code_v1_loc": 18, "code_v0_num_chars": 354, "code_v1_num_chars": 348, "code_v0_no_empty_lines": "from collections import defaultdict\n\nn = int(input())\nd = defaultdict(int)\nfor _ in range(n):\n key = input()\n d[key] += 1\ndict = sorted(list(d.items()), key=lambda x: x[1], reverse=True)\nmax_v = max(d.values())\ndict_li = []\nfor a in dict:\n if a[1] == max_v:\n dict_li.append(a[0])\ndict_li.sort()\nfor s in dict_li:\n print(s)\n", "code_v1_no_empty_lines": "from collections import defaultdict\n\nn = int(input())\nd = defaultdict(int)\nfor _ in range(n):\n key = input()\n d[key] += 1\ndict = sorted(d.items(), key=lambda x: x[1], reverse=True)\nmax_v = max(d.values())\ndict_li = []\nfor a in dict:\n if a[1] == max_v:\n dict_li.append(a[0])\ndict_li.sort()\nprint(*dict_li, sep=\"\\n\")\n", "code_same": false, "relative_loc_diff_percent": 5.2631578947, "diff": ["-n = int(input())", "+n = int(input())", "- key = input()", "+ key = input()", "-dict = sorted(list(d.items()), key=lambda x: x[1], reverse=True)", "+dict = sorted(d.items(), key=lambda x: x[1], reverse=True)", "-for s in dict_li:", "- print(s)", "+print(*dict_li, sep=\"\\n\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2625157752, "measured_runtime_v1": 0.2092528682, "runtime_lift": 1.2545384801, "key": ["s252908207", "s096619437"]} {"user_id": "u867826040", "problem_id": "p03721", "language": "python", "submission_id_v0": "s719602965", "submission_id_v1": "s173376033", "cpu_time_v0": 194, "cpu_time_v1": 151, "memory_v0": 76876, "memory_v1": 16524, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 22.16, "input": "n,k = list(map(int,input().split()))\n\nl = [0]*(10**5+1)\n\nfor i in range(n):\n\n ai,bi = list(map(int,input().split()))\n\n l[ai]+=bi\n\nfor index,i in enumerate(l):\n\n if i:\n\n k-=i\n\n if k<=0:\n\n break\n\nprint(index)", "target": "from collections import defaultdict\n\nfrom sys import stdin\n\ninput = stdin.readline\n\nd = defaultdict(int)\n\nn,k = list(map(int,input().split()))\n\nfor _ in range(n):\n\n a,b = list(map(int,input().split()))\n\n d[a]+=b\n\nfor key in sorted(d.keys()):\n\n v = d[key]\n\n k-=v\n\n if k <= 0:\n\n break\n\nprint(key)", "code_v0_loc": 11, "code_v1_loc": 14, "code_v0_num_chars": 228, "code_v1_num_chars": 304, "code_v0_no_empty_lines": "n, k = list(map(int, input().split()))\nl = [0] * (10**5 + 1)\nfor i in range(n):\n ai, bi = list(map(int, input().split()))\n l[ai] += bi\nfor index, i in enumerate(l):\n if i:\n k -= i\n if k <= 0:\n break\nprint(index)\n", "code_v1_no_empty_lines": "from collections import defaultdict\nfrom sys import stdin\n\ninput = stdin.readline\nd = defaultdict(int)\nn, k = list(map(int, input().split()))\nfor _ in range(n):\n a, b = list(map(int, input().split()))\n d[a] += b\nfor key in sorted(d.keys()):\n v = d[key]\n k -= v\n if k <= 0:\n break\nprint(key)\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["+from collections import defaultdict", "+from sys import stdin", "+", "+input = stdin.readline", "+d = defaultdict(int)", "-l = [0] * (10**5 + 1)", "-for i in range(n):", "- ai, bi = list(map(int, input().split()))", "- l[ai] += bi", "-for index, i in enumerate(l):", "- if i:", "- k -= i", "- if k <= 0:", "- break", "-print(index)", "+for _ in range(n):", "+ a, b = list(map(int, input().split()))", "+ d[a] += b", "+for key in sorted(d.keys()):", "+ v = d[key]", "+ k -= v", "+ if k <= 0:", "+ break", "+print(key)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5501943195, "measured_runtime_v1": 0.4111647634, "runtime_lift": 1.3381358727, "key": ["s719602965", "s173376033"]} {"user_id": "u271934630", "problem_id": "p03416", "language": "python", "submission_id_v0": "s986292698", "submission_id_v1": "s820058882", "cpu_time_v0": 225, "cpu_time_v1": 186, "memory_v0": 40684, "memory_v1": 40300, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.33, "input": "A, B = list(map(int, input().split()))\n\ncnt = 0\n\nfor i in range(A, B+1):\n\n l = list(str(i))\n\n\n\n if l == list(reversed(l)):\n\n cnt += 1\n\n\n\nprint(cnt)\n", "target": "A, B = list(map(int, input().split()))\n\ncnt = 0\n\nfor i in range(A, B+1):\n\n l = str(i)\n\n if l == l[::-1]:\n\n cnt += 1\n\n\n\nprint(cnt)\n", "code_v0_loc": 9, "code_v1_loc": 8, "code_v0_num_chars": 155, "code_v1_num_chars": 137, "code_v0_no_empty_lines": "A, B = list(map(int, input().split()))\ncnt = 0\nfor i in range(A, B + 1):\n l = list(str(i))\n if l == list(reversed(l)):\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\ncnt = 0\nfor i in range(A, B + 1):\n l = str(i)\n if l == l[::-1]:\n cnt += 1\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["- l = list(str(i))", "- if l == list(reversed(l)):", "+ l = str(i)", "+ if l == l[::-1]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3457211592, "measured_runtime_v1": 0.2683477015, "runtime_lift": 1.2883328503, "key": ["s986292698", "s820058882"]} {"user_id": "u761320129", "problem_id": "p02792", "language": "python", "submission_id_v0": "s858070624", "submission_id_v1": "s144947075", "cpu_time_v0": 459, "cpu_time_v1": 184, "memory_v0": 3064, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 59.91, "input": "N = int(input())\n\nmem = [[0]*10 for i in range(10)]\n\n\n\nfor i in range(1,N+1):\n\n a = int(str(i)[0])\n\n b = int(str(i)[-1])\n\n mem[a][b] += 1\n\n\n\nans = 0\n\nfor i in range(1,N+1):\n\n a = int(str(i)[0])\n\n b = int(str(i)[-1])\n\n ans += mem[b][a]\n\nprint(ans)", "target": "N = int(input())\n\n\n\nd = [[0]*10 for i in range(10)]\n\nfor n in range(1,N+1):\n\n s = str(n)\n\n d[int(s[0])][int(s[-1])] += 1\n\nans = 0\n\nfor i in range(10):\n\n for j in range(10):\n\n ans += d[i][j] * d[j][i]\n\nprint(ans)", "code_v0_loc": 14, "code_v1_loc": 11, "code_v0_num_chars": 264, "code_v1_num_chars": 227, "code_v0_no_empty_lines": "N = int(input())\nmem = [[0] * 10 for i in range(10)]\nfor i in range(1, N + 1):\n a = int(str(i)[0])\n b = int(str(i)[-1])\n mem[a][b] += 1\nans = 0\nfor i in range(1, N + 1):\n a = int(str(i)[0])\n b = int(str(i)[-1])\n ans += mem[b][a]\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nd = [[0] * 10 for i in range(10)]\nfor n in range(1, N + 1):\n s = str(n)\n d[int(s[0])][int(s[-1])] += 1\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += d[i][j] * d[j][i]\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["-mem = [[0] * 10 for i in range(10)]", "-for i in range(1, N + 1):", "- a = int(str(i)[0])", "- b = int(str(i)[-1])", "- mem[a][b] += 1", "+d = [[0] * 10 for i in range(10)]", "+for n in range(1, N + 1):", "+ s = str(n)", "+ d[int(s[0])][int(s[-1])] += 1", "-for i in range(1, N + 1):", "- a = int(str(i)[0])", "- b = int(str(i)[-1])", "- ans += mem[b][a]", "+for i in range(10):", "+ for j in range(10):", "+ ans += d[i][j] * d[j][i]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4986082915, "measured_runtime_v1": 0.3140420772, "runtime_lift": 1.5877117355, "key": ["s858070624", "s144947075"]} {"user_id": "u790012205", "problem_id": "p03796", "language": "python", "submission_id_v0": "s234232673", "submission_id_v1": "s468100683", "cpu_time_v0": 175, "cpu_time_v1": 49, "memory_v0": 38512, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 72.0, "input": "N = int(input())\n\np = 1\n\nfor i in range(N):\n\n p *= (i + 1)\n\n p %= (1e9 + 7)\n\nprint((int(p)))", "target": "N = int(input())\n\np = 1\n\nfor i in range(N):\n\n p = p * (i + 1) % (1e9 + 7)\n\nprint((int(p)))", "code_v0_loc": 6, "code_v1_loc": 5, "code_v0_num_chars": 96, "code_v1_num_chars": 91, "code_v0_no_empty_lines": "N = int(input())\np = 1\nfor i in range(N):\n p *= i + 1\n p %= 1e9 + 7\nprint((int(p)))\n", "code_v1_no_empty_lines": "N = int(input())\np = 1\nfor i in range(N):\n p = p * (i + 1) % (1e9 + 7)\nprint((int(p)))\n", "code_same": false, "relative_loc_diff_percent": 16.6666666667, "diff": ["- p *= i + 1", "- p %= 1e9 + 7", "+ p = p * (i + 1) % (1e9 + 7)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4166263335, "measured_runtime_v1": 0.2939343722, "runtime_lift": 1.4174127727, "key": ["s234232673", "s468100683"]} {"user_id": "u771634798", "problem_id": "p02725", "language": "python", "submission_id_v0": "s591694965", "submission_id_v1": "s705639429", "cpu_time_v0": 110, "cpu_time_v1": 85, "memory_v0": 32148, "memory_v1": 32380, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 22.73, "input": "k, n = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\n\n\ndiff = []\n\n\n\nfor i in range(n - 1):\n\n diff.append(a[i + 1] - a[i])\n\ndiff.append(k - a[-1] + a[0])\n\n\n\nprint((k - max(diff)))\n", "target": "k, n = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\n\n\na.append(k + a[0])\n\ndiff = [a1 - a0 for a0, a1 in zip(a, a[1:])]\n\n\n\nprint((k - max(diff)))\n", "code_v0_loc": 10, "code_v1_loc": 7, "code_v0_num_chars": 198, "code_v1_num_chars": 162, "code_v0_no_empty_lines": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\ndiff = []\nfor i in range(n - 1):\n diff.append(a[i + 1] - a[i])\ndiff.append(k - a[-1] + a[0])\nprint((k - max(diff)))\n", "code_v1_no_empty_lines": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\na.append(k + a[0])\ndiff = [a1 - a0 for a0, a1 in zip(a, a[1:])]\nprint((k - max(diff)))\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["-diff = []", "-for i in range(n - 1):", "- diff.append(a[i + 1] - a[i])", "-diff.append(k - a[-1] + a[0])", "+a.append(k + a[0])", "+diff = [a1 - a0 for a0, a1 in zip(a, a[1:])]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3387992765, "measured_runtime_v1": 0.2554280306, "runtime_lift": 1.3263981864, "key": ["s591694965", "s705639429"]} {"user_id": "u562935282", "problem_id": "p03371", "language": "python", "submission_id_v0": "s950527789", "submission_id_v1": "s848046688", "cpu_time_v0": 119, "cpu_time_v1": 19, "memory_v0": 3060, "memory_v1": 3316, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 84.03, "input": "a, b, c, x, y = list(map(int, input().split()))\n\nval = float('inf')\n\nfor k in range(10 ** 5 + 1):\n\n val = min(val, 2 * c * k + max(x - k, 0) * a + max(y - k, 0) * b)\n\nprint(val)", "target": "A, B, C, X, Y = list(map(int, input().split()))\n\n\n\nans = 0\n\nans += min(A + B, 2 * C) * min(X, Y)\n\nif X > Y:\n\n ans += min(A, 2 * C) * (X - Y)\n\nelif X < Y:\n\n ans += min(B, 2 * C) * (Y - X)\n\nprint(ans)\n", "code_v0_loc": 5, "code_v1_loc": 9, "code_v0_num_chars": 174, "code_v1_num_chars": 199, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nval = float(\"inf\")\nfor k in range(10**5 + 1):\n val = min(val, 2 * c * k + max(x - k, 0) * a + max(y - k, 0) * b)\nprint(val)\n", "code_v1_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nans = 0\nans += min(A + B, 2 * C) * min(X, Y)\nif X > Y:\n ans += min(A, 2 * C) * (X - Y)\nelif X < Y:\n ans += min(B, 2 * C) * (Y - X)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 44.4444444444, "diff": ["-a, b, c, x, y = list(map(int, input().split()))", "-val = float(\"inf\")", "-for k in range(10**5 + 1):", "- val = min(val, 2 * c * k + max(x - k, 0) * a + max(y - k, 0) * b)", "-print(val)", "+A, B, C, X, Y = list(map(int, input().split()))", "+ans = 0", "+ans += min(A + B, 2 * C) * min(X, Y)", "+if X > Y:", "+ ans += min(A, 2 * C) * (X - Y)", "+elif X < Y:", "+ ans += min(B, 2 * C) * (Y - X)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 1.3470396991, "measured_runtime_v1": 0.2883047278, "runtime_lift": 4.6722775216, "key": ["s950527789", "s848046688"]} {"user_id": "u869919400", "problem_id": "p03796", "language": "python", "submission_id_v0": "s127994042", "submission_id_v1": "s163960956", "cpu_time_v0": 229, "cpu_time_v1": 37, "memory_v0": 3984, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.84, "input": "from math import factorial as f\n\nn = int(input())\n\nprint((f(n) % (10 ** 9 + 7)))", "target": "n = int(input())\n\np = 1\n\nfor i in range(n):\n\n p = (p * (i+1)) % (10 ** 9 + 7)\n\nprint(p)", "code_v0_loc": 3, "code_v1_loc": 5, "code_v0_num_chars": 78, "code_v1_num_chars": 90, "code_v0_no_empty_lines": "from math import factorial as f\n\nn = int(input())\nprint((f(n) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\np = 1\nfor i in range(n):\n p = (p * (i + 1)) % (10**9 + 7)\nprint(p)\n", "code_same": false, "relative_loc_diff_percent": 40.0, "diff": ["-from math import factorial as f", "-", "-print((f(n) % (10**9 + 7)))", "+p = 1", "+for i in range(n):", "+ p = (p * (i + 1)) % (10**9 + 7)", "+print(p)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.8111317687, "measured_runtime_v1": 0.3589184887, "runtime_lift": 2.2599330882, "key": ["s127994042", "s163960956"]} {"user_id": "u617203831", "problem_id": "p03796", "language": "python", "submission_id_v0": "s015060265", "submission_id_v1": "s192076282", "cpu_time_v0": 230, "cpu_time_v1": 40, "memory_v0": 3980, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.61, "input": "import math\n\nprint((math.factorial(int(input()))%(10**9+7)))", "target": "ans=1\n\nn=int(input())\n\nfor i in range(1,n+1):\n\n ans*=i\n\n ans=ans%(10**9+7)\n\nprint(ans)", "code_v0_loc": 2, "code_v1_loc": 6, "code_v0_num_chars": 58, "code_v1_num_chars": 88, "code_v0_no_empty_lines": "import math\n\nprint((math.factorial(int(input())) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "ans = 1\nn = int(input())\nfor i in range(1, n + 1):\n ans *= i\n ans = ans % (10**9 + 7)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-import math", "-", "-print((math.factorial(int(input())) % (10**9 + 7)))", "+ans = 1", "+n = int(input())", "+for i in range(1, n + 1):", "+ ans *= i", "+ ans = ans % (10**9 + 7)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7955839839, "measured_runtime_v1": 0.4261377716, "runtime_lift": 1.866964247, "key": ["s015060265", "s192076282"]} {"user_id": "u844789719", "problem_id": "p03371", "language": "python", "submission_id_v0": "s272710522", "submission_id_v1": "s867287513", "cpu_time_v0": 94, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 81.91, "input": "A, B, C, X, Y = [int(_) for _ in input().split()]\n\nans = A * X + B * Y\n\nfor i in range(max(X, Y) + 1):\n\n cost = 2 * C * i\n\n if X > i:\n\n cost += A * (X - i)\n\n if Y > i:\n\n cost += B * (Y - i)\n\n ans = min(ans, cost)\n\nprint(ans)", "target": "A, B, C, X, Y = [int(_) for _ in input().split()]\n\nM = max(X, Y)\n\nprint((min(2 * C * M, 2 * C * (X + Y - M) + A *\n\n (M - Y) + B * (M - X), A * X + B * Y)))\n", "code_v0_loc": 10, "code_v1_loc": 4, "code_v0_num_chars": 250, "code_v1_num_chars": 163, "code_v0_no_empty_lines": "A, B, C, X, Y = [int(_) for _ in input().split()]\nans = A * X + B * Y\nfor i in range(max(X, Y) + 1):\n cost = 2 * C * i\n if X > i:\n cost += A * (X - i)\n if Y > i:\n cost += B * (Y - i)\n ans = min(ans, cost)\nprint(ans)\n", "code_v1_no_empty_lines": "A, B, C, X, Y = [int(_) for _ in input().split()]\nM = max(X, Y)\nprint((min(2 * C * M, 2 * C * (X + Y - M) + A * (M - Y) + B * (M - X), A * X + B * Y)))\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-ans = A * X + B * Y", "-for i in range(max(X, Y) + 1):", "- cost = 2 * C * i", "- if X > i:", "- cost += A * (X - i)", "- if Y > i:", "- cost += B * (Y - i)", "- ans = min(ans, cost)", "-print(ans)", "+M = max(X, Y)", "+print((min(2 * C * M, 2 * C * (X + Y - M) + A * (M - Y) + B * (M - X), A * X + B * Y)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5275072498, "measured_runtime_v1": 0.332789422, "runtime_lift": 1.5851082243, "key": ["s272710522", "s867287513"]} {"user_id": "u691018832", "problem_id": "p03945", "language": "python", "submission_id_v0": "s808413359", "submission_id_v1": "s766599872", "cpu_time_v0": 84, "cpu_time_v1": 46, "memory_v0": 3188, "memory_v1": 3188, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 45.24, "input": "s = input()\n\nlen_s = len(s)\n\ncnt = [0, 0]\n\nfor i in range(1, len(s)):\n\n memo_0 = s[i - 1]\n\n memo_1 = s[len_s - i]\n\n if s[i] != memo_0:\n\n cnt[0] += 1\n\n if s[len_s - i - 1] != memo_1:\n\n cnt[1] += 1\n\nprint((min(cnt)))\n", "target": "s = input()\n\nlen_s = len(s)\n\ncnt = 0\n\nfor i in range(1, len(s)):\n\n memo_0 = s[i - 1]\n\n if s[i] != memo_0:\n\n cnt += 1\n\nprint(cnt)\n", "code_v0_loc": 11, "code_v1_loc": 8, "code_v0_num_chars": 239, "code_v1_num_chars": 142, "code_v0_no_empty_lines": "s = input()\nlen_s = len(s)\ncnt = [0, 0]\nfor i in range(1, len(s)):\n memo_0 = s[i - 1]\n memo_1 = s[len_s - i]\n if s[i] != memo_0:\n cnt[0] += 1\n if s[len_s - i - 1] != memo_1:\n cnt[1] += 1\nprint((min(cnt)))\n", "code_v1_no_empty_lines": "s = input()\nlen_s = len(s)\ncnt = 0\nfor i in range(1, len(s)):\n memo_0 = s[i - 1]\n if s[i] != memo_0:\n cnt += 1\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 27.2727272727, "diff": ["-cnt = [0, 0]", "+cnt = 0", "- memo_1 = s[len_s - i]", "- cnt[0] += 1", "- if s[len_s - i - 1] != memo_1:", "- cnt[1] += 1", "-print((min(cnt)))", "+ cnt += 1", "+print(cnt)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3379861441, "measured_runtime_v1": 0.264947257, "runtime_lift": 1.2756733088, "key": ["s808413359", "s766599872"]} {"user_id": "u562016607", "problem_id": "p03558", "language": "python", "submission_id_v0": "s159640382", "submission_id_v1": "s651180421", "cpu_time_v0": 376, "cpu_time_v1": 167, "memory_v0": 8948, "memory_v1": 6060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 55.59, "input": "import heapq\n\nK=int(input())\n\ndist=[10**15 for i in range(K)]\n\ndist[1]=1\n\nq=[]\n\nheapq.heappush(q,(0,1))\n\nwhile (len(q)!=0):\n\n prc,src=heapq.heappop(q)\n\n if dist[src]dist[src]+1:\n\n dist[(src+1)%K]=dist[src]+1\n\n heapq.heappush(q,(dist[(src+1)%K],(src+1)%K))\n\n if dist[(10*src)%K]>dist[src]:\n\n dist[(10*src)%K]=dist[src]\n\n heapq.heappush(q,(dist[(src*10)%K],(src*10)%K))\n\nprint((dist[0]))\n", "target": "from collections import deque\n\nK=int(input())\n\ndist=[10**15 for i in range(K)]\n\ndist[1]=1\n\nq=deque([1])\n\nwhile(len(q)>0):\n\n r=q.popleft()\n\n s=(r+1)%K\n\n if dist[r]+1 dist[src] + 1:\n dist[(src + 1) % K] = dist[src] + 1\n heapq.heappush(q, (dist[(src + 1) % K], (src + 1) % K))\n if dist[(10 * src) % K] > dist[src]:\n dist[(10 * src) % K] = dist[src]\n heapq.heappush(q, (dist[(src * 10) % K], (src * 10) % K))\nprint((dist[0]))\n", "code_v1_no_empty_lines": "from collections import deque\n\nK = int(input())\ndist = [10**15 for i in range(K)]\ndist[1] = 1\nq = deque([1])\nwhile len(q) > 0:\n r = q.popleft()\n s = (r + 1) % K\n if dist[r] + 1 < dist[s]:\n dist[s] = dist[r] + 1\n q.append(s)\n t = (r * 10) % K\n if dist[r] < dist[t]:\n dist[t] = dist[r]\n q.appendleft(t)\nprint((dist[0]))\n", "code_same": false, "relative_loc_diff_percent": 5.8823529412, "diff": ["-import heapq", "+from collections import deque", "-q = []", "-heapq.heappush(q, (0, 1))", "-while len(q) != 0:", "- prc, src = heapq.heappop(q)", "- if dist[src] < prc:", "- continue", "- if dist[(src + 1) % K] > dist[src] + 1:", "- dist[(src + 1) % K] = dist[src] + 1", "- heapq.heappush(q, (dist[(src + 1) % K], (src + 1) % K))", "- if dist[(10 * src) % K] > dist[src]:", "- dist[(10 * src) % K] = dist[src]", "- heapq.heappush(q, (dist[(src * 10) % K], (src * 10) % K))", "+q = deque([1])", "+while len(q) > 0:", "+ r = q.popleft()", "+ s = (r + 1) % K", "+ if dist[r] + 1 < dist[s]:", "+ dist[s] = dist[r] + 1", "+ q.append(s)", "+ t = (r * 10) % K", "+ if dist[r] < dist[t]:", "+ dist[t] = dist[r]", "+ q.appendleft(t)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4453229659, "measured_runtime_v1": 0.2901842129, "runtime_lift": 1.5346216162, "key": ["s159640382", "s651180421"]} {"user_id": "u287132915", "problem_id": "p02792", "language": "python", "submission_id_v0": "s161079550", "submission_id_v1": "s476355973", "cpu_time_v0": 369, "cpu_time_v1": 198, "memory_v0": 46468, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 46.34, "input": "n = int(input())\n\n\n\ncnt = 0\n\nfor i in range(1, n+1):\n\n i_str = str(i)\n\n if len(i_str) == 1:\n\n cnt += 1\n\n continue\n\n if len(i_str) == 2:\n\n if int(i_str[0]) == int(i_str[1]):\n\n cnt += 3\n\n elif int(i_str[1]) != 0 and int(i_str[0]) > int(i_str[1]):\n\n cnt += 2\n\n continue\n\n if len(i_str) == 3:\n\n if int(i_str[0]) == int(i_str[2]):\n\n cnt += 4 + (2 * (int(i_str[1])+1) - 1)\n\n elif int(i_str[2]) != 0 and int(i_str[0]) > int(i_str[2]):\n\n cnt += 22\n\n elif int(i_str[0]) < int(i_str[2]):\n\n cnt += 2\n\n continue\n\n if len(i_str) == 4:\n\n if int(i_str[0]) == int(i_str[3]):\n\n cnt += 24 + 20 * int(i_str[1]) + 2 * (int(i_str[2])+1) - 1\n\n elif int(i_str[3]) != 0 and int(i_str[0]) > int(i_str[3]):\n\n cnt += 222\n\n elif int(i_str[0]) < int(i_str[3]):\n\n cnt += 22\n\n continue\n\n if len(i_str) == 5:\n\n if int(i_str[0]) == int(i_str[4]):\n\n cnt += 224 + 200 * int(i_str[1]) + 20 * int(i_str[2]) + 2 * (int(i_str[3])+1) - 1\n\n elif int(i_str[4]) != 0 and int(i_str[0]) > int(i_str[4]):\n\n cnt += 2222\n\n elif int(i_str[0]) < int(i_str[4]):\n\n cnt += 222\n\n continue\n\n if len(i_str) == 6:\n\n if int(i_str[0]) == int(i_str[5]):\n\n cnt += 2224 + 2000 * int(i_str[1]) + 200 * int(i_str[2]) + 20 * int(i_str[3]) + 2 * (int(i_str[4])+1) - 1\n\n elif int(i_str[5]) != 0 and int(i_str[0]) > int(i_str[5]):\n\n cnt += 22222\n\n elif int(i_str[0]) < int(i_str[5]):\n\n cnt += 2222\n\n continue\n\n\n\nprint(cnt)", "target": "n = int(input())\n\n\n\nc = [[0 for _ in range(10)] for __ in range(10)]\n\nfor i in range(1, n+1):\n\n str_i = str(i)\n\n head = int(str_i[0])\n\n tail = int(str_i[-1])\n\n c[head][tail] += 1\n\n\n\ncnt = 0\n\nfor i in range(10):\n\n for j in range(10):\n\n cnt += c[i][j] * c[j][i]\n\n\n\nprint(cnt)", "code_v0_loc": 48, "code_v1_loc": 15, "code_v0_num_chars": 1676, "code_v1_num_chars": 295, "code_v0_no_empty_lines": "n = int(input())\ncnt = 0\nfor i in range(1, n + 1):\n i_str = str(i)\n if len(i_str) == 1:\n cnt += 1\n continue\n if len(i_str) == 2:\n if int(i_str[0]) == int(i_str[1]):\n cnt += 3\n elif int(i_str[1]) != 0 and int(i_str[0]) > int(i_str[1]):\n cnt += 2\n continue\n if len(i_str) == 3:\n if int(i_str[0]) == int(i_str[2]):\n cnt += 4 + (2 * (int(i_str[1]) + 1) - 1)\n elif int(i_str[2]) != 0 and int(i_str[0]) > int(i_str[2]):\n cnt += 22\n elif int(i_str[0]) < int(i_str[2]):\n cnt += 2\n continue\n if len(i_str) == 4:\n if int(i_str[0]) == int(i_str[3]):\n cnt += 24 + 20 * int(i_str[1]) + 2 * (int(i_str[2]) + 1) - 1\n elif int(i_str[3]) != 0 and int(i_str[0]) > int(i_str[3]):\n cnt += 222\n elif int(i_str[0]) < int(i_str[3]):\n cnt += 22\n continue\n if len(i_str) == 5:\n if int(i_str[0]) == int(i_str[4]):\n cnt += (\n 224\n + 200 * int(i_str[1])\n + 20 * int(i_str[2])\n + 2 * (int(i_str[3]) + 1)\n - 1\n )\n elif int(i_str[4]) != 0 and int(i_str[0]) > int(i_str[4]):\n cnt += 2222\n elif int(i_str[0]) < int(i_str[4]):\n cnt += 222\n continue\n if len(i_str) == 6:\n if int(i_str[0]) == int(i_str[5]):\n cnt += (\n 2224\n + 2000 * int(i_str[1])\n + 200 * int(i_str[2])\n + 20 * int(i_str[3])\n + 2 * (int(i_str[4]) + 1)\n - 1\n )\n elif int(i_str[5]) != 0 and int(i_str[0]) > int(i_str[5]):\n cnt += 22222\n elif int(i_str[0]) < int(i_str[5]):\n cnt += 2222\n continue\nprint(cnt)\n", "code_v1_no_empty_lines": "n = int(input())\nc = [[0 for _ in range(10)] for __ in range(10)]\nfor i in range(1, n + 1):\n str_i = str(i)\n head = int(str_i[0])\n tail = int(str_i[-1])\n c[head][tail] += 1\ncnt = 0\nfor i in range(10):\n for j in range(10):\n cnt += c[i][j] * c[j][i]\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 68.75, "diff": ["+c = [[0 for _ in range(10)] for __ in range(10)]", "+for i in range(1, n + 1):", "+ str_i = str(i)", "+ head = int(str_i[0])", "+ tail = int(str_i[-1])", "+ c[head][tail] += 1", "-for i in range(1, n + 1):", "- i_str = str(i)", "- if len(i_str) == 1:", "- cnt += 1", "- continue", "- if len(i_str) == 2:", "- if int(i_str[0]) == int(i_str[1]):", "- cnt += 3", "- elif int(i_str[1]) != 0 and int(i_str[0]) > int(i_str[1]):", "- cnt += 2", "- continue", "- if len(i_str) == 3:", "- if int(i_str[0]) == int(i_str[2]):", "- cnt += 4 + (2 * (int(i_str[1]) + 1) - 1)", "- elif int(i_str[2]) != 0 and int(i_str[0]) > int(i_str[2]):", "- cnt += 22", "- elif int(i_str[0]) < int(i_str[2]):", "- cnt += 2", "- continue", "- if len(i_str) == 4:", "- if int(i_str[0]) == int(i_str[3]):", "- cnt += 24 + 20 * int(i_str[1]) + 2 * (int(i_str[2]) + 1) - 1", "- elif int(i_str[3]) != 0 and int(i_str[0]) > int(i_str[3]):", "- cnt += 222", "- elif int(i_str[0]) < int(i_str[3]):", "- cnt += 22", "- continue", "- if len(i_str) == 5:", "- if int(i_str[0]) == int(i_str[4]):", "- cnt += (", "- 224", "- + 200 * int(i_str[1])", "- + 20 * int(i_str[2])", "- + 2 * (int(i_str[3]) + 1)", "- - 1", "- )", "- elif int(i_str[4]) != 0 and int(i_str[0]) > int(i_str[4]):", "- cnt += 2222", "- elif int(i_str[0]) < int(i_str[4]):", "- cnt += 222", "- continue", "- if len(i_str) == 6:", "- if int(i_str[0]) == int(i_str[5]):", "- cnt += (", "- 2224", "- + 2000 * int(i_str[1])", "- + 200 * int(i_str[2])", "- + 20 * int(i_str[3])", "- + 2 * (int(i_str[4]) + 1)", "- - 1", "- )", "- elif int(i_str[5]) != 0 and int(i_str[0]) > int(i_str[5]):", "- cnt += 22222", "- elif int(i_str[0]) < int(i_str[5]):", "- cnt += 2222", "- continue", "+for i in range(10):", "+ for j in range(10):", "+ cnt += c[i][j] * c[j][i]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.528624272, "measured_runtime_v1": 0.3498814137, "runtime_lift": 1.5108669718, "key": ["s161079550", "s476355973"]} {"user_id": "u285681431", "problem_id": "p03796", "language": "python", "submission_id_v0": "s922366861", "submission_id_v1": "s031671477", "cpu_time_v0": 154, "cpu_time_v1": 82, "memory_v0": 9940, "memory_v1": 62860, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 46.75, "input": "import math\n\n\n\nN = int(input())\n\nans = math.factorial(N) % (10**9 + 7)\n\nprint(ans)", "target": "N = int(input())\n\nmod = 10**9 + 7\n\nans = 1\n\nfor i in range(1, N + 1):\n\n ans *= i\n\n ans %= mod\n\nprint(ans)\n", "code_v0_loc": 5, "code_v1_loc": 7, "code_v0_num_chars": 82, "code_v1_num_chars": 112, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nans = math.factorial(N) % (10**9 + 7)\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nmod = 10**9 + 7\nans = 1\nfor i in range(1, N + 1):\n ans *= i\n ans %= mod\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 28.5714285714, "diff": ["-import math", "-", "-ans = math.factorial(N) % (10**9 + 7)", "+mod = 10**9 + 7", "+ans = 1", "+for i in range(1, N + 1):", "+ ans *= i", "+ ans %= mod"], "diff_only_import_comment": false, "measured_runtime_v0": 0.599384095, "measured_runtime_v1": 0.2730524833, "runtime_lift": 2.1951241301, "key": ["s922366861", "s031671477"]} {"user_id": "u170201762", "problem_id": "p03371", "language": "python", "submission_id_v0": "s850530798", "submission_id_v1": "s933367975", "cpu_time_v0": 94, "cpu_time_v1": 18, "memory_v0": 7096, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 80.85, "input": "A,B,C,X,Y = list(map(int,input().split()))\n\nl = []\n\nfor i in range(max(X,Y)+1):\n\n T = i * C * 2\n\n if i < X: \n\n T += (X-i)*A\n\n if i < Y:\n\n T += (Y-i)*B\n\n l.append(T)\n\nl.sort()\n\nprint((l[0]))", "target": "A,B,C,X,Y = list(map(int,input().split()))\n\nans = 0\n\nif 2*C <= A+B:\n\n Z = min(X,Y)\n\n ans = 2*C*Z\n\n X -= Z\n\n Y -= Z\n\nans += min(2*C*X,A*X)\n\nans += min(2*C*Y,B*Y)\n\nprint(ans)", "code_v0_loc": 11, "code_v1_loc": 10, "code_v0_num_chars": 207, "code_v1_num_chars": 178, "code_v0_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nl = []\nfor i in range(max(X, Y) + 1):\n T = i * C * 2\n if i < X:\n T += (X - i) * A\n if i < Y:\n T += (Y - i) * B\n l.append(T)\nl.sort()\nprint((l[0]))\n", "code_v1_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nans = 0\nif 2 * C <= A + B:\n Z = min(X, Y)\n ans = 2 * C * Z\n X -= Z\n Y -= Z\nans += min(2 * C * X, A * X)\nans += min(2 * C * Y, B * Y)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 9.0909090909, "diff": ["-l = []", "-for i in range(max(X, Y) + 1):", "- T = i * C * 2", "- if i < X:", "- T += (X - i) * A", "- if i < Y:", "- T += (Y - i) * B", "- l.append(T)", "-l.sort()", "-print((l[0]))", "+ans = 0", "+if 2 * C <= A + B:", "+ Z = min(X, Y)", "+ ans = 2 * C * Z", "+ X -= Z", "+ Y -= Z", "+ans += min(2 * C * X, A * X)", "+ans += min(2 * C * Y, B * Y)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.290536653, "measured_runtime_v1": 0.1943999538, "runtime_lift": 1.494530463, "key": ["s850530798", "s933367975"]} {"user_id": "u708211626", "problem_id": "p04012", "language": "python", "submission_id_v0": "s951351679", "submission_id_v1": "s246688975", "cpu_time_v0": 32, "cpu_time_v1": 26, "memory_v0": 9372, "memory_v1": 9000, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 18.75, "input": "import collections\n\nimport sys\n\na=input()\n\nb=[]\n\n\n\nfor i in a:\n\n b.append(i)\n\n \n\nb.sort()\n\nc=collections.Counter(b)\n\nc=list(c.values())\n\n\n\nfor i in range(len(c)):\n\n if int(c[i])%2==0:\n\n q=0\n\n else:\n\n q=1\n\n print('No')\n\n sys.exit()\n\n \n\nprint('Yes')\n", "target": "w = list(input())\n\ns = set(w)\n\nfor i in s:\n\n if w.count(i)%2 != 0:\n\n print(\"No\")\n\n break\n\nelse:\n\n print(\"Yes\")\n\n ", "code_v0_loc": 21, "code_v1_loc": 9, "code_v0_num_chars": 267, "code_v1_num_chars": 122, "code_v0_no_empty_lines": "import collections\nimport sys\n\na = input()\nb = []\nfor i in a:\n b.append(i)\nb.sort()\nc = collections.Counter(b)\nc = list(c.values())\nfor i in range(len(c)):\n if int(c[i]) % 2 == 0:\n q = 0\n else:\n q = 1\n print(\"No\")\n sys.exit()\nprint(\"Yes\")\n", "code_v1_no_empty_lines": "w = list(input())\ns = set(w)\nfor i in s:\n if w.count(i) % 2 != 0:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n", "code_same": false, "relative_loc_diff_percent": 57.1428571429, "diff": ["-import collections", "-import sys", "-", "-a = input()", "-b = []", "-for i in a:", "- b.append(i)", "-b.sort()", "-c = collections.Counter(b)", "-c = list(c.values())", "-for i in range(len(c)):", "- if int(c[i]) % 2 == 0:", "- q = 0", "- else:", "- q = 1", "+w = list(input())", "+s = set(w)", "+for i in s:", "+ if w.count(i) % 2 != 0:", "- sys.exit()", "-print(\"Yes\")", "+ break", "+else:", "+ print(\"Yes\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2393270415, "measured_runtime_v1": 0.1892163638, "runtime_lift": 1.2648326847, "key": ["s951351679", "s246688975"]} {"user_id": "u379959788", "problem_id": "p03835", "language": "python", "submission_id_v0": "s258964318", "submission_id_v1": "s303783261", "cpu_time_v0": 1751, "cpu_time_v1": 1557, "memory_v0": 2940, "memory_v1": 3444, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.08, "input": "#ABC951B/Sum_of_Three_Integers\n\n\n\nK, S = list(map(int, input().split()))\n\nans = 0\n\nfor x in range(0, K+1):\n\n for y in range(0, K+1):\n\n z = S - x - y\n\n if 0 <= z and z <= K:\n\n ans += 1\n\nprint(ans)", "target": "K, S = list(map(int, input().split()))\n\nans = 0\n\nfor X in range(K+1):\n\n for Y in range(K+1):\n\n Z = S - X - Y\n\n if Z >= 0 and Z <= K:\n\n ans += 1\n\nprint(ans) ", "code_v0_loc": 10, "code_v1_loc": 8, "code_v0_num_chars": 217, "code_v1_num_chars": 184, "code_v0_no_empty_lines": "# ABC951B/Sum_of_Three_Integers\nK, S = list(map(int, input().split()))\nans = 0\nfor x in range(0, K + 1):\n for y in range(0, K + 1):\n z = S - x - y\n if 0 <= z and z <= K:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "K, S = list(map(int, input().split()))\nans = 0\nfor X in range(K + 1):\n for Y in range(K + 1):\n Z = S - X - Y\n if Z >= 0 and Z <= K:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-# ABC951B/Sum_of_Three_Integers", "-for x in range(0, K + 1):", "- for y in range(0, K + 1):", "- z = S - x - y", "- if 0 <= z and z <= K:", "+for X in range(K + 1):", "+ for Y in range(K + 1):", "+ Z = S - X - Y", "+ if Z >= 0 and Z <= K:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2646004359, "measured_runtime_v1": 0.0728798735, "runtime_lift": 3.6306379676, "key": ["s258964318", "s303783261"]} {"user_id": "u150984829", "problem_id": "p02276", "language": "python", "submission_id_v0": "s439916574", "submission_id_v1": "s927428389", "cpu_time_v0": 80, "cpu_time_v1": 60, "memory_v0": 16392, "memory_v1": 16388, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 25.0, "input": "n=int(input())-1\n\nA=list(map(int,input().split()))\n\ni=0\n\nfor j in range(n):\n\n if A[j]<=A[-1]:A[i],A[j]=A[j],A[i];i+=1\n\nA[i],A[n]=A[n],A[i]\n\nprint((\" \".join(map(str,A[:i]))+\" [\"+str(A[i])+\"] \"+\" \".join(map(str,A[i+1:]))))\n", "target": "def s():\n\n n=int(input())-1\n\n A=list(map(int,input().split()))\n\n i=0\n\n for j in range(n):\n\n if A[j]<=A[-1]:A[i],A[j]=A[j],A[i];i+=1\n\n A[i],A[n]=A[n],A[i]\n\n print((\" \".join(map(str,A[:i]))+\" [\"+str(A[i])+\"] \"+\" \".join(map(str,A[i+1:]))))\n\nif'__main__'==__name__:s()\n", "code_v0_loc": 7, "code_v1_loc": 9, "code_v0_num_chars": 219, "code_v1_num_chars": 264, "code_v0_no_empty_lines": "n = int(input()) - 1\nA = list(map(int, input().split()))\ni = 0\nfor j in range(n):\n if A[j] <= A[-1]:\n A[i], A[j] = A[j], A[i]\n i += 1\nA[i], A[n] = A[n], A[i]\nprint(\n (\n \" \".join(map(str, A[:i]))\n + \" [\"\n + str(A[i])\n + \"] \"\n + \" \".join(map(str, A[i + 1 :]))\n )\n)\n", "code_v1_no_empty_lines": "def s():\n n = int(input()) - 1\n A = list(map(int, input().split()))\n i = 0\n for j in range(n):\n if A[j] <= A[-1]:\n A[i], A[j] = A[j], A[i]\n i += 1\n A[i], A[n] = A[n], A[i]\n print(\n (\n \" \".join(map(str, A[:i]))\n + \" [\"\n + str(A[i])\n + \"] \"\n + \" \".join(map(str, A[i + 1 :]))\n )\n )\n\n\nif \"__main__\" == __name__:\n s()\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["-n = int(input()) - 1", "-A = list(map(int, input().split()))", "-i = 0", "-for j in range(n):", "- if A[j] <= A[-1]:", "- A[i], A[j] = A[j], A[i]", "- i += 1", "-A[i], A[n] = A[n], A[i]", "-print(", "- (", "- \" \".join(map(str, A[:i]))", "- + \" [\"", "- + str(A[i])", "- + \"] \"", "- + \" \".join(map(str, A[i + 1 :]))", "+def s():", "+ n = int(input()) - 1", "+ A = list(map(int, input().split()))", "+ i = 0", "+ for j in range(n):", "+ if A[j] <= A[-1]:", "+ A[i], A[j] = A[j], A[i]", "+ i += 1", "+ A[i], A[n] = A[n], A[i]", "+ print(", "+ (", "+ \" \".join(map(str, A[:i]))", "+ + \" [\"", "+ + str(A[i])", "+ + \"] \"", "+ + \" \".join(map(str, A[i + 1 :]))", "+ )", "-)", "+", "+", "+if \"__main__\" == __name__:", "+ s()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2844968953, "measured_runtime_v1": 0.0927553341, "runtime_lift": 3.0671755746, "key": ["s439916574", "s927428389"]} {"user_id": "u580404776", "problem_id": "p02792", "language": "python", "submission_id_v0": "s545080507", "submission_id_v1": "s376438645", "cpu_time_v0": 492, "cpu_time_v1": 192, "memory_v0": 3060, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 60.98, "input": "N = int(input())\n\nmem = [[0]*10 for _ in range(10)]\n\n\n\nfor i in range(1,N+1):\n\n a = int(str(i)[0])\n\n b = int(str(i)[-1])\n\n mem[a][b] += 1\n\n\n\nans = 0\n\nfor i in range(1,N+1):\n\n a = int(str(i)[0])\n\n b = int(str(i)[-1])\n\n ans += mem[b][a]\n\nprint(ans)\n", "target": "N = int(input())\n\nmem=[[0] * 10 for _ in range(10)]\n\n\n\nfor i in range(1, N+1):\n\n s = str(i)\n\n mem[int(s[0])][int(s[-1])] += 1 \n\n \n\nans = 0\n\nfor i in range(1, 10):\n\n for j in range(1, 10):\n\n ans += mem[i][j] * mem[j][i]\n\nprint(ans)", "code_v0_loc": 14, "code_v1_loc": 12, "code_v0_num_chars": 265, "code_v1_num_chars": 249, "code_v0_no_empty_lines": "N = int(input())\nmem = [[0] * 10 for _ in range(10)]\nfor i in range(1, N + 1):\n a = int(str(i)[0])\n b = int(str(i)[-1])\n mem[a][b] += 1\nans = 0\nfor i in range(1, N + 1):\n a = int(str(i)[0])\n b = int(str(i)[-1])\n ans += mem[b][a]\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nmem = [[0] * 10 for _ in range(10)]\nfor i in range(1, N + 1):\n s = str(i)\n mem[int(s[0])][int(s[-1])] += 1\nans = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n ans += mem[i][j] * mem[j][i]\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["- a = int(str(i)[0])", "- b = int(str(i)[-1])", "- mem[a][b] += 1", "+ s = str(i)", "+ mem[int(s[0])][int(s[-1])] += 1", "-for i in range(1, N + 1):", "- a = int(str(i)[0])", "- b = int(str(i)[-1])", "- ans += mem[b][a]", "+for i in range(1, 10):", "+ for j in range(1, 10):", "+ ans += mem[i][j] * mem[j][i]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4534644659, "measured_runtime_v1": 0.3052516449, "runtime_lift": 1.4855430706, "key": ["s545080507", "s376438645"]} {"user_id": "u107077660", "problem_id": "p04012", "language": "python", "submission_id_v0": "s204906128", "submission_id_v1": "s764910207", "cpu_time_v0": 38, "cpu_time_v1": 29, "memory_v0": 3064, "memory_v1": 3444, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 23.68, "input": "w = input()\n\nfor l in w:\n\n\tif w.count(l) % 2 == 1:\n\n\t\tprint(\"No\")\n\n\t\tbreak\n\nelse:\n\n\tprint(\"Yes\")", "target": "from collections import Counter\n\ns = input()\n\nc = list(Counter(s).values())\n\nfor n in c:\n\n\tif n & 1 == 1:\n\n\t\tprint(\"No\")\n\n\t\tbreak\n\nelse:\n\n\tprint(\"Yes\")\n\n\n", "code_v0_loc": 7, "code_v1_loc": 10, "code_v0_num_chars": 96, "code_v1_num_chars": 148, "code_v0_no_empty_lines": "w = input()\nfor l in w:\n if w.count(l) % 2 == 1:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n", "code_v1_no_empty_lines": "from collections import Counter\n\ns = input()\nc = list(Counter(s).values())\nfor n in c:\n if n & 1 == 1:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["-w = input()", "-for l in w:", "- if w.count(l) % 2 == 1:", "+from collections import Counter", "+", "+s = input()", "+c = list(Counter(s).values())", "+for n in c:", "+ if n & 1 == 1:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3070713311, "measured_runtime_v1": 0.212444066, "runtime_lift": 1.44542202, "key": ["s204906128", "s764910207"]} {"user_id": "u391875425", "problem_id": "p03416", "language": "python", "submission_id_v0": "s339057919", "submission_id_v1": "s254043060", "cpu_time_v0": 204, "cpu_time_v1": 57, "memory_v0": 2940, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 72.06, "input": "a, b = list(map(int, input().split()))\n\ntmp=str(a)\n\nc=0\n\nfor i in range(a,b+1):\n\n tmp=str(i)\n\n tmp2=\"\"\n\n for s in range(len(tmp)):\n\n tmp2=tmp2+tmp[len(tmp)-1-s]\n\n if tmp==tmp2:\n\n c=c+1\n\nprint(c)", "target": "def main():\n\n #1. input\n\n a, b = list(map(int, input().split()))\n\n\n\n ans = 0\n\n\n\n #2. from A to B\n\n for i in range(a, b+1):\n\n #2.1. judge if the number is palindromic\n\n if (str(i)[0]==str(i)[4]) and (str(i)[1]==str(i)[3]):\n\n ans = ans+1\n\n\n\n #3. output\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()", "code_v0_loc": 11, "code_v1_loc": 18, "code_v0_num_chars": 214, "code_v1_num_chars": 347, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\ntmp = str(a)\nc = 0\nfor i in range(a, b + 1):\n tmp = str(i)\n tmp2 = \"\"\n for s in range(len(tmp)):\n tmp2 = tmp2 + tmp[len(tmp) - 1 - s]\n if tmp == tmp2:\n c = c + 1\nprint(c)\n", "code_v1_no_empty_lines": "def main():\n # 1. input\n a, b = list(map(int, input().split()))\n ans = 0\n # 2. from A to B\n for i in range(a, b + 1):\n # 2.1. judge if the number is palindromic\n if (str(i)[0] == str(i)[4]) and (str(i)[1] == str(i)[3]):\n ans = ans + 1\n # 3. output\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 38.8888888889, "diff": ["-a, b = list(map(int, input().split()))", "-tmp = str(a)", "-c = 0", "-for i in range(a, b + 1):", "- tmp = str(i)", "- tmp2 = \"\"", "- for s in range(len(tmp)):", "- tmp2 = tmp2 + tmp[len(tmp) - 1 - s]", "- if tmp == tmp2:", "- c = c + 1", "-print(c)", "+def main():", "+ # 1. input", "+ a, b = list(map(int, input().split()))", "+ ans = 0", "+ # 2. from A to B", "+ for i in range(a, b + 1):", "+ # 2.1. judge if the number is palindromic", "+ if (str(i)[0] == str(i)[4]) and (str(i)[1] == str(i)[3]):", "+ ans = ans + 1", "+ # 3. output", "+ print(ans)", "+", "+", "+if __name__ == \"__main__\":", "+ main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5203332471, "measured_runtime_v1": 0.2634068646, "runtime_lift": 1.9753974444, "key": ["s339057919", "s254043060"]} {"user_id": "u505420467", "problem_id": "p03835", "language": "python", "submission_id_v0": "s014481361", "submission_id_v1": "s844546698", "cpu_time_v0": 1491, "cpu_time_v1": 1254, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.9, "input": "k,s=list(map(int,input().split()))\n\nans=0\n\nfor i in range(k+1):\n\n for j in range(k+1):\n\n z=s-i-j\n\n if 0<=z<=k:\n\n ans+=1\n\nprint(ans)\n", "target": "k,s=list(map(int,input().split()))\n\nans=0\n\nfor i in range(k+1):\n\n for j in range(k+1):\n\n if 0<=s-i-j<=k:\n\n ans+=1\n\nprint(ans)\n", "code_v0_loc": 8, "code_v1_loc": 7, "code_v0_num_chars": 154, "code_v1_num_chars": 141, "code_v0_no_empty_lines": "k, s = list(map(int, input().split()))\nans = 0\nfor i in range(k + 1):\n for j in range(k + 1):\n z = s - i - j\n if 0 <= z <= k:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "k, s = list(map(int, input().split()))\nans = 0\nfor i in range(k + 1):\n for j in range(k + 1):\n if 0 <= s - i - j <= k:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["- z = s - i - j", "- if 0 <= z <= k:", "+ if 0 <= s - i - j <= k:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2451675486, "measured_runtime_v1": 0.0064913454, "runtime_lift": 37.7683720217, "key": ["s014481361", "s844546698"]} {"user_id": "u867848444", "problem_id": "p03559", "language": "python", "submission_id_v0": "s912886810", "submission_id_v1": "s338115037", "cpu_time_v0": 472, "cpu_time_v1": 254, "memory_v0": 106340, "memory_v1": 29384, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 46.19, "input": "from bisect import *\n\nn = int(input())\n\na = list(map(int,input().split()))\n\nb = list(map(int,input().split()))\n\nc = list(map(int,input().split()))\n\n\n\na = sorted(a)\n\nc = sorted(c)\n\n\n\nrec = 0\n\nfor i in range(n):\n\n temp = b[i]\n\n l = bisect_left(a, temp)\n\n r = bisect_right(c, temp)\n\n rec += l * (n - r)\n\nprint(rec)", "target": "from bisect import *\n\nn = int(input())\n\na = list(map(int,input().split()))\n\nb = list(map(int,input().split()))\n\nc = list(map(int,input().split()))\n\n\n\na.sort()\n\nc.sort()\n\nres = 0\n\nfor i in b:\n\n temp_a = bisect_left(a, i)\n\n temp_c = n - bisect_right(c, i)\n\n res += temp_a*temp_c\n\nprint(res)", "code_v0_loc": 16, "code_v1_loc": 14, "code_v0_num_chars": 323, "code_v1_num_chars": 297, "code_v0_no_empty_lines": "from bisect import *\n\nn = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\na = sorted(a)\nc = sorted(c)\nrec = 0\nfor i in range(n):\n temp = b[i]\n l = bisect_left(a, temp)\n r = bisect_right(c, temp)\n rec += l * (n - r)\nprint(rec)\n", "code_v1_no_empty_lines": "from bisect import *\n\nn = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\na.sort()\nc.sort()\nres = 0\nfor i in b:\n temp_a = bisect_left(a, i)\n temp_c = n - bisect_right(c, i)\n res += temp_a * temp_c\nprint(res)\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-a = sorted(a)", "-c = sorted(c)", "-rec = 0", "-for i in range(n):", "- temp = b[i]", "- l = bisect_left(a, temp)", "- r = bisect_right(c, temp)", "- rec += l * (n - r)", "-print(rec)", "+a.sort()", "+c.sort()", "+res = 0", "+for i in b:", "+ temp_a = bisect_left(a, i)", "+ temp_c = n - bisect_right(c, i)", "+ res += temp_a * temp_c", "+print(res)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2357759671, "measured_runtime_v1": 0.1661899195, "runtime_lift": 1.4187140102, "key": ["s912886810", "s338115037"]} {"user_id": "u761320129", "problem_id": "p03592", "language": "python", "submission_id_v0": "s651607907", "submission_id_v1": "s022339691", "cpu_time_v0": 277, "cpu_time_v1": 242, "memory_v0": 9168, "memory_v1": 9152, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.64, "input": "N,M,K = list(map(int,input().split()))\n\n\n\nfor i in range(N+1):\n\n for j in range(M+1):\n\n t = i*M + j*N - i*j*2\n\n if t==K:\n\n print('Yes')\n\n exit()\n\nprint('No')", "target": "N,M,K = list(map(int,input().split()))\n\n\n\nfor i in range(N+1):\n\n for j in range(M+1):\n\n if i*(M-j) + j*(N-i) == K:\n\n print('Yes')\n\n exit()\n\nprint('No')", "code_v0_loc": 9, "code_v1_loc": 8, "code_v0_num_chars": 190, "code_v1_num_chars": 177, "code_v0_no_empty_lines": "N, M, K = list(map(int, input().split()))\nfor i in range(N + 1):\n for j in range(M + 1):\n t = i * M + j * N - i * j * 2\n if t == K:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "code_v1_no_empty_lines": "N, M, K = list(map(int, input().split()))\nfor i in range(N + 1):\n for j in range(M + 1):\n if i * (M - j) + j * (N - i) == K:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["- t = i * M + j * N - i * j * 2", "- if t == K:", "+ if i * (M - j) + j * (N - i) == K:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2590724151, "measured_runtime_v1": 0.2069754691, "runtime_lift": 1.2517058964, "key": ["s651607907", "s022339691"]} {"user_id": "u078042885", "problem_id": "p00542", "language": "python", "submission_id_v0": "s237799080", "submission_id_v1": "s666902384", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 7744, "memory_v1": 7736, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "a,b,c,d,e,f=[int(input()) for _ in range(6)]\n\nprint((sum([a,b,c,d,max(e,f)])-min([a,b,c,d])))", "target": "print((sum(sorted(int(input()) for _ in range(4))[1:])+max([int(input()) for _ in range(2)])))", "code_v0_loc": 2, "code_v1_loc": 1, "code_v0_num_chars": 91, "code_v1_num_chars": 92, "code_v0_no_empty_lines": "a, b, c, d, e, f = [int(input()) for _ in range(6)]\nprint((sum([a, b, c, d, max(e, f)]) - min([a, b, c, d])))\n", "code_v1_no_empty_lines": "print(\n (\n sum(sorted(int(input()) for _ in range(4))[1:])\n + max([int(input()) for _ in range(2)])\n )\n)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-a, b, c, d, e, f = [int(input()) for _ in range(6)]", "-print((sum([a, b, c, d, max(e, f)]) - min([a, b, c, d])))", "+print(", "+ (", "+ sum(sorted(int(input()) for _ in range(4))[1:])", "+ + max([int(input()) for _ in range(2)])", "+ )", "+)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1785885925, "measured_runtime_v1": 0.1362432997, "runtime_lift": 1.3108064241, "key": ["s237799080", "s666902384"]} {"user_id": "u545368057", "problem_id": "p02773", "language": "python", "submission_id_v0": "s347160213", "submission_id_v1": "s313812634", "cpu_time_v0": 801, "cpu_time_v1": 714, "memory_v0": 32480, "memory_v1": 35572, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.86, "input": "from collections import defaultdict\n\nN = int(input())\n\nd = defaultdict(int)\n\n\n\nfor i in range(N):\n\n S = input()\n\n d[S] += 1\n\n\n\nm = 0\n\nfor k in list(d.keys()):\n\n m = max(d[k],m)\n\n\n\nli = []\n\nfor k in list(d.keys()):\n\n if d[k] == m:\n\n li.append(k)\n\n\n\nli.sort()\n\nfor l in li:\n\n print(l)", "target": "from collections import defaultdict\n\nN = int(input())\n\nSs = [input() for i in range(N)]\n\n\n\nd = defaultdict(int)\n\nfor S in Ss:\n\n d[S] += 1\n\n\n\nmx = max([d[k] for k in list(d.keys())])\n\n\n\nans = []\n\nfor k in list(d.keys()):\n\n if d[k] == mx:\n\n ans.append(k)\n\n \n\nfor a in sorted(ans):\n\n print(a)", "code_v0_loc": 20, "code_v1_loc": 17, "code_v0_num_chars": 292, "code_v1_num_chars": 298, "code_v0_no_empty_lines": "from collections import defaultdict\n\nN = int(input())\nd = defaultdict(int)\nfor i in range(N):\n S = input()\n d[S] += 1\nm = 0\nfor k in list(d.keys()):\n m = max(d[k], m)\nli = []\nfor k in list(d.keys()):\n if d[k] == m:\n li.append(k)\nli.sort()\nfor l in li:\n print(l)\n", "code_v1_no_empty_lines": "from collections import defaultdict\n\nN = int(input())\nSs = [input() for i in range(N)]\nd = defaultdict(int)\nfor S in Ss:\n d[S] += 1\nmx = max([d[k] for k in list(d.keys())])\nans = []\nfor k in list(d.keys()):\n if d[k] == mx:\n ans.append(k)\nfor a in sorted(ans):\n print(a)\n", "code_same": false, "relative_loc_diff_percent": 15.0, "diff": ["+Ss = [input() for i in range(N)]", "-for i in range(N):", "- S = input()", "+for S in Ss:", "-m = 0", "+mx = max([d[k] for k in list(d.keys())])", "+ans = []", "- m = max(d[k], m)", "-li = []", "-for k in list(d.keys()):", "- if d[k] == m:", "- li.append(k)", "-li.sort()", "-for l in li:", "- print(l)", "+ if d[k] == mx:", "+ ans.append(k)", "+for a in sorted(ans):", "+ print(a)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1866922059, "measured_runtime_v1": 0.0060809708, "runtime_lift": 30.7010529798, "key": ["s347160213", "s313812634"]} {"user_id": "u600402037", "problem_id": "p03037", "language": "python", "submission_id_v0": "s181457641", "submission_id_v1": "s911516772", "cpu_time_v0": 300, "cpu_time_v1": 197, "memory_v0": 11012, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 34.33, "input": "N,M = list(map(int,input().split()))\n\nL,R = [],[]\n\nfor i in range(M):\n\n l,r = list(map(int,input().split()))\n\n L.append(l)\n\n R.append(r)\n\nans = min(R)-max(L)+1\n\nprint((ans if ans >= 0 else 0))", "target": "# coding: utf-8\n\nimport sys\n\n\n\nsr = lambda: sys.stdin.readline().rstrip()\n\nir = lambda: int(sr())\n\nlr = lambda: list(map(int, sr().split()))\n\n\n\nN, M = lr()\n\nL = 0; R = 10 ** 6\n\nfor _ in range(M):\n\n l, r = lr()\n\n if l > L:\n\n L = l\n\n if r < R:\n\n R = r\n\n\n\nanswer = max(0, R - L + 1)\n\nprint(answer)\n", "code_v0_loc": 8, "code_v1_loc": 18, "code_v0_num_chars": 187, "code_v1_num_chars": 318, "code_v0_no_empty_lines": "N, M = list(map(int, input().split()))\nL, R = [], []\nfor i in range(M):\n l, r = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nans = min(R) - max(L) + 1\nprint((ans if ans >= 0 else 0))\n", "code_v1_no_empty_lines": "# coding: utf-8\nimport sys\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\nN, M = lr()\nL = 0\nR = 10**6\nfor _ in range(M):\n l, r = lr()\n if l > L:\n L = l\n if r < R:\n R = r\nanswer = max(0, R - L + 1)\nprint(answer)\n", "code_same": false, "relative_loc_diff_percent": 55.5555555556, "diff": ["-N, M = list(map(int, input().split()))", "-L, R = [], []", "-for i in range(M):", "- l, r = list(map(int, input().split()))", "- L.append(l)", "- R.append(r)", "-ans = min(R) - max(L) + 1", "-print((ans if ans >= 0 else 0))", "+# coding: utf-8", "+import sys", "+", "+sr = lambda: sys.stdin.readline().rstrip()", "+ir = lambda: int(sr())", "+lr = lambda: list(map(int, sr().split()))", "+N, M = lr()", "+L = 0", "+R = 10**6", "+for _ in range(M):", "+ l, r = lr()", "+ if l > L:", "+ L = l", "+ if r < R:", "+ R = r", "+answer = max(0, R - L + 1)", "+print(answer)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2034662783, "measured_runtime_v1": 0.0060762894, "runtime_lift": 33.4852842041, "key": ["s181457641", "s911516772"]} {"user_id": "u175590965", "problem_id": "p02881", "language": "python", "submission_id_v0": "s837964487", "submission_id_v1": "s558772824", "cpu_time_v0": 232, "cpu_time_v1": 167, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 28.02, "input": "n = int(input())\n\nl = []\n\nfor i in range(1,1000001):\n\n a = n / i\n\n if a.is_integer():\n\n l.append(i+n/i)\n\nprint((int(min(l)-2)))", "target": "n = int(input())\n\na = 10**20\n\nfor i in range(1,int(n**0.5)+1):\n\n if n%i==0:\n\n a = min(a,i+n//i)\n\nprint((a-2))", "code_v0_loc": 7, "code_v1_loc": 6, "code_v0_num_chars": 138, "code_v1_num_chars": 117, "code_v0_no_empty_lines": "n = int(input())\nl = []\nfor i in range(1, 1000001):\n a = n / i\n if a.is_integer():\n l.append(i + n / i)\nprint((int(min(l) - 2)))\n", "code_v1_no_empty_lines": "n = int(input())\na = 10**20\nfor i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n a = min(a, i + n // i)\nprint((a - 2))\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-l = []", "-for i in range(1, 1000001):", "- a = n / i", "- if a.is_integer():", "- l.append(i + n / i)", "-print((int(min(l) - 2)))", "+a = 10**20", "+for i in range(1, int(n**0.5) + 1):", "+ if n % i == 0:", "+ a = min(a, i + n // i)", "+print((a - 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 1.3549120984, "measured_runtime_v1": 0.219868273, "runtime_lift": 6.1623811373, "key": ["s837964487", "s558772824"]} {"user_id": "u186838327", "problem_id": "p02881", "language": "python", "submission_id_v0": "s806961932", "submission_id_v1": "s386327339", "cpu_time_v0": 218, "cpu_time_v1": 179, "memory_v0": 40428, "memory_v1": 39280, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.89, "input": "n = int(input())\n\nimport math\n\nm = int(math.sqrt(n))+1\n\nanss = []\n\nfor x in range(1, m+1):\n\n y = n//x\n\n z = n%x\n\n if z == 0:\n\n anss.append(abs(x-1)+abs(y-1))\n\nprint((min(anss)))\n", "target": "n = int(input())\n\ndef make_divisors(n):\n\n divisors = []\n\n for i in range(1, int(n**0.5)+1):\n\n if n % i == 0:\n\n divisors.append(i)\n\n if i != n // i:\n\n divisors.append(n//i)\n\n\n\n #divisors.sort(reverse=True)\n\n return divisors\n\n\n\nl = make_divisors(n)\n\nmin_ = float('inf')\n\nfor i in range(len(l)):\n\n min_ = min(min_, l[i]-1+n//l[i]-1)\n\nprint(min_)\n", "code_v0_loc": 10, "code_v1_loc": 17, "code_v0_num_chars": 182, "code_v1_num_chars": 402, "code_v0_no_empty_lines": "n = int(input())\nimport math\n\nm = int(math.sqrt(n)) + 1\nanss = []\nfor x in range(1, m + 1):\n y = n // x\n z = n % x\n if z == 0:\n anss.append(abs(x - 1) + abs(y - 1))\nprint((min(anss)))\n", "code_v1_no_empty_lines": "n = int(input())\n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n # divisors.sort(reverse=True)\n return divisors\n\n\nl = make_divisors(n)\nmin_ = float(\"inf\")\nfor i in range(len(l)):\n min_ = min(min_, l[i] - 1 + n // l[i] - 1)\nprint(min_)\n", "code_same": false, "relative_loc_diff_percent": 41.1764705882, "diff": ["-import math", "-m = int(math.sqrt(n)) + 1", "-anss = []", "-for x in range(1, m + 1):", "- y = n // x", "- z = n % x", "- if z == 0:", "- anss.append(abs(x - 1) + abs(y - 1))", "-print((min(anss)))", "+", "+def make_divisors(n):", "+ divisors = []", "+ for i in range(1, int(n**0.5) + 1):", "+ if n % i == 0:", "+ divisors.append(i)", "+ if i != n // i:", "+ divisors.append(n // i)", "+ # divisors.sort(reverse=True)", "+ return divisors", "+", "+", "+l = make_divisors(n)", "+min_ = float(\"inf\")", "+for i in range(len(l)):", "+ min_ = min(min_, l[i] - 1 + n // l[i] - 1)", "+print(min_)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3428507342, "measured_runtime_v1": 0.2632945333, "runtime_lift": 1.302156676, "key": ["s806961932", "s386327339"]} {"user_id": "u850516963", "problem_id": "p03455", "language": "python", "submission_id_v0": "s887829630", "submission_id_v1": "s071542109", "cpu_time_v0": 67, "cpu_time_v1": 30, "memory_v0": 61732, "memory_v1": 9060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 55.22, "input": "a, b = list(map(int, input().split()))\n\nif a*b%2 == 1:\n\n print(\"Odd\")\n\nelse:\n\n print(\"Even\")", "target": "a, b = list(map(int, input().split()))\n\nprint(('Odd'if a&b&1 else 'Even'))", "code_v0_loc": 5, "code_v1_loc": 2, "code_v0_num_chars": 92, "code_v1_num_chars": 66, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\nif a * b % 2 == 1:\n print(\"Odd\")\nelse:\n print(\"Even\")\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\nprint((\"Odd\" if a & b & 1 else \"Even\"))\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-if a * b % 2 == 1:", "- print(\"Odd\")", "-else:", "- print(\"Even\")", "+print((\"Odd\" if a & b & 1 else \"Even\"))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1895228839, "measured_runtime_v1": 0.0064490705, "runtime_lift": 29.3876276628, "key": ["s887829630", "s071542109"]} {"user_id": "u754022296", "problem_id": "p04021", "language": "python", "submission_id_v0": "s724849949", "submission_id_v1": "s422278370", "cpu_time_v0": 219, "cpu_time_v1": 182, "memory_v0": 23552, "memory_v1": 23552, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.89, "input": "import sys\n\ninput = sys.stdin.readline\n\nread = sys.stdin.read\n\n\n\nn = int(input())\n\nA = list(map(int, read().split()))\n\nL = sorted([(j, i) for i, j in enumerate(A)])\n\ncount = 0\n\nfor i in range(n):\n\n if (L[i][1]-i)%2:\n\n count += 1\n\nans = (count+1) // 2\n\nprint(ans)", "target": "import sys\n\ninput = sys.stdin.readline\n\nread = sys.stdin.read\n\n\n\nn = int(input())\n\nA = list(map(int, read().split()))\n\nL = sorted([(j, i) for i, j in enumerate(A)])\n\ncount = 0\n\nfor i in range(n):\n\n count += (L[i][1]-i)%2\n\nans = (count+1) // 2\n\nprint(ans)\n", "code_v0_loc": 13, "code_v1_loc": 12, "code_v0_num_chars": 260, "code_v1_num_chars": 250, "code_v0_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nread = sys.stdin.read\nn = int(input())\nA = list(map(int, read().split()))\nL = sorted([(j, i) for i, j in enumerate(A)])\ncount = 0\nfor i in range(n):\n if (L[i][1] - i) % 2:\n count += 1\nans = (count + 1) // 2\nprint(ans)\n", "code_v1_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nread = sys.stdin.read\nn = int(input())\nA = list(map(int, read().split()))\nL = sorted([(j, i) for i, j in enumerate(A)])\ncount = 0\nfor i in range(n):\n count += (L[i][1] - i) % 2\nans = (count + 1) // 2\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 7.6923076923, "diff": ["- if (L[i][1] - i) % 2:", "- count += 1", "+ count += (L[i][1] - i) % 2"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2933020202, "measured_runtime_v1": 0.2201511685, "runtime_lift": 1.3322755547, "key": ["s724849949", "s422278370"]} {"user_id": "u357751375", "problem_id": "p04012", "language": "python", "submission_id_v0": "s590976745", "submission_id_v1": "s361487799", "cpu_time_v0": 31, "cpu_time_v1": 26, "memory_v0": 9044, "memory_v1": 9092, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.13, "input": "w = input()\n\ny = list(set(w))\n\n\n\nfor i in range(len(y)):\n\n if w.count(y[i]) % 2 != 0:\n\n print('No')\n\n exit(0)\n\n\n\nprint('Yes')", "target": "w = list(input())\n\nx = list(set(w))\n\nfor i in x:\n\n y = w.count(i)\n\n if y % 2 != 0:\n\n print('No')\n\n exit(0)\n\nprint('Yes')", "code_v0_loc": 9, "code_v1_loc": 8, "code_v0_num_chars": 142, "code_v1_num_chars": 140, "code_v0_no_empty_lines": "w = input()\ny = list(set(w))\nfor i in range(len(y)):\n if w.count(y[i]) % 2 != 0:\n print(\"No\")\n exit(0)\nprint(\"Yes\")\n", "code_v1_no_empty_lines": "w = list(input())\nx = list(set(w))\nfor i in x:\n y = w.count(i)\n if y % 2 != 0:\n print(\"No\")\n exit(0)\nprint(\"Yes\")\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-w = input()", "-y = list(set(w))", "-for i in range(len(y)):", "- if w.count(y[i]) % 2 != 0:", "+w = list(input())", "+x = list(set(w))", "+for i in x:", "+ y = w.count(i)", "+ if y % 2 != 0:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2480834422, "measured_runtime_v1": 0.172200387, "runtime_lift": 1.4406671583, "key": ["s590976745", "s361487799"]} {"user_id": "u576432509", "problem_id": "p02767", "language": "python", "submission_id_v0": "s320006452", "submission_id_v1": "s025352649", "cpu_time_v0": 403, "cpu_time_v1": 21, "memory_v0": 3188, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 94.79, "input": "n=int(input())\n\nx=list(map(int,input().split()))\n\n\n\nx.sort()\n\n\n\nfor p in range(x[0],x[len(x)-1]+1):\n\n psum=0\n\n for i in range(len(x)):\n\n psum=psum+(x[0]-x[i])**2\n\n# print(psum)\n\n pmin=psum \n\n for j in range(x[0]+1,x[len(x)-1]):\n\n psum=0\n\n for i in range(len(x)):\n\n psum=psum+(j-x[i])**2\n\n# print(psum)\n\n if pmin>psum:\n\n pmin=psum\n\nprint(pmin) ", "target": "n=int(input())\n\nx=list(map(int,input().split()))\n\n\n\nx.sort()\n\n\n\npsum=0\n\nfor i in range(len(x)):\n\n psum=psum+(x[0]-x[i])**2\n\n# print(psum)\n\npmin=psum \n\nfor j in range(x[0]+1,x[len(x)-1]):\n\n psum=0\n\n for i in range(len(x)):\n\n psum=psum+(j-x[i])**2\n\n# print(psum)\n\n if pmin>psum:\n\n pmin=psum\n\nprint(pmin) \n", "code_v0_loc": 19, "code_v1_loc": 18, "code_v0_num_chars": 421, "code_v1_num_chars": 353, "code_v0_no_empty_lines": "n = int(input())\nx = list(map(int, input().split()))\nx.sort()\nfor p in range(x[0], x[len(x) - 1] + 1):\n psum = 0\n for i in range(len(x)):\n psum = psum + (x[0] - x[i]) ** 2\n # print(psum)\n pmin = psum\n for j in range(x[0] + 1, x[len(x) - 1]):\n psum = 0\n for i in range(len(x)):\n psum = psum + (j - x[i]) ** 2\n # print(psum)\n if pmin > psum:\n pmin = psum\nprint(pmin)\n", "code_v1_no_empty_lines": "n = int(input())\nx = list(map(int, input().split()))\nx.sort()\npsum = 0\nfor i in range(len(x)):\n psum = psum + (x[0] - x[i]) ** 2\n# print(psum)\npmin = psum\nfor j in range(x[0] + 1, x[len(x) - 1]):\n psum = 0\n for i in range(len(x)):\n psum = psum + (j - x[i]) ** 2\n # print(psum)\n if pmin > psum:\n pmin = psum\nprint(pmin)\n", "code_same": false, "relative_loc_diff_percent": 5.2631578947, "diff": ["-for p in range(x[0], x[len(x) - 1] + 1):", "+psum = 0", "+for i in range(len(x)):", "+ psum = psum + (x[0] - x[i]) ** 2", "+# print(psum)", "+pmin = psum", "+for j in range(x[0] + 1, x[len(x) - 1]):", "- psum = psum + (x[0] - x[i]) ** 2", "- # print(psum)", "- pmin = psum", "- for j in range(x[0] + 1, x[len(x) - 1]):", "- psum = 0", "- for i in range(len(x)):", "- psum = psum + (j - x[i]) ** 2", "- # print(psum)", "- if pmin > psum:", "- pmin = psum", "+ psum = psum + (j - x[i]) ** 2", "+ # print(psum)", "+ if pmin > psum:", "+ pmin = psum"], "diff_only_import_comment": false, "measured_runtime_v0": 0.298344056, "measured_runtime_v1": 0.1876089347, "runtime_lift": 1.59024439, "key": ["s320006452", "s025352649"]} {"user_id": "u438662618", "problem_id": "p03086", "language": "python", "submission_id_v0": "s956521892", "submission_id_v1": "s325345686", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 3188, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "import re\n\n\n\nS = input()\n\nmax = 0\n\n\n\nfor i in range(len(S)) :\n\n for j in range(i + 1, len(S) + 1) :\n\n pattern = re.compile(r'[A|T|C|G]{%d}' % int(j - i))\n\n subStr = S[i:j]\n\n\n\n if pattern.match(subStr) and j - i > max :\n\n max = j - i\n\n\n\nprint(max)\n", "target": "S = input()\n\n\n\nans = 0\n\n\n\nfor i in range(len(S)) :\n\n for j in range(i, len(S)) :\n\n if all('ACGT'.count(c) == 1 for c in S[i : j + 1]) :\n\n ans = max(ans, j - i + 1)\n\n\n\n\n\nprint(ans)\n", "code_v0_loc": 14, "code_v1_loc": 11, "code_v0_num_chars": 282, "code_v1_num_chars": 201, "code_v0_no_empty_lines": "import re\n\nS = input()\nmax = 0\nfor i in range(len(S)):\n for j in range(i + 1, len(S) + 1):\n pattern = re.compile(r\"[A|T|C|G]{%d}\" % int(j - i))\n subStr = S[i:j]\n if pattern.match(subStr) and j - i > max:\n max = j - i\nprint(max)\n", "code_v1_no_empty_lines": "S = input()\nans = 0\nfor i in range(len(S)):\n for j in range(i, len(S)):\n if all(\"ACGT\".count(c) == 1 for c in S[i : j + 1]):\n ans = max(ans, j - i + 1)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["-import re", "-", "-max = 0", "+ans = 0", "- for j in range(i + 1, len(S) + 1):", "- pattern = re.compile(r\"[A|T|C|G]{%d}\" % int(j - i))", "- subStr = S[i:j]", "- if pattern.match(subStr) and j - i > max:", "- max = j - i", "-print(max)", "+ for j in range(i, len(S)):", "+ if all(\"ACGT\".count(c) == 1 for c in S[i : j + 1]):", "+ ans = max(ans, j - i + 1)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3271781678, "measured_runtime_v1": 0.2537176473, "runtime_lift": 1.2895365036, "key": ["s956521892", "s325345686"]} {"user_id": "u379136995", "problem_id": "p02921", "language": "python", "submission_id_v0": "s545345968", "submission_id_v1": "s346622706", "cpu_time_v0": 27, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 37.04, "input": "s=input()\n\nt=input()\n\nans=0\n\nif s[0]==t[0]:\n\n ans+=1\n\nif s[1]==t[1]:\n\n ans+=1\n\nif s[2]==t[2]:\n\n ans+=1\n\nprint(ans)\n", "target": "s=input()\n\nt=input()\n\nans=0\n\nfor i in range(0,3):\n\n if s[i]==t[i]:\n\n ans+=1\n\nprint(ans)\n", "code_v0_loc": 10, "code_v1_loc": 7, "code_v0_num_chars": 124, "code_v1_num_chars": 98, "code_v0_no_empty_lines": "s = input()\nt = input()\nans = 0\nif s[0] == t[0]:\n ans += 1\nif s[1] == t[1]:\n ans += 1\nif s[2] == t[2]:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "s = input()\nt = input()\nans = 0\nfor i in range(0, 3):\n if s[i] == t[i]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["-if s[0] == t[0]:", "- ans += 1", "-if s[1] == t[1]:", "- ans += 1", "-if s[2] == t[2]:", "- ans += 1", "+for i in range(0, 3):", "+ if s[i] == t[i]:", "+ ans += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3561623907, "measured_runtime_v1": 0.2681128595, "runtime_lift": 1.3284047299, "key": ["s545345968", "s346622706"]} {"user_id": "u263753244", "problem_id": "p03835", "language": "python", "submission_id_v0": "s871403539", "submission_id_v1": "s899034376", "cpu_time_v0": 1228, "cpu_time_v1": 261, "memory_v0": 2940, "memory_v1": 42092, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 78.75, "input": "k,s=list(map(int,input().split()))\n\ncnt=0\n\nfor i in range(k+1):\n\n for j in range(k+1):\n\n if 0 <= s-i-j <= k:\n\n cnt+=1\n\nprint(cnt)", "target": "k,s=list(map(int,input().split()))\n\na=0\n\nfor i in range(0,k+1):\n\n for j in range(0,k+1):\n\n if 0<=s-i-j<=k:\n\n a+=1\n\nprint(a)", "code_v0_loc": 7, "code_v1_loc": 7, "code_v0_num_chars": 144, "code_v1_num_chars": 138, "code_v0_no_empty_lines": "k, s = list(map(int, input().split()))\ncnt = 0\nfor i in range(k + 1):\n for j in range(k + 1):\n if 0 <= s - i - j <= k:\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "k, s = list(map(int, input().split()))\na = 0\nfor i in range(0, k + 1):\n for j in range(0, k + 1):\n if 0 <= s - i - j <= k:\n a += 1\nprint(a)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-cnt = 0", "-for i in range(k + 1):", "- for j in range(k + 1):", "+a = 0", "+for i in range(0, k + 1):", "+ for j in range(0, k + 1):", "- cnt += 1", "-print(cnt)", "+ a += 1", "+print(a)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2440719529, "measured_runtime_v1": 0.12879462, "runtime_lift": 1.8950477354, "key": ["s871403539", "s899034376"]} {"user_id": "u027685417", "problem_id": "p03038", "language": "python", "submission_id_v0": "s124992398", "submission_id_v1": "s099446399", "cpu_time_v0": 678, "cpu_time_v1": 544, "memory_v0": 33104, "memory_v1": 28888, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 19.76, "input": "from heapq import *\n\n\n\n\n\nn, m = list(map(int, input().split()))\n\nPAIRS = [[-a, -1] for a in map(int, input().split())]\n\nheapify(PAIRS)\n\n\n\nfor _ in range(m):\n\n b, c = list(map(int, input().split()))\n\n heappush(PAIRS, [-c, -b])\n\n\n\nanswer = 0\n\nfor _ in range(n):\n\n pair = heappop(PAIRS)\n\n answer += -pair[0]\n\n pair[1] += 1\n\n if pair[1] != 0:\n\n heappush(PAIRS, pair)\n\n\n\nprint(answer)\n", "target": "n, m = list(map(int, input().split()))\n\nPAIRS = [(a, 1) for a in map(int, input().split())]\n\n\n\nfor _ in range(m):\n\n b, c = list(map(int, input().split()))\n\n PAIRS.append((c, b))\n\nPAIRS.sort(reverse = True)\n\n\n\nanswer, count = 0, 0\n\nfor pair in PAIRS:\n\n answer += pair[0] * pair[1]\n\n count += pair[1]\n\n if count > n:\n\n answer -= pair[0] * (count - n)\n\n break\n\n\n\nprint(answer)\n", "code_v0_loc": 20, "code_v1_loc": 17, "code_v0_num_chars": 393, "code_v1_num_chars": 391, "code_v0_no_empty_lines": "from heapq import *\n\nn, m = list(map(int, input().split()))\nPAIRS = [[-a, -1] for a in map(int, input().split())]\nheapify(PAIRS)\nfor _ in range(m):\n b, c = list(map(int, input().split()))\n heappush(PAIRS, [-c, -b])\nanswer = 0\nfor _ in range(n):\n pair = heappop(PAIRS)\n answer += -pair[0]\n pair[1] += 1\n if pair[1] != 0:\n heappush(PAIRS, pair)\nprint(answer)\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\nPAIRS = [(a, 1) for a in map(int, input().split())]\nfor _ in range(m):\n b, c = list(map(int, input().split()))\n PAIRS.append((c, b))\nPAIRS.sort(reverse=True)\nanswer, count = 0, 0\nfor pair in PAIRS:\n answer += pair[0] * pair[1]\n count += pair[1]\n if count > n:\n answer -= pair[0] * (count - n)\n break\nprint(answer)\n", "code_same": false, "relative_loc_diff_percent": 15.0, "diff": ["-from heapq import *", "-", "-PAIRS = [[-a, -1] for a in map(int, input().split())]", "-heapify(PAIRS)", "+PAIRS = [(a, 1) for a in map(int, input().split())]", "- heappush(PAIRS, [-c, -b])", "-answer = 0", "-for _ in range(n):", "- pair = heappop(PAIRS)", "- answer += -pair[0]", "- pair[1] += 1", "- if pair[1] != 0:", "- heappush(PAIRS, pair)", "+ PAIRS.append((c, b))", "+PAIRS.sort(reverse=True)", "+answer, count = 0, 0", "+for pair in PAIRS:", "+ answer += pair[0] * pair[1]", "+ count += pair[1]", "+ if count > n:", "+ answer -= pair[0] * (count - n)", "+ break"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2969929054, "measured_runtime_v1": 0.0828762929, "runtime_lift": 3.5835688928, "key": ["s124992398", "s099446399"]} {"user_id": "u803617136", "problem_id": "p03796", "language": "python", "submission_id_v0": "s262574211", "submission_id_v1": "s998310124", "cpu_time_v0": 230, "cpu_time_v1": 37, "memory_v0": 3980, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.91, "input": "import math\n\n\n\nn = int(input())\n\nans = math.factorial(n) % (pow(10, 9) + 7)\n\nprint(ans)", "target": "n = int(input())\n\nans = 1\n\nmod = 10 ** 9 + 7\n\nfor i in range(1, n + 1):\n\n ans = (ans * i % mod) % mod\n\nprint(ans)", "code_v0_loc": 5, "code_v1_loc": 6, "code_v0_num_chars": 87, "code_v1_num_chars": 116, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nans = math.factorial(n) % (pow(10, 9) + 7)\nprint(ans)\n", "code_v1_no_empty_lines": "n = int(input())\nans = 1\nmod = 10**9 + 7\nfor i in range(1, n + 1):\n ans = (ans * i % mod) % mod\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 16.6666666667, "diff": ["-import math", "-", "-ans = math.factorial(n) % (pow(10, 9) + 7)", "+ans = 1", "+mod = 10**9 + 7", "+for i in range(1, n + 1):", "+ ans = (ans * i % mod) % mod"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5572224624, "measured_runtime_v1": 0.2586410534, "runtime_lift": 2.154423882, "key": ["s262574211", "s998310124"]} {"user_id": "u991567869", "problem_id": "p02596", "language": "python", "submission_id_v0": "s146225899", "submission_id_v1": "s204753661", "cpu_time_v0": 292, "cpu_time_v1": 175, "memory_v0": 9152, "memory_v1": 9164, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 40.07, "input": "k = int(input())\n\nx = 1\n\n\n\nif k%7 != 0:\n\n mod = 9*k\n\nelse:\n\n mod = 9*k//7\n\n\n\nfor i in range(10**6):\n\n x = x*10%mod\n\n if x == 1:\n\n print((i + 1))\n\n exit()\n\n\n\nprint((-1))", "target": "k = int(input())\n\na = 0\n\n\n\nfor i in range(k + 10):\n\n a = (a*10 + 7)%k\n\n if a == 0:\n\n print((i + 1))\n\n exit()\n\nprint((-1))", "code_v0_loc": 15, "code_v1_loc": 9, "code_v0_num_chars": 190, "code_v1_num_chars": 137, "code_v0_no_empty_lines": "k = int(input())\nx = 1\nif k % 7 != 0:\n mod = 9 * k\nelse:\n mod = 9 * k // 7\nfor i in range(10**6):\n x = x * 10 % mod\n if x == 1:\n print((i + 1))\n exit()\nprint((-1))\n", "code_v1_no_empty_lines": "k = int(input())\na = 0\nfor i in range(k + 10):\n a = (a * 10 + 7) % k\n if a == 0:\n print((i + 1))\n exit()\nprint((-1))\n", "code_same": false, "relative_loc_diff_percent": 40.0, "diff": ["-x = 1", "-if k % 7 != 0:", "- mod = 9 * k", "-else:", "- mod = 9 * k // 7", "-for i in range(10**6):", "- x = x * 10 % mod", "- if x == 1:", "+a = 0", "+for i in range(k + 10):", "+ a = (a * 10 + 7) % k", "+ if a == 0:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5332653046, "measured_runtime_v1": 0.4200988929, "runtime_lift": 1.2693804091, "key": ["s146225899", "s204753661"]} {"user_id": "u562935282", "problem_id": "p03200", "language": "python", "submission_id_v0": "s639682353", "submission_id_v1": "s546135650", "cpu_time_v0": 48, "cpu_time_v1": 43, "memory_v0": 3500, "memory_v1": 3500, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.42, "input": "s = input()\n\n\n\ncnt = 0\n\nans = 0\n\nfor c in s:\n\n if c == 'B':\n\n cnt += 1\n\n elif c == 'W':\n\n ans += cnt\n\nprint(ans)\n", "target": "s = input()\n\n\n\nans = 0\n\nb = 0\n\nfor ss in s:\n\n if ss == 'W':\n\n ans += b\n\n else:\n\n b += 1\n\nprint(ans)\n", "code_v0_loc": 10, "code_v1_loc": 10, "code_v0_num_chars": 133, "code_v1_num_chars": 120, "code_v0_no_empty_lines": "s = input()\ncnt = 0\nans = 0\nfor c in s:\n if c == \"B\":\n cnt += 1\n elif c == \"W\":\n ans += cnt\nprint(ans)\n", "code_v1_no_empty_lines": "s = input()\nans = 0\nb = 0\nfor ss in s:\n if ss == \"W\":\n ans += b\n else:\n b += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-cnt = 0", "-for c in s:", "- if c == \"B\":", "- cnt += 1", "- elif c == \"W\":", "- ans += cnt", "+b = 0", "+for ss in s:", "+ if ss == \"W\":", "+ ans += b", "+ else:", "+ b += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2094221431, "measured_runtime_v1": 0.1051600281, "runtime_lift": 1.9914614603, "key": ["s639682353", "s546135650"]} {"user_id": "u744114948", "problem_id": "p00053", "language": "python", "submission_id_v0": "s391855332", "submission_id_v1": "s612183692", "cpu_time_v0": 660, "cpu_time_v1": 70, "memory_v0": 7228, "memory_v1": 8024, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 89.39, "input": "import math\n\ndef pri(n):\n\n if n < 2:\n\n return False\n\n elif n == 2:\n\n return True\n\n elif n % 2 == 0:\n\n return False\n\n\n\n i = 3\n\n while i <= math.sqrt(n):\n\n if n % i == 0:\n\n return False\n\n i += 2\n\n return True\n\n\n\nl=[i for i in range(110000)if pri(i) ]\n\n\n\nwhile True:\n\n n = int(input())\n\n if n == 0: break\n\n print((sum(l[:n])))", "target": "import math\n\ndef pri(n):\n\n l =[True] * n\n\n l[0] = l[1] = False\n\n for i in range(2,n):\n\n if l[i]:\n\n for j in range(i*2, n, i):\n\n l[j] = False\n\n return l\n\nn=105000\n\ns=pri(n)\n\nl=[i for i in range(n) if s[i]]\n\nwhile True:\n\n n = int(input())\n\n if n == 0: break\n\n print((sum(l[:n])))", "code_v0_loc": 22, "code_v1_loc": 16, "code_v0_num_chars": 394, "code_v1_num_chars": 329, "code_v0_no_empty_lines": "import math\n\n\ndef pri(n):\n if n < 2:\n return False\n elif n == 2:\n return True\n elif n % 2 == 0:\n return False\n i = 3\n while i <= math.sqrt(n):\n if n % i == 0:\n return False\n i += 2\n return True\n\n\nl = [i for i in range(110000) if pri(i)]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print((sum(l[:n])))\n", "code_v1_no_empty_lines": "import math\n\n\ndef pri(n):\n l = [True] * n\n l[0] = l[1] = False\n for i in range(2, n):\n if l[i]:\n for j in range(i * 2, n, i):\n l[j] = False\n return l\n\n\nn = 105000\ns = pri(n)\nl = [i for i in range(n) if s[i]]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print((sum(l[:n])))\n", "code_same": false, "relative_loc_diff_percent": 27.2727272727, "diff": ["- if n < 2:", "- return False", "- elif n == 2:", "- return True", "- elif n % 2 == 0:", "- return False", "- i = 3", "- while i <= math.sqrt(n):", "- if n % i == 0:", "- return False", "- i += 2", "- return True", "+ l = [True] * n", "+ l[0] = l[1] = False", "+ for i in range(2, n):", "+ if l[i]:", "+ for j in range(i * 2, n, i):", "+ l[j] = False", "+ return l", "-l = [i for i in range(110000) if pri(i)]", "+n = 105000", "+s = pri(n)", "+l = [i for i in range(n) if s[i]]"], "diff_only_import_comment": false, "measured_runtime_v0": 2.8203961465, "measured_runtime_v1": 0.4705428715, "runtime_lift": 5.9939196138, "key": ["s391855332", "s612183692"]} {"user_id": "u133936772", "problem_id": "p02988", "language": "python", "submission_id_v0": "s657683547", "submission_id_v1": "s740427744", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3316, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "n = int(input())\n\nl = list(map(int, input().split()))\n\nprint((sum(l[i]l[i+1]>l[i+2] for i in range(n-2))))", "target": "n=int(input())\n\nl=list(map(int,input().split()))\n\na=0\n\nfor i in range(n-2):\n\n p,q,r=l[i:i+3]\n\n if p l[i + 1] > l[i + 2]\n for i in range(n - 2)\n )\n )\n)\n", "code_v1_no_empty_lines": "n = int(input())\nl = list(map(int, input().split()))\na = 0\nfor i in range(n - 2):\n p, q, r = l[i : i + 3]\n if p < q < r or r < q < p:\n a += 1\nprint(a)\n", "code_same": false, "relative_loc_diff_percent": 57.1428571429, "diff": ["-print(", "- (", "- sum(", "- l[i] < l[i + 1] < l[i + 2] or l[i] > l[i + 1] > l[i + 2]", "- for i in range(n - 2)", "- )", "- )", "-)", "+a = 0", "+for i in range(n - 2):", "+ p, q, r = l[i : i + 3]", "+ if p < q < r or r < q < p:", "+ a += 1", "+print(a)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1639216754, "measured_runtime_v1": 0.0058678908, "runtime_lift": 27.9353658749, "key": ["s657683547", "s740427744"]} {"user_id": "u813098295", "problem_id": "p03363", "language": "python", "submission_id_v0": "s373502740", "submission_id_v1": "s912924761", "cpu_time_v0": 217, "cpu_time_v1": 194, "memory_v0": 31620, "memory_v1": 45788, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.6, "input": "N = int(input())\n\nA = list(map(int, input().split()))\n\n\n\nans, s = 0, 0\n\nd = {0:1}\n\n\n\nfor i in A:\n\n s += i\n\n ans += d.get(s, 0)\n\n d[s] = d.get(s, 0) + 1\n\n\n\nprint(ans)", "target": "#!/usr/bin/env python3\n\n\n\nfrom collections import defaultdict\n\n\n\nN = int(input())\n\nA = list(map(int, input().split()))\n\n\n\nd = defaultdict(int)\n\nd[0] = 1\n\n\n\ns, ans = 0, 0\n\n\n\nfor a in A:\n\n s += a\n\n ans += d[s]\n\n d[s] += 1\n\n\n\nprint (ans)", "code_v0_loc": 12, "code_v1_loc": 18, "code_v0_num_chars": 175, "code_v1_num_chars": 237, "code_v0_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nans, s = 0, 0\nd = {0: 1}\nfor i in A:\n s += i\n ans += d.get(s, 0)\n d[s] = d.get(s, 0) + 1\nprint(ans)\n", "code_v1_no_empty_lines": "#!/usr/bin/env python3\nfrom collections import defaultdict\n\nN = int(input())\nA = list(map(int, input().split()))\nd = defaultdict(int)\nd[0] = 1\ns, ans = 0, 0\nfor a in A:\n s += a\n ans += d[s]\n d[s] += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-N = int(input())", "+#!/usr/bin/env python3", "+from collections import defaultdict", "+", "+N = int(input())", "-ans, s = 0, 0", "-d = {0: 1}", "-for i in A:", "- s += i", "- ans += d.get(s, 0)", "- d[s] = d.get(s, 0) + 1", "+d = defaultdict(int)", "+d[0] = 1", "+s, ans = 0, 0", "+for a in A:", "+ s += a", "+ ans += d[s]", "+ d[s] += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2992557037, "measured_runtime_v1": 0.2235582159, "runtime_lift": 1.3386030235, "key": ["s373502740", "s912924761"]} {"user_id": "u120865944", "problem_id": "p03162", "language": "python", "submission_id_v0": "s595235842", "submission_id_v1": "s886147212", "cpu_time_v0": 1019, "cpu_time_v1": 680, "memory_v0": 47328, "memory_v1": 59484, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.27, "input": "N = int(input())\n\nl = [list(map(int, input().split())) for _ in range(N)]\n\n\n\ndp = [[0 for i in range(3)] for j in range(N+1)]\n\n\n\n\n\nfor i in range(1, N+1):\n\n for j in range(3):\n\n for k in range(3):\n\n if j != k:\n\n dp[i][j] = max(dp[i][j], dp[i-1][k]+l[i-1][k])\n\n\n\nprint((max(dp[N][0], dp[N][1], dp[N][2])))\n\n\n", "target": "N = int(input())\n\ndp = [[0 for i in range(3)] for j in range(N+1)]\n\n\n\nfor i in range(1, N+1):\n\n hapiness = list(map(int, input().split()))\n\n for j in range(3):\n\n for k in range(3):\n\n if j != k:\n\n dp[i][j] = max(dp[i][j], dp[i-1][k] + hapiness[k])\n\n\n\nprint((max(dp[N][0], dp[N][1], dp[N][2])))", "code_v0_loc": 14, "code_v1_loc": 11, "code_v0_num_chars": 341, "code_v1_num_chars": 329, "code_v0_no_empty_lines": "N = int(input())\nl = [list(map(int, input().split())) for _ in range(N)]\ndp = [[0 for i in range(3)] for j in range(N + 1)]\nfor i in range(1, N + 1):\n for j in range(3):\n for k in range(3):\n if j != k:\n dp[i][j] = max(dp[i][j], dp[i - 1][k] + l[i - 1][k])\nprint((max(dp[N][0], dp[N][1], dp[N][2])))\n", "code_v1_no_empty_lines": "N = int(input())\ndp = [[0 for i in range(3)] for j in range(N + 1)]\nfor i in range(1, N + 1):\n hapiness = list(map(int, input().split()))\n for j in range(3):\n for k in range(3):\n if j != k:\n dp[i][j] = max(dp[i][j], dp[i - 1][k] + hapiness[k])\nprint((max(dp[N][0], dp[N][1], dp[N][2])))\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["-l = [list(map(int, input().split())) for _ in range(N)]", "+ hapiness = list(map(int, input().split()))", "- dp[i][j] = max(dp[i][j], dp[i - 1][k] + l[i - 1][k])", "+ dp[i][j] = max(dp[i][j], dp[i - 1][k] + hapiness[k])"], "diff_only_import_comment": false, "measured_runtime_v0": 0.267745409, "measured_runtime_v1": 0.0801038151, "runtime_lift": 3.3424801143, "key": ["s595235842", "s886147212"]} {"user_id": "u394731058", "problem_id": "p02899", "language": "python", "submission_id_v0": "s948462743", "submission_id_v1": "s673167226", "cpu_time_v0": 210, "cpu_time_v1": 76, "memory_v0": 13304, "memory_v1": 17740, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 63.81, "input": "import sys\n\n\n\ninput = sys.stdin.readline\n\n\n\ndef main():\n\n ans = 0\n\n n = int(input())\n\n o = list(map(int, input().split()))\n\n l = [0]*n\n\n for i in range(n):\n\n l[o[i]-1] = i+1\n\n for i in range(len(l)):\n\n if i != len(l)-1:\n\n print(\"{} \".format(l[i]), end='')\n\n else:\n\n print(l[i])\n\n\n\nif __name__ == '__main__':\n\n main()\n", "target": "import sys\n\n\n\ninput = sys.stdin.readline\n\n\n\ndef main():\n\n ans = 0\n\n n = int(input())\n\n o = list(map(int, input().split()))\n\n l = [0]*n\n\n for i in range(n):\n\n l[o[i]-1] = i+1\n\n print((\" \".join(map(str,l))))\n\nif __name__ == '__main__':\n\n main()", "code_v0_loc": 19, "code_v1_loc": 14, "code_v0_num_chars": 381, "code_v1_num_chars": 268, "code_v0_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n ans = 0\n n = int(input())\n o = list(map(int, input().split()))\n l = [0] * n\n for i in range(n):\n l[o[i] - 1] = i + 1\n for i in range(len(l)):\n if i != len(l) - 1:\n print(\"{} \".format(l[i]), end=\"\")\n else:\n print(l[i])\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n ans = 0\n n = int(input())\n o = list(map(int, input().split()))\n l = [0] * n\n for i in range(n):\n l[o[i] - 1] = i + 1\n print((\" \".join(map(str, l))))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 26.3157894737, "diff": ["- n = int(input())", "+ n = int(input())", "- for i in range(len(l)):", "- if i != len(l) - 1:", "- print(\"{} \".format(l[i]), end=\"\")", "- else:", "- print(l[i])", "+ print((\" \".join(map(str, l))))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3305146998, "measured_runtime_v1": 0.2638847903, "runtime_lift": 1.2524962104, "key": ["s948462743", "s673167226"]} {"user_id": "u531220228", "problem_id": "p02994", "language": "python", "submission_id_v0": "s512634929", "submission_id_v1": "s713379557", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "N,L = list(map(int, input().split()))\n\ntaste = [L+i-1 for i in range(1,N+1)]\n\nif taste[-1] < 0:\n\n print((sum(taste) + min([abs(x) for x in taste])))\n\nelse:\n\n print((sum(taste) - min([abs(x) for x in taste])))", "target": "N, L = list(map(int, input().split()))\n\n\n\ntaste = [L+i-1 for i in range(1, N+1)]\n\n\n\nif 0 in taste:\n\n select = 0\n\nelse:\n\n select_with_ind = min(enumerate(taste), key = lambda x: abs(x[1]))\n\n select = select_with_ind[1]\n\n \n\nprint((sum(taste) - select))", "code_v0_loc": 6, "code_v1_loc": 11, "code_v0_num_chars": 200, "code_v1_num_chars": 254, "code_v0_no_empty_lines": "N, L = list(map(int, input().split()))\ntaste = [L + i - 1 for i in range(1, N + 1)]\nif taste[-1] < 0:\n print((sum(taste) + min([abs(x) for x in taste])))\nelse:\n print((sum(taste) - min([abs(x) for x in taste])))\n", "code_v1_no_empty_lines": "N, L = list(map(int, input().split()))\ntaste = [L + i - 1 for i in range(1, N + 1)]\nif 0 in taste:\n select = 0\nelse:\n select_with_ind = min(enumerate(taste), key=lambda x: abs(x[1]))\n select = select_with_ind[1]\nprint((sum(taste) - select))\n", "code_same": false, "relative_loc_diff_percent": 45.4545454545, "diff": ["-if taste[-1] < 0:", "- print((sum(taste) + min([abs(x) for x in taste])))", "+if 0 in taste:", "+ select = 0", "- print((sum(taste) - min([abs(x) for x in taste])))", "+ select_with_ind = min(enumerate(taste), key=lambda x: abs(x[1]))", "+ select = select_with_ind[1]", "+print((sum(taste) - select))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3334629779, "measured_runtime_v1": 0.1486533701, "runtime_lift": 2.2432251455, "key": ["s512634929", "s713379557"]} {"user_id": "u077291787", "problem_id": "p03416", "language": "python", "submission_id_v0": "s642708796", "submission_id_v1": "s868202811", "cpu_time_v0": 245, "cpu_time_v1": 42, "memory_v0": 40940, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.86, "input": "# ABC090B - Palindromic Numbers\n\na, b = list(map(int, input().rstrip().split()))\n\ncount = 0\n\nfor i in range(a, b + 1):\n\n lst = list(map(int, list(str(i))))\n\n if lst[0] == lst[4] and lst[1] == lst[3]:\n\n count += 1\n\nprint(count)", "target": "# ABC090B - Palindromic Numbers\n\ndef main():\n\n a, b = list(map(int, input().rstrip().split()))\n\n cnt = 0\n\n for i in range(a, b + 1):\n\n s = str(i)\n\n if s == s[::-1]:\n\n cnt += 1\n\n print(cnt)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()", "code_v0_loc": 8, "code_v1_loc": 13, "code_v0_num_chars": 239, "code_v1_num_chars": 269, "code_v0_no_empty_lines": "# ABC090B - Palindromic Numbers\na, b = list(map(int, input().rstrip().split()))\ncount = 0\nfor i in range(a, b + 1):\n lst = list(map(int, list(str(i))))\n if lst[0] == lst[4] and lst[1] == lst[3]:\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "# ABC090B - Palindromic Numbers\ndef main():\n a, b = list(map(int, input().rstrip().split()))\n cnt = 0\n for i in range(a, b + 1):\n s = str(i)\n if s == s[::-1]:\n cnt += 1\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 38.4615384615, "diff": ["-a, b = list(map(int, input().rstrip().split()))", "-count = 0", "-for i in range(a, b + 1):", "- lst = list(map(int, list(str(i))))", "- if lst[0] == lst[4] and lst[1] == lst[3]:", "- count += 1", "-print(count)", "+def main():", "+ a, b = list(map(int, input().rstrip().split()))", "+ cnt = 0", "+ for i in range(a, b + 1):", "+ s = str(i)", "+ if s == s[::-1]:", "+ cnt += 1", "+ print(cnt)", "+", "+", "+if __name__ == \"__main__\":", "+ main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3956292481, "measured_runtime_v1": 0.2484657222, "runtime_lift": 1.5922890477, "key": ["s642708796", "s868202811"]} {"user_id": "u977389981", "problem_id": "p03720", "language": "python", "submission_id_v0": "s310815601", "submission_id_v1": "s089084009", "cpu_time_v0": 25, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 32.0, "input": "n, m = list(map(int, input().split()))\n\ndp = [0] * n\n\nfor i in range(m):\n\n x, y = list(map(int, input().split()))\n\n dp[x - 1] += 1\n\n dp[y - 1] += 1\n\nfor i in range(n):\n\n print((dp[i]))", "target": "n, m = list(map(int, input().split()))\n\nA = [0] * n\n\nfor i in range(m):\n\n a, b = list(map(int, input().split()))\n\n A[a - 1] += 1\n\n A[b - 1] += 1\n\n \n\nfor i in range(n):\n\n print((A[i]))", "code_v0_loc": 8, "code_v1_loc": 9, "code_v0_num_chars": 182, "code_v1_num_chars": 184, "code_v0_no_empty_lines": "n, m = list(map(int, input().split()))\ndp = [0] * n\nfor i in range(m):\n x, y = list(map(int, input().split()))\n dp[x - 1] += 1\n dp[y - 1] += 1\nfor i in range(n):\n print((dp[i]))\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\nA = [0] * n\nfor i in range(m):\n a, b = list(map(int, input().split()))\n A[a - 1] += 1\n A[b - 1] += 1\nfor i in range(n):\n print((A[i]))\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-dp = [0] * n", "+A = [0] * n", "- x, y = list(map(int, input().split()))", "- dp[x - 1] += 1", "- dp[y - 1] += 1", "+ a, b = list(map(int, input().split()))", "+ A[a - 1] += 1", "+ A[b - 1] += 1", "- print((dp[i]))", "+ print((A[i]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2766861832, "measured_runtime_v1": 0.17692909, "runtime_lift": 1.5638252769, "key": ["s310815601", "s089084009"]} {"user_id": "u171065106", "problem_id": "p03796", "language": "python", "submission_id_v0": "s258128729", "submission_id_v1": "s727911974", "cpu_time_v0": 230, "cpu_time_v1": 43, "memory_v0": 3976, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 81.3, "input": "import math\n\n\n\nn = int(input())\n\n\n\nprint((math.factorial(n) % (10**9 + 7)))\n", "target": "n = int(input())\n\n\n\nans = 1\n\n\n\nfor i in range(1, n+1):\n\n ans *= i\n\n ans %= 10**9 + 7\n\n\n\nprint(ans)\n", "code_v0_loc": 5, "code_v1_loc": 9, "code_v0_num_chars": 74, "code_v1_num_chars": 105, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nprint((math.factorial(n) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\nans = 1\nfor i in range(1, n + 1):\n ans *= i\n ans %= 10**9 + 7\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 44.4444444444, "diff": ["-import math", "-", "-print((math.factorial(n) % (10**9 + 7)))", "+ans = 1", "+for i in range(1, n + 1):", "+ ans *= i", "+ ans %= 10**9 + 7", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6649877462, "measured_runtime_v1": 0.4034042664, "runtime_lift": 1.6484400431, "key": ["s258128729", "s727911974"]} {"user_id": "u488127128", "problem_id": "p03796", "language": "python", "submission_id_v0": "s637972642", "submission_id_v1": "s581563839", "cpu_time_v0": 32, "cpu_time_v1": 28, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.5, "input": "def factorial(N):\n\n power_r = 1\n\n for n in range(2,N+1):\n\n power_r *= n\n\n power_r %= 10**9+7\n\n return power_r\n\n\n\nif __name__ == '__main__':\n\n N = int(input())\n\n print((factorial(N)))", "target": "def factorial(N):\n\n power_r = 1\n\n for n in range(2,N+1):\n\n power_r = power_r*n % (10**9+7)\n\n return power_r\n\n\n\nif __name__ == '__main__':\n\n N = int(input())\n\n print((factorial(N)))", "code_v0_loc": 10, "code_v1_loc": 9, "code_v0_num_chars": 209, "code_v1_num_chars": 200, "code_v0_no_empty_lines": "def factorial(N):\n power_r = 1\n for n in range(2, N + 1):\n power_r *= n\n power_r %= 10**9 + 7\n return power_r\n\n\nif __name__ == \"__main__\":\n N = int(input())\n print((factorial(N)))\n", "code_v1_no_empty_lines": "def factorial(N):\n power_r = 1\n for n in range(2, N + 1):\n power_r = power_r * n % (10**9 + 7)\n return power_r\n\n\nif __name__ == \"__main__\":\n N = int(input())\n print((factorial(N)))\n", "code_same": false, "relative_loc_diff_percent": 10.0, "diff": ["- power_r *= n", "- power_r %= 10**9 + 7", "+ power_r = power_r * n % (10**9 + 7)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3227770622, "measured_runtime_v1": 0.2497183731, "runtime_lift": 1.2925643324, "key": ["s637972642", "s581563839"]} {"user_id": "u189479417", "problem_id": "p02596", "language": "python", "submission_id_v0": "s892012548", "submission_id_v1": "s295850055", "cpu_time_v0": 350, "cpu_time_v1": 211, "memory_v0": 9176, "memory_v1": 9188, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 39.71, "input": "import sys\n\nK = int(input())\n\n\n\npower = 7\n\nSUM = 0\n\n\n\nfor i in range(1, 10 ** 6):\n\n SUM += power\n\n if SUM % K == 0:\n\n print(i)\n\n sys.exit()\n\n power *= 10\n\n power %= K\n\n\n\nprint((-1))", "target": "import sys\n\nK = int(input())\n\n\n\nL = 9 * K\n\n\n\nif K % 7 == 0:\n\n L //= 7\n\n\n\npower = 1\n\n\n\nfor i in range(1, 10 ** 6):\n\n power *= 10\n\n power %= L\n\n if power == 1:\n\n print(i)\n\n sys.exit()\n\n\n\nprint((-1))", "code_v0_loc": 15, "code_v1_loc": 18, "code_v0_num_chars": 205, "code_v1_num_chars": 220, "code_v0_no_empty_lines": "import sys\n\nK = int(input())\npower = 7\nSUM = 0\nfor i in range(1, 10**6):\n SUM += power\n if SUM % K == 0:\n print(i)\n sys.exit()\n power *= 10\n power %= K\nprint((-1))\n", "code_v1_no_empty_lines": "import sys\n\nK = int(input())\nL = 9 * K\nif K % 7 == 0:\n L //= 7\npower = 1\nfor i in range(1, 10**6):\n power *= 10\n power %= L\n if power == 1:\n print(i)\n sys.exit()\nprint((-1))\n", "code_same": false, "relative_loc_diff_percent": 16.6666666667, "diff": ["-power = 7", "-SUM = 0", "+L = 9 * K", "+if K % 7 == 0:", "+ L //= 7", "+power = 1", "- SUM += power", "- if SUM % K == 0:", "+ power *= 10", "+ power %= L", "+ if power == 1:", "- power *= 10", "- power %= K"], "diff_only_import_comment": false, "measured_runtime_v0": 0.9885553987, "measured_runtime_v1": 0.6379526145, "runtime_lift": 1.5495749624, "key": ["s892012548", "s295850055"]} {"user_id": "u497046426", "problem_id": "p03568", "language": "python", "submission_id_v0": "s711599117", "submission_id_v1": "s424536945", "cpu_time_v0": 181, "cpu_time_v1": 17, "memory_v0": 3572, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 90.61, "input": "from functools import reduce\n\nfrom itertools import product\n\n\n\nN = int(input())\n\n*A, = list(map(int, input().split()))\n\nans = 0\n\nfor t in product([-1, 0, 1], repeat=N):\n\n prod = reduce(lambda x, y: x*y, [a + t[i] for i, a in enumerate(A)])\n\n if prod % 2 == 0: ans += 1\n\nprint(ans)", "target": "N = int(input())\n\n*A, = list(map(int, input().split()))\n\nevens = 0\n\nfor a in A:\n\n if a % 2 == 0: evens += 1\n\nans = 3**N - 2**evens\n\nprint(ans)", "code_v0_loc": 10, "code_v1_loc": 7, "code_v0_num_chars": 280, "code_v1_num_chars": 139, "code_v0_no_empty_lines": "from functools import reduce\nfrom itertools import product\n\nN = int(input())\n(*A,) = list(map(int, input().split()))\nans = 0\nfor t in product([-1, 0, 1], repeat=N):\n prod = reduce(lambda x, y: x * y, [a + t[i] for i, a in enumerate(A)])\n if prod % 2 == 0:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\n(*A,) = list(map(int, input().split()))\nevens = 0\nfor a in A:\n if a % 2 == 0:\n evens += 1\nans = 3**N - 2**evens\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["-from functools import reduce", "-from itertools import product", "-", "-ans = 0", "-for t in product([-1, 0, 1], repeat=N):", "- prod = reduce(lambda x, y: x * y, [a + t[i] for i, a in enumerate(A)])", "- if prod % 2 == 0:", "- ans += 1", "+evens = 0", "+for a in A:", "+ if a % 2 == 0:", "+ evens += 1", "+ans = 3**N - 2**evens"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6547077734, "measured_runtime_v1": 0.2760411811, "runtime_lift": 2.3717757287, "key": ["s711599117", "s424536945"]} {"user_id": "u306664745", "problem_id": "p02983", "language": "python", "submission_id_v0": "s965697641", "submission_id_v1": "s560038811", "cpu_time_v0": 68, "cpu_time_v1": 56, "memory_v0": 3060, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.65, "input": "l, r=list(map(int, input().split()))\n\nif r-l>672:\n\n\tp=0\n\nelse:\n\n\tp=2019\n\n\tfor i in range(l, r):\n\n\t\tfor j in range(i+1, r+1):\n\n\t\t\tp=min(p, (((i%2019)*(j%2019))%2019))\n\n\t\t\tif not p:\n\n\t\t\t\tbreak\n\n\t\tif not p:\n\n\t\t\tbreak\n\nprint(p)", "target": "l, r=list(map(int, input().split()))\n\nif r-l>672:\n\n\tp=0\n\nelse:\n\n\tp=2019\n\n\tfor i in range(l, r):\n\n\t\tfor j in range(i+1, r+1):\n\n\t\t\tp=min(p, (i*j%2019))\n\n\t\t\tif not p:\n\n\t\t\t\tbreak\n\n\t\tif not p:\n\n\t\t\tbreak\n\nprint(p)", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 217, "code_v1_num_chars": 201, "code_v0_no_empty_lines": "l, r = list(map(int, input().split()))\nif r - l > 672:\n p = 0\nelse:\n p = 2019\n for i in range(l, r):\n for j in range(i + 1, r + 1):\n p = min(p, (((i % 2019) * (j % 2019)) % 2019))\n if not p:\n break\n if not p:\n break\nprint(p)\n", "code_v1_no_empty_lines": "l, r = list(map(int, input().split()))\nif r - l > 672:\n p = 0\nelse:\n p = 2019\n for i in range(l, r):\n for j in range(i + 1, r + 1):\n p = min(p, (i * j % 2019))\n if not p:\n break\n if not p:\n break\nprint(p)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- p = min(p, (((i % 2019) * (j % 2019)) % 2019))", "+ p = min(p, (i * j % 2019))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3854847456, "measured_runtime_v1": 0.191389215, "runtime_lift": 2.0141403766, "key": ["s965697641", "s560038811"]} {"user_id": "u046592970", "problem_id": "p03371", "language": "python", "submission_id_v0": "s911937877", "submission_id_v1": "s225349134", "cpu_time_v0": 121, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 85.95, "input": "a,b,c,x,y = list(map(int,input().split()))\n\nprice = 10**10\n\nfor k in range(10**5+1):\n\n re = 2*c*k + max(0,x-k)*a + max(0,y-k)*b\n\n price = min(re,price)\n\nprint(price)", "target": "a,b,c,x,y = list(map(int,input().split()))\n\na1 = a*x + b*y\n\na2 = max(x,y) * 2*c\n\nif y >= x:\n\n a3 = 2*c*x + (y-x)*b\n\nelse:\n\n a3 = 2*c*y + (x-y)*a\n\nprint((min(a1,a2,a3)))", "code_v0_loc": 6, "code_v1_loc": 8, "code_v0_num_chars": 165, "code_v1_num_chars": 166, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nprice = 10**10\nfor k in range(10**5 + 1):\n re = 2 * c * k + max(0, x - k) * a + max(0, y - k) * b\n price = min(re, price)\nprint(price)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\na1 = a * x + b * y\na2 = max(x, y) * 2 * c\nif y >= x:\n a3 = 2 * c * x + (y - x) * b\nelse:\n a3 = 2 * c * y + (x - y) * a\nprint((min(a1, a2, a3)))\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-price = 10**10", "-for k in range(10**5 + 1):", "- re = 2 * c * k + max(0, x - k) * a + max(0, y - k) * b", "- price = min(re, price)", "-print(price)", "+a1 = a * x + b * y", "+a2 = max(x, y) * 2 * c", "+if y >= x:", "+ a3 = 2 * c * x + (y - x) * b", "+else:", "+ a3 = 2 * c * y + (x - y) * a", "+print((min(a1, a2, a3)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4459569323, "measured_runtime_v1": 0.1564870899, "runtime_lift": 2.8498001506, "key": ["s911937877", "s225349134"]} {"user_id": "u597374218", "problem_id": "p03796", "language": "python", "submission_id_v0": "s873197292", "submission_id_v1": "s712740845", "cpu_time_v0": 231, "cpu_time_v1": 40, "memory_v0": 3980, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.68, "input": "import math\n\nprint((math.factorial(int(input()))%(10**9+7)))", "target": "ans=1\n\nn=int(input())\n\nfor i in range(1,n+1):\n\n ans*=i\n\n ans=ans%(10**9+7)\n\nprint(ans)", "code_v0_loc": 2, "code_v1_loc": 6, "code_v0_num_chars": 58, "code_v1_num_chars": 92, "code_v0_no_empty_lines": "import math\n\nprint((math.factorial(int(input())) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "ans = 1\nn = int(input())\nfor i in range(1, n + 1):\n ans *= i\n ans = ans % (10**9 + 7)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-import math", "-", "-print((math.factorial(int(input())) % (10**9 + 7)))", "+ans = 1", "+n = int(input())", "+for i in range(1, n + 1):", "+ ans *= i", "+ ans = ans % (10**9 + 7)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5415332041, "measured_runtime_v1": 0.2632789848, "runtime_lift": 2.0568797183, "key": ["s873197292", "s712740845"]} {"user_id": "u222668979", "problem_id": "p02996", "language": "python", "submission_id_v0": "s000658921", "submission_id_v1": "s911267857", "cpu_time_v0": 791, "cpu_time_v1": 572, "memory_v0": 38028, "memory_v1": 117796, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 27.69, "input": "import sys\n\ninput = sys.stdin.readline\n\n\n\nn = int(input())\n\nab = sorted([list(map(int, input().split()))[::-1] for _ in range(n)])\n\n\n\ncnt = 0\n\nfor b, a in ab:\n\n cnt += a\n\n if cnt > b:\n\n print('No')\n\n break\n\nelse:\n\n print('Yes')\n", "target": "n = int(input())\n\nab = [list(map(int, input().split())) for _ in range(n)]\n\nab = sorted(ab, key=lambda x: x[1])\n\n\n\nt = 0\n\nfor a, b in ab:\n\n t += a\n\n if t > b:\n\n print('No')\n\n break\n\nelse:\n\n print('Yes')\n", "code_v0_loc": 14, "code_v1_loc": 12, "code_v0_num_chars": 251, "code_v1_num_chars": 226, "code_v0_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nn = int(input())\nab = sorted([list(map(int, input().split()))[::-1] for _ in range(n)])\ncnt = 0\nfor b, a in ab:\n cnt += a\n if cnt > b:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n", "code_v1_no_empty_lines": "n = int(input())\nab = [list(map(int, input().split())) for _ in range(n)]\nab = sorted(ab, key=lambda x: x[1])\nt = 0\nfor a, b in ab:\n t += a\n if t > b:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-import sys", "-", "-input = sys.stdin.readline", "-ab = sorted([list(map(int, input().split()))[::-1] for _ in range(n)])", "-cnt = 0", "-for b, a in ab:", "- cnt += a", "- if cnt > b:", "+ab = [list(map(int, input().split())) for _ in range(n)]", "+ab = sorted(ab, key=lambda x: x[1])", "+t = 0", "+for a, b in ab:", "+ t += a", "+ if t > b:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2345721078, "measured_runtime_v1": 0.0064230425, "runtime_lift": 36.5204038616, "key": ["s000658921", "s911267857"]} {"user_id": "u896741788", "problem_id": "p03037", "language": "python", "submission_id_v0": "s129241236", "submission_id_v1": "s743438543", "cpu_time_v0": 355, "cpu_time_v1": 218, "memory_v0": 7832, "memory_v1": 15472, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 38.59, "input": "k,m=list(map(int,input().split()))\n\nl=[0 for i in range(k+1)]\n\nfor i in range(m):\n\n a,s=list(map(int,input().split()))\n\n l[a-1]+=1;l[s]-=1\n\nans=0\n\nf=0\n\nfor j in range(k):\n\n l[j]+=f\n\n f=l[j]\n\nprint((len([1 for i in l if i==m])))", "target": "n,m=list(map(int,input().split()))\n\ntable=[0]*(n+2)\n\nfor i in range(m):\n\n l,r=list(map(int,input().split()))\n\n table[l]+=1\n\n table[r+1]-=1\n\nfrom itertools import accumulate\n\nfrom collections import Counter as co\n\nvar=co((accumulate(table)))\n\n\n\nif m not in var:print((0))\n\nelse:print((var[m]))\n\n\n\n\n", "code_v0_loc": 11, "code_v1_loc": 14, "code_v0_num_chars": 217, "code_v1_num_chars": 290, "code_v0_no_empty_lines": "k, m = list(map(int, input().split()))\nl = [0 for i in range(k + 1)]\nfor i in range(m):\n a, s = list(map(int, input().split()))\n l[a - 1] += 1\n l[s] -= 1\nans = 0\nf = 0\nfor j in range(k):\n l[j] += f\n f = l[j]\nprint((len([1 for i in l if i == m])))\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\ntable = [0] * (n + 2)\nfor i in range(m):\n l, r = list(map(int, input().split()))\n table[l] += 1\n table[r + 1] -= 1\nfrom itertools import accumulate\nfrom collections import Counter as co\n\nvar = co((accumulate(table)))\nif m not in var:\n print((0))\nelse:\n print((var[m]))\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["-k, m = list(map(int, input().split()))", "-l = [0 for i in range(k + 1)]", "+n, m = list(map(int, input().split()))", "+table = [0] * (n + 2)", "- a, s = list(map(int, input().split()))", "- l[a - 1] += 1", "- l[s] -= 1", "-ans = 0", "-f = 0", "-for j in range(k):", "- l[j] += f", "- f = l[j]", "-print((len([1 for i in l if i == m])))", "+ l, r = list(map(int, input().split()))", "+ table[l] += 1", "+ table[r + 1] -= 1", "+from itertools import accumulate", "+from collections import Counter as co", "+", "+var = co((accumulate(table)))", "+if m not in var:", "+ print((0))", "+else:", "+ print((var[m]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4122046263, "measured_runtime_v1": 0.3202181025, "runtime_lift": 1.2872620978, "key": ["s129241236", "s743438543"]} {"user_id": "u442877951", "problem_id": "p02881", "language": "python", "submission_id_v0": "s498895748", "submission_id_v1": "s605488454", "cpu_time_v0": 574, "cpu_time_v1": 295, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 48.61, "input": "import math\n\nN = int(input())\n\nans = 10**12\n\nfor i in range(1,10**6+1):\n\n j = math.ceil(N/(i+1))\n\n if (1+i)*j == N:\n\n ans = min(i+j-1,ans)\n\n if i == 10**6 and ans == 10**12:\n\n ans = N-1\n\n break\n\nprint(ans)", "target": "N = int(input())\n\nans = 10**12\n\nfor i in range(1,10**6+1):\n\n j = N//i\n\n if i*j == N:\n\n ans = min(i+j-2,ans)\n\n if i == 10**6 and ans == 10**12:\n\n ans = N-1\n\n break\n\nprint(ans)", "code_v0_loc": 11, "code_v1_loc": 10, "code_v0_num_chars": 217, "code_v1_num_chars": 186, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nans = 10**12\nfor i in range(1, 10**6 + 1):\n j = math.ceil(N / (i + 1))\n if (1 + i) * j == N:\n ans = min(i + j - 1, ans)\n if i == 10**6 and ans == 10**12:\n ans = N - 1\n break\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nans = 10**12\nfor i in range(1, 10**6 + 1):\n j = N // i\n if i * j == N:\n ans = min(i + j - 2, ans)\n if i == 10**6 and ans == 10**12:\n ans = N - 1\n break\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 9.0909090909, "diff": ["-import math", "-", "- j = math.ceil(N / (i + 1))", "- if (1 + i) * j == N:", "- ans = min(i + j - 1, ans)", "+ j = N // i", "+ if i * j == N:", "+ ans = min(i + j - 2, ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 3.3566168053, "measured_runtime_v1": 2.0076369724, "runtime_lift": 1.6719241832, "key": ["s498895748", "s605488454"]} {"user_id": "u539692012", "problem_id": "p02622", "language": "python", "submission_id_v0": "s511745855", "submission_id_v1": "s953276742", "cpu_time_v0": 78, "cpu_time_v1": 44, "memory_v0": 68212, "memory_v1": 9464, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 43.59, "input": "print((sum(si != ti for si, ti in zip(input(), input()))))\n", "target": "print((sum(a!=b for a,b in zip(*open(0)))))", "code_v0_loc": 1, "code_v1_loc": 1, "code_v0_num_chars": 57, "code_v1_num_chars": 41, "code_v0_no_empty_lines": "print((sum(si != ti for si, ti in zip(input(), input()))))\n", "code_v1_no_empty_lines": "print((sum(a != b for a, b in zip(*open(0)))))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-print((sum(si != ti for si, ti in zip(input(), input()))))", "+print((sum(a != b for a, b in zip(*open(0)))))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3334237881, "measured_runtime_v1": 0.1220404458, "runtime_lift": 2.7320761232, "key": ["s511745855", "s953276742"]} {"user_id": "u540631540", "problem_id": "p02767", "language": "python", "submission_id_v0": "s304816826", "submission_id_v1": "s138180908", "cpu_time_v0": 22, "cpu_time_v1": 19, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.64, "input": "n = int(input())\n\nx = [int(i) for i in input().split()]\n\np = 10000000\n\nfor i in range(100):\n\n pi = 0\n\n for j in range(n):\n\n pi += (x[j] - (i + 1))**2\n\n if pi < p:\n\n p = pi\n\n # else:\n\n # break\n\n # p[i] += (x[j]-(i+1))**2\n\nprint(p)", "target": "n = int(input())\n\nx = [int(i) for i in input().split()]\n\np = 10000000\n\nfor i in range(100):\n\n pi = 0\n\n for j in range(n):\n\n pi += (x[j] - (i + 1))**2\n\n if pi < p:\n\n p = pi\n\n else:\n\n break\n\n # p[i] += (x[j]-(i+1))**2\n\nprint(p)", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 269, "code_v1_num_chars": 265, "code_v0_no_empty_lines": "n = int(input())\nx = [int(i) for i in input().split()]\np = 10000000\nfor i in range(100):\n pi = 0\n for j in range(n):\n pi += (x[j] - (i + 1)) ** 2\n if pi < p:\n p = pi\n # else:\n # break\n # p[i] += (x[j]-(i+1))**2\nprint(p)\n", "code_v1_no_empty_lines": "n = int(input())\nx = [int(i) for i in input().split()]\np = 10000000\nfor i in range(100):\n pi = 0\n for j in range(n):\n pi += (x[j] - (i + 1)) ** 2\n if pi < p:\n p = pi\n else:\n break\n # p[i] += (x[j]-(i+1))**2\nprint(p)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- # else:", "- # break", "- # p[i] += (x[j]-(i+1))**2", "+ else:", "+ break", "+ # p[i] += (x[j]-(i+1))**2"], "diff_only_import_comment": false, "measured_runtime_v0": 0.18753242, "measured_runtime_v1": 0.0060767163, "runtime_lift": 30.860815536, "key": ["s304816826", "s138180908"]} {"user_id": "u777923818", "problem_id": "p03086", "language": "python", "submission_id_v0": "s716593637", "submission_id_v1": "s955967436", "cpu_time_v0": 22, "cpu_time_v1": 17, "memory_v0": 3316, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 22.73, "input": "# -*- coding: utf-8 -*-\n\nfrom collections import deque\n\ndef inpl(): return list(map(int, input().split()))\n\n\n\nS = input()\n\nA = set(\"ATCG\")\n\nans = 0\n\nmode = 0\n\nfor i, s in enumerate(S):\n\n if s in A:\n\n if mode == 0:\n\n mode = 1\n\n start = i\n\n else:\n\n if mode == 1:\n\n ans = max(i - start, ans)\n\n mode = 0\n\nif mode == 1:\n\n ans = max(len(S) - start, ans)\n\nprint(ans)", "target": "def inpl(): return list(map(int, input().split()))\n\nS = input()\n\nC = set(\"ACGT\")\n\n\n\ntmp = 0\n\nans = 0\n\n\n\nfor s in S:\n\n if s in C:\n\n tmp += 1\n\n else:\n\n ans = max(ans, tmp)\n\n tmp = 0\n\nans = max(ans, tmp)\n\nprint(ans)", "code_v0_loc": 20, "code_v1_loc": 15, "code_v0_num_chars": 426, "code_v1_num_chars": 239, "code_v0_no_empty_lines": "# -*- coding: utf-8 -*-\nfrom collections import deque\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\nS = input()\nA = set(\"ATCG\")\nans = 0\nmode = 0\nfor i, s in enumerate(S):\n if s in A:\n if mode == 0:\n mode = 1\n start = i\n else:\n if mode == 1:\n ans = max(i - start, ans)\n mode = 0\nif mode == 1:\n ans = max(len(S) - start, ans)\nprint(ans)\n", "code_v1_no_empty_lines": "def inpl():\n return list(map(int, input().split()))\n\n\nS = input()\nC = set(\"ACGT\")\ntmp = 0\nans = 0\nfor s in S:\n if s in C:\n tmp += 1\n else:\n ans = max(ans, tmp)\n tmp = 0\nans = max(ans, tmp)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-# -*- coding: utf-8 -*-", "-from collections import deque", "-", "-", "-A = set(\"ATCG\")", "+C = set(\"ACGT\")", "+tmp = 0", "-mode = 0", "-for i, s in enumerate(S):", "- if s in A:", "- if mode == 0:", "- mode = 1", "- start = i", "+for s in S:", "+ if s in C:", "+ tmp += 1", "- if mode == 1:", "- ans = max(i - start, ans)", "- mode = 0", "-if mode == 1:", "- ans = max(len(S) - start, ans)", "+ ans = max(ans, tmp)", "+ tmp = 0", "+ans = max(ans, tmp)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1640799, "measured_runtime_v1": 0.006362747, "runtime_lift": 25.7875884356, "key": ["s716593637", "s955967436"]} {"user_id": "u854690176", "problem_id": "p02952", "language": "python", "submission_id_v0": "s720457111", "submission_id_v1": "s185706611", "cpu_time_v0": 60, "cpu_time_v1": 51, "memory_v0": 2940, "memory_v1": 6732, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "N = int(input())\n\nans = 0\n\nfor i in range(1, N + 1):\n\n if len(str(i)) % 2 == 1:\n\n ans += 1\n\nprint(ans)", "target": "N = int(input())\n\nprint((len(list([x for x in range(1, N + 1) if len(str(x)) % 2 == 1]))))", "code_v0_loc": 6, "code_v1_loc": 2, "code_v0_num_chars": 112, "code_v1_num_chars": 91, "code_v0_no_empty_lines": "N = int(input())\nans = 0\nfor i in range(1, N + 1):\n if len(str(i)) % 2 == 1:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nprint((len(list([x for x in range(1, N + 1) if len(str(x)) % 2 == 1]))))\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-ans = 0", "-for i in range(1, N + 1):", "- if len(str(i)) % 2 == 1:", "- ans += 1", "-print(ans)", "+print((len(list([x for x in range(1, N + 1) if len(str(x)) % 2 == 1]))))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1607959216, "measured_runtime_v1": 0.006350698, "runtime_lift": 25.3194092141, "key": ["s720457111", "s185706611"]} {"user_id": "u282228874", "problem_id": "p03353", "language": "python", "submission_id_v0": "s703764972", "submission_id_v1": "s575406884", "cpu_time_v0": 39, "cpu_time_v1": 34, "memory_v0": 4976, "memory_v1": 4592, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.82, "input": "S = input()\n\nk = int(input())\n\nA = set()\n\nfor l in range(k+1):\n\n\tfor i in range(len(S)-l):\n\n\t\t\tA.add(S[i:i+l+1])\n\nA = sorted(list(A))\n\nprint((A[k-1]))", "target": "S = input()\n\nl = len(S)\n\nd = set()\n\nK = int(input())\n\nfor i in range(5):\n\n for j in range(l-i):\n\n d.add(S[j:j+i+1])\n\nD = sorted(list(d))\n\nprint((D[K-1]))", "code_v0_loc": 8, "code_v1_loc": 9, "code_v0_num_chars": 148, "code_v1_num_chars": 161, "code_v0_no_empty_lines": "S = input()\nk = int(input())\nA = set()\nfor l in range(k + 1):\n for i in range(len(S) - l):\n A.add(S[i : i + l + 1])\nA = sorted(list(A))\nprint((A[k - 1]))\n", "code_v1_no_empty_lines": "S = input()\nl = len(S)\nd = set()\nK = int(input())\nfor i in range(5):\n for j in range(l - i):\n d.add(S[j : j + i + 1])\nD = sorted(list(d))\nprint((D[K - 1]))\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-k = int(input())", "-A = set()", "-for l in range(k + 1):", "- for i in range(len(S) - l):", "- A.add(S[i : i + l + 1])", "-A = sorted(list(A))", "-print((A[k - 1]))", "+l = len(S)", "+d = set()", "+K = int(input())", "+for i in range(5):", "+ for j in range(l - i):", "+ d.add(S[j : j + i + 1])", "+D = sorted(list(d))", "+print((D[K - 1]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2549800012, "measured_runtime_v1": 0.1151928709, "runtime_lift": 2.2135050485, "key": ["s703764972", "s575406884"]} {"user_id": "u047796752", "problem_id": "p02693", "language": "python", "submission_id_v0": "s690438210", "submission_id_v1": "s726211396", "cpu_time_v0": 69, "cpu_time_v1": 61, "memory_v0": 64680, "memory_v1": 61880, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.59, "input": "import sys\n\ninput = sys.stdin.readline\n\nfrom collections import *\n\n\n\nK = int(input())\n\nA, B = list(map(int, input().split()))\n\n\n\nfor i in range(A, B+1):\n\n if i%K==0:\n\n print('OK')\n\n exit()\n\n \n\nprint('NG')", "target": "K = int(input())\n\nA, B = list(map(int, input().split()))\n\n\n\nif (A-1)//K!=B//K:\n\n print('OK')\n\nelse:\n\n print('NG')", "code_v0_loc": 13, "code_v1_loc": 7, "code_v0_num_chars": 218, "code_v1_num_chars": 113, "code_v0_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nfrom collections import *\n\nK = int(input())\nA, B = list(map(int, input().split()))\nfor i in range(A, B + 1):\n if i % K == 0:\n print(\"OK\")\n exit()\nprint(\"NG\")\n", "code_v1_no_empty_lines": "K = int(input())\nA, B = list(map(int, input().split()))\nif (A - 1) // K != B // K:\n print(\"OK\")\nelse:\n print(\"NG\")\n", "code_same": false, "relative_loc_diff_percent": 46.1538461538, "diff": ["-import sys", "-", "-input = sys.stdin.readline", "-from collections import *", "-", "-for i in range(A, B + 1):", "- if i % K == 0:", "- print(\"OK\")", "- exit()", "-print(\"NG\")", "+if (A - 1) // K != B // K:", "+ print(\"OK\")", "+else:", "+ print(\"NG\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2312573931, "measured_runtime_v1": 0.006134352, "runtime_lift": 37.6987486082, "key": ["s690438210", "s726211396"]} {"user_id": "u803848678", "problem_id": "p03558", "language": "python", "submission_id_v0": "s650935446", "submission_id_v1": "s013593877", "cpu_time_v0": 647, "cpu_time_v1": 206, "memory_v0": 80204, "memory_v1": 46940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 68.16, "input": "from heapq import heappush, heappop\n\nk = int(input())\n\n\n\nheap = [(1,1)]\n\ndist = [float(\"inf\")]*k\n\nwhile heap:\n\n cost, cur = heappop(heap)\n\n if dist[cur] <= cost:\n\n continue\n\n dist[cur] = cost\n\n # +1\n\n nxt = (cur+1)%k\n\n heappush(heap, (cost+1, nxt))\n\n # *10\n\n nxt = cur*10 % k\n\n heappush(heap, (cost, nxt))\n\n\n\nprint((dist[0]))", "target": "from collections import deque\n\nk = int(input())\n\n\n\nque = deque()\n\nque.append((1,1))\n\ndist = [float(\"inf\")]*k\n\nwhile que:\n\n cost, cur = que.popleft()\n\n if dist[cur] <= cost:\n\n continue\n\n dist[cur] = cost\n\n # +1\n\n nxt = (cur+1)%k\n\n que.append((cost+1,nxt))\n\n # *10\n\n nxt = cur*10 % k\n\n que.appendleft((cost, nxt))\n\nprint((dist[0]))", "code_v0_loc": 18, "code_v1_loc": 18, "code_v0_num_chars": 357, "code_v1_num_chars": 361, "code_v0_no_empty_lines": "from heapq import heappush, heappop\n\nk = int(input())\nheap = [(1, 1)]\ndist = [float(\"inf\")] * k\nwhile heap:\n cost, cur = heappop(heap)\n if dist[cur] <= cost:\n continue\n dist[cur] = cost\n # +1\n nxt = (cur + 1) % k\n heappush(heap, (cost + 1, nxt))\n # *10\n nxt = cur * 10 % k\n heappush(heap, (cost, nxt))\nprint((dist[0]))\n", "code_v1_no_empty_lines": "from collections import deque\n\nk = int(input())\nque = deque()\nque.append((1, 1))\ndist = [float(\"inf\")] * k\nwhile que:\n cost, cur = que.popleft()\n if dist[cur] <= cost:\n continue\n dist[cur] = cost\n # +1\n nxt = (cur + 1) % k\n que.append((cost + 1, nxt))\n # *10\n nxt = cur * 10 % k\n que.appendleft((cost, nxt))\nprint((dist[0]))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-from heapq import heappush, heappop", "+from collections import deque", "-heap = [(1, 1)]", "+que = deque()", "+que.append((1, 1))", "-while heap:", "- cost, cur = heappop(heap)", "+while que:", "+ cost, cur = que.popleft()", "- heappush(heap, (cost + 1, nxt))", "+ que.append((cost + 1, nxt))", "- heappush(heap, (cost, nxt))", "+ que.appendleft((cost, nxt))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7778599041, "measured_runtime_v1": 0.4842932501, "runtime_lift": 1.6061753987, "key": ["s650935446", "s013593877"]} {"user_id": "u853010060", "problem_id": "p02921", "language": "python", "submission_id_v0": "s066833687", "submission_id_v1": "s453964878", "cpu_time_v0": 21, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 19.05, "input": "S = input()\n\nT = input()\n\n\n\nl = len(S)\n\nres = 0\n\nfor n in range(l):\n\n if S[n] == T[n]:\n\n res += 1\n\nprint(res)", "target": "S = input()\n\nT = input()\n\nl = len(S)\n\nans = 0\n\nfor n in range(l):\n\n if S[n] == T[n]:\n\n ans += 1\n\nprint(ans)\n", "code_v0_loc": 9, "code_v1_loc": 8, "code_v0_num_chars": 119, "code_v1_num_chars": 118, "code_v0_no_empty_lines": "S = input()\nT = input()\nl = len(S)\nres = 0\nfor n in range(l):\n if S[n] == T[n]:\n res += 1\nprint(res)\n", "code_v1_no_empty_lines": "S = input()\nT = input()\nl = len(S)\nans = 0\nfor n in range(l):\n if S[n] == T[n]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-res = 0", "+ans = 0", "- res += 1", "-print(res)", "+ ans += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3049550076, "measured_runtime_v1": 0.2412325363, "runtime_lift": 1.2641537174, "key": ["s066833687", "s453964878"]} {"user_id": "u884323674", "problem_id": "p03371", "language": "python", "submission_id_v0": "s486102959", "submission_id_v1": "s507293588", "cpu_time_v0": 228, "cpu_time_v1": 129, "memory_v0": 3064, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 43.42, "input": "A, B, C, X, Y = list(map(int, input().split()))\n\n\n\nmax_iter = max(X, Y) * 2\n\nans = float(\"inf\")\n\nfor i in range(max_iter):\n\n a = max(X - i, 0)\n\n b = max(Y - i, 0)\n\n price = 2*C * i + A * a + B * b\n\n ans = min(ans, price)\n\n\n\nprint(ans)", "target": "A, B, C, X, Y = list(map(int, input().split()))\n\n\n\nans = float(\"inf\")\n\nfor i in range(max(X, Y)+1):\n\n x = max(X - i, 0)\n\n y = max(Y - i, 0)\n\n cost = 2*C * i + A * x + B * y\n\n ans = min(ans, cost)\n\n\n\nprint(ans)", "code_v0_loc": 11, "code_v1_loc": 10, "code_v0_num_chars": 240, "code_v1_num_chars": 215, "code_v0_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nmax_iter = max(X, Y) * 2\nans = float(\"inf\")\nfor i in range(max_iter):\n a = max(X - i, 0)\n b = max(Y - i, 0)\n price = 2 * C * i + A * a + B * b\n ans = min(ans, price)\nprint(ans)\n", "code_v1_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(max(X, Y) + 1):\n x = max(X - i, 0)\n y = max(Y - i, 0)\n cost = 2 * C * i + A * x + B * y\n ans = min(ans, cost)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 9.0909090909, "diff": ["-max_iter = max(X, Y) * 2", "-for i in range(max_iter):", "- a = max(X - i, 0)", "- b = max(Y - i, 0)", "- price = 2 * C * i + A * a + B * b", "- ans = min(ans, price)", "+for i in range(max(X, Y) + 1):", "+ x = max(X - i, 0)", "+ y = max(Y - i, 0)", "+ cost = 2 * C * i + A * x + B * y", "+ ans = min(ans, cost)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4454369638, "measured_runtime_v1": 0.3371012073, "runtime_lift": 1.321374573, "key": ["s486102959", "s507293588"]} {"user_id": "u982896977", "problem_id": "p03371", "language": "python", "submission_id_v0": "s299972417", "submission_id_v1": "s929413776", "cpu_time_v0": 102, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.33, "input": "a,b,c,x,y = list(map(int,input().split()))\n\nans = a*x + b*y\n\nfor i in range(max(x,y) + 1):\n\n\tmoney = max(0,(x-i)*a) + max(0,(y-i)*b) + 2*i*c\n\n\tif money <= ans:\n\n\t\tans = money\n\nprint(ans)", "target": "a,b,c,x,y = list(map(int,input().split()))\n\nif a + b >= 2*c:\n\n\tif x >= y:\n\n\t\tans = 2*y*c + (x-y)*min(a,2*c)\n\n\telse:\n\n\t\tans = 2*x*c + (y-x)*min(b,2*c)\n\nelse:\n\n\tans = (x*a + y*b)\n\nprint(ans)", "code_v0_loc": 7, "code_v1_loc": 9, "code_v0_num_chars": 180, "code_v1_num_chars": 182, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = a * x + b * y\nfor i in range(max(x, y) + 1):\n money = max(0, (x - i) * a) + max(0, (y - i) * b) + 2 * i * c\n if money <= ans:\n ans = money\nprint(ans)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nif a + b >= 2 * c:\n if x >= y:\n ans = 2 * y * c + (x - y) * min(a, 2 * c)\n else:\n ans = 2 * x * c + (y - x) * min(b, 2 * c)\nelse:\n ans = x * a + y * b\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["-ans = a * x + b * y", "-for i in range(max(x, y) + 1):", "- money = max(0, (x - i) * a) + max(0, (y - i) * b) + 2 * i * c", "- if money <= ans:", "- ans = money", "+if a + b >= 2 * c:", "+ if x >= y:", "+ ans = 2 * y * c + (x - y) * min(a, 2 * c)", "+ else:", "+ ans = 2 * x * c + (y - x) * min(b, 2 * c)", "+else:", "+ ans = x * a + y * b"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3295188012, "measured_runtime_v1": 0.2310098734, "runtime_lift": 1.4264273486, "key": ["s299972417", "s929413776"]} {"user_id": "u546285759", "problem_id": "p00500", "language": "python", "submission_id_v0": "s199562246", "submission_id_v1": "s512442556", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 7644, "memory_v1": 7672, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "N = int(input())\n\nscore = [list(map(int, input().split())) for _ in range(N)]\n\nplayers = [0 for _ in range(N)]\n\nfor play in list(zip(*score)):\n\n for i, p in enumerate(play):\n\n if play.count(p) == 1:\n\n players[i] += p\n\nprint(*players, sep='\\n')\n", "target": "N = int(input())\n\nscore = [input().split() for _ in range(N)]\n\nplayers = [0]*N\n\nfor play in list(zip(*score)):\n\n for i, p in enumerate(play):\n\n if play.count(p) == 1:\n\n players[i] += int(p)\n\nprint(*players, sep='\\n')\n", "code_v0_loc": 8, "code_v1_loc": 8, "code_v0_num_chars": 264, "code_v1_num_chars": 237, "code_v0_no_empty_lines": "N = int(input())\nscore = [list(map(int, input().split())) for _ in range(N)]\nplayers = [0 for _ in range(N)]\nfor play in list(zip(*score)):\n for i, p in enumerate(play):\n if play.count(p) == 1:\n players[i] += p\nprint(*players, sep=\"\\n\")\n", "code_v1_no_empty_lines": "N = int(input())\nscore = [input().split() for _ in range(N)]\nplayers = [0] * N\nfor play in list(zip(*score)):\n for i, p in enumerate(play):\n if play.count(p) == 1:\n players[i] += int(p)\nprint(*players, sep=\"\\n\")\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-score = [list(map(int, input().split())) for _ in range(N)]", "-players = [0 for _ in range(N)]", "+score = [input().split() for _ in range(N)]", "+players = [0] * N", "- players[i] += p", "+ players[i] += int(p)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3026783457, "measured_runtime_v1": 0.2355215042, "runtime_lift": 1.2851410182, "key": ["s199562246", "s512442556"]} {"user_id": "u419963262", "problem_id": "p03170", "language": "python", "submission_id_v0": "s690193516", "submission_id_v1": "s176737022", "cpu_time_v0": 1807, "cpu_time_v1": 395, "memory_v0": 3828, "memory_v1": 43416, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 78.14, "input": "n,k = list(map(int,input().split()))\n\narr = list(map(int,input().split()))\n\n\n\ndp = [False]*(k+1)\n\n\n\nfor stones in range(k+1):\n\n for x in arr:\n\n if stones >= x and dp[stones-x] == False:\n\n dp[stones] = True\n\n\n\nif dp[k]:\n\n print(\"First\")\n\nelse:\n\n print(\"Second\")\n", "target": "N,K = list(map(int,input().split()))\n\nA = list(map(int,input().split()))\n\n\n\ndp = [False]*(K+1)\n\n\n\nfor i in range(K+1):\n\n for j in range(N):\n\n if i-A[j]>=0 and dp[i-A[j]] == False:\n\n dp[i] = True\n\n\n\n \n\nif dp[K]:\n\n print(\"First\")\n\nelse:\n\n print(\"Second\")", "code_v0_loc": 14, "code_v1_loc": 15, "code_v0_num_chars": 282, "code_v1_num_chars": 280, "code_v0_no_empty_lines": "n, k = list(map(int, input().split()))\narr = list(map(int, input().split()))\ndp = [False] * (k + 1)\nfor stones in range(k + 1):\n for x in arr:\n if stones >= x and dp[stones - x] == False:\n dp[stones] = True\nif dp[k]:\n print(\"First\")\nelse:\n print(\"Second\")\n", "code_v1_no_empty_lines": "N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\ndp = [False] * (K + 1)\nfor i in range(K + 1):\n for j in range(N):\n if i - A[j] >= 0 and dp[i - A[j]] == False:\n dp[i] = True\nif dp[K]:\n print(\"First\")\nelse:\n print(\"Second\")\n", "code_same": false, "relative_loc_diff_percent": 6.6666666667, "diff": ["-n, k = list(map(int, input().split()))", "-arr = list(map(int, input().split()))", "-dp = [False] * (k + 1)", "-for stones in range(k + 1):", "- for x in arr:", "- if stones >= x and dp[stones - x] == False:", "- dp[stones] = True", "-if dp[k]:", "+N, K = list(map(int, input().split()))", "+A = list(map(int, input().split()))", "+dp = [False] * (K + 1)", "+for i in range(K + 1):", "+ for j in range(N):", "+ if i - A[j] >= 0 and dp[i - A[j]] == False:", "+ dp[i] = True", "+if dp[K]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2082244466, "measured_runtime_v1": 0.0065503952, "runtime_lift": 31.7880739295, "key": ["s690193516", "s176737022"]} {"user_id": "u579833671", "problem_id": "p02419", "language": "python", "submission_id_v0": "s913061371", "submission_id_v1": "s394956399", "cpu_time_v0": 20, "cpu_time_v1": 10, "memory_v0": 4220, "memory_v1": 4212, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 50.0, "input": "W = input().lower()\n\ns = []\n\nwhile True:\n\n T = list(map(str, input().split()))\n\n if(T[0] == \"END_OF_TEXT\"):\n\n break\n\n else:\n\n for i in range(len(T)):\n\n s.append(T[i].lower())\n\nans = 0\n\nfor i in range(len(s)):\n\n if(s[i] == W):\n\n ans += 1\n\nprint(ans)", "target": "W = input().lower()\n\ns = []\n\nans = 0\n\nwhile True:\n\n T = list(map(str, input().split()))\n\n if(T[0] == \"END_OF_TEXT\"):\n\n break\n\n else:\n\n for i in range(len(T)):\n\n if(W == T[i].lower()):\n\n ans += 1\n\nprint(ans)", "code_v0_loc": 14, "code_v1_loc": 12, "code_v0_num_chars": 294, "code_v1_num_chars": 257, "code_v0_no_empty_lines": "W = input().lower()\ns = []\nwhile True:\n T = list(map(str, input().split()))\n if T[0] == \"END_OF_TEXT\":\n break\n else:\n for i in range(len(T)):\n s.append(T[i].lower())\nans = 0\nfor i in range(len(s)):\n if s[i] == W:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "W = input().lower()\ns = []\nans = 0\nwhile True:\n T = list(map(str, input().split()))\n if T[0] == \"END_OF_TEXT\":\n break\n else:\n for i in range(len(T)):\n if W == T[i].lower():\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["+ans = 0", "- s.append(T[i].lower())", "-ans = 0", "-for i in range(len(s)):", "- if s[i] == W:", "- ans += 1", "+ if W == T[i].lower():", "+ ans += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1894613738, "measured_runtime_v1": 0.0060594826, "runtime_lift": 31.2669227389, "key": ["s913061371", "s394956399"]} {"user_id": "u919633157", "problem_id": "p03796", "language": "python", "submission_id_v0": "s593917202", "submission_id_v1": "s901232961", "cpu_time_v0": 230, "cpu_time_v1": 42, "memory_v0": 3980, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 81.74, "input": "import math\n\nprint((math.factorial(int(input()))%(10**9+7)))", "target": "n=int(input())\n\nans=1\n\nfor i in range(1,n+1):\n\n ans*=i\n\n ans%=10**9+7\n\nprint(ans)", "code_v0_loc": 2, "code_v1_loc": 6, "code_v0_num_chars": 58, "code_v1_num_chars": 87, "code_v0_no_empty_lines": "import math\n\nprint((math.factorial(int(input())) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\nans = 1\nfor i in range(1, n + 1):\n ans *= i\n ans %= 10**9 + 7\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-import math", "-", "-print((math.factorial(int(input())) % (10**9 + 7)))", "+n = int(input())", "+ans = 1", "+for i in range(1, n + 1):", "+ ans *= i", "+ ans %= 10**9 + 7", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.9124054093, "measured_runtime_v1": 0.4053284261, "runtime_lift": 2.2510274398, "key": ["s593917202", "s901232961"]} {"user_id": "u414980766", "problem_id": "p02773", "language": "python", "submission_id_v0": "s498649498", "submission_id_v1": "s794455280", "cpu_time_v0": 480, "cpu_time_v1": 421, "memory_v0": 47872, "memory_v1": 43256, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.29, "input": "import sys\n\nread = sys.stdin.buffer.read\n\nreadline = sys.stdin.buffer.readline\n\nreadlines = sys.stdin.buffer.readlines\n\nN = int(readline())\n\nS = read().split()\n\n\n\nS = sorted(S)\n\nls = [[] for i in range(N + 1)]\n\nmax_num = 0\n\nleft = 0\n\nright = 0\n\nwhile right < N:\n\n while right < N and S[left] == S[right]:\n\n right += 1\n\n if (right - left) >= max_num:\n\n ls[right - left].append(S[left].decode())\n\n max_num = right - left\n\n left = right\n\n \n\nprint(('\\n'.join(ls[max_num])))\n", "target": "from collections import Counter\n\n\n\nimport sys\n\nread = sys.stdin.buffer.read\n\nreadline = sys.stdin.buffer.readline\n\nreadlines = sys.stdin.buffer.readlines\n\nN = int(readline())\n\nS = read().split()\n\n\n\nres = []\n\nc = Counter(S)\n\nmax_num = c.most_common(1)[0][1]\n\nfor i, j in list(c.items()):\n\n if j == max_num:\n\n res.append(i)\n\n \n\nres.sort()\n\n\n\n \n\nprint(('\\n'.join(list([x.decode() for x in res]))))\n", "code_v0_loc": 21, "code_v1_loc": 20, "code_v0_num_chars": 502, "code_v1_num_chars": 421, "code_v0_no_empty_lines": "import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nN = int(readline())\nS = read().split()\nS = sorted(S)\nls = [[] for i in range(N + 1)]\nmax_num = 0\nleft = 0\nright = 0\nwhile right < N:\n while right < N and S[left] == S[right]:\n right += 1\n if (right - left) >= max_num:\n ls[right - left].append(S[left].decode())\n max_num = right - left\n left = right\nprint((\"\\n\".join(ls[max_num])))\n", "code_v1_no_empty_lines": "from collections import Counter\nimport sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nN = int(readline())\nS = read().split()\nres = []\nc = Counter(S)\nmax_num = c.most_common(1)[0][1]\nfor i, j in list(c.items()):\n if j == max_num:\n res.append(i)\nres.sort()\nprint((\"\\n\".join(list([x.decode() for x in res]))))\n", "code_same": false, "relative_loc_diff_percent": 4.7619047619, "diff": ["+from collections import Counter", "-S = sorted(S)", "-ls = [[] for i in range(N + 1)]", "-max_num = 0", "-left = 0", "-right = 0", "-while right < N:", "- while right < N and S[left] == S[right]:", "- right += 1", "- if (right - left) >= max_num:", "- ls[right - left].append(S[left].decode())", "- max_num = right - left", "- left = right", "-print((\"\\n\".join(ls[max_num])))", "+res = []", "+c = Counter(S)", "+max_num = c.most_common(1)[0][1]", "+for i, j in list(c.items()):", "+ if j == max_num:", "+ res.append(i)", "+res.sort()", "+print((\"\\n\".join(list([x.decode() for x in res]))))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2394288239, "measured_runtime_v1": 0.0062145643, "runtime_lift": 38.5270488971, "key": ["s498649498", "s794455280"]} {"user_id": "u021548497", "problem_id": "p02555", "language": "python", "submission_id_v0": "s983449721", "submission_id_v1": "s321084928", "cpu_time_v0": 330, "cpu_time_v1": 30, "memory_v0": 9192, "memory_v1": 9108, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 90.91, "input": "def main():\n\n n = int(input())\n\n \n\n dp = [0]*(n+1)\n\n dp[0] = 1\n\n mod = pow(10, 9) + 7\n\n for i in range(n+1):\n\n for j in range(i-2):\n\n dp[i] += dp[j]\n\n dp[i] %= mod\n\n \n\n print((dp[n]))\n\n\n\nif __name__ == \"__main__\":\n\n main()", "target": "def main():\n\n n = int(input())\n\n \n\n dp = [0]*(n+1)\n\n dp[0] = 1\n\n mod = pow(10, 9) + 7\n\n for i in range(3, n+1):\n\n dp[i] = dp[i-1] + dp[i-3]\n\n dp[i] %= mod\n\n \n\n print((dp[n]))\n\n\n\nif __name__ == \"__main__\":\n\n main()", "code_v0_loc": 15, "code_v1_loc": 14, "code_v0_num_chars": 242, "code_v1_num_chars": 226, "code_v0_no_empty_lines": "def main():\n n = int(input())\n dp = [0] * (n + 1)\n dp[0] = 1\n mod = pow(10, 9) + 7\n for i in range(n + 1):\n for j in range(i - 2):\n dp[i] += dp[j]\n dp[i] %= mod\n print((dp[n]))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "def main():\n n = int(input())\n dp = [0] * (n + 1)\n dp[0] = 1\n mod = pow(10, 9) + 7\n for i in range(3, n + 1):\n dp[i] = dp[i - 1] + dp[i - 3]\n dp[i] %= mod\n print((dp[n]))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 6.6666666667, "diff": ["- for i in range(n + 1):", "- for j in range(i - 2):", "- dp[i] += dp[j]", "- dp[i] %= mod", "+ for i in range(3, n + 1):", "+ dp[i] = dp[i - 1] + dp[i - 3]", "+ dp[i] %= mod"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6721006331, "measured_runtime_v1": 0.344866425, "runtime_lift": 1.9488723295, "key": ["s983449721", "s321084928"]} {"user_id": "u672220554", "problem_id": "p02983", "language": "python", "submission_id_v0": "s554161170", "submission_id_v1": "s606893257", "cpu_time_v0": 990, "cpu_time_v1": 76, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 92.32, "input": "l,r = list(map(int,input().split()))\n\n\n\nif r - l > 2019:\n\n print((0))\n\nelse:\n\n tres = 2019\n\n for i in range(l,r):\n\n for j in range(i+1,r+1):\n\n mod = (i % 2019) * (j % 2019) % 2019\n\n tres = min(tres,mod)\n\n print(tres)\n", "target": "l,r = list(map(int,input().split()))\n\n\n\nif r - l > 2019:\n\n print((0))\n\nelse:\n\n tres = 2019\n\n for i in range(l,r):\n\n for j in range(i+1,r+1):\n\n mod = (i % 2019) * (j % 2019) % 2019\n\n tres = min(tres,mod)\n\n if tres == 0:\n\n break\n\n if tres == 0:\n\n break\n\n print(tres)\n", "code_v0_loc": 11, "code_v1_loc": 15, "code_v0_num_chars": 250, "code_v1_num_chars": 342, "code_v0_no_empty_lines": "l, r = list(map(int, input().split()))\nif r - l > 2019:\n print((0))\nelse:\n tres = 2019\n for i in range(l, r):\n for j in range(i + 1, r + 1):\n mod = (i % 2019) * (j % 2019) % 2019\n tres = min(tres, mod)\n print(tres)\n", "code_v1_no_empty_lines": "l, r = list(map(int, input().split()))\nif r - l > 2019:\n print((0))\nelse:\n tres = 2019\n for i in range(l, r):\n for j in range(i + 1, r + 1):\n mod = (i % 2019) * (j % 2019) % 2019\n tres = min(tres, mod)\n if tres == 0:\n break\n if tres == 0:\n break\n print(tres)\n", "code_same": false, "relative_loc_diff_percent": 26.6666666667, "diff": ["+ if tres == 0:", "+ break", "+ if tres == 0:", "+ break"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2616734529, "measured_runtime_v1": 0.2086780975, "runtime_lift": 1.2539574397, "key": ["s554161170", "s606893257"]} {"user_id": "u254871849", "problem_id": "p03309", "language": "python", "submission_id_v0": "s802702568", "submission_id_v1": "s939867576", "cpu_time_v0": 372, "cpu_time_v1": 200, "memory_v0": 27268, "memory_v1": 25180, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 46.24, "input": "# author: kagemeka \n\n# created: 2019-11-08 14:51:29(JST)\n\n## internal modules\n\nimport sys\n\n# import collections\n\n# import math\n\n# import string\n\n# import bisect\n\n# import re\n\n# import itertools\n\nimport statistics\n\n# import functools\n\n# import operator\n\n## external modules\n\n# import scipy.special # if use comb function on AtCoder, \n\n# import scipy.misc # select scipy.misc.comb (old version) \n\n\n\ndef main():\n\n n, *a = (int(x) for x in sys.stdin.read().split())\n\n \n\n for i in range(n):\n\n a[i] -= (i + 1)\n\n\n\n if n % 2 != 0:\n\n b = statistics.median(a)\n\n else:\n\n if a.count(statistics.median_high(a)) >= a.count(statistics.median_low(a)):\n\n b = statistics.median_high(a)\n\n else:\n\n b = statistics.median_low(a)\n\n \n\n ans = sum([abs(a[i] - b) for i in range(n)])\n\n print(ans)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n # execute only if run as a script\n\n main()\n\n\n\n\n", "target": "import sys\n\n\n\nn, *a = list(map(int, sys.stdin.read().split()))\n\n\n\ndef main():\n\n for i in range(n):\n\n a[i] -= (i + 1)\n\n a.sort()\n\n b = a[n // 2]\n\n res = 0\n\n for i in range(n):\n\n res += abs(a[i] - b)\n\n \n\n return res\n\n \n\nif __name__ == '__main__':\n\n ans = main()\n\n print(ans)", "code_v0_loc": 40, "code_v1_loc": 18, "code_v0_num_chars": 987, "code_v1_num_chars": 310, "code_v0_no_empty_lines": "# author: kagemeka\n# created: 2019-11-08 14:51:29(JST)\n## internal modules\nimport sys\n\n# import collections\n# import math\n# import string\n# import bisect\n# import re\n# import itertools\nimport statistics\n\n# import functools\n# import operator\n## external modules\n# import scipy.special # if use comb function on AtCoder,\n# import scipy.misc # select scipy.misc.comb (old version)\ndef main():\n n, *a = (int(x) for x in sys.stdin.read().split())\n for i in range(n):\n a[i] -= i + 1\n if n % 2 != 0:\n b = statistics.median(a)\n else:\n if a.count(statistics.median_high(a)) >= a.count(statistics.median_low(a)):\n b = statistics.median_high(a)\n else:\n b = statistics.median_low(a)\n ans = sum([abs(a[i] - b) for i in range(n)])\n print(ans)\n\n\nif __name__ == \"__main__\":\n # execute only if run as a script\n main()\n", "code_v1_no_empty_lines": "import sys\n\nn, *a = list(map(int, sys.stdin.read().split()))\n\n\ndef main():\n for i in range(n):\n a[i] -= i + 1\n a.sort()\n b = a[n // 2]\n res = 0\n for i in range(n):\n res += abs(a[i] - b)\n return res\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "code_same": false, "relative_loc_diff_percent": 55.0, "diff": ["-# author: kagemeka", "-# created: 2019-11-08 14:51:29(JST)", "-## internal modules", "-# import collections", "-# import math", "-# import string", "-# import bisect", "-# import re", "-# import itertools", "-import statistics", "+n, *a = list(map(int, sys.stdin.read().split()))", "-# import functools", "-# import operator", "-## external modules", "-# import scipy.special # if use comb function on AtCoder,", "-# import scipy.misc # select scipy.misc.comb (old version)", "+", "- n, *a = (int(x) for x in sys.stdin.read().split())", "- if n % 2 != 0:", "- b = statistics.median(a)", "- else:", "- if a.count(statistics.median_high(a)) >= a.count(statistics.median_low(a)):", "- b = statistics.median_high(a)", "- else:", "- b = statistics.median_low(a)", "- ans = sum([abs(a[i] - b) for i in range(n)])", "- print(ans)", "+ a.sort()", "+ b = a[n // 2]", "+ res = 0", "+ for i in range(n):", "+ res += abs(a[i] - b)", "+ return res", "- # execute only if run as a script", "- main()", "+ ans = main()", "+ print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2726693273, "measured_runtime_v1": 0.2052652476, "runtime_lift": 1.3283755066, "key": ["s802702568", "s939867576"]} {"user_id": "u416758623", "problem_id": "p03416", "language": "python", "submission_id_v0": "s698254896", "submission_id_v1": "s209236188", "cpu_time_v0": 210, "cpu_time_v1": 54, "memory_v0": 3060, "memory_v1": 9152, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 74.29, "input": "def findSumDigit(num):\n\n global total\n\n total = \"\"\n\n while num > 0:\n\n total += str(num % 10)\n\n num //= 10\n\n return total\n\n\n\ndef main():\n\n a,b = list(map(int, input().split()))\n\n ans = 0\n\n for i in range(a,b+1):\n\n tmp = str(findSumDigit(i))\n\n if tmp == str(i):\n\n ans += 1\n\n print(ans)\n\n\n\nif __name__ == '__main__':\n\n main()", "target": "a, b = list(map(int, input().split()))\n\nans = 0\n\n\n\nfor i in range(a,b+1):\n\n seki_gyaku = str(i)\n\n if seki_gyaku == seki_gyaku[::-1]:\n\n ans += 1\n\n\n\nprint(ans)\n", "code_v0_loc": 19, "code_v1_loc": 9, "code_v0_num_chars": 382, "code_v1_num_chars": 165, "code_v0_no_empty_lines": "def findSumDigit(num):\n global total\n total = \"\"\n while num > 0:\n total += str(num % 10)\n num //= 10\n return total\n\n\ndef main():\n a, b = list(map(int, input().split()))\n ans = 0\n for i in range(a, b + 1):\n tmp = str(findSumDigit(i))\n if tmp == str(i):\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\nans = 0\nfor i in range(a, b + 1):\n seki_gyaku = str(i)\n if seki_gyaku == seki_gyaku[::-1]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 52.6315789474, "diff": ["-def findSumDigit(num):", "- global total", "- total = \"\"", "- while num > 0:", "- total += str(num % 10)", "- num //= 10", "- return total", "-", "-", "-def main():", "- a, b = list(map(int, input().split()))", "- ans = 0", "- for i in range(a, b + 1):", "- tmp = str(findSumDigit(i))", "- if tmp == str(i):", "- ans += 1", "- print(ans)", "-", "-", "-if __name__ == \"__main__\":", "- main()", "+a, b = list(map(int, input().split()))", "+ans = 0", "+for i in range(a, b + 1):", "+ seki_gyaku = str(i)", "+ if seki_gyaku == seki_gyaku[::-1]:", "+ ans += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.908202547, "measured_runtime_v1": 0.4125540495, "runtime_lift": 2.2014146949, "key": ["s698254896", "s209236188"]} {"user_id": "u759412327", "problem_id": "p03680", "language": "python", "submission_id_v0": "s086989807", "submission_id_v1": "s510724514", "cpu_time_v0": 397, "cpu_time_v1": 201, "memory_v0": 7084, "memory_v1": 13724, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 49.37, "input": "N = int(input())\n\na = [int(input()) for i in range(N)]\n\nnow = a[0]\n\ncount = 1\n\nc = 0\n\nfor i in range(10**6):\n\n if now != 2:\n\n count += 1\n\n now = a[now - 1]\n\n else:\n\n print(count)\n\n c = 1\n\n break\n\nif c == 0:\n\n print((-1))\n", "target": "N = int(input())\n\na = [0] + [int(input()) for _ in range(N)]\n\nx = 1\n\nvisited = set([1])\n\nanswer = 0\n\n\n\nwhile True:\n\n x = a[x]\n\n if x in visited:\n\n answer = -1\n\n break\n\n visited.add(x)\n\n answer += 1\n\n if x == 2:\n\n break\n\n \n\nprint(answer)\n", "code_v0_loc": 15, "code_v1_loc": 17, "code_v0_num_chars": 263, "code_v1_num_chars": 254, "code_v0_no_empty_lines": "N = int(input())\na = [int(input()) for i in range(N)]\nnow = a[0]\ncount = 1\nc = 0\nfor i in range(10**6):\n if now != 2:\n count += 1\n now = a[now - 1]\n else:\n print(count)\n c = 1\n break\nif c == 0:\n print((-1))\n", "code_v1_no_empty_lines": "N = int(input())\na = [0] + [int(input()) for _ in range(N)]\nx = 1\nvisited = set([1])\nanswer = 0\nwhile True:\n x = a[x]\n if x in visited:\n answer = -1\n break\n visited.add(x)\n answer += 1\n if x == 2:\n break\nprint(answer)\n", "code_same": false, "relative_loc_diff_percent": 11.7647058824, "diff": ["-a = [int(input()) for i in range(N)]", "-now = a[0]", "-count = 1", "-c = 0", "-for i in range(10**6):", "- if now != 2:", "- count += 1", "- now = a[now - 1]", "- else:", "- print(count)", "- c = 1", "+a = [0] + [int(input()) for _ in range(N)]", "+x = 1", "+visited = set([1])", "+answer = 0", "+while True:", "+ x = a[x]", "+ if x in visited:", "+ answer = -1", "-if c == 0:", "- print((-1))", "+ visited.add(x)", "+ answer += 1", "+ if x == 2:", "+ break", "+print(answer)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.8020722582, "measured_runtime_v1": 0.2096916373, "runtime_lift": 3.8250083246, "key": ["s086989807", "s510724514"]} {"user_id": "u860002137", "problem_id": "p02952", "language": "python", "submission_id_v0": "s726498671", "submission_id_v1": "s714071292", "cpu_time_v0": 61, "cpu_time_v1": 26, "memory_v0": 2940, "memory_v1": 9004, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 57.38, "input": "N = int(input())\n\n\n\nans = 0\n\n\n\nfor i in range(1, N+1):\n\n if len(str(i))%2==1:\n\n ans += 1\n\n\n\nprint(ans)", "target": "import sys\n\n\n\n\n\ndef rec(length):\n\n if length == 1:\n\n return 9\n\n else:\n\n return 9 * 10**(length - 1) + rec(length - 2)\n\n\n\n\n\nn = input()\n\nlength = len(n)\n\n\n\nif length == 1:\n\n print(n)\n\n sys.exit()\n\n\n\nif length % 2 == 0:\n\n ans = rec(length - 1)\n\nelse:\n\n ans = rec(length - 2) + int(n) - int(\"1\" + \"0\" * (length - 1)) + 1\n\n\n\nprint(ans)", "code_v0_loc": 9, "code_v1_loc": 23, "code_v0_num_chars": 112, "code_v1_num_chars": 363, "code_v0_no_empty_lines": "N = int(input())\nans = 0\nfor i in range(1, N + 1):\n if len(str(i)) % 2 == 1:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "import sys\n\n\ndef rec(length):\n if length == 1:\n return 9\n else:\n return 9 * 10 ** (length - 1) + rec(length - 2)\n\n\nn = input()\nlength = len(n)\nif length == 1:\n print(n)\n sys.exit()\nif length % 2 == 0:\n ans = rec(length - 1)\nelse:\n ans = rec(length - 2) + int(n) - int(\"1\" + \"0\" * (length - 1)) + 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 60.8695652174, "diff": ["-N = int(input())", "-ans = 0", "-for i in range(1, N + 1):", "- if len(str(i)) % 2 == 1:", "- ans += 1", "+import sys", "+", "+", "+def rec(length):", "+ if length == 1:", "+ return 9", "+ else:", "+ return 9 * 10 ** (length - 1) + rec(length - 2)", "+", "+", "+n = input()", "+length = len(n)", "+if length == 1:", "+ print(n)", "+ sys.exit()", "+if length % 2 == 0:", "+ ans = rec(length - 1)", "+else:", "+ ans = rec(length - 2) + int(n) - int(\"1\" + \"0\" * (length - 1)) + 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2155013096, "measured_runtime_v1": 0.1672313638, "runtime_lift": 1.2886417043, "key": ["s726498671", "s714071292"]} {"user_id": "u761320129", "problem_id": "p03425", "language": "python", "submission_id_v0": "s293375746", "submission_id_v1": "s279901441", "cpu_time_v0": 180, "cpu_time_v1": 149, "memory_v0": 10112, "memory_v1": 10876, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.22, "input": "import itertools\n\nfrom collections import Counter\n\nN = int(input())\n\nsrc = [input() for i in range(N)]\n\nctr = Counter()\n\nfor s in src:\n\n ctr[s[0]] += 1\n\n\n\nans = 0\n\nfor ptn in itertools.combinations('MARCH',3):\n\n a,b,c = ptn\n\n ans += ctr[a]*ctr[b]*ctr[c]\n\nprint(ans)", "target": "N = int(input())\n\nS = [input() for i in range(N)]\n\nfrom collections import Counter\n\nctr = Counter([s[0] for s in S])\n\n\n\nans = 0\n\nimport itertools\n\nfor ptn in itertools.combinations('MARCH', 3):\n\n t = 1\n\n for c in ptn:\n\n t *= ctr[c]\n\n ans += t\n\nprint(ans)", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 274, "code_v1_num_chars": 270, "code_v0_no_empty_lines": "import itertools\nfrom collections import Counter\n\nN = int(input())\nsrc = [input() for i in range(N)]\nctr = Counter()\nfor s in src:\n ctr[s[0]] += 1\nans = 0\nfor ptn in itertools.combinations(\"MARCH\", 3):\n a, b, c = ptn\n ans += ctr[a] * ctr[b] * ctr[c]\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nS = [input() for i in range(N)]\nfrom collections import Counter\n\nctr = Counter([s[0] for s in S])\nans = 0\nimport itertools\n\nfor ptn in itertools.combinations(\"MARCH\", 3):\n t = 1\n for c in ptn:\n t *= ctr[c]\n ans += t\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-import itertools", "+N = int(input())", "+S = [input() for i in range(N)]", "-N = int(input())", "-src = [input() for i in range(N)]", "-ctr = Counter()", "-for s in src:", "- ctr[s[0]] += 1", "+ctr = Counter([s[0] for s in S])", "+import itertools", "+", "- a, b, c = ptn", "- ans += ctr[a] * ctr[b] * ctr[c]", "+ t = 1", "+ for c in ptn:", "+ t *= ctr[c]", "+ ans += t"], "diff_only_import_comment": false, "measured_runtime_v0": 0.206595207, "measured_runtime_v1": 0.1454657862, "runtime_lift": 1.420232292, "key": ["s293375746", "s279901441"]} {"user_id": "u047102107", "problem_id": "p02952", "language": "python", "submission_id_v0": "s855248831", "submission_id_v1": "s153783643", "cpu_time_v0": 193, "cpu_time_v1": 64, "memory_v0": 40812, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 66.84, "input": "N = int(input())\n\n\n\ncount = 0\n\nfor i in range(1, N + 1):\n\n num_dig = 0\n\n ii = i\n\n while ii > 0:\n\n ii = int(ii / 10)\n\n num_dig += 1\n\n if num_dig % 2 != 0:\n\n count += 1\n\n\n\nprint(count)", "target": "N = int(input())\n\n\n\ncount = 0\n\nfor i in range(1, N + 1):\n\n if len(str(i)) % 2 != 0:\n\n count += 1\n\nprint(count)", "code_v0_loc": 13, "code_v1_loc": 7, "code_v0_num_chars": 215, "code_v1_num_chars": 120, "code_v0_no_empty_lines": "N = int(input())\ncount = 0\nfor i in range(1, N + 1):\n num_dig = 0\n ii = i\n while ii > 0:\n ii = int(ii / 10)\n num_dig += 1\n if num_dig % 2 != 0:\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "N = int(input())\ncount = 0\nfor i in range(1, N + 1):\n if len(str(i)) % 2 != 0:\n count += 1\nprint(count)\n", "code_same": false, "relative_loc_diff_percent": 46.1538461538, "diff": ["- num_dig = 0", "- ii = i", "- while ii > 0:", "- ii = int(ii / 10)", "- num_dig += 1", "- if num_dig % 2 != 0:", "+ if len(str(i)) % 2 != 0:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3673675511, "measured_runtime_v1": 0.2702338476, "runtime_lift": 1.3594431427, "key": ["s855248831", "s153783643"]} {"user_id": "u372550522", "problem_id": "p02801", "language": "python", "submission_id_v0": "s439687684", "submission_id_v1": "s397132828", "cpu_time_v0": 25, "cpu_time_v1": 17, "memory_v0": 3768, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 32.0, "input": "from string import ascii_lowercase as lower\n\nprint((lower[lower.find(input())+1]))", "target": "print((chr(ord(input())+1)))", "code_v0_loc": 2, "code_v1_loc": 1, "code_v0_num_chars": 80, "code_v1_num_chars": 26, "code_v0_no_empty_lines": "from string import ascii_lowercase as lower\n\nprint((lower[lower.find(input()) + 1]))\n", "code_v1_no_empty_lines": "print((chr(ord(input()) + 1)))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-from string import ascii_lowercase as lower", "-", "-print((lower[lower.find(input()) + 1]))", "+print((chr(ord(input()) + 1)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3241319713, "measured_runtime_v1": 0.2361063808, "runtime_lift": 1.3728217348, "key": ["s439687684", "s397132828"]} {"user_id": "u419874471", "problem_id": "p04012", "language": "python", "submission_id_v0": "s872816747", "submission_id_v1": "s223982270", "cpu_time_v0": 32, "cpu_time_v1": 17, "memory_v0": 3956, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 46.88, "input": "import string\n\nw = input()\n\nfor a in string.ascii_lowercase:\n\n cnt = 0\n\n for t in w:\n\n if t == a:\n\n cnt = cnt + 1\n\n if cnt % 2 == 1:\n\n print(\"No\")\n\n exit()\n\n\n\nprint(\"Yes\")", "target": "w = input()\n\nm = [0] * 26\n\nfor t in w:\n\n m[ord(t) - ord('a')] += 1\n\n\n\nfor cnt in m:\n\n if cnt % 2 == 1:\n\n print(\"No\")\n\n exit()\n\n\n\nprint(\"Yes\")", "code_v0_loc": 12, "code_v1_loc": 11, "code_v0_num_chars": 212, "code_v1_num_chars": 161, "code_v0_no_empty_lines": "import string\n\nw = input()\nfor a in string.ascii_lowercase:\n cnt = 0\n for t in w:\n if t == a:\n cnt = cnt + 1\n if cnt % 2 == 1:\n print(\"No\")\n exit()\nprint(\"Yes\")\n", "code_v1_no_empty_lines": "w = input()\nm = [0] * 26\nfor t in w:\n m[ord(t) - ord(\"a\")] += 1\nfor cnt in m:\n if cnt % 2 == 1:\n print(\"No\")\n exit()\nprint(\"Yes\")\n", "code_same": false, "relative_loc_diff_percent": 8.3333333333, "diff": ["-import string", "-", "-for a in string.ascii_lowercase:", "- cnt = 0", "- for t in w:", "- if t == a:", "- cnt = cnt + 1", "+m = [0] * 26", "+for t in w:", "+ m[ord(t) - ord(\"a\")] += 1", "+for cnt in m:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2442542629, "measured_runtime_v1": 0.193693031, "runtime_lift": 1.2610379509, "key": ["s872816747", "s223982270"]} {"user_id": "u133936772", "problem_id": "p03013", "language": "python", "submission_id_v0": "s323963688", "submission_id_v1": "s220101257", "cpu_time_v0": 187, "cpu_time_v1": 70, "memory_v0": 3828, "memory_v1": 3828, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 62.57, "input": "mod = 10**9+7\n\nn, m = list(map(int, input().split()))\n\nl = [0]*n\n\nfor _ in range(m):\n\n l[int(input())-1] = 1\n\n\n\ns = 0\n\nt = 1\n\n\n\nfor i in range(n):\n\n if l[i] > 0:\n\n t, s = 0, t\n\n else:\n\n t, s = (s+t)%mod, t\n\n\n\nprint(t)", "target": "import sys\n\ninput = sys.stdin.readline\n\n\n\nmod = 10**9+7\n\nn, m = list(map(int, input().split()))\n\nl = [0]*n\n\nfor _ in range(m):\n\n l[int(input())-1] = 1\n\n\n\nt, s = 1, 0\n\n\n\nfor i in range(n):\n\n if l[i]:\n\n t, s = 0, t\n\n else:\n\n t, s = (s+t)%mod, t\n\n\n\nprint(t)", "code_v0_loc": 16, "code_v1_loc": 18, "code_v0_num_chars": 220, "code_v1_num_chars": 257, "code_v0_no_empty_lines": "mod = 10**9 + 7\nn, m = list(map(int, input().split()))\nl = [0] * n\nfor _ in range(m):\n l[int(input()) - 1] = 1\ns = 0\nt = 1\nfor i in range(n):\n if l[i] > 0:\n t, s = 0, t\n else:\n t, s = (s + t) % mod, t\nprint(t)\n", "code_v1_no_empty_lines": "import sys\n\ninput = sys.stdin.readline\nmod = 10**9 + 7\nn, m = list(map(int, input().split()))\nl = [0] * n\nfor _ in range(m):\n l[int(input()) - 1] = 1\nt, s = 1, 0\nfor i in range(n):\n if l[i]:\n t, s = 0, t\n else:\n t, s = (s + t) % mod, t\nprint(t)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["+import sys", "+", "+input = sys.stdin.readline", "-s = 0", "-t = 1", "+t, s = 1, 0", "- if l[i] > 0:", "+ if l[i]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3071881404, "measured_runtime_v1": 0.1884790037, "runtime_lift": 1.6298268475, "key": ["s323963688", "s220101257"]} {"user_id": "u911856499", "problem_id": "p03774", "language": "python", "submission_id_v0": "s205905114", "submission_id_v1": "s474977819", "cpu_time_v0": 31, "cpu_time_v1": 26, "memory_v0": 9140, "memory_v1": 9144, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.13, "input": "N,M = [int(c) for c in input().split()]\n\nab = [list(map(int,input().split())) for c in range(N)]\n\ncd = [list(map(int,input().split())) for c in range(M)]\n\nfor i in range(N):\n\n mi = 2*10**9\n\n for j in range(M):\n\n tmp = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])\n\n if mi > tmp:\n\n mi = tmp\n\n ans = j+1\n\n print(ans)\n", "target": "N,M = [int(c) for c in input().split()]\n\nab = [list(map(int,input().split())) for c in range(N)]\n\ncd = [list(map(int,input().split())) for c in range(M)]\n\nfor i in range(N):\n\n mi = 10**9\n\n for j in range(M):\n\n tmp = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])\n\n if mi > tmp:\n\n mi = tmp\n\n ans = j+1\n\n print(ans)\n", "code_v0_loc": 11, "code_v1_loc": 11, "code_v0_num_chars": 360, "code_v1_num_chars": 358, "code_v0_no_empty_lines": "N, M = [int(c) for c in input().split()]\nab = [list(map(int, input().split())) for c in range(N)]\ncd = [list(map(int, input().split())) for c in range(M)]\nfor i in range(N):\n mi = 2 * 10**9\n for j in range(M):\n tmp = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])\n if mi > tmp:\n mi = tmp\n ans = j + 1\n print(ans)\n", "code_v1_no_empty_lines": "N, M = [int(c) for c in input().split()]\nab = [list(map(int, input().split())) for c in range(N)]\ncd = [list(map(int, input().split())) for c in range(M)]\nfor i in range(N):\n mi = 10**9\n for j in range(M):\n tmp = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])\n if mi > tmp:\n mi = tmp\n ans = j + 1\n print(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- mi = 2 * 10**9", "+ mi = 10**9"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2982070241, "measured_runtime_v1": 0.232865705, "runtime_lift": 1.2805965742, "key": ["s205905114", "s474977819"]} {"user_id": "u187857228", "problem_id": "p03416", "language": "python", "submission_id_v0": "s720217601", "submission_id_v1": "s964731712", "cpu_time_v0": 154, "cpu_time_v1": 57, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 62.99, "input": "def test():\n\n a,b = list(map(int,input().split()))\n\n count = 0\n\n for i in range(a,b+1):\n\n j = list(map(int,list(str(i))))\n\n if j[0] == j[4] and j[1] == j[3]:\n\n count += 1\n\n print(count)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n test()\n", "target": "def test():\n\n a,b = list(map(int,input().split()))\n\n count = 0\n\n for i in range(a,b+1):\n\n if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:\n\n count += 1\n\n print(count)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n test()\n", "code_v0_loc": 12, "code_v1_loc": 11, "code_v0_num_chars": 261, "code_v1_num_chars": 240, "code_v0_no_empty_lines": "def test():\n a, b = list(map(int, input().split()))\n count = 0\n for i in range(a, b + 1):\n j = list(map(int, list(str(i))))\n if j[0] == j[4] and j[1] == j[3]:\n count += 1\n print(count)\n\n\nif __name__ == \"__main__\":\n test()\n", "code_v1_no_empty_lines": "def test():\n a, b = list(map(int, input().split()))\n count = 0\n for i in range(a, b + 1):\n if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:\n count += 1\n print(count)\n\n\nif __name__ == \"__main__\":\n test()\n", "code_same": false, "relative_loc_diff_percent": 8.3333333333, "diff": ["- j = list(map(int, list(str(i))))", "- if j[0] == j[4] and j[1] == j[3]:", "+ if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4881631348, "measured_runtime_v1": 0.3868406759, "runtime_lift": 1.2619229704, "key": ["s720217601", "s964731712"]} {"user_id": "u624475441", "problem_id": "p03548", "language": "python", "submission_id_v0": "s161926153", "submission_id_v1": "s067842786", "cpu_time_v0": 36, "cpu_time_v1": 18, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 50.0, "input": "X, Y, Z = list(map(int, input().split()))\n\nfor n in range(10 ** 5, 0, -1):\n\n if X >= n * (Y + Z) + Z:\n\n break\n\nprint(n)", "target": "X, Y, Z = list(map(int, input().split()))\n\nprint(((X - Z) // (Y + Z)))", "code_v0_loc": 5, "code_v1_loc": 2, "code_v0_num_chars": 123, "code_v1_num_chars": 62, "code_v0_no_empty_lines": "X, Y, Z = list(map(int, input().split()))\nfor n in range(10**5, 0, -1):\n if X >= n * (Y + Z) + Z:\n break\nprint(n)\n", "code_v1_no_empty_lines": "X, Y, Z = list(map(int, input().split()))\nprint(((X - Z) // (Y + Z)))\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-for n in range(10**5, 0, -1):", "- if X >= n * (Y + Z) + Z:", "- break", "-print(n)", "+print(((X - Z) // (Y + Z)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4167550103, "measured_runtime_v1": 0.2488601058, "runtime_lift": 1.6746557624, "key": ["s161926153", "s067842786"]} {"user_id": "u465961647", "problem_id": "p02576", "language": "python", "submission_id_v0": "s578033438", "submission_id_v1": "s457299018", "cpu_time_v0": 28, "cpu_time_v1": 25, "memory_v0": 9032, "memory_v1": 9096, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.71, "input": "array = list(map(int, input().split()))\n\nif array[0] % array[1] > 0:\n\n print(((array[0] // array[1] + 1) * array[2]))\n\nelse:\n\n print(((array[0] // array[1]) * array[2]))", "target": "n, x, t = list(map(int, input().split()))\n\n\n\nprint((0--n//x*t))", "code_v0_loc": 5, "code_v1_loc": 3, "code_v0_num_chars": 171, "code_v1_num_chars": 55, "code_v0_no_empty_lines": "array = list(map(int, input().split()))\nif array[0] % array[1] > 0:\n print(((array[0] // array[1] + 1) * array[2]))\nelse:\n print(((array[0] // array[1]) * array[2]))\n", "code_v1_no_empty_lines": "n, x, t = list(map(int, input().split()))\nprint((0 - -n // x * t))\n", "code_same": false, "relative_loc_diff_percent": 40.0, "diff": ["-array = list(map(int, input().split()))", "-if array[0] % array[1] > 0:", "- print(((array[0] // array[1] + 1) * array[2]))", "-else:", "- print(((array[0] // array[1]) * array[2]))", "+n, x, t = list(map(int, input().split()))", "+print((0 - -n // x * t))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1827679622, "measured_runtime_v1": 0.0061908547, "runtime_lift": 29.5222502437, "key": ["s578033438", "s457299018"]} {"user_id": "u924353076", "problem_id": "p03796", "language": "python", "submission_id_v0": "s982585501", "submission_id_v1": "s413088188", "cpu_time_v0": 118, "cpu_time_v1": 40, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 66.1, "input": "n=input()\n\nn=int(n)\n\na=1\n\nfor i in range(n):\n\n a=a*(i+1)\n\n if a>=pow(10,9)+7:\n\n a=a%(pow(10,9)+7)\n\nprint(a)", "target": "n=int(input())\n\na=1\n\nfor i in range(1,n+1):\n\n a*=i\n\n a %= (10**9+7)\n\nprint(a)", "code_v0_loc": 8, "code_v1_loc": 6, "code_v0_num_chars": 120, "code_v1_num_chars": 83, "code_v0_no_empty_lines": "n = input()\nn = int(n)\na = 1\nfor i in range(n):\n a = a * (i + 1)\n if a >= pow(10, 9) + 7:\n a = a % (pow(10, 9) + 7)\nprint(a)\n", "code_v1_no_empty_lines": "n = int(input())\na = 1\nfor i in range(1, n + 1):\n a *= i\n a %= 10**9 + 7\nprint(a)\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-n = input()", "-n = int(n)", "+n = int(input())", "-for i in range(n):", "- a = a * (i + 1)", "- if a >= pow(10, 9) + 7:", "- a = a % (pow(10, 9) + 7)", "+for i in range(1, n + 1):", "+ a *= i", "+ a %= 10**9 + 7"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4161043401, "measured_runtime_v1": 0.2489673834, "runtime_lift": 1.6713206943, "key": ["s982585501", "s413088188"]} {"user_id": "u935184340", "problem_id": "p00003", "language": "python", "submission_id_v0": "s695745765", "submission_id_v1": "s444816349", "cpu_time_v0": 40, "cpu_time_v1": 30, "memory_v0": 7832, "memory_v1": 7708, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 25.0, "input": "import sys\n\nr = []\n\nn = int(input())\n\nl = sys.stdin.readlines()\n\nfor i in l:\n\n x, y, z = sorted([x*x for x in list(map(int, i.split()))])\n\n if x + y == z:\n\n print(\"YES\")\n\n else:\n\n print(\"NO\")", "target": "import sys\n\n\n\nn = int(input())\n\nl = sys.stdin.readlines()\n\ns = \"\"\n\nfor i in l:\n\n x, y, z = sorted(map(lambda x:x*x,map(int, i.split())))\n\n if x + y == z:\n\n s += \"YES\\n\"\n\n else:\n\n s += \"NO\\n\"\n\n\n\nprint(s,end=\"\")\n", "code_v0_loc": 10, "code_v1_loc": 13, "code_v0_num_chars": 201, "code_v1_num_chars": 222, "code_v0_no_empty_lines": "import sys\n\nr = []\nn = int(input())\nl = sys.stdin.readlines()\nfor i in l:\n x, y, z = sorted([x * x for x in list(map(int, i.split()))])\n if x + y == z:\n print(\"YES\")\n else:\n print(\"NO\")\n", "code_v1_no_empty_lines": "import sys\n\nn = int(input())\nl = sys.stdin.readlines()\ns = \"\"\nfor i in l:\n x, y, z = sorted(map(lambda x: x * x, map(int, i.split())))\n if x + y == z:\n s += \"YES\\n\"\n else:\n s += \"NO\\n\"\nprint(s, end=\"\")\n", "code_same": false, "relative_loc_diff_percent": 23.0769230769, "diff": ["-r = []", "-n = int(input())", "+n = int(input())", "+s = \"\"", "- x, y, z = sorted([x * x for x in list(map(int, i.split()))])", "+ x, y, z = sorted(map(lambda x: x * x, map(int, i.split())))", "- print(\"YES\")", "+ s += \"YES\\n\"", "- print(\"NO\")", "+ s += \"NO\\n\"", "+print(s, end=\"\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3577006006, "measured_runtime_v1": 0.2704619627, "runtime_lift": 1.3225541848, "key": ["s695745765", "s444816349"]} {"user_id": "u243699903", "problem_id": "p03371", "language": "python", "submission_id_v0": "s088381244", "submission_id_v1": "s357905210", "cpu_time_v0": 104, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.65, "input": "a,b,c,x,y=list(map(int,input().split()))\n\n\n\nans=a*x+b*y\n\nfor ci in range(max(x,y)+1):\n\n sumc = 2*ci*c\n\n sumc += (x-ci)*a if (x-ci)>0 else 0\n\n sumc += (y-ci)*b if (y-ci)>0 else 0\n\n ans=min(ans,sumc)\n\n\n\nprint(ans)", "target": "a,b,c,x,y=list(map(int,input().split()))\n\nans=a*x+b*y\n\nif x==y:\n\n ans=min(ans,2*x*c)\n\nelif x>y:\n\n ans=min(ans,a*(x-y)+2*y*c)\n\n ans=min(ans,2*x*c)\n\nelse:\n\n ans=min(ans,b*(y-x)+2*x*c)\n\n ans=min(ans,2*y*c)\n\nprint(ans)", "code_v0_loc": 10, "code_v1_loc": 11, "code_v0_num_chars": 217, "code_v1_num_chars": 223, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = a * x + b * y\nfor ci in range(max(x, y) + 1):\n sumc = 2 * ci * c\n sumc += (x - ci) * a if (x - ci) > 0 else 0\n sumc += (y - ci) * b if (y - ci) > 0 else 0\n ans = min(ans, sumc)\nprint(ans)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = a * x + b * y\nif x == y:\n ans = min(ans, 2 * x * c)\nelif x > y:\n ans = min(ans, a * (x - y) + 2 * y * c)\n ans = min(ans, 2 * x * c)\nelse:\n ans = min(ans, b * (y - x) + 2 * x * c)\n ans = min(ans, 2 * y * c)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 9.0909090909, "diff": ["-for ci in range(max(x, y) + 1):", "- sumc = 2 * ci * c", "- sumc += (x - ci) * a if (x - ci) > 0 else 0", "- sumc += (y - ci) * b if (y - ci) > 0 else 0", "- ans = min(ans, sumc)", "+if x == y:", "+ ans = min(ans, 2 * x * c)", "+elif x > y:", "+ ans = min(ans, a * (x - y) + 2 * y * c)", "+ ans = min(ans, 2 * x * c)", "+else:", "+ ans = min(ans, b * (y - x) + 2 * x * c)", "+ ans = min(ans, 2 * y * c)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2025436199, "measured_runtime_v1": 0.1559800074, "runtime_lift": 1.2985229532, "key": ["s088381244", "s357905210"]} {"user_id": "u193598069", "problem_id": "p03544", "language": "python", "submission_id_v0": "s403516424", "submission_id_v1": "s258691406", "cpu_time_v0": 27, "cpu_time_v1": 17, "memory_v0": 10740, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 37.04, "input": "N = int(input())\n\nL = [ 0 ] * 1000000\n\n\n\nL[0] = 2\n\nL[1] = 1\n\n\n\nfor i in range(2, N+1):\n\n L[i] = L[i-2] + L[i-1]\n\n\n\nprint((L[N]))\n", "target": "N = int(input())\n\nL = [ 0 ] * (N+1)\n\n\n\nL[0] = 2\n\nL[1] = 1\n\n\n\nfor i in range(2, N+1):\n\n L[i] = L[i-2] + L[i-1]\n\n\n\nprint((L[N]))\n", "code_v0_loc": 10, "code_v1_loc": 10, "code_v0_num_chars": 129, "code_v1_num_chars": 127, "code_v0_no_empty_lines": "N = int(input())\nL = [0] * 1000000\nL[0] = 2\nL[1] = 1\nfor i in range(2, N + 1):\n L[i] = L[i - 2] + L[i - 1]\nprint((L[N]))\n", "code_v1_no_empty_lines": "N = int(input())\nL = [0] * (N + 1)\nL[0] = 2\nL[1] = 1\nfor i in range(2, N + 1):\n L[i] = L[i - 2] + L[i - 1]\nprint((L[N]))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-L = [0] * 1000000", "+L = [0] * (N + 1)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4811118691, "measured_runtime_v1": 0.3226976706, "runtime_lift": 1.4909059249, "key": ["s403516424", "s258691406"]} {"user_id": "u218834617", "problem_id": "p03013", "language": "python", "submission_id_v0": "s048931274", "submission_id_v1": "s960526895", "cpu_time_v0": 127, "cpu_time_v1": 59, "memory_v0": 17264, "memory_v1": 17228, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 53.54, "input": "import sys\n\nN,M=list(map(int,input().split()))\n\nS=set(map(int,sys.stdin))\n\n\n\na,b=0,1\n\nfor i in range(1,N+1):\n\n if i in S:\n\n a,b=b,0\n\n else:\n\n a,b=b,a+b\n\n\n\nprint((b%(10**9+7)))\n", "target": "import sys\n\n\n\nN,M=list(map(int,input().split()))\n\nbad=set(map(int,sys.stdin))\n\nMOD=10**9+7\n\n\n\na,b=0,1\n\nfor i in range(1,N+1):\n\n if i in bad:\n\n a,b=b,0\n\n if a==0:\n\n break\n\n else:\n\n a,b=b,(a+b)%MOD\n\n\n\nprint(b)\n", "code_v0_loc": 12, "code_v1_loc": 16, "code_v0_num_chars": 188, "code_v1_num_chars": 240, "code_v0_no_empty_lines": "import sys\n\nN, M = list(map(int, input().split()))\nS = set(map(int, sys.stdin))\na, b = 0, 1\nfor i in range(1, N + 1):\n if i in S:\n a, b = b, 0\n else:\n a, b = b, a + b\nprint((b % (10**9 + 7)))\n", "code_v1_no_empty_lines": "import sys\n\nN, M = list(map(int, input().split()))\nbad = set(map(int, sys.stdin))\nMOD = 10**9 + 7\na, b = 0, 1\nfor i in range(1, N + 1):\n if i in bad:\n a, b = b, 0\n if a == 0:\n break\n else:\n a, b = b, (a + b) % MOD\nprint(b)\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-S = set(map(int, sys.stdin))", "+bad = set(map(int, sys.stdin))", "+MOD = 10**9 + 7", "- if i in S:", "+ if i in bad:", "+ if a == 0:", "+ break", "- a, b = b, a + b", "-print((b % (10**9 + 7)))", "+ a, b = b, (a + b) % MOD", "+print(b)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3212681165, "measured_runtime_v1": 0.212405349, "runtime_lift": 1.5125236626, "key": ["s048931274", "s960526895"]} {"user_id": "u813384600", "problem_id": "p01138", "language": "python", "submission_id_v0": "s409826221", "submission_id_v1": "s148489336", "cpu_time_v0": 6790, "cpu_time_v1": 260, "memory_v0": 9596, "memory_v1": 7608, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 96.17, "input": "import re\n\n\n\nwhile True:\n\n n = int(input())\n\n if n == 0:\n\n break\n\n l = [0] * (24*60*60+1)\n\n for _ in range(n):\n\n h1,m1,s1,h2,m2,s2 = list(map(int, re.split(':| ', input())))\n\n l[h1*60*60 + m1*60 + s1] += 1\n\n l[h2*60*60 + m2*60 + s2] -= 1\n\n r = 0\n\n for i in range(24*60*60):\n\n l[i+1] += l[i]\n\n r = max(r, l[i+1])\n\n print(r)", "target": "while True:\n\n n = int(input())\n\n if n == 0:\n\n break\n\n l = []\n\n for _ in range(n):\n\n hms1, hms2 = input().split()\n\n l.append((hms1, True))\n\n l.append((hms2, False))\n\n l.sort()\n\n r, t = 0, 0\n\n for i in range(len(l)):\n\n if l[i][1]:\n\n t += 1\n\n else:\n\n t -= 1\n\n r = max(r, t)\n\n print(r)", "code_v0_loc": 16, "code_v1_loc": 18, "code_v0_num_chars": 386, "code_v1_num_chars": 383, "code_v0_no_empty_lines": "import re\n\nwhile True:\n n = int(input())\n if n == 0:\n break\n l = [0] * (24 * 60 * 60 + 1)\n for _ in range(n):\n h1, m1, s1, h2, m2, s2 = list(map(int, re.split(\":| \", input())))\n l[h1 * 60 * 60 + m1 * 60 + s1] += 1\n l[h2 * 60 * 60 + m2 * 60 + s2] -= 1\n r = 0\n for i in range(24 * 60 * 60):\n l[i + 1] += l[i]\n r = max(r, l[i + 1])\n print(r)\n", "code_v1_no_empty_lines": "while True:\n n = int(input())\n if n == 0:\n break\n l = []\n for _ in range(n):\n hms1, hms2 = input().split()\n l.append((hms1, True))\n l.append((hms2, False))\n l.sort()\n r, t = 0, 0\n for i in range(len(l)):\n if l[i][1]:\n t += 1\n else:\n t -= 1\n r = max(r, t)\n print(r)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-import re", "-", "- l = [0] * (24 * 60 * 60 + 1)", "+ l = []", "- h1, m1, s1, h2, m2, s2 = list(map(int, re.split(\":| \", input())))", "- l[h1 * 60 * 60 + m1 * 60 + s1] += 1", "- l[h2 * 60 * 60 + m2 * 60 + s2] -= 1", "- r = 0", "- for i in range(24 * 60 * 60):", "- l[i + 1] += l[i]", "- r = max(r, l[i + 1])", "+ hms1, hms2 = input().split()", "+ l.append((hms1, True))", "+ l.append((hms2, False))", "+ l.sort()", "+ r, t = 0, 0", "+ for i in range(len(l)):", "+ if l[i][1]:", "+ t += 1", "+ else:", "+ t -= 1", "+ r = max(r, t)"], "diff_only_import_comment": false, "measured_runtime_v0": 1.2066217821, "measured_runtime_v1": 0.2932185929, "runtime_lift": 4.1150930102, "key": ["s409826221", "s148489336"]} {"user_id": "u242518667", "problem_id": "p03424", "language": "python", "submission_id_v0": "s488879497", "submission_id_v1": "s152130126", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "n=int(input())\n\ns=list(map(str,input().split()))\n\ntotal=[]\n\nfor i in range(n):\n\n if s[i] not in total:\n\n total.append(s[i])\n\nprint(('Three' if len(total)==3 else 'Four'))", "target": "input()\n\nl=list(map(str,input().split()))\n\nprint(('Three' if len(set(l))==3 else 'Four'))", "code_v0_loc": 7, "code_v1_loc": 3, "code_v0_num_chars": 178, "code_v1_num_chars": 81, "code_v0_no_empty_lines": "n = int(input())\ns = list(map(str, input().split()))\ntotal = []\nfor i in range(n):\n if s[i] not in total:\n total.append(s[i])\nprint((\"Three\" if len(total) == 3 else \"Four\"))\n", "code_v1_no_empty_lines": "input()\nl = list(map(str, input().split()))\nprint((\"Three\" if len(set(l)) == 3 else \"Four\"))\n", "code_same": false, "relative_loc_diff_percent": 57.1428571429, "diff": ["-n = int(input())", "-s = list(map(str, input().split()))", "-total = []", "-for i in range(n):", "- if s[i] not in total:", "- total.append(s[i])", "-print((\"Three\" if len(total) == 3 else \"Four\"))", "+input()", "+l = list(map(str, input().split()))", "+print((\"Three\" if len(set(l)) == 3 else \"Four\"))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3119253957, "measured_runtime_v1": 0.2361336248, "runtime_lift": 1.3209698364, "key": ["s488879497", "s152130126"]} {"user_id": "u882209234", "problem_id": "p03796", "language": "python", "submission_id_v0": "s179415880", "submission_id_v1": "s895771571", "cpu_time_v0": 230, "cpu_time_v1": 42, "memory_v0": 3984, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 81.74, "input": "from math import factorial\n\nN = int(input())\n\nprint((factorial(N) % (10**9 + 7)))", "target": "from math import factorial\n\nN = int(input())\n\nans = 1\n\nfor i in range(1,N+1):\n\n ans *= i % (10**9 + 7)\n\n ans %= 10**9 + 7\n\nprint(ans)", "code_v0_loc": 3, "code_v1_loc": 7, "code_v0_num_chars": 79, "code_v1_num_chars": 139, "code_v0_no_empty_lines": "from math import factorial\n\nN = int(input())\nprint((factorial(N) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "from math import factorial\n\nN = int(input())\nans = 1\nfor i in range(1, N + 1):\n ans *= i % (10**9 + 7)\n ans %= 10**9 + 7\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 57.1428571429, "diff": ["-print((factorial(N) % (10**9 + 7)))", "+ans = 1", "+for i in range(1, N + 1):", "+ ans *= i % (10**9 + 7)", "+ ans %= 10**9 + 7", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.9434056597, "measured_runtime_v1": 0.3957924933, "runtime_lift": 2.3835865397, "key": ["s179415880", "s895771571"]} {"user_id": "u146816547", "problem_id": "p00005", "language": "python", "submission_id_v0": "s153581221", "submission_id_v1": "s486237781", "cpu_time_v0": 30, "cpu_time_v1": 10, "memory_v0": 5872, "memory_v1": 6452, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 66.67, "input": "import math\n\nwhile True:\n\n\ttry:\n\n\t\tx,y = list(map(int,input().split()))\n\n\t\tprint('%d %d' % (math.gcd(x,y),x/math.gcd(x,y)*y))\n\n\texcept EOFError:\n\n\t\tbreak", "target": "def gcd(x, y):\n\n if y == 0:\n\n return x\n\n else:\n\n return gcd(y, x%y)\n\n\n\n\n\ndef lcm(x,y):\n\n return x/gcd(x, y)*y\n\n\n\n\n\nwhile True:\n\n try:\n\n x, y = list(map(int, input().split()))\n\n except EOFError:\n\n break\n\n\n\n print(\"%d %d\" % (gcd(x, y), lcm(x, y)))", "code_v0_loc": 7, "code_v1_loc": 18, "code_v0_num_chars": 165, "code_v1_num_chars": 288, "code_v0_no_empty_lines": "import math\n\nwhile True:\n try:\n x, y = list(map(int, input().split()))\n print(\"%d %d\" % (math.gcd(x, y), x / math.gcd(x, y) * y))\n except EOFError:\n break\n", "code_v1_no_empty_lines": "def gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\n\ndef lcm(x, y):\n return x / gcd(x, y) * y\n\n\nwhile True:\n try:\n x, y = list(map(int, input().split()))\n except EOFError:\n break\n print(\"%d %d\" % (gcd(x, y), lcm(x, y)))\n", "code_same": false, "relative_loc_diff_percent": 61.1111111111, "diff": ["-import math", "+def gcd(x, y):", "+ if y == 0:", "+ return x", "+ else:", "+ return gcd(y, x % y)", "+", "+", "+def lcm(x, y):", "+ return x / gcd(x, y) * y", "+", "- print(\"%d %d\" % (math.gcd(x, y), x / math.gcd(x, y) * y))", "+ print(\"%d %d\" % (gcd(x, y), lcm(x, y)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2843708012, "measured_runtime_v1": 0.2133130357, "runtime_lift": 1.3331149699, "key": ["s153581221", "s486237781"]} {"user_id": "u111365362", "problem_id": "p02881", "language": "python", "submission_id_v0": "s326793866", "submission_id_v1": "s577051886", "cpu_time_v0": 202, "cpu_time_v1": 174, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.86, "input": "n = int(input())\n\nr = int(n**.5)\n\nfor i in range(r):\n\n if n % (r-i) == 0:\n\n print(( (r-i) + n//(r-i) - 2 ))\n\n break", "target": "n = int(input())\n\ns = int(n**.5)\n\nfor i in range(s):\n\n if n % (s-i) == 0:\n\n print(((s-i) + n // (s-i) - 2))\n\n break", "code_v0_loc": 6, "code_v1_loc": 6, "code_v0_num_chars": 120, "code_v1_num_chars": 120, "code_v0_no_empty_lines": "n = int(input())\nr = int(n**0.5)\nfor i in range(r):\n if n % (r - i) == 0:\n print(((r - i) + n // (r - i) - 2))\n break\n", "code_v1_no_empty_lines": "n = int(input())\ns = int(n**0.5)\nfor i in range(s):\n if n % (s - i) == 0:\n print(((s - i) + n // (s - i) - 2))\n break\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-r = int(n**0.5)", "-for i in range(r):", "- if n % (r - i) == 0:", "- print(((r - i) + n // (r - i) - 2))", "+s = int(n**0.5)", "+for i in range(s):", "+ if n % (s - i) == 0:", "+ print(((s - i) + n // (s - i) - 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3217455449, "measured_runtime_v1": 0.1190871449, "runtime_lift": 2.7017655456, "key": ["s326793866", "s577051886"]} {"user_id": "u346812984", "problem_id": "p02725", "language": "python", "submission_id_v0": "s133823600", "submission_id_v1": "s446849062", "cpu_time_v0": 124, "cpu_time_v1": 97, "memory_v0": 26420, "memory_v1": 26444, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.77, "input": "K, N = list(map(int, input().split()))\n\nA = list(map(int, input().split()))\n\n\n\ndiff = A[0] + K - A[-1]\n\nans = A[-1] - A[0]\n\nfor i in range(1, N):\n\n dist = K - A[i] + A[i - 1]\n\n if dist < ans:\n\n ans = dist\n\n\n\nprint(ans)\n", "target": "import sys\n\n\n\n\n\ndef input():\n\n return sys.stdin.readline().strip()\n\n\n\n\n\ndef main():\n\n K, N = list(map(int, input().split()))\n\n A = list(map(int, input().split()))\n\n\n\n ans = [K - A[i] + A[i - 1] for i in range(1, N)]\n\n print((min(min(ans), A[-1] - A[0])))\n\n\n\n\n\nmain()\n", "code_v0_loc": 11, "code_v1_loc": 16, "code_v0_num_chars": 226, "code_v1_num_chars": 274, "code_v0_no_empty_lines": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\ndiff = A[0] + K - A[-1]\nans = A[-1] - A[0]\nfor i in range(1, N):\n dist = K - A[i] + A[i - 1]\n if dist < ans:\n ans = dist\nprint(ans)\n", "code_v1_no_empty_lines": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n K, N = list(map(int, input().split()))\n A = list(map(int, input().split()))\n ans = [K - A[i] + A[i - 1] for i in range(1, N)]\n print((min(min(ans), A[-1] - A[0])))\n\n\nmain()\n", "code_same": false, "relative_loc_diff_percent": 31.25, "diff": ["-K, N = list(map(int, input().split()))", "-A = list(map(int, input().split()))", "-diff = A[0] + K - A[-1]", "-ans = A[-1] - A[0]", "-for i in range(1, N):", "- dist = K - A[i] + A[i - 1]", "- if dist < ans:", "- ans = dist", "-print(ans)", "+import sys", "+", "+", "+def input():", "+ return sys.stdin.readline().strip()", "+", "+", "+def main():", "+ K, N = list(map(int, input().split()))", "+ A = list(map(int, input().split()))", "+ ans = [K - A[i] + A[i - 1] for i in range(1, N)]", "+ print((min(min(ans), A[-1] - A[0])))", "+", "+", "+main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2153115588, "measured_runtime_v1": 0.0063990955, "runtime_lift": 33.6471865365, "key": ["s133823600", "s446849062"]} {"user_id": "u648881683", "problem_id": "p03371", "language": "python", "submission_id_v0": "s115897723", "submission_id_v1": "s652896869", "cpu_time_v0": 101, "cpu_time_v1": 18, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.18, "input": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip() \n\n\n\ndef resolve():\n\n A, B, C, X, Y = list(map(int, input().split()))\n\n\n\n ans = float('inf')\n\n for i in range(0, max(X, Y)*2+1, 2):\n\n ans = min(A*max(X-i//2, 0)+B*max(Y-i//2, 0)+C*i, ans)\n\n print(ans)\n\n\n\nif __name__ == '__main__':\n\n resolve()\n", "target": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip() \n\n\n\ndef resolve():\n\n A, B, C, X, Y = list(map(int, input().split()))\n\n\n\n ans = 0\n\n if A+B > 2*C:\n\n ans = 2*C*min(X, Y)+min((A if X>Y else B)*abs(X-Y), 2*C*abs(X-Y))\n\n else:\n\n ans = A*X+B*Y\n\n \n\n print(ans)\n\n\n\nif __name__ == '__main__':\n\n resolve()\n", "code_v0_loc": 13, "code_v1_loc": 16, "code_v0_num_chars": 316, "code_v1_num_chars": 334, "code_v0_no_empty_lines": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n A, B, C, X, Y = list(map(int, input().split()))\n ans = float(\"inf\")\n for i in range(0, max(X, Y) * 2 + 1, 2):\n ans = min(A * max(X - i // 2, 0) + B * max(Y - i // 2, 0) + C * i, ans)\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "code_v1_no_empty_lines": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n A, B, C, X, Y = list(map(int, input().split()))\n ans = 0\n if A + B > 2 * C:\n ans = 2 * C * min(X, Y) + min(\n (A if X > Y else B) * abs(X - Y), 2 * C * abs(X - Y)\n )\n else:\n ans = A * X + B * Y\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "code_same": false, "relative_loc_diff_percent": 18.75, "diff": ["- ans = float(\"inf\")", "- for i in range(0, max(X, Y) * 2 + 1, 2):", "- ans = min(A * max(X - i // 2, 0) + B * max(Y - i // 2, 0) + C * i, ans)", "+ ans = 0", "+ if A + B > 2 * C:", "+ ans = 2 * C * min(X, Y) + min(", "+ (A if X > Y else B) * abs(X - Y), 2 * C * abs(X - Y)", "+ )", "+ else:", "+ ans = A * X + B * Y"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4475863097, "measured_runtime_v1": 0.2669118404, "runtime_lift": 1.6769069102, "key": ["s115897723", "s652896869"]} {"user_id": "u556589653", "problem_id": "p03416", "language": "python", "submission_id_v0": "s253072561", "submission_id_v1": "s839464643", "cpu_time_v0": 58, "cpu_time_v1": 50, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.79, "input": "A,B = list(map(int,input().split()))\n\nans = 0\n\nfor i in range(A,B+1):\n\n i = str(i)\n\n if i[0] == i[4]:\n\n if i[1] == i[3]:\n\n ans += 1\n\n else:\n\n ans += 0\n\n else:\n\n ans += 0\n\nprint(ans)", "target": "A,B = list(map(int,input().split()))\n\nans = 0\n\nfor i in range(A,B+1):\n\n k = str(i)\n\n if k[0] == k[4] and k[1] == k[3]:\n\n ans += 1\n\nprint(ans)", "code_v0_loc": 12, "code_v1_loc": 7, "code_v0_num_chars": 227, "code_v1_num_chars": 148, "code_v0_no_empty_lines": "A, B = list(map(int, input().split()))\nans = 0\nfor i in range(A, B + 1):\n i = str(i)\n if i[0] == i[4]:\n if i[1] == i[3]:\n ans += 1\n else:\n ans += 0\n else:\n ans += 0\nprint(ans)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\nans = 0\nfor i in range(A, B + 1):\n k = str(i)\n if k[0] == k[4] and k[1] == k[3]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 41.6666666667, "diff": ["- i = str(i)", "- if i[0] == i[4]:", "- if i[1] == i[3]:", "- ans += 1", "- else:", "- ans += 0", "- else:", "- ans += 0", "+ k = str(i)", "+ if k[0] == k[4] and k[1] == k[3]:", "+ ans += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1907642818, "measured_runtime_v1": 0.0059664835, "runtime_lift": 31.9726487264, "key": ["s253072561", "s839464643"]} {"user_id": "u312025627", "problem_id": "p03568", "language": "python", "submission_id_v0": "s088632051", "submission_id_v1": "s935108099", "cpu_time_v0": 196, "cpu_time_v1": 167, "memory_v0": 41068, "memory_v1": 38256, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 14.8, "input": "def main():\n\n N = int(input())\n\n A = [int(i) for i in input().split()]\n\n if N == 1:\n\n return print(1 if A[0] % 2 == 0 else 2)\n\n ans = 0\n\n d = (-1, 0, 1)\n\n from itertools import product\n\n for i in product(range(3), repeat=N):\n\n cur = 1\n\n for j in range(N):\n\n cur *= (A[j] + d[i[j]])\n\n if cur % 2 == 0:\n\n ans += 1\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "target": "def main():\n\n N = int(input())\n\n A = [int(i) for i in input().split()]\n\n ans = 3**N\n\n cnt = len([a for a in A if a % 2 == 0])\n\n ans -= 2**cnt\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "code_v0_loc": 19, "code_v1_loc": 11, "code_v0_num_chars": 443, "code_v1_num_chars": 217, "code_v0_no_empty_lines": "def main():\n N = int(input())\n A = [int(i) for i in input().split()]\n if N == 1:\n return print(1 if A[0] % 2 == 0 else 2)\n ans = 0\n d = (-1, 0, 1)\n from itertools import product\n\n for i in product(range(3), repeat=N):\n cur = 1\n for j in range(N):\n cur *= A[j] + d[i[j]]\n if cur % 2 == 0:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "def main():\n N = int(input())\n A = [int(i) for i in input().split()]\n ans = 3**N\n cnt = len([a for a in A if a % 2 == 0])\n ans -= 2**cnt\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 42.1052631579, "diff": ["- N = int(input())", "+ N = int(input())", "- if N == 1:", "- return print(1 if A[0] % 2 == 0 else 2)", "- ans = 0", "- d = (-1, 0, 1)", "- from itertools import product", "-", "- for i in product(range(3), repeat=N):", "- cur = 1", "- for j in range(N):", "- cur *= A[j] + d[i[j]]", "- if cur % 2 == 0:", "- ans += 1", "+ ans = 3**N", "+ cnt = len([a for a in A if a % 2 == 0])", "+ ans -= 2**cnt"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4432550566, "measured_runtime_v1": 0.2109588499, "runtime_lift": 2.1011446393, "key": ["s088632051", "s935108099"]} {"user_id": "u777923818", "problem_id": "p03425", "language": "python", "submission_id_v0": "s258539301", "submission_id_v1": "s541501179", "cpu_time_v0": 165, "cpu_time_v1": 142, "memory_v0": 3316, "memory_v1": 9336, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.94, "input": "# -*- coding: utf-8 -*-\n\nfrom collections import defaultdict\n\nfrom itertools import combinations\n\nN = int(input())\n\nC = [0, 0, 0, 0, 0, 0]\n\nD = defaultdict(int)\n\nfor i, m in enumerate(\"MARCH\", start=1):\n\n D[m] = i\n\n\n\nfor _ in range(N):\n\n C[D[input()[0]]] += 1\n\n\n\nans = 0\n\nfor a, b, c in combinations(list(range(1, 6)), r=3):\n\n ans += C[a]*C[b]*C[c]\n\nprint(ans)", "target": "from collections import defaultdict\n\nfrom itertools import combinations\n\ndef inpl(): return list(map(int, input().split()))\n\n\n\nC = defaultdict(int)\n\nN = int(input())\n\nfor _ in range(N):\n\n C[input()[0]] += 1\n\n\n\nres = 0\n\nfor H in combinations(\"MARCH\", r=3):\n\n res += C[H[0]] * C[H[1]] * C[H[2]]\n\nprint(res)", "code_v0_loc": 16, "code_v1_loc": 13, "code_v0_num_chars": 363, "code_v1_num_chars": 310, "code_v0_no_empty_lines": "# -*- coding: utf-8 -*-\nfrom collections import defaultdict\nfrom itertools import combinations\n\nN = int(input())\nC = [0, 0, 0, 0, 0, 0]\nD = defaultdict(int)\nfor i, m in enumerate(\"MARCH\", start=1):\n D[m] = i\nfor _ in range(N):\n C[D[input()[0]]] += 1\nans = 0\nfor a, b, c in combinations(list(range(1, 6)), r=3):\n ans += C[a] * C[b] * C[c]\nprint(ans)\n", "code_v1_no_empty_lines": "from collections import defaultdict\nfrom itertools import combinations\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\nC = defaultdict(int)\nN = int(input())\nfor _ in range(N):\n C[input()[0]] += 1\nres = 0\nfor H in combinations(\"MARCH\", r=3):\n res += C[H[0]] * C[H[1]] * C[H[2]]\nprint(res)\n", "code_same": false, "relative_loc_diff_percent": 18.75, "diff": ["-# -*- coding: utf-8 -*-", "+", "+def inpl():", "+ return list(map(int, input().split()))", "+", "+", "+C = defaultdict(int)", "-C = [0, 0, 0, 0, 0, 0]", "-D = defaultdict(int)", "-for i, m in enumerate(\"MARCH\", start=1):", "- D[m] = i", "- C[D[input()[0]]] += 1", "-ans = 0", "-for a, b, c in combinations(list(range(1, 6)), r=3):", "- ans += C[a] * C[b] * C[c]", "-print(ans)", "+ C[input()[0]] += 1", "+res = 0", "+for H in combinations(\"MARCH\", r=3):", "+ res += C[H[0]] * C[H[1]] * C[H[2]]", "+print(res)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.388673193, "measured_runtime_v1": 0.2150466468, "runtime_lift": 1.8073901578, "key": ["s258539301", "s541501179"]} {"user_id": "u964904181", "problem_id": "p03796", "language": "python", "submission_id_v0": "s459904551", "submission_id_v1": "s685671735", "cpu_time_v0": 153, "cpu_time_v1": 46, "memory_v0": 9880, "memory_v1": 9092, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 69.93, "input": "import math\n\n\n\nN = int(input())\n\n\n\nprint((math.factorial(N) % (1000000000 + 7)))\n", "target": "import math\n\n\n\nN = int(input())\n\n\n\np = 1\n\nfor i in range(2, N+1):\n\n p *= i\n\n p = p % (1000000000 + 7)\n\n \n\nprint(p)\n", "code_v0_loc": 5, "code_v1_loc": 10, "code_v0_num_chars": 79, "code_v1_num_chars": 118, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nprint((math.factorial(N) % (1000000000 + 7)))\n", "code_v1_no_empty_lines": "import math\n\nN = int(input())\np = 1\nfor i in range(2, N + 1):\n p *= i\n p = p % (1000000000 + 7)\nprint(p)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-print((math.factorial(N) % (1000000000 + 7)))", "+p = 1", "+for i in range(2, N + 1):", "+ p *= i", "+ p = p % (1000000000 + 7)", "+print(p)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5259809067, "measured_runtime_v1": 0.2554857254, "runtime_lift": 2.0587487065, "key": ["s459904551", "s685671735"]} {"user_id": "u127499732", "problem_id": "p03309", "language": "python", "submission_id_v0": "s031191514", "submission_id_v1": "s488102802", "cpu_time_v0": 214, "cpu_time_v1": 169, "memory_v0": 27212, "memory_v1": 25180, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.03, "input": "def main():\n\n from statistics import median\n\n\n\n n, *a, = list(map(int, open(0).read().split()))\n\n a = [x - i for i, x in enumerate(a, 1)]\n\n a.sort()\n\n m = int(median(a))\n\n\n\n ans = sum([abs(x - m) for x in a])\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "target": "def main():\n\n n, *a, = list(map(int, open(0).read().split()))\n\n a = [x - i for i, x in enumerate(a, 1)]\n\n a.sort()\n\n if n % 2 == 0:\n\n ans = sum(a[n // 2:]) - sum(a[:n // 2])\n\n else:\n\n ans = sum(a[n // 2 + 1:]) - sum(a[:n // 2])\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "code_v0_loc": 14, "code_v1_loc": 13, "code_v0_num_chars": 281, "code_v1_num_chars": 311, "code_v0_no_empty_lines": "def main():\n from statistics import median\n\n (\n n,\n *a,\n ) = list(map(int, open(0).read().split()))\n a = [x - i for i, x in enumerate(a, 1)]\n a.sort()\n m = int(median(a))\n ans = sum([abs(x - m) for x in a])\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "def main():\n (\n n,\n *a,\n ) = list(map(int, open(0).read().split()))\n a = [x - i for i, x in enumerate(a, 1)]\n a.sort()\n if n % 2 == 0:\n ans = sum(a[n // 2 :]) - sum(a[: n // 2])\n else:\n ans = sum(a[n // 2 + 1 :]) - sum(a[: n // 2])\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 7.1428571429, "diff": ["- from statistics import median", "-", "- m = int(median(a))", "- ans = sum([abs(x - m) for x in a])", "+ if n % 2 == 0:", "+ ans = sum(a[n // 2 :]) - sum(a[: n // 2])", "+ else:", "+ ans = sum(a[n // 2 + 1 :]) - sum(a[: n // 2])"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2784859991, "measured_runtime_v1": 0.2092100859, "runtime_lift": 1.3311308484, "key": ["s031191514", "s488102802"]} {"user_id": "u159994501", "problem_id": "p03037", "language": "python", "submission_id_v0": "s060142514", "submission_id_v1": "s502871070", "cpu_time_v0": 326, "cpu_time_v1": 290, "memory_v0": 10996, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.04, "input": "N, M = list(map(int, input().split()))\n\nL, R = [], []\n\nlow = -float('INF')\n\nhigh = float('INF')\n\nfor i in range(M):\n\n l, r = list(map(int, input().split()))\n\n L.append(l)\n\n R.append(r)\n\n if l > low:\n\n low = l\n\n if r < high:\n\n high = r\n\nprint((max(0, high - low + 1)))\n", "target": "N, M = list(map(int, input().split()))\n\nlow = -float('INF')\n\nhigh = float('INF')\n\nfor i in range(M):\n\n l, r = list(map(int, input().split()))\n\n if l > low:\n\n low = l\n\n if r < high:\n\n high = r\n\nprint((max(0, high - low + 1)))\n", "code_v0_loc": 13, "code_v1_loc": 10, "code_v0_num_chars": 283, "code_v1_num_chars": 234, "code_v0_no_empty_lines": "N, M = list(map(int, input().split()))\nL, R = [], []\nlow = -float(\"INF\")\nhigh = float(\"INF\")\nfor i in range(M):\n l, r = list(map(int, input().split()))\n L.append(l)\n R.append(r)\n if l > low:\n low = l\n if r < high:\n high = r\nprint((max(0, high - low + 1)))\n", "code_v1_no_empty_lines": "N, M = list(map(int, input().split()))\nlow = -float(\"INF\")\nhigh = float(\"INF\")\nfor i in range(M):\n l, r = list(map(int, input().split()))\n if l > low:\n low = l\n if r < high:\n high = r\nprint((max(0, high - low + 1)))\n", "code_same": false, "relative_loc_diff_percent": 23.0769230769, "diff": ["-L, R = [], []", "- L.append(l)", "- R.append(r)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2778050728, "measured_runtime_v1": 0.0913613791, "runtime_lift": 3.0407276614, "key": ["s060142514", "s502871070"]} {"user_id": "u729133443", "problem_id": "p02555", "language": "python", "submission_id_v0": "s039277419", "submission_id_v1": "s210669705", "cpu_time_v0": 66, "cpu_time_v1": 51, "memory_v0": 29052, "memory_v1": 22328, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 22.73, "input": "a,b,c=1,0,0\n\nexec('a,b,c=b,c,(a+c)%(10**9+7);'*(int(input())-2))\n\nprint(c)", "target": "a,b,c=1,0,0\n\nexec('a,b,c=b,c,a+c;'*(int(input())-2))\n\nprint((c%(10**9+7)))", "code_v0_loc": 3, "code_v1_loc": 3, "code_v0_num_chars": 74, "code_v1_num_chars": 72, "code_v0_no_empty_lines": "a, b, c = 1, 0, 0\nexec(\"a,b,c=b,c,(a+c)%(10**9+7);\" * (int(input()) - 2))\nprint(c)\n", "code_v1_no_empty_lines": "a, b, c = 1, 0, 0\nexec(\"a,b,c=b,c,a+c;\" * (int(input()) - 2))\nprint((c % (10**9 + 7)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-exec(\"a,b,c=b,c,(a+c)%(10**9+7);\" * (int(input()) - 2))", "-print(c)", "+exec(\"a,b,c=b,c,a+c;\" * (int(input()) - 2))", "+print((c % (10**9 + 7)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4045331192, "measured_runtime_v1": 0.1489405618, "runtime_lift": 2.7160708565, "key": ["s039277419", "s210669705"]} {"user_id": "u768896740", "problem_id": "p03371", "language": "python", "submission_id_v0": "s303630482", "submission_id_v1": "s785488691", "cpu_time_v0": 197, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 91.37, "input": "a, b, c, x, y = list(map(int, input().split()))\n\n\n\nz = max(x,y) * 2\n\nmin_sum = c * z\n\n\n\nfor i in range(z):\n\n r = max(0, y - i) * b\n\n t = max(0, x - i) * a\n\n sum = c * i * 2 + r + t\n\n if sum < min_sum:\n\n min_sum = sum\n\n\n\nprint(min_sum)", "target": "a,b,c,x,y = list(map(int, input().split()))\n\n\n\nplan_a = c * (2*x) + max(0, y-x) * b\n\nplan_b = c * (2*y) + max(0, x-y) * a\n\nplan_c = a * x + b * y\n\n\n\nprint((min(plan_a, plan_b, plan_c)))", "code_v0_loc": 13, "code_v1_loc": 7, "code_v0_num_chars": 247, "code_v1_num_chars": 177, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nz = max(x, y) * 2\nmin_sum = c * z\nfor i in range(z):\n r = max(0, y - i) * b\n t = max(0, x - i) * a\n sum = c * i * 2 + r + t\n if sum < min_sum:\n min_sum = sum\nprint(min_sum)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nplan_a = c * (2 * x) + max(0, y - x) * b\nplan_b = c * (2 * y) + max(0, x - y) * a\nplan_c = a * x + b * y\nprint((min(plan_a, plan_b, plan_c)))\n", "code_same": false, "relative_loc_diff_percent": 46.1538461538, "diff": ["-z = max(x, y) * 2", "-min_sum = c * z", "-for i in range(z):", "- r = max(0, y - i) * b", "- t = max(0, x - i) * a", "- sum = c * i * 2 + r + t", "- if sum < min_sum:", "- min_sum = sum", "-print(min_sum)", "+plan_a = c * (2 * x) + max(0, y - x) * b", "+plan_b = c * (2 * y) + max(0, x - y) * a", "+plan_c = a * x + b * y", "+print((min(plan_a, plan_b, plan_c)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7115524154, "measured_runtime_v1": 0.3421670091, "runtime_lift": 2.0795471112, "key": ["s303630482", "s785488691"]} {"user_id": "u488127128", "problem_id": "p03796", "language": "python", "submission_id_v0": "s349010345", "submission_id_v1": "s174569561", "cpu_time_v0": 35, "cpu_time_v1": 29, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.14, "input": "N = int(input())\n\na = 1\n\nfor n in range(2,N+1):\n\n a = a*n % (10**9+7)\n\nprint(a)", "target": "def factorial(N):\n\n a = 1\n\n for n in range(2,N+1):\n\n a = a*n % (10**9 + 7)\n\n return a\n\n\n\nif __name__ == '__main__':\n\n N = int(input())\n\n print((factorial(N)))", "code_v0_loc": 5, "code_v1_loc": 9, "code_v0_num_chars": 82, "code_v1_num_chars": 178, "code_v0_no_empty_lines": "N = int(input())\na = 1\nfor n in range(2, N + 1):\n a = a * n % (10**9 + 7)\nprint(a)\n", "code_v1_no_empty_lines": "def factorial(N):\n a = 1\n for n in range(2, N + 1):\n a = a * n % (10**9 + 7)\n return a\n\n\nif __name__ == \"__main__\":\n N = int(input())\n print((factorial(N)))\n", "code_same": false, "relative_loc_diff_percent": 44.4444444444, "diff": ["-N = int(input())", "-a = 1", "-for n in range(2, N + 1):", "- a = a * n % (10**9 + 7)", "-print(a)", "+def factorial(N):", "+ a = 1", "+ for n in range(2, N + 1):", "+ a = a * n % (10**9 + 7)", "+ return a", "+", "+", "+if __name__ == \"__main__\":", "+ N = int(input())", "+ print((factorial(N)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3416386657, "measured_runtime_v1": 0.2695478878, "runtime_lift": 1.2674507244, "key": ["s349010345", "s174569561"]} {"user_id": "u102461423", "problem_id": "p03170", "language": "python", "submission_id_v0": "s503646377", "submission_id_v1": "s803807514", "cpu_time_v0": 1298, "cpu_time_v1": 123, "memory_v0": 3684, "memory_v1": 3828, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 90.52, "input": "import sys\n\nread = sys.stdin.buffer.read\n\nreadline = sys.stdin.buffer.readline\n\nreadlines = sys.stdin.buffer.readlines\n\n\n\nfrom operator import xor\n\nfrom functools import reduce\n\n\n\nN,K,*A = list(map(int,read().split()))\n\n\n\na = reduce(xor,(1<K:\n\n break\n\n dp[n+a]=1\n\n\n\nanswer = 'First' if dp[-1] else 'Second'\n\nprint(answer)", "code_v0_loc": 19, "code_v1_loc": 17, "code_v0_num_chars": 396, "code_v1_num_chars": 369, "code_v0_no_empty_lines": "import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nfrom operator import xor\nfrom functools import reduce\n\nN, K, *A = list(map(int, read().split()))\na = reduce(xor, (1 << a for a in A))\ndp = 0 # bitset\nfor n in range(K):\n if not (dp & (1 << n)):\n dp |= a << n\nanswer = \"First\" if dp & (1 << K) else \"Second\"\nprint(answer)\n", "code_v1_no_empty_lines": "import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nN, K, *A = list(map(int, read().split()))\ndp = [0] * (K + 1) # bitset\nfor n in range(K):\n if not dp[n]:\n for a in A:\n if n + a > K:\n break\n dp[n + a] = 1\nanswer = \"First\" if dp[-1] else \"Second\"\nprint(answer)\n", "code_same": false, "relative_loc_diff_percent": 10.5263157895, "diff": ["-from operator import xor", "-from functools import reduce", "-", "-a = reduce(xor, (1 << a for a in A))", "-dp = 0 # bitset", "+dp = [0] * (K + 1) # bitset", "- if not (dp & (1 << n)):", "- dp |= a << n", "-answer = \"First\" if dp & (1 << K) else \"Second\"", "+ if not dp[n]:", "+ for a in A:", "+ if n + a > K:", "+ break", "+ dp[n + a] = 1", "+answer = \"First\" if dp[-1] else \"Second\""], "diff_only_import_comment": false, "measured_runtime_v0": 0.510753959, "measured_runtime_v1": 0.2748723721, "runtime_lift": 1.8581494935, "key": ["s503646377", "s803807514"]} {"user_id": "u102960641", "problem_id": "p02624", "language": "python", "submission_id_v0": "s523843051", "submission_id_v1": "s066295883", "cpu_time_v0": 36, "cpu_time_v1": 31, "memory_v0": 9312, "memory_v1": 9436, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.89, "input": "n = int(input())\n\nans = 0\n\nSQRT = int(n ** 0.5)\n\nfor m in range(1,SQRT + 1):\n\n b = int(n/m)\n\n ans += m * (m + b) * (b + 1 - m)\n\nans -= SQRT * (SQRT+1) * (2*SQRT+1) // 6\n\nprint(ans)", "target": "def main():\n\n n = int(input())\n\n ans = 0\n\n SQRT = int(n ** 0.5)\n\n for m in range(1,SQRT + 1):\n\n b = int(n/m)\n\n ans += m * (m + b) * (b + 1 - m)\n\n ans -= SQRT * (SQRT+1) * (2*SQRT+1) // 6\n\n print(ans)\n\nmain()\n", "code_v0_loc": 8, "code_v1_loc": 10, "code_v0_num_chars": 186, "code_v1_num_chars": 220, "code_v0_no_empty_lines": "n = int(input())\nans = 0\nSQRT = int(n**0.5)\nfor m in range(1, SQRT + 1):\n b = int(n / m)\n ans += m * (m + b) * (b + 1 - m)\nans -= SQRT * (SQRT + 1) * (2 * SQRT + 1) // 6\nprint(ans)\n", "code_v1_no_empty_lines": "def main():\n n = int(input())\n ans = 0\n SQRT = int(n**0.5)\n for m in range(1, SQRT + 1):\n b = int(n / m)\n ans += m * (m + b) * (b + 1 - m)\n ans -= SQRT * (SQRT + 1) * (2 * SQRT + 1) // 6\n print(ans)\n\n\nmain()\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-n = int(input())", "-ans = 0", "-SQRT = int(n**0.5)", "-for m in range(1, SQRT + 1):", "- b = int(n / m)", "- ans += m * (m + b) * (b + 1 - m)", "-ans -= SQRT * (SQRT + 1) * (2 * SQRT + 1) // 6", "-print(ans)", "+def main():", "+ n = int(input())", "+ ans = 0", "+ SQRT = int(n**0.5)", "+ for m in range(1, SQRT + 1):", "+ b = int(n / m)", "+ ans += m * (m + b) * (b + 1 - m)", "+ ans -= SQRT * (SQRT + 1) * (2 * SQRT + 1) // 6", "+ print(ans)", "+", "+", "+main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3880330081, "measured_runtime_v1": 0.212660579, "runtime_lift": 1.8246588529, "key": ["s523843051", "s066295883"]} {"user_id": "u513081876", "problem_id": "p03828", "language": "python", "submission_id_v0": "s988350400", "submission_id_v1": "s443952708", "cpu_time_v0": 39, "cpu_time_v1": 35, "memory_v0": 3316, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.26, "input": "import math\n\nimport collections\n\n\n\nN = int(input())\n\na = math.factorial(N)\n\ncheck = []\n\nans = 1\n\ni = 2\n\n\n\nwhile a != 1:\n\n if a % i == 0:\n\n a //= i\n\n check.append(i)\n\n else:\n\n i += 1\n\n \n\ncheck = list(collections.Counter(check).values())\n\nfor i in check:\n\n ans *= (i+1)\n\n ans %= 10**9+7\n\nprint(ans)", "target": "from math import factorial\n\n\n\nN = factorial(int(input()))\n\n\n\ni = 2\n\ncheck = 1\n\nans = 1\n\nwhile N != 1:\n\n if N % i == 0:\n\n N //= i\n\n check += 1\n\n else:\n\n ans *= check\n\n check = 1\n\n i += 1\n\nprint(((ans*check)%(10**9+7)))", "code_v0_loc": 21, "code_v1_loc": 16, "code_v0_num_chars": 330, "code_v1_num_chars": 256, "code_v0_no_empty_lines": "import math\nimport collections\n\nN = int(input())\na = math.factorial(N)\ncheck = []\nans = 1\ni = 2\nwhile a != 1:\n if a % i == 0:\n a //= i\n check.append(i)\n else:\n i += 1\ncheck = list(collections.Counter(check).values())\nfor i in check:\n ans *= i + 1\n ans %= 10**9 + 7\nprint(ans)\n", "code_v1_no_empty_lines": "from math import factorial\n\nN = factorial(int(input()))\ni = 2\ncheck = 1\nans = 1\nwhile N != 1:\n if N % i == 0:\n N //= i\n check += 1\n else:\n ans *= check\n check = 1\n i += 1\nprint(((ans * check) % (10**9 + 7)))\n", "code_same": false, "relative_loc_diff_percent": 23.8095238095, "diff": ["-import math", "-import collections", "+from math import factorial", "-N = int(input())", "-a = math.factorial(N)", "-check = []", "+N = factorial(int(input()))", "+i = 2", "+check = 1", "-i = 2", "-while a != 1:", "- if a % i == 0:", "- a //= i", "- check.append(i)", "+while N != 1:", "+ if N % i == 0:", "+ N //= i", "+ check += 1", "+ ans *= check", "+ check = 1", "-check = list(collections.Counter(check).values())", "-for i in check:", "- ans *= i + 1", "- ans %= 10**9 + 7", "-print(ans)", "+print(((ans * check) % (10**9 + 7)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1990540142, "measured_runtime_v1": 0.0063210642, "runtime_lift": 31.4905855295, "key": ["s988350400", "s443952708"]} {"user_id": "u693694535", "problem_id": "p03371", "language": "python", "submission_id_v0": "s328045307", "submission_id_v1": "s953197610", "cpu_time_v0": 105, "cpu_time_v1": 26, "memory_v0": 9176, "memory_v1": 9168, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 75.24, "input": "A,B,C,X,Y=list(map(int,input().split()))\n\n\n\nK=10**9\n\nfor i in range(10**5+1):\n\n S=i*2*C+max(0,X-i)*A+max(0,Y-i)*B\n\n K=min(K,S)\n\nprint(K)", "target": "A,B,C,X,Y=list(map(int,input().split()))\n\n\n\na=min(X,Y)*min(A+B,2*C)\n\n\n\na+=max(0,X-Y)*min(A,2*C)\n\na+=max(0,Y-X)*min(B,2*C)\n\n\n\n\n\nprint(a)", "code_v0_loc": 7, "code_v1_loc": 9, "code_v0_num_chars": 136, "code_v1_num_chars": 129, "code_v0_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nK = 10**9\nfor i in range(10**5 + 1):\n S = i * 2 * C + max(0, X - i) * A + max(0, Y - i) * B\n K = min(K, S)\nprint(K)\n", "code_v1_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\na = min(X, Y) * min(A + B, 2 * C)\na += max(0, X - Y) * min(A, 2 * C)\na += max(0, Y - X) * min(B, 2 * C)\nprint(a)\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["-K = 10**9", "-for i in range(10**5 + 1):", "- S = i * 2 * C + max(0, X - i) * A + max(0, Y - i) * B", "- K = min(K, S)", "-print(K)", "+a = min(X, Y) * min(A + B, 2 * C)", "+a += max(0, X - Y) * min(A, 2 * C)", "+a += max(0, Y - X) * min(B, 2 * C)", "+print(a)"], "diff_only_import_comment": false, "measured_runtime_v0": 1.3979784026, "measured_runtime_v1": 0.2418090019, "runtime_lift": 5.7813331656, "key": ["s328045307", "s953197610"]} {"user_id": "u365686736", "problem_id": "p02390", "language": "python", "submission_id_v0": "s143749551", "submission_id_v1": "s514847697", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 7676, "memory_v1": 5584, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "S = int(input())\n\n\n\nif S >= 3600:\n\n h=S//3600\n\n m=S%3600//60\n\n s=S%60\n\nelif 3600 > S >= 60:\n\n h=0\n\n m=S//60\n\n s=S%60\n\nelse:\n\n h=m=0\n\n s=S\n\nprint(h, m, s, sep=\":\")\n", "target": "s = int(input())\n\nh = s // 3600\n\nm = (s - h * 3600) // 60\n\ns = s - h * 3600 - m * 60\n\nprint(h, m, s, sep=\":\")\n", "code_v0_loc": 14, "code_v1_loc": 5, "code_v0_num_chars": 186, "code_v1_num_chars": 110, "code_v0_no_empty_lines": "S = int(input())\nif S >= 3600:\n h = S // 3600\n m = S % 3600 // 60\n s = S % 60\nelif 3600 > S >= 60:\n h = 0\n m = S // 60\n s = S % 60\nelse:\n h = m = 0\n s = S\nprint(h, m, s, sep=\":\")\n", "code_v1_no_empty_lines": "s = int(input())\nh = s // 3600\nm = (s - h * 3600) // 60\ns = s - h * 3600 - m * 60\nprint(h, m, s, sep=\":\")\n", "code_same": false, "relative_loc_diff_percent": 64.2857142857, "diff": ["-S = int(input())", "-if S >= 3600:", "- h = S // 3600", "- m = S % 3600 // 60", "- s = S % 60", "-elif 3600 > S >= 60:", "- h = 0", "- m = S // 60", "- s = S % 60", "-else:", "- h = m = 0", "- s = S", "+s = int(input())", "+h = s // 3600", "+m = (s - h * 3600) // 60", "+s = s - h * 3600 - m * 60"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3295819011, "measured_runtime_v1": 0.255378567, "runtime_lift": 1.2905621053, "key": ["s143749551", "s514847697"]} {"user_id": "u729133443", "problem_id": "p03434", "language": "python", "submission_id_v0": "s231475572", "submission_id_v1": "s619171000", "cpu_time_v0": 35, "cpu_time_v1": 30, "memory_v0": 9016, "memory_v1": 9012, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 14.29, "input": "_,s=open(c:=0)\n\nfor a in sorted(map(int,s.split())):c=a-c\n\nprint(c)", "target": "for a in sorted(map(int,[*open(c:=0)][1].split())):c=a-c\n\nprint(c)", "code_v0_loc": 3, "code_v1_loc": 2, "code_v0_num_chars": 67, "code_v1_num_chars": 66, "code_v0_no_empty_lines": "_, s = open(c := 0)\nfor a in sorted(map(int, s.split())):\n c = a - c\nprint(c)\n", "code_v1_no_empty_lines": "for a in sorted(map(int, [*open(c := 0)][1].split())):\n c = a - c\nprint(c)\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-_, s = open(c := 0)", "-for a in sorted(map(int, s.split())):", "+for a in sorted(map(int, [*open(c := 0)][1].split())):"], "diff_only_import_comment": false, "measured_runtime_v0": 0.269129122, "measured_runtime_v1": 0.112153646, "runtime_lift": 2.3996466598, "key": ["s231475572", "s619171000"]} {"user_id": "u808429775", "problem_id": "p00134", "language": "python", "submission_id_v0": "s571351483", "submission_id_v1": "s722552691", "cpu_time_v0": 100, "cpu_time_v1": 60, "memory_v0": 7404, "memory_v1": 5952, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 40.0, "input": "from statistics import mean\n\n\n\ninputCount = int(input())\n\nprices = [int(input()) for lp in range(inputCount)]\n\naverage = mean(prices)\n\nprint((int(average)))\n\n\n", "target": "inputCount = int(input())\n\nprices = [int(input()) for lp in range(inputCount)]\n\naverage = sum(prices) // inputCount\n\nprint(average)\n\n\n", "code_v0_loc": 7, "code_v1_loc": 5, "code_v0_num_chars": 157, "code_v1_num_chars": 134, "code_v0_no_empty_lines": "from statistics import mean\n\ninputCount = int(input())\nprices = [int(input()) for lp in range(inputCount)]\naverage = mean(prices)\nprint((int(average)))\n", "code_v1_no_empty_lines": "inputCount = int(input())\nprices = [int(input()) for lp in range(inputCount)]\naverage = sum(prices) // inputCount\nprint(average)\n", "code_same": false, "relative_loc_diff_percent": 28.5714285714, "diff": ["-from statistics import mean", "-", "-average = mean(prices)", "-print((int(average)))", "+average = sum(prices) // inputCount", "+print(average)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.453101104, "measured_runtime_v1": 0.2992461076, "runtime_lift": 1.514142014, "key": ["s571351483", "s722552691"]} {"user_id": "u145950990", "problem_id": "p02552", "language": "python", "submission_id_v0": "s431367942", "submission_id_v1": "s270499104", "cpu_time_v0": 32, "cpu_time_v1": 25, "memory_v0": 9148, "memory_v1": 9028, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.88, "input": "x = int(input())\n\nprint((0 if x==1 else 1))", "target": "s = input()\n\nif s == '0':\n\n print((1))\n\nelse:\n\n print((0))", "code_v0_loc": 2, "code_v1_loc": 5, "code_v0_num_chars": 41, "code_v1_num_chars": 56, "code_v0_no_empty_lines": "x = int(input())\nprint((0 if x == 1 else 1))\n", "code_v1_no_empty_lines": "s = input()\nif s == \"0\":\n print((1))\nelse:\n print((0))\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-x = int(input())", "-print((0 if x == 1 else 1))", "+s = input()", "+if s == \"0\":", "+ print((1))", "+else:", "+ print((0))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2680207849, "measured_runtime_v1": 0.0548314691, "runtime_lift": 4.8880832377, "key": ["s431367942", "s270499104"]} {"user_id": "u600065151", "problem_id": "p02268", "language": "python", "submission_id_v0": "s783851867", "submission_id_v1": "s366216704", "cpu_time_v0": 50, "cpu_time_v1": 40, "memory_v0": 18684, "memory_v1": 20588, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 20.0, "input": "def binarySearch():\n\n n = int(input())\n\n S = set(map(int, input().split()))\n\n q = int(input())\n\n T = set(map(int, input().split()))\n\n print((len(S.intersection(T))))\n\n \n\n\n\nbinarySearch()", "target": "def binarySearch():\n\n n = int(input())\n\n S = set(input().split())\n\n q = int(input())\n\n T = set(input().split())\n\n print((len(S.intersection(T))))\n\n \n\n\n\nbinarySearch()", "code_v0_loc": 9, "code_v1_loc": 9, "code_v0_num_chars": 202, "code_v1_num_chars": 182, "code_v0_no_empty_lines": "def binarySearch():\n n = int(input())\n S = set(map(int, input().split()))\n q = int(input())\n T = set(map(int, input().split()))\n print((len(S.intersection(T))))\n\n\nbinarySearch()\n", "code_v1_no_empty_lines": "def binarySearch():\n n = int(input())\n S = set(input().split())\n q = int(input())\n T = set(input().split())\n print((len(S.intersection(T))))\n\n\nbinarySearch()\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- S = set(map(int, input().split()))", "+ S = set(input().split())", "- T = set(map(int, input().split()))", "+ T = set(input().split())"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3310329242, "measured_runtime_v1": 0.2247743328, "runtime_lift": 1.4727345427, "key": ["s783851867", "s366216704"]} {"user_id": "u996434204", "problem_id": "p03416", "language": "python", "submission_id_v0": "s285618885", "submission_id_v1": "s172989285", "cpu_time_v0": 114, "cpu_time_v1": 57, "memory_v0": 3060, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 50.0, "input": "a,b=list(map(int,input().split()))\n\n\n\nans=0\n\n\n\nfor i in range(a,b+1):\n\n buf=str(i)\n\n #print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])\n\n str1=buf[0:int(len(buf)/2)]\n\n str2=buf[int(len(buf)/2+1):]\n\n if str1[0]==str2[1] and str1[1]==str2[0]:\n\n ans+=1\n\n\n\nprint(ans)\n", "target": "a,b=list(map(int,input().split()))\n\n\n\nans=0\n\n\n\nfor i in range(a,b+1):\n\n buf=str(i)\n\n str1=buf[::-1]\n\n if buf==str1:\n\n ans+=1\n\n\n\nprint(ans)\n", "code_v0_loc": 13, "code_v1_loc": 11, "code_v0_num_chars": 284, "code_v1_num_chars": 149, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\nans = 0\nfor i in range(a, b + 1):\n buf = str(i)\n # print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])\n str1 = buf[0 : int(len(buf) / 2)]\n str2 = buf[int(len(buf) / 2 + 1) :]\n if str1[0] == str2[1] and str1[1] == str2[0]:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\nans = 0\nfor i in range(a, b + 1):\n buf = str(i)\n str1 = buf[::-1]\n if buf == str1:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 15.3846153846, "diff": ["- # print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])", "- str1 = buf[0 : int(len(buf) / 2)]", "- str2 = buf[int(len(buf) / 2 + 1) :]", "- if str1[0] == str2[1] and str1[1] == str2[0]:", "+ str1 = buf[::-1]", "+ if buf == str1:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3597218115, "measured_runtime_v1": 0.2724662972, "runtime_lift": 1.3202433295, "key": ["s285618885", "s172989285"]} {"user_id": "u537976628", "problem_id": "p03720", "language": "python", "submission_id_v0": "s957846271", "submission_id_v1": "s235024999", "cpu_time_v0": 28, "cpu_time_v1": 25, "memory_v0": 9128, "memory_v1": 9136, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.71, "input": "n, m = list(map(int, input().split()))\n\nRD = list(list(map(int, input().split())) for _ in range(m))\n\nfor i in range(1, n + 1):\n\n ans = 0\n\n for j in RD:\n\n ans += j.count(i)\n\n print(ans)", "target": "n, m = list(map(int, input().split()))\n\nNRD = list(0 for i in range(n))\n\nfor i in range(m):\n\n r1, r2 = list(map(int, input().split()))\n\n NRD[r1 - 1] += 1\n\n NRD[r2 - 1] += 1\n\nfor i in range(n):\n\n print((NRD[i]))", "code_v0_loc": 7, "code_v1_loc": 8, "code_v0_num_chars": 195, "code_v1_num_chars": 208, "code_v0_no_empty_lines": "n, m = list(map(int, input().split()))\nRD = list(list(map(int, input().split())) for _ in range(m))\nfor i in range(1, n + 1):\n ans = 0\n for j in RD:\n ans += j.count(i)\n print(ans)\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\nNRD = list(0 for i in range(n))\nfor i in range(m):\n r1, r2 = list(map(int, input().split()))\n NRD[r1 - 1] += 1\n NRD[r2 - 1] += 1\nfor i in range(n):\n print((NRD[i]))\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-RD = list(list(map(int, input().split())) for _ in range(m))", "-for i in range(1, n + 1):", "- ans = 0", "- for j in RD:", "- ans += j.count(i)", "- print(ans)", "+NRD = list(0 for i in range(n))", "+for i in range(m):", "+ r1, r2 = list(map(int, input().split()))", "+ NRD[r1 - 1] += 1", "+ NRD[r2 - 1] += 1", "+for i in range(n):", "+ print((NRD[i]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2888841586, "measured_runtime_v1": 0.0609361191, "runtime_lift": 4.7407705467, "key": ["s957846271", "s235024999"]} {"user_id": "u298297089", "problem_id": "p03325", "language": "python", "submission_id_v0": "s106132375", "submission_id_v1": "s827937559", "cpu_time_v0": 122, "cpu_time_v1": 72, "memory_v0": 4148, "memory_v1": 3828, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 40.98, "input": "N = int(input())\n\nx = list(map(int, input().split()))\n\ncnt = 0\n\nfor i in x:\n\n while i % 2 == 0:\n\n cnt += 1\n\n i /= 2\n\nprint(cnt)", "target": "n = int(input())\n\nans = 0\n\nfor i in map(int, input().split()):\n\n cnt = 0\n\n while i % 2 == 0:\n\n i >>= 1\n\n cnt += 1\n\n ans += cnt\n\nprint(ans)", "code_v0_loc": 8, "code_v1_loc": 9, "code_v0_num_chars": 134, "code_v1_num_chars": 161, "code_v0_no_empty_lines": "N = int(input())\nx = list(map(int, input().split()))\ncnt = 0\nfor i in x:\n while i % 2 == 0:\n cnt += 1\n i /= 2\nprint(cnt)\n", "code_v1_no_empty_lines": "n = int(input())\nans = 0\nfor i in map(int, input().split()):\n cnt = 0\n while i % 2 == 0:\n i >>= 1\n cnt += 1\n ans += cnt\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-N = int(input())", "-x = list(map(int, input().split()))", "-cnt = 0", "-for i in x:", "+n = int(input())", "+ans = 0", "+for i in map(int, input().split()):", "+ cnt = 0", "+ i >>= 1", "- i /= 2", "-print(cnt)", "+ ans += cnt", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2336064763, "measured_runtime_v1": 0.0059840708, "runtime_lift": 39.0380536239, "key": ["s106132375", "s827937559"]} {"user_id": "u230717961", "problem_id": "p03796", "language": "python", "submission_id_v0": "s450924156", "submission_id_v1": "s743009434", "cpu_time_v0": 229, "cpu_time_v1": 35, "memory_v0": 3984, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 84.72, "input": "import math\n\nn = int(input())\n\n\n\npower = math.factorial(n)\n\n\n\nprint((power % (10**9 + 7)))\n", "target": "import math\n\nn = int(input())\n\n\n\npower = 1\n\n\n\nfor i in range(1, n+1):\n\n power = i * power % (10**9 + 7)\n\n\n\nprint(power)\n", "code_v0_loc": 6, "code_v1_loc": 9, "code_v0_num_chars": 89, "code_v1_num_chars": 123, "code_v0_no_empty_lines": "import math\n\nn = int(input())\npower = math.factorial(n)\nprint((power % (10**9 + 7)))\n", "code_v1_no_empty_lines": "import math\n\nn = int(input())\npower = 1\nfor i in range(1, n + 1):\n power = i * power % (10**9 + 7)\nprint(power)\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-power = math.factorial(n)", "-print((power % (10**9 + 7)))", "+power = 1", "+for i in range(1, n + 1):", "+ power = i * power % (10**9 + 7)", "+print(power)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5500237288, "measured_runtime_v1": 0.2133381867, "runtime_lift": 2.5781775744, "key": ["s450924156", "s743009434"]} {"user_id": "u077898957", "problem_id": "p03796", "language": "python", "submission_id_v0": "s080864979", "submission_id_v1": "s354066004", "cpu_time_v0": 230, "cpu_time_v1": 42, "memory_v0": 3980, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 81.74, "input": "import math\n\nn = int(input())\n\nprint((math.factorial(n)%(10**9+7)))\n", "target": "n = int(input())\n\npw = 1\n\nfor i in range(n):\n\n pw *= (i+1)\n\n pw %= 10**9+7\n\nprint(pw)", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 66, "code_v1_num_chars": 87, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nprint((math.factorial(n) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\npw = 1\nfor i in range(n):\n pw *= i + 1\n pw %= 10**9 + 7\nprint(pw)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-import math", "-", "-print((math.factorial(n) % (10**9 + 7)))", "+pw = 1", "+for i in range(n):", "+ pw *= i + 1", "+ pw %= 10**9 + 7", "+print(pw)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.9190823469, "measured_runtime_v1": 0.4266894727, "runtime_lift": 2.1539841167, "key": ["s080864979", "s354066004"]} {"user_id": "u467041847", "problem_id": "p03416", "language": "python", "submission_id_v0": "s364629573", "submission_id_v1": "s490395080", "cpu_time_v0": 93, "cpu_time_v1": 62, "memory_v0": 3316, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "A,B = list(map(int,input().split()))\n\n\n\n\n\ndef kaibun(n):\n\n\tkey = 0\n\n\tfor i in range(1,n+1):\n\n\t\tif str(i) == str(i)[::-1]:\n\n\t\t\tkey += 1\n\n\treturn key\n\n\n\nprint((kaibun(B)-kaibun(A-1)))", "target": "A,B = list(map(int,input().split()))\n\n\n\n\n\ndef kaibun(m, n):\n\n\tkey = 0\n\n\tfor i in range(m,n+1):\n\n\t\tif str(i) == str(i)[::-1]:\n\n\t\t\tkey += 1\n\n\treturn key\n\n\n\nprint((kaibun(A,B)))", "code_v0_loc": 11, "code_v1_loc": 11, "code_v0_num_chars": 173, "code_v1_num_chars": 166, "code_v0_no_empty_lines": "A, B = list(map(int, input().split()))\n\n\ndef kaibun(n):\n key = 0\n for i in range(1, n + 1):\n if str(i) == str(i)[::-1]:\n key += 1\n return key\n\n\nprint((kaibun(B) - kaibun(A - 1)))\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\n\n\ndef kaibun(m, n):\n key = 0\n for i in range(m, n + 1):\n if str(i) == str(i)[::-1]:\n key += 1\n return key\n\n\nprint((kaibun(A, B)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-def kaibun(n):", "+def kaibun(m, n):", "- for i in range(1, n + 1):", "+ for i in range(m, n + 1):", "-print((kaibun(B) - kaibun(A - 1)))", "+print((kaibun(A, B)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5900465159, "measured_runtime_v1": 0.3264039189, "runtime_lift": 1.8077188467, "key": ["s364629573", "s490395080"]} {"user_id": "u868628468", "problem_id": "p02555", "language": "python", "submission_id_v0": "s517832809", "submission_id_v1": "s490323912", "cpu_time_v0": 151, "cpu_time_v1": 62, "memory_v0": 73984, "memory_v1": 63380, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 58.94, "input": "from sys import stdin\n\ndef solve():\n\n s = int(stdin.readline())\n\n mod = 10**9+7\n\n if s < 3: return 0\n\n dp = [0]*(s+1)\n\n dp[0] = 1\n\n for i in range(3,s+1):\n\n for x in range(3,i+1):\n\n if x in [i-1,i-2]:\n\n continue\n\n dp[i] += dp[i-x]\n\n return dp[s]%mod\n\nprint((solve()))", "target": "from sys import stdin\n\ndef solve():\n\n s = int(stdin.readline())\n\n mod = 10**9+7\n\n if s < 3: return 0\n\n dp = [0]*(s+1)\n\n dp[0] = 1\n\n for i in range(3,s+1):\n\n dp[i] = dp[i-1] + dp[i-3]\n\n return dp[s]%mod\n\nprint((solve()))", "code_v0_loc": 14, "code_v1_loc": 11, "code_v0_num_chars": 330, "code_v1_num_chars": 245, "code_v0_no_empty_lines": "from sys import stdin\n\n\ndef solve():\n s = int(stdin.readline())\n mod = 10**9 + 7\n if s < 3:\n return 0\n dp = [0] * (s + 1)\n dp[0] = 1\n for i in range(3, s + 1):\n for x in range(3, i + 1):\n if x in [i - 1, i - 2]:\n continue\n dp[i] += dp[i - x]\n return dp[s] % mod\n\n\nprint((solve()))\n", "code_v1_no_empty_lines": "from sys import stdin\n\n\ndef solve():\n s = int(stdin.readline())\n mod = 10**9 + 7\n if s < 3:\n return 0\n dp = [0] * (s + 1)\n dp[0] = 1\n for i in range(3, s + 1):\n dp[i] = dp[i - 1] + dp[i - 3]\n return dp[s] % mod\n\n\nprint((solve()))\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["- for x in range(3, i + 1):", "- if x in [i - 1, i - 2]:", "- continue", "- dp[i] += dp[i - x]", "+ dp[i] = dp[i - 1] + dp[i - 3]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6190335753, "measured_runtime_v1": 0.2015811858, "runtime_lift": 3.0708896406, "key": ["s517832809", "s490323912"]} {"user_id": "u678167152", "problem_id": "p02773", "language": "python", "submission_id_v0": "s779115559", "submission_id_v1": "s953043553", "cpu_time_v0": 682, "cpu_time_v1": 392, "memory_v0": 32096, "memory_v1": 38716, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 42.52, "input": "N = int(input())\n\ns_list = {}\n\nfor i in range(N):\n\n S = input()\n\n if S in list(s_list.keys()):\n\n s_list[S] += 1\n\n else:\n\n s_list[S] = 0\n\nmax = 0\n\nmaxs = []\n\nfor s,c in list(s_list.items()):\n\n if c > max:\n\n maxs = [s]\n\n max = c\n\n elif c == max:\n\n maxs.append(s)\n\nmaxs.sort()\n\nfor m in maxs:\n\n print(m)", "target": "from collections import Counter\n\ndef solve():\n\n N = int(input())\n\n S = [input() for _ in range(N)]\n\n c = Counter(S)\n\n M = max(c.values())\n\n ans = []\n\n for k,v in c.items():\n\n if v==M:\n\n ans.append(k)\n\n ans.sort()\n\n return ans\n\nprint(*solve(),sep='\\n')\n", "code_v0_loc": 19, "code_v1_loc": 13, "code_v0_num_chars": 309, "code_v1_num_chars": 267, "code_v0_no_empty_lines": "N = int(input())\ns_list = {}\nfor i in range(N):\n S = input()\n if S in list(s_list.keys()):\n s_list[S] += 1\n else:\n s_list[S] = 0\nmax = 0\nmaxs = []\nfor s, c in list(s_list.items()):\n if c > max:\n maxs = [s]\n max = c\n elif c == max:\n maxs.append(s)\nmaxs.sort()\nfor m in maxs:\n print(m)\n", "code_v1_no_empty_lines": "from collections import Counter\n\n\ndef solve():\n N = int(input())\n S = [input() for _ in range(N)]\n c = Counter(S)\n M = max(c.values())\n ans = []\n for k, v in c.items():\n if v == M:\n ans.append(k)\n ans.sort()\n return ans\n\n\nprint(*solve(), sep=\"\\n\")\n", "code_same": false, "relative_loc_diff_percent": 31.5789473684, "diff": ["-N = int(input())", "-s_list = {}", "-for i in range(N):", "- S = input()", "- if S in list(s_list.keys()):", "- s_list[S] += 1", "- else:", "- s_list[S] = 0", "-max = 0", "-maxs = []", "-for s, c in list(s_list.items()):", "- if c > max:", "- maxs = [s]", "- max = c", "- elif c == max:", "- maxs.append(s)", "-maxs.sort()", "-for m in maxs:", "- print(m)", "+from collections import Counter", "+", "+", "+def solve():", "+ N = int(input())", "+ S = [input() for _ in range(N)]", "+ c = Counter(S)", "+ M = max(c.values())", "+ ans = []", "+ for k, v in c.items():", "+ if v == M:", "+ ans.append(k)", "+ ans.sort()", "+ return ans", "+", "+", "+print(*solve(), sep=\"\\n\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1935686147, "measured_runtime_v1": 0.0062823365, "runtime_lift": 30.8115643329, "key": ["s779115559", "s953043553"]} {"user_id": "u018679195", "problem_id": "p03796", "language": "python", "submission_id_v0": "s992615685", "submission_id_v1": "s822858934", "cpu_time_v0": 232, "cpu_time_v1": 36, "memory_v0": 4024, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 84.48, "input": "import math\n\nx = int(input())\n\nprint((math.factorial(x) % (10**9 + 7)))", "target": "M = 1000000007\n\nn=int(input())\n\nf = 1\n\nfor i in range(1, n + 1): \n\n f = (f * i) % M \n\nprint(f)", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 69, "code_v1_num_chars": 98, "code_v0_no_empty_lines": "import math\n\nx = int(input())\nprint((math.factorial(x) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "M = 1000000007\nn = int(input())\nf = 1\nfor i in range(1, n + 1):\n f = (f * i) % M\nprint(f)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-import math", "-", "-x = int(input())", "-print((math.factorial(x) % (10**9 + 7)))", "+M = 1000000007", "+n = int(input())", "+f = 1", "+for i in range(1, n + 1):", "+ f = (f * i) % M", "+print(f)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5256081567, "measured_runtime_v1": 0.2486211307, "runtime_lift": 2.1140928576, "key": ["s992615685", "s822858934"]} {"user_id": "u926412290", "problem_id": "p02730", "language": "python", "submission_id_v0": "s449146060", "submission_id_v1": "s811980926", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "S = input()\n\nN = len(S)\n\nleft = S[:int(N/2)]\n\nright = S[int((N+2)/2):]\n\nS_reversed = \"\".join(reversed(list(S)))\n\nleft_reversed = \"\".join(reversed(list(left)))\n\nright_reversed = \"\".join(reversed(list(right)))\n\n\n\nif S == S_reversed and left == left_reversed and right == right_reversed:\n\n print(\"Yes\")\n\nelse:\n\n print(\"No\")", "target": "S = input()\n\nN = len(S)\n\nleft = S[:int(N/2)]\n\nright = S[int((N+2)/2):]\n\n\n\nif S == S[::-1] and left == left[::-1] and right == right[::-1]:\n\n print(\"Yes\")\n\nelse:\n\n print(\"No\")", "code_v0_loc": 12, "code_v1_loc": 9, "code_v0_num_chars": 326, "code_v1_num_chars": 180, "code_v0_no_empty_lines": "S = input()\nN = len(S)\nleft = S[: int(N / 2)]\nright = S[int((N + 2) / 2) :]\nS_reversed = \"\".join(reversed(list(S)))\nleft_reversed = \"\".join(reversed(list(left)))\nright_reversed = \"\".join(reversed(list(right)))\nif S == S_reversed and left == left_reversed and right == right_reversed:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_v1_no_empty_lines": "S = input()\nN = len(S)\nleft = S[: int(N / 2)]\nright = S[int((N + 2) / 2) :]\nif S == S[::-1] and left == left[::-1] and right == right[::-1]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-S_reversed = \"\".join(reversed(list(S)))", "-left_reversed = \"\".join(reversed(list(left)))", "-right_reversed = \"\".join(reversed(list(right)))", "-if S == S_reversed and left == left_reversed and right == right_reversed:", "+if S == S[::-1] and left == left[::-1] and right == right[::-1]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2928721476, "measured_runtime_v1": 0.0555575957, "runtime_lift": 5.2715050689, "key": ["s449146060", "s811980926"]} {"user_id": "u896741788", "problem_id": "p03416", "language": "python", "submission_id_v0": "s606562684", "submission_id_v1": "s721402043", "cpu_time_v0": 284, "cpu_time_v1": 62, "memory_v0": 3064, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 78.17, "input": "a,b=list(map(int,input().split()))\n\nans=0\n\nfor i in range(b+1)[a:]:\n\n if len(str(i))%2==0:\n\n p=list(str(i))[:len(str(i))//2]\n\n q=list(reversed(list(str(i))[len(str(i))//2:]))\n\n if p==q:\n\n ans+=1\n\n else:\n\n s=list(str(i))[:len(str(i))//2+1]\n\n d=list(reversed(list(str(i))[len(str(i))//2:]))\n\n if s==d:\n\n ans += 1\n\nprint(ans)", "target": "a,s=list(map(int,input().split()))\n\nad=0\n\nfor i in range(a,s+1):\n\n if str(i)==str(i)[::-1]:ad+=1\n\nprint(ad)", "code_v0_loc": 14, "code_v1_loc": 5, "code_v0_num_chars": 346, "code_v1_num_chars": 102, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\nans = 0\nfor i in range(b + 1)[a:]:\n if len(str(i)) % 2 == 0:\n p = list(str(i))[: len(str(i)) // 2]\n q = list(reversed(list(str(i))[len(str(i)) // 2 :]))\n if p == q:\n ans += 1\n else:\n s = list(str(i))[: len(str(i)) // 2 + 1]\n d = list(reversed(list(str(i))[len(str(i)) // 2 :]))\n if s == d:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "a, s = list(map(int, input().split()))\nad = 0\nfor i in range(a, s + 1):\n if str(i) == str(i)[::-1]:\n ad += 1\nprint(ad)\n", "code_same": false, "relative_loc_diff_percent": 64.2857142857, "diff": ["-a, b = list(map(int, input().split()))", "-ans = 0", "-for i in range(b + 1)[a:]:", "- if len(str(i)) % 2 == 0:", "- p = list(str(i))[: len(str(i)) // 2]", "- q = list(reversed(list(str(i))[len(str(i)) // 2 :]))", "- if p == q:", "- ans += 1", "- else:", "- s = list(str(i))[: len(str(i)) // 2 + 1]", "- d = list(reversed(list(str(i))[len(str(i)) // 2 :]))", "- if s == d:", "- ans += 1", "-print(ans)", "+a, s = list(map(int, input().split()))", "+ad = 0", "+for i in range(a, s + 1):", "+ if str(i) == str(i)[::-1]:", "+ ad += 1", "+print(ad)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6921946588, "measured_runtime_v1": 0.3831296915, "runtime_lift": 1.8066849794, "key": ["s606562684", "s721402043"]} {"user_id": "u590871958", "problem_id": "p01093", "language": "python", "submission_id_v0": "s330226420", "submission_id_v1": "s459093378", "cpu_time_v0": 50, "cpu_time_v1": 40, "memory_v0": 7684, "memory_v1": 7704, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 20.0, "input": "while int(input()) > 0:\n\n s = sorted(map(int, input().split()))\n\n print((min(abs(a - b) for (a, b) in zip(s, s[1:]))))", "target": "while True:\n\n if int(input()) == 0:\n\n break\n\n s = sorted(map(int, input().split()))\n\n r = min(abs(x - y) for (x, y) in zip(s, s[1:]))\n\n print(r)", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 122, "code_v1_num_chars": 163, "code_v0_no_empty_lines": "while int(input()) > 0:\n s = sorted(map(int, input().split()))\n print((min(abs(a - b) for (a, b) in zip(s, s[1:]))))\n", "code_v1_no_empty_lines": "while True:\n if int(input()) == 0:\n break\n s = sorted(map(int, input().split()))\n r = min(abs(x - y) for (x, y) in zip(s, s[1:]))\n print(r)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-while int(input()) > 0:", "+while True:", "+ if int(input()) == 0:", "+ break", "- print((min(abs(a - b) for (a, b) in zip(s, s[1:]))))", "+ r = min(abs(x - y) for (x, y) in zip(s, s[1:]))", "+ print(r)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2760278752, "measured_runtime_v1": 0.2140542445, "runtime_lift": 1.2895230169, "key": ["s330226420", "s459093378"]} {"user_id": "u392029857", "problem_id": "p03416", "language": "python", "submission_id_v0": "s263636434", "submission_id_v1": "s255168613", "cpu_time_v0": 110, "cpu_time_v1": 20, "memory_v0": 2940, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 81.82, "input": "A, B = list(map(int, input().split()))\n\nnumbers = list(range(A, B+1))\n\ncount = 0\n\nfor i in numbers:\n\n m = str(i)\n\n rm = ''.join(list(reversed(m)))\n\n if m == rm:\n\n count += 1\n\nprint(count)", "target": "A, B = list(map(int, input().split()))\n\nx = list(range(1,10))\n\ny = list(range(10))\n\ncount = 0\n\nfor p in x:\n\n for q in y:\n\n for r in y:\n\n sakasama = int(str(p)+str(q)+str(r)+str(q)+str(p))\n\n if A <= sakasama <= B:\n\n count += 1\n\nprint(count)", "code_v0_loc": 9, "code_v1_loc": 11, "code_v0_num_chars": 191, "code_v1_num_chars": 268, "code_v0_no_empty_lines": "A, B = list(map(int, input().split()))\nnumbers = list(range(A, B + 1))\ncount = 0\nfor i in numbers:\n m = str(i)\n rm = \"\".join(list(reversed(m)))\n if m == rm:\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\nx = list(range(1, 10))\ny = list(range(10))\ncount = 0\nfor p in x:\n for q in y:\n for r in y:\n sakasama = int(str(p) + str(q) + str(r) + str(q) + str(p))\n if A <= sakasama <= B:\n count += 1\nprint(count)\n", "code_same": false, "relative_loc_diff_percent": 18.1818181818, "diff": ["-numbers = list(range(A, B + 1))", "+x = list(range(1, 10))", "+y = list(range(10))", "-for i in numbers:", "- m = str(i)", "- rm = \"\".join(list(reversed(m)))", "- if m == rm:", "- count += 1", "+for p in x:", "+ for q in y:", "+ for r in y:", "+ sakasama = int(str(p) + str(q) + str(r) + str(q) + str(p))", "+ if A <= sakasama <= B:", "+ count += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3536295901, "measured_runtime_v1": 0.1996227459, "runtime_lift": 1.7714894587, "key": ["s263636434", "s255168613"]} {"user_id": "u855831834", "problem_id": "p02596", "language": "python", "submission_id_v0": "s777833838", "submission_id_v1": "s349314776", "cpu_time_v0": 179, "cpu_time_v1": 88, "memory_v0": 9072, "memory_v1": 63520, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 50.84, "input": "k = int(input())\n\nnum = 0\n\nif not k%2:\n\n print((-1))\n\nelse:\n\n for i in range(k):\n\n num = (num*10+7)%k\n\n if num == 0:\n\n print((i+1))\n\n break\n\n else:\n\n print((-1))", "target": "K = int(input())\n\n\n\nans = 1\n\nnum = 0\n\nseven = 7\n\n\n\nif not K%2:\n\n print((-1))\n\nelse:\n\n for i in range(K):\n\n num = num + seven\n\n seven = seven*10%K\n\n num = num%K\n\n if num == 0:\n\n print(ans)\n\n break\n\n ans += 1\n\n else:\n\n print((-1))", "code_v0_loc": 12, "code_v1_loc": 19, "code_v0_num_chars": 207, "code_v1_num_chars": 297, "code_v0_no_empty_lines": "k = int(input())\nnum = 0\nif not k % 2:\n print((-1))\nelse:\n for i in range(k):\n num = (num * 10 + 7) % k\n if num == 0:\n print((i + 1))\n break\n else:\n print((-1))\n", "code_v1_no_empty_lines": "K = int(input())\nans = 1\nnum = 0\nseven = 7\nif not K % 2:\n print((-1))\nelse:\n for i in range(K):\n num = num + seven\n seven = seven * 10 % K\n num = num % K\n if num == 0:\n print(ans)\n break\n ans += 1\n else:\n print((-1))\n", "code_same": false, "relative_loc_diff_percent": 36.8421052632, "diff": ["-k = int(input())", "+K = int(input())", "+ans = 1", "-if not k % 2:", "+seven = 7", "+if not K % 2:", "- for i in range(k):", "- num = (num * 10 + 7) % k", "+ for i in range(K):", "+ num = num + seven", "+ seven = seven * 10 % K", "+ num = num % K", "- print((i + 1))", "+ print(ans)", "+ ans += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.513984643, "measured_runtime_v1": 0.3340408325, "runtime_lift": 1.5386880672, "key": ["s777833838", "s349314776"]} {"user_id": "u444560129", "problem_id": "p02596", "language": "python", "submission_id_v0": "s838540391", "submission_id_v1": "s786083962", "cpu_time_v0": 192, "cpu_time_v1": 156, "memory_v0": 9088, "memory_v1": 9172, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 18.75, "input": "k = int(input())\n\ncount = 1\n\nn = 0\n\nif k % 2 == 0 or k % 5 == 0:\n\n print((-1))\n\nelse:\n\n while 1:\n\n n = (n * 10 + 7) % k \n\n if n == 0:\n\n break \n\n count += 1\n\n print(count)", "target": "def main(h):\n\n count = 1\n\n n = 0\n\n for i in range (k):\n\n n = (n * 10 + 7) % k \n\n if n == 0: \n\n print(count)\n\n return 0\n\n count += 1\n\n print((-1))\n\n \n\nif __name__ == '__main__':\n\n k = int(input())\n\n main(k)", "code_v0_loc": 12, "code_v1_loc": 14, "code_v0_num_chars": 196, "code_v1_num_chars": 230, "code_v0_no_empty_lines": "k = int(input())\ncount = 1\nn = 0\nif k % 2 == 0 or k % 5 == 0:\n print((-1))\nelse:\n while 1:\n n = (n * 10 + 7) % k\n if n == 0:\n break\n count += 1\n print(count)\n", "code_v1_no_empty_lines": "def main(h):\n count = 1\n n = 0\n for i in range(k):\n n = (n * 10 + 7) % k\n if n == 0:\n print(count)\n return 0\n count += 1\n print((-1))\n\n\nif __name__ == \"__main__\":\n k = int(input())\n main(k)\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-k = int(input())", "-count = 1", "-n = 0", "-if k % 2 == 0 or k % 5 == 0:", "- print((-1))", "-else:", "- while 1:", "+def main(h):", "+ count = 1", "+ n = 0", "+ for i in range(k):", "- break", "+ print(count)", "+ return 0", "- print(count)", "+ print((-1))", "+", "+", "+if __name__ == \"__main__\":", "+ k = int(input())", "+ main(k)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.359774395, "measured_runtime_v1": 0.0061541715, "runtime_lift": 58.4602486856, "key": ["s838540391", "s786083962"]} {"user_id": "u089376182", "problem_id": "p03250", "language": "python", "submission_id_v0": "s131709017", "submission_id_v1": "s244884559", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "a, b, c = sorted(map(int, input().split()))\n\n\n\nprint((c*10 + b + a))", "target": "a, b, c = list(map(int, input().split()))\n\n\n\nprint((max(a, b, c)*9 + (a + b + c)))", "code_v0_loc": 3, "code_v1_loc": 3, "code_v0_num_chars": 66, "code_v1_num_chars": 74, "code_v0_no_empty_lines": "a, b, c = sorted(map(int, input().split()))\nprint((c * 10 + b + a))\n", "code_v1_no_empty_lines": "a, b, c = list(map(int, input().split()))\nprint((max(a, b, c) * 9 + (a + b + c)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-a, b, c = sorted(map(int, input().split()))", "-print((c * 10 + b + a))", "+a, b, c = list(map(int, input().split()))", "+print((max(a, b, c) * 9 + (a + b + c)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2633334219, "measured_runtime_v1": 0.0501041813, "runtime_lift": 5.2557174893, "key": ["s131709017", "s244884559"]} {"user_id": "u813098295", "problem_id": "p03371", "language": "python", "submission_id_v0": "s229566237", "submission_id_v1": "s072536815", "cpu_time_v0": 222, "cpu_time_v1": 129, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 41.89, "input": "a, b, c, x, y = list(map(int, input().split()))\n\nans = float('inf')\n\n\n\nfor i in range(200005):\n\n tmp = i * 2 * c\n\n tmp += max(0, x-i) * a\n\n tmp += max(0, y-i) * b\n\n ans = min(ans, tmp)\n\n\n\nprint(ans)", "target": "a, b, c, x, y = list(map(int, input().split()))\n\nans = float('inf')\n\n\n\nfor i in range(100005):\n\n tmp = i * 2 * c\n\n tmp += max(0, x-i) * a\n\n tmp += max(0, y-i) * b\n\n ans = min(ans, tmp)\n\n\n\nprint(ans)", "code_v0_loc": 10, "code_v1_loc": 10, "code_v0_num_chars": 204, "code_v1_num_chars": 204, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(200005):\n tmp = i * 2 * c\n tmp += max(0, x - i) * a\n tmp += max(0, y - i) * b\n ans = min(ans, tmp)\nprint(ans)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(100005):\n tmp = i * 2 * c\n tmp += max(0, x - i) * a\n tmp += max(0, y - i) * b\n ans = min(ans, tmp)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-for i in range(200005):", "+for i in range(100005):"], "diff_only_import_comment": false, "measured_runtime_v0": 2.0992211397, "measured_runtime_v1": 1.3130319312, "runtime_lift": 1.5987586363, "key": ["s229566237", "s072536815"]} {"user_id": "u576434377", "problem_id": "p03568", "language": "python", "submission_id_v0": "s245503579", "submission_id_v1": "s305475228", "cpu_time_v0": 101, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.17, "input": "N = int(input())\n\nAs = list(map(int,input().split()))\n\n\n\n\n\ndef dfs(A_s, index,Bss):\n\n if index == N:\n\n tmp = 1\n\n for b in Bss:\n\n tmp *= b\n\n return 1 if tmp % 2 == 0 else 0\n\n b_mi = Bss.copy()\n\n b_mi.append(A_s[index] - 1)\n\n\n\n b = Bss.copy()\n\n b.append(A_s[index])\n\n\n\n b_pl = Bss.copy()\n\n b_pl.append(A_s[index] + 1)\n\n return dfs(A_s,index + 1, b_mi) + dfs(A_s,index + 1,b) + dfs(A_s,index + 1,b_pl)\n\n\n\n\n\nprint((dfs(As,0,[])))\n", "target": "N = int(input())\n\nAs = list(map(int,input().split()))\n\n\n\ntmp = 1\n\nfor i in range(N):\n\n if As[i] % 2 == 0:\n\n tmp *= 2\n\n\n\nprint((3 ** N - tmp))", "code_v0_loc": 22, "code_v1_loc": 9, "code_v0_num_chars": 480, "code_v1_num_chars": 148, "code_v0_no_empty_lines": "N = int(input())\nAs = list(map(int, input().split()))\n\n\ndef dfs(A_s, index, Bss):\n if index == N:\n tmp = 1\n for b in Bss:\n tmp *= b\n return 1 if tmp % 2 == 0 else 0\n b_mi = Bss.copy()\n b_mi.append(A_s[index] - 1)\n b = Bss.copy()\n b.append(A_s[index])\n b_pl = Bss.copy()\n b_pl.append(A_s[index] + 1)\n return (\n dfs(A_s, index + 1, b_mi) + dfs(A_s, index + 1, b) + dfs(A_s, index + 1, b_pl)\n )\n\n\nprint((dfs(As, 0, [])))\n", "code_v1_no_empty_lines": "N = int(input())\nAs = list(map(int, input().split()))\ntmp = 1\nfor i in range(N):\n if As[i] % 2 == 0:\n tmp *= 2\nprint((3**N - tmp))\n", "code_same": false, "relative_loc_diff_percent": 59.0909090909, "diff": ["-", "-", "-def dfs(A_s, index, Bss):", "- if index == N:", "- tmp = 1", "- for b in Bss:", "- tmp *= b", "- return 1 if tmp % 2 == 0 else 0", "- b_mi = Bss.copy()", "- b_mi.append(A_s[index] - 1)", "- b = Bss.copy()", "- b.append(A_s[index])", "- b_pl = Bss.copy()", "- b_pl.append(A_s[index] + 1)", "- return (", "- dfs(A_s, index + 1, b_mi) + dfs(A_s, index + 1, b) + dfs(A_s, index + 1, b_pl)", "- )", "-", "-", "-print((dfs(As, 0, [])))", "+tmp = 1", "+for i in range(N):", "+ if As[i] % 2 == 0:", "+ tmp *= 2", "+print((3**N - tmp))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4574659042, "measured_runtime_v1": 0.2742938831, "runtime_lift": 1.6677947721, "key": ["s245503579", "s305475228"]} {"user_id": "u414877092", "problem_id": "p03796", "language": "python", "submission_id_v0": "s477602976", "submission_id_v1": "s500304823", "cpu_time_v0": 230, "cpu_time_v1": 31, "memory_v0": 4024, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 86.52, "input": "import math\n\nn=int(input())\n\nprint((math.factorial(n)%(10**9+7)))", "target": "N=int(input())\n\ndef fact(n):\n\n val=1\n\n for i in range(2,n+1):\n\n val*=i\n\n val%=1000000007\n\n return val\n\nprint((fact(N)))", "code_v0_loc": 3, "code_v1_loc": 8, "code_v0_num_chars": 63, "code_v1_num_chars": 140, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nprint((math.factorial(n) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "N = int(input())\n\n\ndef fact(n):\n val = 1\n for i in range(2, n + 1):\n val *= i\n val %= 1000000007\n return val\n\n\nprint((fact(N)))\n", "code_same": false, "relative_loc_diff_percent": 62.5, "diff": ["-import math", "+N = int(input())", "-n = int(input())", "-print((math.factorial(n) % (10**9 + 7)))", "+", "+def fact(n):", "+ val = 1", "+ for i in range(2, n + 1):", "+ val *= i", "+ val %= 1000000007", "+ return val", "+", "+", "+print((fact(N)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5394072673, "measured_runtime_v1": 0.259771318, "runtime_lift": 2.0764696871, "key": ["s477602976", "s500304823"]} {"user_id": "u573754721", "problem_id": "p02792", "language": "python", "submission_id_v0": "s001079757", "submission_id_v1": "s791261959", "cpu_time_v0": 461, "cpu_time_v1": 326, "memory_v0": 40684, "memory_v1": 40428, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 29.28, "input": "n=int(input())\n\nD={}\n\nDD={}\n\nfor i in range(1,n+1):\n\n s=(str(i)[0],str(i)[-1])\n\n t=(str(i)[-1],str(i)[0])\n\n if s not in D:\n\n D[s]=1\n\n else:\n\n D[s]+=1\n\n if t not in DD:\n\n DD[t]=1\n\n else:\n\n DD[t]+=1\n\nans=0\n\nfor i in D:\n\n if i in DD:\n\n ans+=D[i]*DD[i]\n\nprint(ans)\n\n ", "target": "n=int(input())\n\nD={}\n\nfor i in range(1,n+1):\n\n s=(str(i)[0],str(i)[-1])\n\n if s in D:\n\n D[s]+=1\n\n else:\n\n D[s]=1\n\n\n\nans=0\n\nfor aj,bj in D:\n\n if (bj,aj) in D:\n\n ans+=D[(aj,bj)]*D[(bj,aj)]\n\nprint(ans)", "code_v0_loc": 20, "code_v1_loc": 14, "code_v0_num_chars": 307, "code_v1_num_chars": 220, "code_v0_no_empty_lines": "n = int(input())\nD = {}\nDD = {}\nfor i in range(1, n + 1):\n s = (str(i)[0], str(i)[-1])\n t = (str(i)[-1], str(i)[0])\n if s not in D:\n D[s] = 1\n else:\n D[s] += 1\n if t not in DD:\n DD[t] = 1\n else:\n DD[t] += 1\nans = 0\nfor i in D:\n if i in DD:\n ans += D[i] * DD[i]\nprint(ans)\n", "code_v1_no_empty_lines": "n = int(input())\nD = {}\nfor i in range(1, n + 1):\n s = (str(i)[0], str(i)[-1])\n if s in D:\n D[s] += 1\n else:\n D[s] = 1\nans = 0\nfor aj, bj in D:\n if (bj, aj) in D:\n ans += D[(aj, bj)] * D[(bj, aj)]\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["-DD = {}", "- t = (str(i)[-1], str(i)[0])", "- if s not in D:", "+ if s in D:", "+ D[s] += 1", "+ else:", "- else:", "- D[s] += 1", "- if t not in DD:", "- DD[t] = 1", "- else:", "- DD[t] += 1", "-for i in D:", "- if i in DD:", "- ans += D[i] * DD[i]", "+for aj, bj in D:", "+ if (bj, aj) in D:", "+ ans += D[(aj, bj)] * D[(bj, aj)]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4521915812, "measured_runtime_v1": 0.3498246684, "runtime_lift": 1.2926234825, "key": ["s001079757", "s791261959"]} {"user_id": "u486297080", "problem_id": "p03796", "language": "python", "submission_id_v0": "s015826115", "submission_id_v1": "s256698183", "cpu_time_v0": 231, "cpu_time_v1": 37, "memory_v0": 4020, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.98, "input": "import math\n\n\n\nN = int(input())\n\nans = 0\n\n\n\nans =math.factorial(N) % (10**9 +7)\n\n\n\nprint(ans)", "target": "N = int(input())\n\npower = 1\n\n\n\nfor i in range(N):\n\n power = ((i+1) * power) % 1000000007\n\n\n\nprint(power)", "code_v0_loc": 8, "code_v1_loc": 7, "code_v0_num_chars": 93, "code_v1_num_chars": 107, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nans = 0\nans = math.factorial(N) % (10**9 + 7)\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\npower = 1\nfor i in range(N):\n power = ((i + 1) * power) % 1000000007\nprint(power)\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-import math", "-", "-ans = 0", "-ans = math.factorial(N) % (10**9 + 7)", "-print(ans)", "+power = 1", "+for i in range(N):", "+ power = ((i + 1) * power) % 1000000007", "+print(power)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5450858786, "measured_runtime_v1": 0.2547745125, "runtime_lift": 2.1394835503, "key": ["s015826115", "s256698183"]} {"user_id": "u969190727", "problem_id": "p03371", "language": "python", "submission_id_v0": "s944521020", "submission_id_v1": "s713825460", "cpu_time_v0": 121, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 85.95, "input": "a,b,c,x,y=list(map(int,input().split()))\n\nans=a*x+b*y\n\nn=max(x,y)\n\nfor i in range(1,n+1):\n\n ans=min(ans,2*i*c+a*max(0,x-i)+b*max(0,y-i))\n\nprint(ans)\n\n\n\n\n", "target": "a,b,c,x,y=list(map(int,input().split()))\n\nans1=a*x+b*y\n\nans2=2*c*max(x,y)\n\nans3=2*c*min(x,y)+a*(x-min(x,y))+b*(y-min(x,y))\n\nprint((min(ans1,ans2,ans3)))", "code_v0_loc": 8, "code_v1_loc": 5, "code_v0_num_chars": 148, "code_v1_num_chars": 144, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = a * x + b * y\nn = max(x, y)\nfor i in range(1, n + 1):\n ans = min(ans, 2 * i * c + a * max(0, x - i) + b * max(0, y - i))\nprint(ans)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans1 = a * x + b * y\nans2 = 2 * c * max(x, y)\nans3 = 2 * c * min(x, y) + a * (x - min(x, y)) + b * (y - min(x, y))\nprint((min(ans1, ans2, ans3)))\n", "code_same": false, "relative_loc_diff_percent": 37.5, "diff": ["-ans = a * x + b * y", "-n = max(x, y)", "-for i in range(1, n + 1):", "- ans = min(ans, 2 * i * c + a * max(0, x - i) + b * max(0, y - i))", "-print(ans)", "+ans1 = a * x + b * y", "+ans2 = 2 * c * max(x, y)", "+ans3 = 2 * c * min(x, y) + a * (x - min(x, y)) + b * (y - min(x, y))", "+print((min(ans1, ans2, ans3)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.247306282, "measured_runtime_v1": 0.1774894836, "runtime_lift": 1.3933573811, "key": ["s944521020", "s713825460"]} {"user_id": "u879870653", "problem_id": "p03325", "language": "python", "submission_id_v0": "s933212033", "submission_id_v1": "s130104970", "cpu_time_v0": 143, "cpu_time_v1": 121, "memory_v0": 4148, "memory_v1": 4148, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.38, "input": "answer = 0\n\nN = int(input())\n\nA = list(map(int,input().split()))\n\nfor i in range(N) :\n\n while A[i] % 2 == 0 :\n\n A[i] = A[i] / 2\n\n answer += 1\n\nprint(answer)\n\n\n", "target": "N = int(input())\n\nL = list(map(int,input().split()))\n\n\n\nans = 0\n\nfor i in range(N) :\n\n flag = 0\n\n while flag == 0 :\n\n if (L[i] % 2) == 0 :\n\n ans += 1\n\n L[i] = L[i]//2\n\n else :\n\n flag = 1\n\nprint(ans)\n", "code_v0_loc": 9, "code_v1_loc": 13, "code_v0_num_chars": 176, "code_v1_num_chars": 252, "code_v0_no_empty_lines": "answer = 0\nN = int(input())\nA = list(map(int, input().split()))\nfor i in range(N):\n while A[i] % 2 == 0:\n A[i] = A[i] / 2\n answer += 1\nprint(answer)\n", "code_v1_no_empty_lines": "N = int(input())\nL = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n flag = 0\n while flag == 0:\n if (L[i] % 2) == 0:\n ans += 1\n L[i] = L[i] // 2\n else:\n flag = 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 30.7692307692, "diff": ["-answer = 0", "-A = list(map(int, input().split()))", "+L = list(map(int, input().split()))", "+ans = 0", "- while A[i] % 2 == 0:", "- A[i] = A[i] / 2", "- answer += 1", "-print(answer)", "+ flag = 0", "+ while flag == 0:", "+ if (L[i] % 2) == 0:", "+ ans += 1", "+ L[i] = L[i] // 2", "+ else:", "+ flag = 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2890260706, "measured_runtime_v1": 0.1461268132, "runtime_lift": 1.9779126383, "key": ["s933212033", "s130104970"]} {"user_id": "u728498511", "problem_id": "p03416", "language": "python", "submission_id_v0": "s773095214", "submission_id_v1": "s841162290", "cpu_time_v0": 111, "cpu_time_v1": 67, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 39.64, "input": "n, m = list(map(int, input().split()))\n\nans = 0\n\nfor i in range(n, m+1):\n\n if str(i)[0]+str(i)[1] == str(i)[-1]+str(i)[-2]: ans += 1\n\nprint(ans)", "target": "a, b = list(map(int, input().split()))\n\nans = 0\n\nfor n in range(a, b+1):\n\n if str(n) == str(n)[::-1]: ans += 1\n\nprint(ans)", "code_v0_loc": 5, "code_v1_loc": 5, "code_v0_num_chars": 141, "code_v1_num_chars": 119, "code_v0_no_empty_lines": "n, m = list(map(int, input().split()))\nans = 0\nfor i in range(n, m + 1):\n if str(i)[0] + str(i)[1] == str(i)[-1] + str(i)[-2]:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\nans = 0\nfor n in range(a, b + 1):\n if str(n) == str(n)[::-1]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-n, m = list(map(int, input().split()))", "+a, b = list(map(int, input().split()))", "-for i in range(n, m + 1):", "- if str(i)[0] + str(i)[1] == str(i)[-1] + str(i)[-2]:", "+for n in range(a, b + 1):", "+ if str(n) == str(n)[::-1]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6137721554, "measured_runtime_v1": 0.3378130706, "runtime_lift": 1.8168987785, "key": ["s773095214", "s841162290"]} {"user_id": "u498511622", "problem_id": "p00001", "language": "python", "submission_id_v0": "s534000808", "submission_id_v1": "s891056906", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 7536, "memory_v1": 7656, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "ans=[]\n\nfor i in range (0,10):\n\n ans.append(int(input()))\n\nans.sort(reverse=True)\n\nfor i in range (0,3):\n\n print((ans[i]))", "target": "mountain=[]\n\nfor s in range(0,10):\n\n mountain.append(int(input()))\n\nmountain.sort(reverse=True)\n\nfor s in range(0,3):\n\n print((mountain[s]))", "code_v0_loc": 6, "code_v1_loc": 6, "code_v0_num_chars": 126, "code_v1_num_chars": 141, "code_v0_no_empty_lines": "ans = []\nfor i in range(0, 10):\n ans.append(int(input()))\nans.sort(reverse=True)\nfor i in range(0, 3):\n print((ans[i]))\n", "code_v1_no_empty_lines": "mountain = []\nfor s in range(0, 10):\n mountain.append(int(input()))\nmountain.sort(reverse=True)\nfor s in range(0, 3):\n print((mountain[s]))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-ans = []", "-for i in range(0, 10):", "- ans.append(int(input()))", "-ans.sort(reverse=True)", "-for i in range(0, 3):", "- print((ans[i]))", "+mountain = []", "+for s in range(0, 10):", "+ mountain.append(int(input()))", "+mountain.sort(reverse=True)", "+for s in range(0, 3):", "+ print((mountain[s]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3030959003, "measured_runtime_v1": 0.0643225815, "runtime_lift": 4.7121227575, "key": ["s534000808", "s891056906"]} {"user_id": "u530383736", "problem_id": "p02555", "language": "python", "submission_id_v0": "s720124366", "submission_id_v1": "s340965185", "cpu_time_v0": 275, "cpu_time_v1": 33, "memory_v0": 9116, "memory_v1": 9000, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 88.0, "input": "# -*- coding: utf-8 -*-\n\nimport sys\n\n\n\n\n\ndef main():\n\n S = int( sys.stdin.readline() )\n\n\n\n dp = [0]*(S+1)\n\n dp[0] = 1\n\n mod = 10**9 + 7\n\n\n\n for i in range(3, S+1):\n\n cnt = 0\n\n\n\n for j in range(3, i+1):\n\n cnt += dp[i-j]\n\n cnt %= mod\n\n \n\n dp[i] = cnt\n\n\n\n\n\n print((dp[-1]))\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()\n", "target": "# -*- coding: utf-8 -*-\n\nimport sys\n\n\n\n\n\ndef main():\n\n S = int( sys.stdin.readline() )\n\n\n\n dp = [0]*(S+1)\n\n dp[0] = 1\n\n mod = 10**9 + 7\n\n\n\n for i in range(3, S+1):\n\n dp[i] = dp[i-3] + dp[i-1]\n\n dp[i] %= mod\n\n \n\n\n\n print((dp[-1]))\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()\n", "code_v0_loc": 26, "code_v1_loc": 21, "code_v0_num_chars": 381, "code_v1_num_chars": 307, "code_v0_no_empty_lines": "# -*- coding: utf-8 -*-\nimport sys\n\n\ndef main():\n S = int(sys.stdin.readline())\n dp = [0] * (S + 1)\n dp[0] = 1\n mod = 10**9 + 7\n for i in range(3, S + 1):\n cnt = 0\n for j in range(3, i + 1):\n cnt += dp[i - j]\n cnt %= mod\n dp[i] = cnt\n print((dp[-1]))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "# -*- coding: utf-8 -*-\nimport sys\n\n\ndef main():\n S = int(sys.stdin.readline())\n dp = [0] * (S + 1)\n dp[0] = 1\n mod = 10**9 + 7\n for i in range(3, S + 1):\n dp[i] = dp[i - 3] + dp[i - 1]\n dp[i] %= mod\n print((dp[-1]))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 19.2307692308, "diff": ["- cnt = 0", "- for j in range(3, i + 1):", "- cnt += dp[i - j]", "- cnt %= mod", "- dp[i] = cnt", "+ dp[i] = dp[i - 3] + dp[i - 1]", "+ dp[i] %= mod"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4620170944, "measured_runtime_v1": 0.1881556332, "runtime_lift": 2.4555049799, "key": ["s720124366", "s340965185"]} {"user_id": "u678167152", "problem_id": "p02785", "language": "python", "submission_id_v0": "s271865493", "submission_id_v1": "s007549888", "cpu_time_v0": 145, "cpu_time_v1": 112, "memory_v0": 104796, "memory_v1": 31552, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 22.76, "input": "def solve():\n\n N, K = list(map(int, input().split()))\n\n H = list(map(int, input().split()))\n\n if K>=N:\n\n return 0\n\n H.sort()\n\n ans = sum(H[:N-K])\n\n return ans\n\nprint((solve()))", "target": "def solve():\n\n N, K = list(map(int, input().split()))\n\n H = list(map(int, input().split()))\n\n H.sort()\n\n ans = sum(H[:max(N-K,0)])\n\n return ans\n\nprint((solve()))", "code_v0_loc": 9, "code_v1_loc": 7, "code_v0_num_chars": 177, "code_v1_num_chars": 158, "code_v0_no_empty_lines": "def solve():\n N, K = list(map(int, input().split()))\n H = list(map(int, input().split()))\n if K >= N:\n return 0\n H.sort()\n ans = sum(H[: N - K])\n return ans\n\n\nprint((solve()))\n", "code_v1_no_empty_lines": "def solve():\n N, K = list(map(int, input().split()))\n H = list(map(int, input().split()))\n H.sort()\n ans = sum(H[: max(N - K, 0)])\n return ans\n\n\nprint((solve()))\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["- if K >= N:", "- return 0", "- ans = sum(H[: N - K])", "+ ans = sum(H[: max(N - K, 0)])"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1896718335, "measured_runtime_v1": 0.0060620093, "runtime_lift": 31.2886079077, "key": ["s271865493", "s007549888"]} {"user_id": "u583507988", "problem_id": "p03835", "language": "python", "submission_id_v0": "s254920914", "submission_id_v1": "s788748142", "cpu_time_v0": 1001, "cpu_time_v1": 785, "memory_v0": 9104, "memory_v1": 9072, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.58, "input": "k, s = list(map(int, input().split()))\n\n\n\nans = 0\n\nfor x in range(k+1):\n\n for y in range(k+1):\n\n if 0<=s-x-y<=k:\n\n ans += 1\n\n \n\nprint(ans)", "target": "k,s=list(map(int,input().split()))\n\nans=0\n\nfor i in range(k+1):\n\n num=s-i\n\n for j in range(min(num+1,k+1)):\n\n if 0<=num-j<=k:\n\n ans+=1\n\nprint(ans)", "code_v0_loc": 9, "code_v1_loc": 8, "code_v0_num_chars": 146, "code_v1_num_chars": 150, "code_v0_no_empty_lines": "k, s = list(map(int, input().split()))\nans = 0\nfor x in range(k + 1):\n for y in range(k + 1):\n if 0 <= s - x - y <= k:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "k, s = list(map(int, input().split()))\nans = 0\nfor i in range(k + 1):\n num = s - i\n for j in range(min(num + 1, k + 1)):\n if 0 <= num - j <= k:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-for x in range(k + 1):", "- for y in range(k + 1):", "- if 0 <= s - x - y <= k:", "+for i in range(k + 1):", "+ num = s - i", "+ for j in range(min(num + 1, k + 1)):", "+ if 0 <= num - j <= k:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2276177601, "measured_runtime_v1": 0.0063076721, "runtime_lift": 36.0858579862, "key": ["s254920914", "s788748142"]} {"user_id": "u528470578", "problem_id": "p03680", "language": "python", "submission_id_v0": "s142356798", "submission_id_v1": "s532531190", "cpu_time_v0": 547, "cpu_time_v1": 248, "memory_v0": 7084, "memory_v1": 7084, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 54.66, "input": "import sys\n\n\n\nN = int(input())\n\na = [int(input()) for _ in range(N)]\n\n\n\nl = 1\n\np = a[0] - 1\n\n\n\nif a[0] == 2:\n\n print(l)\n\n sys.exit()\n\n\n\nwhile l < int(1e6):\n\n l += 1\n\n if a[p] == 2:\n\n print(l)\n\n break\n\n else:\n\n p = a[p] - 1\n\nelse:\n\n print((-1))", "target": "import sys\n\n\n\nN = int(input())\n\na = [int(input()) for _ in range(N)]\n\n\n\nl = 1\n\np = a[0] - 1\n\n\n\nif a[0] == 2:\n\n print(l)\n\n sys.exit()\n\n\n\nwhile l < int(2e5):\n\n l += 1\n\n if a[p] == 2:\n\n print(l)\n\n break\n\n else:\n\n p = a[p] - 1\n\nelse:\n\n print((-1))", "code_v0_loc": 21, "code_v1_loc": 21, "code_v0_num_chars": 280, "code_v1_num_chars": 280, "code_v0_no_empty_lines": "import sys\n\nN = int(input())\na = [int(input()) for _ in range(N)]\nl = 1\np = a[0] - 1\nif a[0] == 2:\n print(l)\n sys.exit()\nwhile l < int(1e6):\n l += 1\n if a[p] == 2:\n print(l)\n break\n else:\n p = a[p] - 1\nelse:\n print((-1))\n", "code_v1_no_empty_lines": "import sys\n\nN = int(input())\na = [int(input()) for _ in range(N)]\nl = 1\np = a[0] - 1\nif a[0] == 2:\n print(l)\n sys.exit()\nwhile l < int(2e5):\n l += 1\n if a[p] == 2:\n print(l)\n break\n else:\n p = a[p] - 1\nelse:\n print((-1))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-while l < int(1e6):", "+while l < int(2e5):"], "diff_only_import_comment": false, "measured_runtime_v0": 1.1321929171, "measured_runtime_v1": 0.4105077217, "runtime_lift": 2.7580307442, "key": ["s142356798", "s532531190"]} {"user_id": "u359358631", "problem_id": "p03796", "language": "python", "submission_id_v0": "s916466489", "submission_id_v1": "s520315696", "cpu_time_v0": 158, "cpu_time_v1": 44, "memory_v0": 10172, "memory_v1": 8932, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 72.15, "input": "import math\n\n\n\n\n\ndef main():\n\n N = int(input())\n\n power = math.factorial(N)\n\n print((power % (10 ** 9 + 7)))\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()\n", "target": "def main():\n\n N = int(input())\n\n power = 1\n\n for i in range(1, N + 1):\n\n power *= i\n\n power %= 10 ** 9 + 7\n\n print(power)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()\n", "code_v0_loc": 11, "code_v1_loc": 11, "code_v0_num_chars": 160, "code_v1_num_chars": 192, "code_v0_no_empty_lines": "import math\n\n\ndef main():\n N = int(input())\n power = math.factorial(N)\n print((power % (10**9 + 7)))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "def main():\n N = int(input())\n power = 1\n for i in range(1, N + 1):\n power *= i\n power %= 10**9 + 7\n print(power)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-import math", "-", "-", "- power = math.factorial(N)", "- print((power % (10**9 + 7)))", "+ power = 1", "+ for i in range(1, N + 1):", "+ power *= i", "+ power %= 10**9 + 7", "+ print(power)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7842813587, "measured_runtime_v1": 0.3569579227, "runtime_lift": 2.1971255121, "key": ["s916466489", "s520315696"]} {"user_id": "u259738923", "problem_id": "p03796", "language": "python", "submission_id_v0": "s911512169", "submission_id_v1": "s353747803", "cpu_time_v0": 231, "cpu_time_v1": 41, "memory_v0": 3972, "memory_v1": 7396, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.25, "input": "import math\n\nN = int(input())\n\nans = math.factorial(N) % (10 ** 9 + 7)\n\nprint(ans)", "target": "n = int(input())\n\nfrom functools import reduce\n\nprint((reduce(lambda x,y:x*y%1000000007,list(range(1,n+1)))))", "code_v0_loc": 4, "code_v1_loc": 3, "code_v0_num_chars": 82, "code_v1_num_chars": 107, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nans = math.factorial(N) % (10**9 + 7)\nprint(ans)\n", "code_v1_no_empty_lines": "n = int(input())\nfrom functools import reduce\n\nprint((reduce(lambda x, y: x * y % 1000000007, list(range(1, n + 1)))))\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-import math", "+n = int(input())", "+from functools import reduce", "-N = int(input())", "-ans = math.factorial(N) % (10**9 + 7)", "-print(ans)", "+print((reduce(lambda x, y: x * y % 1000000007, list(range(1, n + 1)))))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5315986769, "measured_runtime_v1": 0.2369310765, "runtime_lift": 2.2436848922, "key": ["s911512169", "s353747803"]} {"user_id": "u775681539", "problem_id": "p03371", "language": "python", "submission_id_v0": "s986639109", "submission_id_v1": "s095330807", "cpu_time_v0": 186, "cpu_time_v1": 89, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 52.15, "input": "#python3\n\nINF = int(1e9)\n\ndef main():\n\n a, b, c, x, y = list(map(int, input().split()))\n\n ans = INF\n\n for i in range(2*10**5+100):\n\n t = 2*c*i + max(x-i, 0) * a + max(y-i, 0) * b\n\n ans = min(ans, t)\n\n print(ans)\n\nmain()", "target": "INF = int(1e5)+5\n\n\n\ndef main():\n\n a, b, c, x, y = list(map(int, input().split()))\n\n ans = INF*INF\n\n for i in range(INF):\n\n tmp = 2*i*c + a*max(x-i, 0) + b*max(y-i, 0) \n\n ans = min(tmp, ans)\n\n print(ans)\n\nmain()\n", "code_v0_loc": 10, "code_v1_loc": 10, "code_v0_num_chars": 239, "code_v1_num_chars": 231, "code_v0_no_empty_lines": "# python3\nINF = int(1e9)\n\n\ndef main():\n a, b, c, x, y = list(map(int, input().split()))\n ans = INF\n for i in range(2 * 10**5 + 100):\n t = 2 * c * i + max(x - i, 0) * a + max(y - i, 0) * b\n ans = min(ans, t)\n print(ans)\n\n\nmain()\n", "code_v1_no_empty_lines": "INF = int(1e5) + 5\n\n\ndef main():\n a, b, c, x, y = list(map(int, input().split()))\n ans = INF * INF\n for i in range(INF):\n tmp = 2 * i * c + a * max(x - i, 0) + b * max(y - i, 0)\n ans = min(tmp, ans)\n print(ans)\n\n\nmain()\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-# python3", "-INF = int(1e9)", "+INF = int(1e5) + 5", "- ans = INF", "- for i in range(2 * 10**5 + 100):", "- t = 2 * c * i + max(x - i, 0) * a + max(y - i, 0) * b", "- ans = min(ans, t)", "+ ans = INF * INF", "+ for i in range(INF):", "+ tmp = 2 * i * c + a * max(x - i, 0) + b * max(y - i, 0)", "+ ans = min(tmp, ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 1.3276309614, "measured_runtime_v1": 0.7168484554, "runtime_lift": 1.8520385325, "key": ["s986639109", "s095330807"]} {"user_id": "u925364229", "problem_id": "p03835", "language": "python", "submission_id_v0": "s889927917", "submission_id_v1": "s987244986", "cpu_time_v0": 1777, "cpu_time_v1": 266, "memory_v0": 2940, "memory_v1": 42092, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 85.03, "input": "K,S = list(map(int,input().split(\" \")))\n\nans = 0\n\nfor i in range(K+1):\n\n\tfor j in range(K+1):\n\n\t\tif (S - i - j) <= K and (S-i-j) >= 0:\n\n\t\t\tans += 1\n\n\n\nprint(ans)\n", "target": "K, S = list(map(int,input().split(\" \")))\n\nans = 0\n\nfor X in range(K+1):\n\n for Y in range(K+1):\n\n if 0 <= (S - X - Y) <= K:\n\n ans += 1\n\n\n\nprint(ans)", "code_v0_loc": 8, "code_v1_loc": 8, "code_v0_num_chars": 156, "code_v1_num_chars": 162, "code_v0_no_empty_lines": "K, S = list(map(int, input().split(\" \")))\nans = 0\nfor i in range(K + 1):\n for j in range(K + 1):\n if (S - i - j) <= K and (S - i - j) >= 0:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "K, S = list(map(int, input().split(\" \")))\nans = 0\nfor X in range(K + 1):\n for Y in range(K + 1):\n if 0 <= (S - X - Y) <= K:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-for i in range(K + 1):", "- for j in range(K + 1):", "- if (S - i - j) <= K and (S - i - j) >= 0:", "+for X in range(K + 1):", "+ for Y in range(K + 1):", "+ if 0 <= (S - X - Y) <= K:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.441297763, "measured_runtime_v1": 0.3279348275, "runtime_lift": 1.3456873926, "key": ["s889927917", "s987244986"]} {"user_id": "u140201022", "problem_id": "p02412", "language": "python", "submission_id_v0": "s179146540", "submission_id_v1": "s419434066", "cpu_time_v0": 420, "cpu_time_v1": 30, "memory_v0": 4208, "memory_v1": 4204, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 92.86, "input": "while 1:\n\n ans=0\n\n n,x=list(map(int,input().split()))\n\n if n:\n\n for i in range(1,n-1):\n\n for j in range(i+1,n):\n\n for k in range(j+1,n+1):\n\n if i+j+k==x:ans+=1\n\n else:break\n\n print(ans)", "target": "while 1:\n\n a=0\n\n n,x=list(map(int,input().split()))\n\n if n==0:break\n\n for i in range(1,n-1):\n\n for j in range(i+1,n):\n\n c=x-i-j\n\n if c>j and c<=n:a+=1\n\n print(a)", "code_v0_loc": 10, "code_v1_loc": 9, "code_v0_num_chars": 249, "code_v1_num_chars": 202, "code_v0_no_empty_lines": "while 1:\n ans = 0\n n, x = list(map(int, input().split()))\n if n:\n for i in range(1, n - 1):\n for j in range(i + 1, n):\n for k in range(j + 1, n + 1):\n if i + j + k == x:\n ans += 1\n else:\n break\n print(ans)\n", "code_v1_no_empty_lines": "while 1:\n a = 0\n n, x = list(map(int, input().split()))\n if n == 0:\n break\n for i in range(1, n - 1):\n for j in range(i + 1, n):\n c = x - i - j\n if c > j and c <= n:\n a += 1\n print(a)\n", "code_same": false, "relative_loc_diff_percent": 10.0, "diff": ["- ans = 0", "+ a = 0", "- if n:", "- for i in range(1, n - 1):", "- for j in range(i + 1, n):", "- for k in range(j + 1, n + 1):", "- if i + j + k == x:", "- ans += 1", "- else:", "+ if n == 0:", "- print(ans)", "+ for i in range(1, n - 1):", "+ for j in range(i + 1, n):", "+ c = x - i - j", "+ if c > j and c <= n:", "+ a += 1", "+ print(a)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3642889087, "measured_runtime_v1": 0.2896689522, "runtime_lift": 1.2576042614, "key": ["s179146540", "s419434066"]} {"user_id": "u072717685", "problem_id": "p02767", "language": "python", "submission_id_v0": "s067063811", "submission_id_v1": "s910505357", "cpu_time_v0": 35, "cpu_time_v1": 31, "memory_v0": 5084, "memory_v1": 9036, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.43, "input": "def main():\n\n from statistics import mean\n\n from math import floor,ceil\n\n\n\n n = int(input())\n\n x = list(map(int, input().split()))\n\n x_mean = mean(x) \n\n if x_mean == 0.5:\n\n greater_than_x = len([i for i in x if i > x_mean])\n\n if greater_than_x * 2 >= n:\n\n x_mean = ceil(x_mean)\n\n else:\n\n x_mean = floor(x_mean)\n\n elif x_mean % 1 > 0.5:\n\n x_mean = ceil(x_mean)\n\n else:\n\n x_mean = floor(x_mean)\n\n x2 = [(num - x_mean)**2 for num in x]\n\n print((sum(x2)))\n\n\n\nmain()", "target": "import sys\n\nread = sys.stdin.read\n\ndef main():\n\n n, *x = list(map(int, read().split()))\n\n r = float('inf')\n\n for i1 in range(1, 101):\n\n rt = 0\n\n for xe in x:\n\n rt += (xe - i1)**2\n\n r = min(r, rt)\n\n print(r)\n\n\n\nif __name__ == '__main__':\n\n main()\n", "code_v0_loc": 21, "code_v1_loc": 14, "code_v0_num_chars": 512, "code_v1_num_chars": 287, "code_v0_no_empty_lines": "def main():\n from statistics import mean\n from math import floor, ceil\n\n n = int(input())\n x = list(map(int, input().split()))\n x_mean = mean(x)\n if x_mean == 0.5:\n greater_than_x = len([i for i in x if i > x_mean])\n if greater_than_x * 2 >= n:\n x_mean = ceil(x_mean)\n else:\n x_mean = floor(x_mean)\n elif x_mean % 1 > 0.5:\n x_mean = ceil(x_mean)\n else:\n x_mean = floor(x_mean)\n x2 = [(num - x_mean) ** 2 for num in x]\n print((sum(x2)))\n\n\nmain()\n", "code_v1_no_empty_lines": "import sys\n\nread = sys.stdin.read\n\n\ndef main():\n n, *x = list(map(int, read().split()))\n r = float(\"inf\")\n for i1 in range(1, 101):\n rt = 0\n for xe in x:\n rt += (xe - i1) ** 2\n r = min(r, rt)\n print(r)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-def main():", "- from statistics import mean", "- from math import floor, ceil", "+import sys", "- n = int(input())", "- x = list(map(int, input().split()))", "- x_mean = mean(x)", "- if x_mean == 0.5:", "- greater_than_x = len([i for i in x if i > x_mean])", "- if greater_than_x * 2 >= n:", "- x_mean = ceil(x_mean)", "- else:", "- x_mean = floor(x_mean)", "- elif x_mean % 1 > 0.5:", "- x_mean = ceil(x_mean)", "- else:", "- x_mean = floor(x_mean)", "- x2 = [(num - x_mean) ** 2 for num in x]", "- print((sum(x2)))", "+read = sys.stdin.read", "-main()", "+def main():", "+ n, *x = list(map(int, read().split()))", "+ r = float(\"inf\")", "+ for i1 in range(1, 101):", "+ rt = 0", "+ for xe in x:", "+ rt += (xe - i1) ** 2", "+ r = min(r, rt)", "+ print(r)", "+", "+", "+if __name__ == \"__main__\":", "+ main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3305953437, "measured_runtime_v1": 0.2443374534, "runtime_lift": 1.3530277041, "key": ["s067063811", "s910505357"]} {"user_id": "u112317104", "problem_id": "p02773", "language": "python", "submission_id_v0": "s565064219", "submission_id_v1": "s656135042", "cpu_time_v0": 1126, "cpu_time_v1": 742, "memory_v0": 46132, "memory_v1": 32480, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 34.1, "input": "from collections import defaultdict\n\n\n\nN = int(input())\n\nA = [input() for _ in range(N)]\n\nA.sort()\n\nd = defaultdict(int)\n\nfor a in A:\n\n d[a] += 1\n\n\n\nl = sorted(d.items())\n\nmax_v = 0\n\n\n\nfor _, v in l:\n\n if v > max_v:\n\n max_v = v\n\n \n\nfor k, v in l:\n\n if v == max_v:\n\n print(k)\n\n else:\n\n continue\n", "target": "from collections import defaultdict\n\n\n\ndef solve():\n\n N = int(input())\n\n d = defaultdict(int)\n\n for _ in range(N):\n\n a = input()\n\n d[a] += 1\n\n\n\n m = 0\n\n for k, v in list(d.items()):\n\n m = max(m, v)\n\n \n\n l = []\n\n for k, v in list(d.items()):\n\n if m == v:\n\n l.append(k)\n\n l.sort()\n\n for ans in l:\n\n print(ans)\n\n \n\nsolve()", "code_v0_loc": 21, "code_v1_loc": 22, "code_v0_num_chars": 330, "code_v1_num_chars": 386, "code_v0_no_empty_lines": "from collections import defaultdict\n\nN = int(input())\nA = [input() for _ in range(N)]\nA.sort()\nd = defaultdict(int)\nfor a in A:\n d[a] += 1\nl = sorted(d.items())\nmax_v = 0\nfor _, v in l:\n if v > max_v:\n max_v = v\nfor k, v in l:\n if v == max_v:\n print(k)\n else:\n continue\n", "code_v1_no_empty_lines": "from collections import defaultdict\n\n\ndef solve():\n N = int(input())\n d = defaultdict(int)\n for _ in range(N):\n a = input()\n d[a] += 1\n m = 0\n for k, v in list(d.items()):\n m = max(m, v)\n l = []\n for k, v in list(d.items()):\n if m == v:\n l.append(k)\n l.sort()\n for ans in l:\n print(ans)\n\n\nsolve()\n", "code_same": false, "relative_loc_diff_percent": 4.5454545455, "diff": ["-N = int(input())", "-A = [input() for _ in range(N)]", "-A.sort()", "-d = defaultdict(int)", "-for a in A:", "- d[a] += 1", "-l = sorted(d.items())", "-max_v = 0", "-for _, v in l:", "- if v > max_v:", "- max_v = v", "-for k, v in l:", "- if v == max_v:", "- print(k)", "- else:", "- continue", "+", "+def solve():", "+ N = int(input())", "+ d = defaultdict(int)", "+ for _ in range(N):", "+ a = input()", "+ d[a] += 1", "+ m = 0", "+ for k, v in list(d.items()):", "+ m = max(m, v)", "+ l = []", "+ for k, v in list(d.items()):", "+ if m == v:", "+ l.append(k)", "+ l.sort()", "+ for ans in l:", "+ print(ans)", "+", "+", "+solve()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2730668259, "measured_runtime_v1": 0.1417047331, "runtime_lift": 1.9270127385, "key": ["s565064219", "s656135042"]} {"user_id": "u038408819", "problem_id": "p02691", "language": "python", "submission_id_v0": "s116716284", "submission_id_v1": "s825945845", "cpu_time_v0": 328, "cpu_time_v1": 178, "memory_v0": 73948, "memory_v1": 132600, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 45.73, "input": "n = int(input())\n\na = list(map(int, input().split()))\n\na_index = []\n\nfor i in range(n):\n\n a_index.append((i, a[i]))\n\ndic1 = {}\n\ndic2 = {}\n\nfor i in range(n):\n\n one = a_index[i][0] + a_index[i][1]\n\n two = a_index[i][0] - a_index[i][1]\n\n if one not in dic1:\n\n dic1[one] = 1\n\n else:\n\n dic1[one] += 1\n\n if two not in dic2:\n\n dic2[two] = 1\n\n else:\n\n dic2[two] += 1\n\nans = 0\n\nfor i in list(dic1.keys()):\n\n if i in dic2:\n\n ans += dic2[i] * dic1[i]\n\nfor i in list(dic2.keys()):\n\n if i in dic1:\n\n ans += dic1[i] * dic2[i]\n\n #print(i)\n\nprint((ans // 2))\n", "target": "n = int(input())\n\na = list(map(int, input().split()))\n\nimport collections\n\nans = 0\n\ndic = collections.defaultdict(int)\n\nfor i in range(1, n + 1):\n\n ans += dic[i - a[i - 1]]\n\n dic[i + a[i - 1]] += 1\n\nprint(ans)", "code_v0_loc": 27, "code_v1_loc": 9, "code_v0_num_chars": 606, "code_v1_num_chars": 215, "code_v0_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\na_index = []\nfor i in range(n):\n a_index.append((i, a[i]))\ndic1 = {}\ndic2 = {}\nfor i in range(n):\n one = a_index[i][0] + a_index[i][1]\n two = a_index[i][0] - a_index[i][1]\n if one not in dic1:\n dic1[one] = 1\n else:\n dic1[one] += 1\n if two not in dic2:\n dic2[two] = 1\n else:\n dic2[two] += 1\nans = 0\nfor i in list(dic1.keys()):\n if i in dic2:\n ans += dic2[i] * dic1[i]\nfor i in list(dic2.keys()):\n if i in dic1:\n ans += dic1[i] * dic2[i]\n # print(i)\nprint((ans // 2))\n", "code_v1_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\nimport collections\n\nans = 0\ndic = collections.defaultdict(int)\nfor i in range(1, n + 1):\n ans += dic[i - a[i - 1]]\n dic[i + a[i - 1]] += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-a_index = []", "-for i in range(n):", "- a_index.append((i, a[i]))", "-dic1 = {}", "-dic2 = {}", "-for i in range(n):", "- one = a_index[i][0] + a_index[i][1]", "- two = a_index[i][0] - a_index[i][1]", "- if one not in dic1:", "- dic1[one] = 1", "- else:", "- dic1[one] += 1", "- if two not in dic2:", "- dic2[two] = 1", "- else:", "- dic2[two] += 1", "+import collections", "+", "-for i in list(dic1.keys()):", "- if i in dic2:", "- ans += dic2[i] * dic1[i]", "-for i in list(dic2.keys()):", "- if i in dic1:", "- ans += dic1[i] * dic2[i]", "- # print(i)", "-print((ans // 2))", "+dic = collections.defaultdict(int)", "+for i in range(1, n + 1):", "+ ans += dic[i - a[i - 1]]", "+ dic[i + a[i - 1]] += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3792731187, "measured_runtime_v1": 0.2976846831, "runtime_lift": 1.2740767002, "key": ["s116716284", "s825945845"]} {"user_id": "u123756661", "problem_id": "p03835", "language": "python", "submission_id_v0": "s113088304", "submission_id_v1": "s025062934", "cpu_time_v0": 1218, "cpu_time_v1": 258, "memory_v0": 2940, "memory_v1": 41580, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 78.82, "input": "k,s=list(map(int,input().split()))\n\nans=chk=0\n\nfor i in range(k+1):\n\n for j in range(k+1):\n\n if (0<=s-i-j<=k): ans+=1\n\nprint(ans)", "target": "k,s=list(map(int,input().split()))\n\nans=0\n\nx=min(k+1,s+1)\n\ny=max(0,s-k-k)\n\nfor i in range(y,x):\n\n for j in range(y,x):\n\n if i+j>s: break\n\n if 0<=s-i-j<=k:\n\n ans+=1\n\nprint(ans)", "code_v0_loc": 6, "code_v1_loc": 10, "code_v0_num_chars": 133, "code_v1_num_chars": 197, "code_v0_no_empty_lines": "k, s = list(map(int, input().split()))\nans = chk = 0\nfor i in range(k + 1):\n for j in range(k + 1):\n if 0 <= s - i - j <= k:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "k, s = list(map(int, input().split()))\nans = 0\nx = min(k + 1, s + 1)\ny = max(0, s - k - k)\nfor i in range(y, x):\n for j in range(y, x):\n if i + j > s:\n break\n if 0 <= s - i - j <= k:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 40.0, "diff": ["-ans = chk = 0", "-for i in range(k + 1):", "- for j in range(k + 1):", "+ans = 0", "+x = min(k + 1, s + 1)", "+y = max(0, s - k - k)", "+for i in range(y, x):", "+ for j in range(y, x):", "+ if i + j > s:", "+ break"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3946401063, "measured_runtime_v1": 0.3009130723, "runtime_lift": 1.3114754477, "key": ["s113088304", "s025062934"]} {"user_id": "u761320129", "problem_id": "p03564", "language": "python", "submission_id_v0": "s515134391", "submission_id_v1": "s980600609", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 3316, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "N,K = int(input()), int(input())\n\nnow = 1\n\nfor i in range(N):\n\n if now*2 < now + K:\n\n now *= 2\n\n else:\n\n now += K\n\nprint(now)\n", "target": "N = int(input())\n\nK = int(input())\n\nans = 1\n\nfor i in range(N):\n\n if ans < K:\n\n ans *= 2\n\n else:\n\n ans += K\n\nprint(ans)", "code_v0_loc": 8, "code_v1_loc": 9, "code_v0_num_chars": 146, "code_v1_num_chars": 139, "code_v0_no_empty_lines": "N, K = int(input()), int(input())\nnow = 1\nfor i in range(N):\n if now * 2 < now + K:\n now *= 2\n else:\n now += K\nprint(now)\n", "code_v1_no_empty_lines": "N = int(input())\nK = int(input())\nans = 1\nfor i in range(N):\n if ans < K:\n ans *= 2\n else:\n ans += K\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 11.1111111111, "diff": ["-N, K = int(input()), int(input())", "-now = 1", "+N = int(input())", "+K = int(input())", "+ans = 1", "- if now * 2 < now + K:", "- now *= 2", "+ if ans < K:", "+ ans *= 2", "- now += K", "-print(now)", "+ ans += K", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2990638907, "measured_runtime_v1": 0.1086408798, "runtime_lift": 2.7527749338, "key": ["s515134391", "s980600609"]} {"user_id": "u177388368", "problem_id": "p02881", "language": "python", "submission_id_v0": "s386884404", "submission_id_v1": "s516418112", "cpu_time_v0": 474, "cpu_time_v1": 256, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 45.99, "input": "import math\n\nn=int(input())\n\nans=n\n\ni=1\n\nwhile(i<=math.sqrt(n)):\n\n if n%i==0:\n\n d=i+n/i-2\n\n ans=min(ans,d)\n\n i+=1\n\nprint((int(ans)))", "target": "from math import floor\n\nfrom math import sqrt\n\nn=int(input())\n\nnn=floor(sqrt(n))\n\nrest=n%nn\n\nwhile rest!=0:\n\n nn-=1\n\n rest=n%nn\n\nnnn=n/nn\n\nprint((int(nn+nnn-2)))", "code_v0_loc": 10, "code_v1_loc": 10, "code_v0_num_chars": 150, "code_v1_num_chars": 165, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nans = n\ni = 1\nwhile i <= math.sqrt(n):\n if n % i == 0:\n d = i + n / i - 2\n ans = min(ans, d)\n i += 1\nprint((int(ans)))\n", "code_v1_no_empty_lines": "from math import floor\nfrom math import sqrt\n\nn = int(input())\nnn = floor(sqrt(n))\nrest = n % nn\nwhile rest != 0:\n nn -= 1\n rest = n % nn\nnnn = n / nn\nprint((int(nn + nnn - 2)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-import math", "+from math import floor", "+from math import sqrt", "-ans = n", "-i = 1", "-while i <= math.sqrt(n):", "- if n % i == 0:", "- d = i + n / i - 2", "- ans = min(ans, d)", "- i += 1", "-print((int(ans)))", "+nn = floor(sqrt(n))", "+rest = n % nn", "+while rest != 0:", "+ nn -= 1", "+ rest = n % nn", "+nnn = n / nn", "+print((int(nn + nnn - 2)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3770523396, "measured_runtime_v1": 0.2395324836, "runtime_lift": 1.5741177727, "key": ["s386884404", "s516418112"]} {"user_id": "u275934251", "problem_id": "p03796", "language": "python", "submission_id_v0": "s111144925", "submission_id_v1": "s028336395", "cpu_time_v0": 229, "cpu_time_v1": 37, "memory_v0": 3980, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.84, "input": "import math\n\n\n\nN = int(input())\n\n\n\npower = math.factorial(N)\n\n\n\nprint((power % 1000000007))\n\n\n", "target": "n=int(input())\n\nans=1\n\nfor i in range(n):\n\n ans=(ans*(i+1))%(10**9+7)\n\nprint(ans)", "code_v0_loc": 8, "code_v1_loc": 5, "code_v0_num_chars": 92, "code_v1_num_chars": 84, "code_v0_no_empty_lines": "import math\n\nN = int(input())\npower = math.factorial(N)\nprint((power % 1000000007))\n", "code_v1_no_empty_lines": "n = int(input())\nans = 1\nfor i in range(n):\n ans = (ans * (i + 1)) % (10**9 + 7)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 37.5, "diff": ["-import math", "-", "-N = int(input())", "-power = math.factorial(N)", "-print((power % 1000000007))", "+n = int(input())", "+ans = 1", "+for i in range(n):", "+ ans = (ans * (i + 1)) % (10**9 + 7)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7185150633, "measured_runtime_v1": 0.3322105608, "runtime_lift": 2.1628302891, "key": ["s111144925", "s028336395"]} {"user_id": "u353797797", "problem_id": "p03170", "language": "python", "submission_id_v0": "s365373544", "submission_id_v1": "s835744397", "cpu_time_v0": 126, "cpu_time_v1": 112, "memory_v0": 3828, "memory_v1": 3828, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.11, "input": "n, k = list(map(int, input().split()))\n\na_s = list(map(int, input().split()))\n\ndp = [\"Second\"] * (k + 1)\n\nfor i in range(k + 1):\n\n if dp[i] == \"Second\":\n\n for a in a_s:\n\n ii = i + a\n\n if ii <= k:\n\n dp[ii] = \"First\"\n\nprint((dp[-1]))\n", "target": "n, k = list(map(int, input().split()))\n\na_s = list(map(int, input().split()))\n\ndp = [\"Second\"] * (k + 1)\n\nfor i in range(k + 1):\n\n if dp[i] == \"Second\":\n\n for a in a_s:\n\n ii = i + a\n\n if ii > k:break\n\n dp[ii] = \"First\"\n\nprint((dp[-1]))\n", "code_v0_loc": 10, "code_v1_loc": 10, "code_v0_num_chars": 271, "code_v1_num_chars": 271, "code_v0_no_empty_lines": "n, k = list(map(int, input().split()))\na_s = list(map(int, input().split()))\ndp = [\"Second\"] * (k + 1)\nfor i in range(k + 1):\n if dp[i] == \"Second\":\n for a in a_s:\n ii = i + a\n if ii <= k:\n dp[ii] = \"First\"\nprint((dp[-1]))\n", "code_v1_no_empty_lines": "n, k = list(map(int, input().split()))\na_s = list(map(int, input().split()))\ndp = [\"Second\"] * (k + 1)\nfor i in range(k + 1):\n if dp[i] == \"Second\":\n for a in a_s:\n ii = i + a\n if ii > k:\n break\n dp[ii] = \"First\"\nprint((dp[-1]))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- if ii <= k:", "- dp[ii] = \"First\"", "+ if ii > k:", "+ break", "+ dp[ii] = \"First\""], "diff_only_import_comment": false, "measured_runtime_v0": 0.3611531999, "measured_runtime_v1": 0.2298232606, "runtime_lift": 1.5714388476, "key": ["s365373544", "s835744397"]} {"user_id": "u604839890", "problem_id": "p02622", "language": "python", "submission_id_v0": "s830524393", "submission_id_v1": "s723518358", "cpu_time_v0": 83, "cpu_time_v1": 70, "memory_v0": 85616, "memory_v1": 73748, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.66, "input": "S, T = [list(input()) for _ in range(2)]\n\ncnt = 0\n\nfor i in range(len(S)):\n\n if S[i] != T[i]:\n\n cnt += 1\n\nprint(cnt)\n", "target": "s, t = [input() for i in range(2)]\n\nans = 0\n\nfor i in range(len(s)):\n\n if s[i] != t[i]:\n\n ans += 1\n\nprint(ans)", "code_v0_loc": 6, "code_v1_loc": 6, "code_v0_num_chars": 127, "code_v1_num_chars": 114, "code_v0_no_empty_lines": "S, T = [list(input()) for _ in range(2)]\ncnt = 0\nfor i in range(len(S)):\n if S[i] != T[i]:\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "s, t = [input() for i in range(2)]\nans = 0\nfor i in range(len(s)):\n if s[i] != t[i]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-S, T = [list(input()) for _ in range(2)]", "-cnt = 0", "-for i in range(len(S)):", "- if S[i] != T[i]:", "- cnt += 1", "-print(cnt)", "+s, t = [input() for i in range(2)]", "+ans = 0", "+for i in range(len(s)):", "+ if s[i] != t[i]:", "+ ans += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2683959379, "measured_runtime_v1": 0.2054475396, "runtime_lift": 1.3063964576, "key": ["s830524393", "s723518358"]} {"user_id": "u644907318", "problem_id": "p02886", "language": "python", "submission_id_v0": "s745140004", "submission_id_v1": "s021490246", "cpu_time_v0": 167, "cpu_time_v1": 89, "memory_v0": 38512, "memory_v1": 61656, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 46.71, "input": "N = int(input())\n\nD = list(map(int,input().split()))\n\ncnt = 0\n\nfor i in range(N-1):\n\n for j in range(i+1,N):\n\n cnt += D[i]*D[j]\n\nprint(cnt)", "target": "N = int(input())\n\nD = list(map(int,input().split()))\n\ncnt = 0\n\nfor i in range(N):\n\n cnt += D[i]**2\n\ntot = 0\n\nfor i in range(N):\n\n tot += D[i]\n\ntot = tot**2\n\ntot -= cnt\n\nprint((tot//2))", "code_v0_loc": 7, "code_v1_loc": 11, "code_v0_num_chars": 149, "code_v1_num_chars": 188, "code_v0_no_empty_lines": "N = int(input())\nD = list(map(int, input().split()))\ncnt = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n cnt += D[i] * D[j]\nprint(cnt)\n", "code_v1_no_empty_lines": "N = int(input())\nD = list(map(int, input().split()))\ncnt = 0\nfor i in range(N):\n cnt += D[i] ** 2\ntot = 0\nfor i in range(N):\n tot += D[i]\ntot = tot**2\ntot -= cnt\nprint((tot // 2))\n", "code_same": false, "relative_loc_diff_percent": 36.3636363636, "diff": ["-for i in range(N - 1):", "- for j in range(i + 1, N):", "- cnt += D[i] * D[j]", "-print(cnt)", "+for i in range(N):", "+ cnt += D[i] ** 2", "+tot = 0", "+for i in range(N):", "+ tot += D[i]", "+tot = tot**2", "+tot -= cnt", "+print((tot // 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2884610276, "measured_runtime_v1": 0.2260356005, "runtime_lift": 1.2761751997, "key": ["s745140004", "s021490246"]} {"user_id": "u258073778", "problem_id": "p03370", "language": "python", "submission_id_v0": "s864579791", "submission_id_v1": "s018766024", "cpu_time_v0": 712, "cpu_time_v1": 525, "memory_v0": 3064, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 26.26, "input": "N, X = list(map(int, input().split()))\n\n\n\nmn = [0]*N\n\nfor i in range(N):\n\n mn[i] = int(input())\n\n \n\nans = N\n\nx = X - sum(mn)\n\n\n\nwhile(x >= min(mn)):\n\n if x // min(mn) == 0:\n\n mn[mn.index(min(mn))] = 1000000\n\n else:\n\n if x >= min(mn):\n\n x -= min(mn)\n\n ans += 1\n\n \n\nprint(ans)", "target": "N, X = list(map(int, input().split()))\n\n\n\nmn = [0]*N\n\nfor i in range(N):\n\n mn[i] = int(input())\n\n \n\nans = N\n\nx = X - sum(mn)\n\n\n\nwhile(x >= min(mn)):\n\n if x // min(mn) == 0:\n\n mn[mn.index(min(mn))] = 1000000\n\n else:\n\n x -= min(mn)\n\n ans += 1\n\n \n\nprint(ans)", "code_v0_loc": 18, "code_v1_loc": 17, "code_v0_num_chars": 293, "code_v1_num_chars": 267, "code_v0_no_empty_lines": "N, X = list(map(int, input().split()))\nmn = [0] * N\nfor i in range(N):\n mn[i] = int(input())\nans = N\nx = X - sum(mn)\nwhile x >= min(mn):\n if x // min(mn) == 0:\n mn[mn.index(min(mn))] = 1000000\n else:\n if x >= min(mn):\n x -= min(mn)\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "N, X = list(map(int, input().split()))\nmn = [0] * N\nfor i in range(N):\n mn[i] = int(input())\nans = N\nx = X - sum(mn)\nwhile x >= min(mn):\n if x // min(mn) == 0:\n mn[mn.index(min(mn))] = 1000000\n else:\n x -= min(mn)\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 5.5555555556, "diff": ["- if x >= min(mn):", "- x -= min(mn)", "- ans += 1", "+ x -= min(mn)", "+ ans += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2841449485, "measured_runtime_v1": 0.2087575016, "runtime_lift": 1.3611244927, "key": ["s864579791", "s018766024"]} {"user_id": "u961683878", "problem_id": "p02596", "language": "python", "submission_id_v0": "s650878996", "submission_id_v1": "s172963527", "cpu_time_v0": 1976, "cpu_time_v1": 198, "memory_v0": 165028, "memory_v1": 9244, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 89.98, "input": "#! /usr/bin/env python3\n\n\n\nimport sys\n\nint1 = lambda x: int(x) - 1\n\nread = sys.stdin.buffer.read\n\nreadline = sys.stdin.buffer.readline\n\nreadlines = sys.stdin.buffer.readlines\n\nsys.setrecursionlimit(500000)\n\n\n\n\n\ndef isMultiple(s, m):\n\n tmp = 0\n\n for i in range(len(s)):\n\n tmp = (tmp * 10 + int(s[i])) % m\n\n if tmp == 0:\n\n return i\n\n return -1\n\n\n\n\n\nk = int(readline())\n\nacc = \"7\" * 50000000\n\nif k % 2 == 0:\n\n ans = -1\n\nelse:\n\n\n\n ans = isMultiple(acc, k)\n\n if ans != -1:\n\n ans += 1\n\n\n\nprint(ans)\n", "target": "#! /usr/bin/env python3\n\n\n\nimport sys\n\nint1 = lambda x: int(x) - 1\n\nread = sys.stdin.buffer.read\n\nreadline = sys.stdin.buffer.readline\n\nreadlines = sys.stdin.buffer.readlines\n\nsys.setrecursionlimit(500000)\n\n\n\nk = int(readline())\n\n\n\nans = -1\n\nacc = 7 % k\n\nfor n in range(1, k + 10):\n\n if acc == 0:\n\n ans = n\n\n break\n\n acc = (10 * acc + 7) % k\n\n\n\nprint(ans)\n", "code_v0_loc": 30, "code_v1_loc": 20, "code_v0_num_chars": 543, "code_v1_num_chars": 376, "code_v0_no_empty_lines": "#! /usr/bin/env python3\nimport sys\n\nint1 = lambda x: int(x) - 1\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(500000)\n\n\ndef isMultiple(s, m):\n tmp = 0\n for i in range(len(s)):\n tmp = (tmp * 10 + int(s[i])) % m\n if tmp == 0:\n return i\n return -1\n\n\nk = int(readline())\nacc = \"7\" * 50000000\nif k % 2 == 0:\n ans = -1\nelse:\n ans = isMultiple(acc, k)\n if ans != -1:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "#! /usr/bin/env python3\nimport sys\n\nint1 = lambda x: int(x) - 1\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(500000)\nk = int(readline())\nans = -1\nacc = 7 % k\nfor n in range(1, k + 10):\n if acc == 0:\n ans = n\n break\n acc = (10 * acc + 7) % k\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-", "-", "-def isMultiple(s, m):", "- tmp = 0", "- for i in range(len(s)):", "- tmp = (tmp * 10 + int(s[i])) % m", "- if tmp == 0:", "- return i", "- return -1", "-", "-", "-acc = \"7\" * 50000000", "-if k % 2 == 0:", "- ans = -1", "-else:", "- ans = isMultiple(acc, k)", "- if ans != -1:", "- ans += 1", "+ans = -1", "+acc = 7 % k", "+for n in range(1, k + 10):", "+ if acc == 0:", "+ ans = n", "+ break", "+ acc = (10 * acc + 7) % k"], "diff_only_import_comment": false, "measured_runtime_v0": 0.8533027549, "measured_runtime_v1": 0.4769769247, "runtime_lift": 1.788981208, "key": ["s650878996", "s172963527"]} {"user_id": "u133936772", "problem_id": "p02615", "language": "python", "submission_id_v0": "s324254523", "submission_id_v1": "s548223725", "cpu_time_v0": 146, "cpu_time_v1": 118, "memory_v0": 31756, "memory_v1": 31752, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 19.18, "input": "n,*l=list(map(int,open(0).read().split()));print((sum(sorted(l*2)[-2:~n:-1])))", "target": "n,*l=list(map(int,open(0).read().split()))\n\nl.sort(reverse=1)\n\nprint((sum(l[i//2] for i in range(1,n))))", "code_v0_loc": 1, "code_v1_loc": 3, "code_v0_num_chars": 70, "code_v1_num_chars": 96, "code_v0_no_empty_lines": "n, *l = list(map(int, open(0).read().split()))\nprint((sum(sorted(l * 2)[-2:~n:-1])))\n", "code_v1_no_empty_lines": "n, *l = list(map(int, open(0).read().split()))\nl.sort(reverse=1)\nprint((sum(l[i // 2] for i in range(1, n))))\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-print((sum(sorted(l * 2)[-2:~n:-1])))", "+l.sort(reverse=1)", "+print((sum(l[i // 2] for i in range(1, n))))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2901719676, "measured_runtime_v1": 0.1990829677, "runtime_lift": 1.4575429076, "key": ["s324254523", "s548223725"]} {"user_id": "u727072969", "problem_id": "p02881", "language": "python", "submission_id_v0": "s064089444", "submission_id_v1": "s044740610", "cpu_time_v0": 519, "cpu_time_v1": 181, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 65.13, "input": "import math\n\nN = int(input())\n\nfor i in range(int(math.sqrt(N))):\n\n if N % (int(math.sqrt(N))-i) == 0:\n\n print((int(N/(int(math.sqrt(N))-i)+int(math.sqrt(N))-i-2)))\n\n break", "target": "import math\n\nN = int(input())\n\nM = int(math.sqrt(N))\n\nfor i in range(M):\n\n if N % (M-i) == 0:\n\n print((int(N/(M-i)+M-i-2)))\n\n break\n", "code_v0_loc": 6, "code_v1_loc": 7, "code_v0_num_chars": 187, "code_v1_num_chars": 147, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nfor i in range(int(math.sqrt(N))):\n if N % (int(math.sqrt(N)) - i) == 0:\n print((int(N / (int(math.sqrt(N)) - i) + int(math.sqrt(N)) - i - 2)))\n break\n", "code_v1_no_empty_lines": "import math\n\nN = int(input())\nM = int(math.sqrt(N))\nfor i in range(M):\n if N % (M - i) == 0:\n print((int(N / (M - i) + M - i - 2)))\n break\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-for i in range(int(math.sqrt(N))):", "- if N % (int(math.sqrt(N)) - i) == 0:", "- print((int(N / (int(math.sqrt(N)) - i) + int(math.sqrt(N)) - i - 2)))", "+M = int(math.sqrt(N))", "+for i in range(M):", "+ if N % (M - i) == 0:", "+ print((int(N / (M - i) + M - i - 2)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3627885733, "measured_runtime_v1": 0.269237565, "runtime_lift": 1.3474664028, "key": ["s064089444", "s044740610"]} {"user_id": "u753589982", "problem_id": "p02994", "language": "python", "submission_id_v0": "s918408995", "submission_id_v1": "s703264591", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "N, L = [int(i) for i in input().split()]\n\n\n\nmin_ = L\n\nmax_ = L + N -1\n\n\n\ndef eat_apple():\n\n if max_<0:\n\n return max_ \n\n if L < 0:\n\n return 0\n\n return L\n\n\n\nprint(((min_+max_)*(max_-min_+1)//2 - eat_apple()))", "target": "N, L = [int(i) for i in input().split()]\n\n\n\nmin_ = L\n\nmax_ = L + N -1\n\n\n\ndef eat_apple(N, L, max_):\n\n if max_<0:\n\n return max_ \n\n if L < 0:\n\n return 0\n\n return L\n\n\n\nprint(((min_+max_)*(max_-min_+1)//2 - eat_apple(N, L, max_)))", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 227, "code_v1_num_chars": 247, "code_v0_no_empty_lines": "N, L = [int(i) for i in input().split()]\nmin_ = L\nmax_ = L + N - 1\n\n\ndef eat_apple():\n if max_ < 0:\n return max_\n if L < 0:\n return 0\n return L\n\n\nprint(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple()))\n", "code_v1_no_empty_lines": "N, L = [int(i) for i in input().split()]\nmin_ = L\nmax_ = L + N - 1\n\n\ndef eat_apple(N, L, max_):\n if max_ < 0:\n return max_\n if L < 0:\n return 0\n return L\n\n\nprint(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple(N, L, max_)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-def eat_apple():", "+def eat_apple(N, L, max_):", "-print(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple()))", "+print(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple(N, L, max_)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2025646191, "measured_runtime_v1": 0.0060813091, "runtime_lift": 33.309377317, "key": ["s918408995", "s703264591"]} {"user_id": "u280978334", "problem_id": "p03107", "language": "python", "submission_id_v0": "s353947972", "submission_id_v1": "s266533401", "cpu_time_v0": 65, "cpu_time_v1": 18, "memory_v0": 5400, "memory_v1": 3188, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 72.31, "input": "S = [int(_) for _ in input()]\n\nlength = len(S)\n\ntemp = [S[0]]\n\nfor x in S[1:]:\n\n if(len(temp) == 0):\n\n temp.append(x)\n\n elif( temp[-1] == x):\n\n temp.append(x)\n\n else:\n\n temp.pop(-1)\n\nprint((length-len(temp)))\n\n ", "target": "def main():\n\n A = input()\n\n print((2*min(A.count(\"0\"),A.count(\"1\"))))\n\n \n\nif __name__ == \"__main__\":\n\n main()", "code_v0_loc": 12, "code_v1_loc": 6, "code_v0_num_chars": 246, "code_v1_num_chars": 119, "code_v0_no_empty_lines": "S = [int(_) for _ in input()]\nlength = len(S)\ntemp = [S[0]]\nfor x in S[1:]:\n if len(temp) == 0:\n temp.append(x)\n elif temp[-1] == x:\n temp.append(x)\n else:\n temp.pop(-1)\nprint((length - len(temp)))\n", "code_v1_no_empty_lines": "def main():\n A = input()\n print((2 * min(A.count(\"0\"), A.count(\"1\"))))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-S = [int(_) for _ in input()]", "-length = len(S)", "-temp = [S[0]]", "-for x in S[1:]:", "- if len(temp) == 0:", "- temp.append(x)", "- elif temp[-1] == x:", "- temp.append(x)", "- else:", "- temp.pop(-1)", "-print((length - len(temp)))", "+def main():", "+ A = input()", "+ print((2 * min(A.count(\"0\"), A.count(\"1\"))))", "+", "+", "+if __name__ == \"__main__\":", "+ main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2279973624, "measured_runtime_v1": 0.00614361, "runtime_lift": 37.1113013328, "key": ["s353947972", "s266533401"]} {"user_id": "u423966555", "problem_id": "p02596", "language": "python", "submission_id_v0": "s734835984", "submission_id_v1": "s256781932", "cpu_time_v0": 338, "cpu_time_v1": 178, "memory_v0": 16560, "memory_v1": 9056, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 47.34, "input": "K = int(input())\n\n\n\nflg = [False]*K\n\n\n\ntmp = 7 % K\n\ncnt = 1\n\nif tmp == 0:\n\n print(cnt)\n\n exit()\n\nwhile True:\n\n tmp = (tmp*10+7)%K\n\n if flg[tmp]:\n\n print((-1))\n\n break\n\n else:\n\n cnt += 1\n\n if tmp == 0:\n\n print(cnt)\n\n break\n\n flg[tmp] = True\n", "target": "K = int(input())\n\nt = 7\n\nt %= K\n\n\n\nfor i in range(K+1):\n\n if t == 0:\n\n print((i+1))\n\n exit()\n\n t = (t*10+7)%K\n\nprint((-1))\n", "code_v0_loc": 20, "code_v1_loc": 10, "code_v0_num_chars": 310, "code_v1_num_chars": 139, "code_v0_no_empty_lines": "K = int(input())\nflg = [False] * K\ntmp = 7 % K\ncnt = 1\nif tmp == 0:\n print(cnt)\n exit()\nwhile True:\n tmp = (tmp * 10 + 7) % K\n if flg[tmp]:\n print((-1))\n break\n else:\n cnt += 1\n if tmp == 0:\n print(cnt)\n break\n flg[tmp] = True\n", "code_v1_no_empty_lines": "K = int(input())\nt = 7\nt %= K\nfor i in range(K + 1):\n if t == 0:\n print((i + 1))\n exit()\n t = (t * 10 + 7) % K\nprint((-1))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-flg = [False] * K", "-tmp = 7 % K", "-cnt = 1", "-if tmp == 0:", "- print(cnt)", "- exit()", "-while True:", "- tmp = (tmp * 10 + 7) % K", "- if flg[tmp]:", "- print((-1))", "- break", "- else:", "- cnt += 1", "- if tmp == 0:", "- print(cnt)", "- break", "- flg[tmp] = True", "+t = 7", "+t %= K", "+for i in range(K + 1):", "+ if t == 0:", "+ print((i + 1))", "+ exit()", "+ t = (t * 10 + 7) % K", "+print((-1))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6767371264, "measured_runtime_v1": 0.4369205115, "runtime_lift": 1.5488792779, "key": ["s734835984", "s256781932"]} {"user_id": "u239981649", "problem_id": "p03796", "language": "python", "submission_id_v0": "s383796227", "submission_id_v1": "s138334572", "cpu_time_v0": 232, "cpu_time_v1": 34, "memory_v0": 3972, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 85.34, "input": "from math import factorial\n\nprint((factorial(int(input())) % (10**9+7)))", "target": "ans = 1\n\nfor k in range(1, int(input())+1):\n\n ans = ans*k % (10**9+7)\n\nprint(ans)", "code_v0_loc": 2, "code_v1_loc": 4, "code_v0_num_chars": 70, "code_v1_num_chars": 84, "code_v0_no_empty_lines": "from math import factorial\n\nprint((factorial(int(input())) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "ans = 1\nfor k in range(1, int(input()) + 1):\n ans = ans * k % (10**9 + 7)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-from math import factorial", "-", "-print((factorial(int(input())) % (10**9 + 7)))", "+ans = 1", "+for k in range(1, int(input()) + 1):", "+ ans = ans * k % (10**9 + 7)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3382144179, "measured_runtime_v1": 0.1644267938, "runtime_lift": 2.0569300785, "key": ["s383796227", "s138334572"]} {"user_id": "u263737105", "problem_id": "p02595", "language": "python", "submission_id_v0": "s947121829", "submission_id_v1": "s479170385", "cpu_time_v0": 481, "cpu_time_v1": 391, "memory_v0": 9072, "memory_v1": 9124, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 18.71, "input": "N, D = list(map(int, input().split()))\n\ncount = 0\n\nfor i in range(N):\n\n a, b = list(map(int, input().split()))\n\n if (a**2 + b**2) <= D**2:\n\n count += 1\n\nprint(count)\n", "target": "N, D = list(map(int, input().split()))\n\ncount = 0\n\nfor i in range(N):\n\n a, b = list(map(int, input().split()))\n\n if (a*a + b*b) <= D*D:\n\n count += 1\n\nprint(count)\n", "code_v0_loc": 7, "code_v1_loc": 7, "code_v0_num_chars": 167, "code_v1_num_chars": 164, "code_v0_no_empty_lines": "N, D = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n a, b = list(map(int, input().split()))\n if (a**2 + b**2) <= D**2:\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "N, D = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n a, b = list(map(int, input().split()))\n if (a * a + b * b) <= D * D:\n count += 1\nprint(count)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- if (a**2 + b**2) <= D**2:", "+ if (a * a + b * b) <= D * D:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2832637064, "measured_runtime_v1": 0.1751975398, "runtime_lift": 1.6168246811, "key": ["s947121829", "s479170385"]} {"user_id": "u077291787", "problem_id": "p03309", "language": "python", "submission_id_v0": "s828043733", "submission_id_v1": "s360156642", "cpu_time_v0": 210, "cpu_time_v1": 183, "memory_v0": 27472, "memory_v1": 25324, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.86, "input": "# ABC102C - Linear Approximation (ARC100C)\n\nfrom statistics import median\n\n\n\n\n\ndef main():\n\n n = int(input())\n\n A = tuple(map(int, input().rstrip().split()))\n\n A = tuple(j - i for i, j in enumerate(A, start=1))\n\n b = median(A)\n\n ans = sum(abs(a - b) for a in A)\n\n print((int(ans)))\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()", "target": "# ABC102C - Linear Approximation (ARC100C)\n\ndef main():\n\n n = int(input())\n\n A = tuple(map(int, input().rstrip().split()))\n\n A = sorted(j - i for i, j in enumerate(A, start=1))\n\n b = A[n // 2]\n\n ans = sum(abs(a - b) for a in A)\n\n print(ans)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()", "code_v0_loc": 15, "code_v1_loc": 12, "code_v0_num_chars": 341, "code_v1_num_chars": 302, "code_v0_no_empty_lines": "# ABC102C - Linear Approximation (ARC100C)\nfrom statistics import median\n\n\ndef main():\n n = int(input())\n A = tuple(map(int, input().rstrip().split()))\n A = tuple(j - i for i, j in enumerate(A, start=1))\n b = median(A)\n ans = sum(abs(a - b) for a in A)\n print((int(ans)))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "# ABC102C - Linear Approximation (ARC100C)\ndef main():\n n = int(input())\n A = tuple(map(int, input().rstrip().split()))\n A = sorted(j - i for i, j in enumerate(A, start=1))\n b = A[n // 2]\n ans = sum(abs(a - b) for a in A)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-from statistics import median", "-", "-", "- A = tuple(j - i for i, j in enumerate(A, start=1))", "- b = median(A)", "+ A = sorted(j - i for i, j in enumerate(A, start=1))", "+ b = A[n // 2]", "- print((int(ans)))", "+ print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2185840318, "measured_runtime_v1": 0.1650515537, "runtime_lift": 1.3243379227, "key": ["s828043733", "s360156642"]} {"user_id": "u893063840", "problem_id": "p03038", "language": "python", "submission_id_v0": "s696312664", "submission_id_v1": "s914180377", "cpu_time_v0": 588, "cpu_time_v1": 493, "memory_v0": 32888, "memory_v1": 36036, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.16, "input": "n, m = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\nbc = [list(map(int, input().split())) for _ in range(m)]\n\n\n\nbc.sort(key=lambda x: x[1], reverse=True)\n\na.sort()\n\n\n\ni = 0\n\nfor b, c in bc:\n\n for _ in range(b):\n\n if i < n and a[i] < c:\n\n a[i] = c\n\n i += 1\n\n else:\n\n break\n\n\n\nans = sum(a)\n\nprint(ans)\n", "target": "n, m = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\nbc = [list(map(int, input().split())) for _ in range(m)]\n\n\n\nbc.sort(reverse=True, key=lambda x: x[1])\n\n\n\nli = []\n\nl = 0\n\ni = 0\n\nwhile i < m and l < n:\n\n b, c = bc[i]\n\n li += [c] * b\n\n i += 1\n\n l += b\n\n\n\na += li\n\na.sort(reverse=True)\n\nans = sum(a[:n])\n\nprint(ans)\n", "code_v0_loc": 18, "code_v1_loc": 19, "code_v0_num_chars": 369, "code_v1_num_chars": 346, "code_v0_no_empty_lines": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nbc = [list(map(int, input().split())) for _ in range(m)]\nbc.sort(key=lambda x: x[1], reverse=True)\na.sort()\ni = 0\nfor b, c in bc:\n for _ in range(b):\n if i < n and a[i] < c:\n a[i] = c\n i += 1\n else:\n break\nans = sum(a)\nprint(ans)\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nbc = [list(map(int, input().split())) for _ in range(m)]\nbc.sort(reverse=True, key=lambda x: x[1])\nli = []\nl = 0\ni = 0\nwhile i < m and l < n:\n b, c = bc[i]\n li += [c] * b\n i += 1\n l += b\na += li\na.sort(reverse=True)\nans = sum(a[:n])\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 5.2631578947, "diff": ["-bc.sort(key=lambda x: x[1], reverse=True)", "-a.sort()", "+bc.sort(reverse=True, key=lambda x: x[1])", "+li = []", "+l = 0", "-for b, c in bc:", "- for _ in range(b):", "- if i < n and a[i] < c:", "- a[i] = c", "- i += 1", "- else:", "- break", "-ans = sum(a)", "+while i < m and l < n:", "+ b, c = bc[i]", "+ li += [c] * b", "+ i += 1", "+ l += b", "+a += li", "+a.sort(reverse=True)", "+ans = sum(a[:n])"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2346956289, "measured_runtime_v1": 0.006594183, "runtime_lift": 35.5913127767, "key": ["s696312664", "s914180377"]} {"user_id": "u189326411", "problem_id": "p03796", "language": "python", "submission_id_v0": "s862494830", "submission_id_v1": "s415254610", "cpu_time_v0": 230, "cpu_time_v1": 37, "memory_v0": 4020, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.91, "input": "import math\n\nn = int(input())\n\nprint((math.factorial(n)%(10**9+7)))\n", "target": "n = int(input())\n\nmod = 10**9 + 7\n\n\n\npow = 1\n\nfor i in range(n):\n\n pow = pow*(i+1)%mod\n\n\n\nprint(pow)\n", "code_v0_loc": 3, "code_v1_loc": 8, "code_v0_num_chars": 66, "code_v1_num_chars": 104, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nprint((math.factorial(n) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\nmod = 10**9 + 7\npow = 1\nfor i in range(n):\n pow = pow * (i + 1) % mod\nprint(pow)\n", "code_same": false, "relative_loc_diff_percent": 62.5, "diff": ["-import math", "-", "-print((math.factorial(n) % (10**9 + 7)))", "+mod = 10**9 + 7", "+pow = 1", "+for i in range(n):", "+ pow = pow * (i + 1) % mod", "+print(pow)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5275577738, "measured_runtime_v1": 0.2526761317, "runtime_lift": 2.0878813135, "key": ["s862494830", "s415254610"]} {"user_id": "u982591663", "problem_id": "p03107", "language": "python", "submission_id_v0": "s749413264", "submission_id_v1": "s028114766", "cpu_time_v0": 22, "cpu_time_v1": 19, "memory_v0": 3956, "memory_v1": 3188, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.64, "input": "S = list(input())\n\nnum_one = S.count(\"1\")\n\nnum_zero = S.count(\"0\")\n\nans = min(num_one, num_zero) *2\n\nprint(ans)\n", "target": "S = input()\n\n\n\nans = min(S.count(\"0\"), S.count(\"1\")) * 2\n\nprint(ans)\n", "code_v0_loc": 5, "code_v1_loc": 4, "code_v0_num_chars": 112, "code_v1_num_chars": 69, "code_v0_no_empty_lines": "S = list(input())\nnum_one = S.count(\"1\")\nnum_zero = S.count(\"0\")\nans = min(num_one, num_zero) * 2\nprint(ans)\n", "code_v1_no_empty_lines": "S = input()\nans = min(S.count(\"0\"), S.count(\"1\")) * 2\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-S = list(input())", "-num_one = S.count(\"1\")", "-num_zero = S.count(\"0\")", "-ans = min(num_one, num_zero) * 2", "+S = input()", "+ans = min(S.count(\"0\"), S.count(\"1\")) * 2"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2118026633, "measured_runtime_v1": 0.0063807995, "runtime_lift": 33.1937497698, "key": ["s749413264", "s028114766"]} {"user_id": "u624475441", "problem_id": "p03457", "language": "python", "submission_id_v0": "s302891502", "submission_id_v1": "s171916715", "cpu_time_v0": 228, "cpu_time_v1": 146, "memory_v0": 28148, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 35.96, "input": "import sys\n\ncan = True; input()\n\ne = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]\n\nfor a, b in zip(e[1:], e):\n\n t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2])\n\n if t < 0 or t % 2 == 1: can = False; break\n\nprint((['No', 'Yes'][can]))", "target": "import sys\n\nans = 'Yes'; input()\n\nfor e in sys.stdin:\n\n t, x, y = list(map(int, e.split()))\n\n t = t - x - y\n\n if t < 0 or t % 2 == 1: ans = 'No'; break\n\nprint(ans)", "code_v0_loc": 7, "code_v1_loc": 7, "code_v0_num_chars": 259, "code_v1_num_chars": 166, "code_v0_no_empty_lines": "import sys\n\ncan = True\ninput()\ne = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]\nfor a, b in zip(e[1:], e):\n t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2])\n if t < 0 or t % 2 == 1:\n can = False\n break\nprint(([\"No\", \"Yes\"][can]))\n", "code_v1_no_empty_lines": "import sys\n\nans = \"Yes\"\ninput()\nfor e in sys.stdin:\n t, x, y = list(map(int, e.split()))\n t = t - x - y\n if t < 0 or t % 2 == 1:\n ans = \"No\"\n break\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-can = True", "+ans = \"Yes\"", "-e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]", "-for a, b in zip(e[1:], e):", "- t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2])", "+for e in sys.stdin:", "+ t, x, y = list(map(int, e.split()))", "+ t = t - x - y", "- can = False", "+ ans = \"No\"", "-print(([\"No\", \"Yes\"][can]))", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2223628902, "measured_runtime_v1": 0.1447919474, "runtime_lift": 1.5357407251, "key": ["s302891502", "s171916715"]} {"user_id": "u628794221", "problem_id": "p02688", "language": "python", "submission_id_v0": "s048784054", "submission_id_v1": "s441243732", "cpu_time_v0": 24, "cpu_time_v1": 20, "memory_v0": 9192, "memory_v1": 9172, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.67, "input": "N, K = list(map(int, input().split()))\n\nsunuke = [True]*N\n\nfor i in range(K):\n\n d = int(input())\n\n A = list(map(int, input().split()))\n\n for a in A:\n\n sunuke[a-1] = False\n\n\n\nans = 0\n\nfor i in range(N):\n\n if sunuke[i]:\n\n ans += 1\n\nprint(ans)", "target": "N, K = list(map(int, input().split()))\n\nflag = [True]*N\n\nfor i in range(K):\n\n d = int(input())\n\n A = list(map(int, input().split()))\n\n for a in A:\n\n flag[a-1] = False\n\nans = 0\n\nfor i in range(N):\n\n if flag[i]:\n\n ans += 1\n\nprint(ans)", "code_v0_loc": 13, "code_v1_loc": 12, "code_v0_num_chars": 260, "code_v1_num_chars": 252, "code_v0_no_empty_lines": "N, K = list(map(int, input().split()))\nsunuke = [True] * N\nfor i in range(K):\n d = int(input())\n A = list(map(int, input().split()))\n for a in A:\n sunuke[a - 1] = False\nans = 0\nfor i in range(N):\n if sunuke[i]:\n ans += 1\nprint(ans)\n", "code_v1_no_empty_lines": "N, K = list(map(int, input().split()))\nflag = [True] * N\nfor i in range(K):\n d = int(input())\n A = list(map(int, input().split()))\n for a in A:\n flag[a - 1] = False\nans = 0\nfor i in range(N):\n if flag[i]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 7.6923076923, "diff": ["-sunuke = [True] * N", "+flag = [True] * N", "- sunuke[a - 1] = False", "+ flag[a - 1] = False", "- if sunuke[i]:", "+ if flag[i]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3757941551, "measured_runtime_v1": 0.2950303654, "runtime_lift": 1.2737473806, "key": ["s048784054", "s441243732"]} {"user_id": "u057964173", "problem_id": "p03796", "language": "python", "submission_id_v0": "s018166938", "submission_id_v1": "s633160279", "cpu_time_v0": 298, "cpu_time_v1": 42, "memory_v0": 42992, "memory_v1": 28396, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 85.91, "input": "import sys\n\ndef input(): return sys.stdin.readline().strip()\n\n\n\ndef resolve():\n\n import math\n\n n=int(input())\n\n print((math.factorial(n)%(10**9+7)))\n\nresolve()", "target": "import sys\n\ndef input(): return sys.stdin.readline().strip()\n\n\n\ndef resolve():\n\n answer=1\n\n n=int(input())\n\n for i in range(1,n+1):\n\n answer*=i\n\n answer%=10**9+7\n\n print(answer)\n\nresolve()", "code_v0_loc": 8, "code_v1_loc": 11, "code_v0_num_chars": 166, "code_v1_num_chars": 214, "code_v0_no_empty_lines": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n import math\n\n n = int(input())\n print((math.factorial(n) % (10**9 + 7)))\n\n\nresolve()\n", "code_v1_no_empty_lines": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n answer = 1\n n = int(input())\n for i in range(1, n + 1):\n answer *= i\n answer %= 10**9 + 7\n print(answer)\n\n\nresolve()\n", "code_same": false, "relative_loc_diff_percent": 27.2727272727, "diff": ["- import math", "-", "+ answer = 1", "- print((math.factorial(n) % (10**9 + 7)))", "+ for i in range(1, n + 1):", "+ answer *= i", "+ answer %= 10**9 + 7", "+ print(answer)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5731575236, "measured_runtime_v1": 0.2333363581, "runtime_lift": 2.4563575447, "key": ["s018166938", "s633160279"]} {"user_id": "u983918956", "problem_id": "p03416", "language": "python", "submission_id_v0": "s018952102", "submission_id_v1": "s778219351", "cpu_time_v0": 118, "cpu_time_v1": 60, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 49.15, "input": "A,B = list(map(int,input().split()))\n\nj = 0\n\nfor i in range(A,B+1):\n\n l = list(str(i))\n\n l_reverse = list(reversed(l))\n\n if l == l_reverse:\n\n j += 1\n\nprint(j)", "target": "A, B = list(map(int,input().split()))\n\n\n\nans = 0\n\nfor n in range(A, B+1):\n\n n = str(n)\n\n if n == n[::-1]:\n\n ans += 1\n\nprint(ans)", "code_v0_loc": 8, "code_v1_loc": 8, "code_v0_num_chars": 158, "code_v1_num_chars": 135, "code_v0_no_empty_lines": "A, B = list(map(int, input().split()))\nj = 0\nfor i in range(A, B + 1):\n l = list(str(i))\n l_reverse = list(reversed(l))\n if l == l_reverse:\n j += 1\nprint(j)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\nans = 0\nfor n in range(A, B + 1):\n n = str(n)\n if n == n[::-1]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-j = 0", "-for i in range(A, B + 1):", "- l = list(str(i))", "- l_reverse = list(reversed(l))", "- if l == l_reverse:", "- j += 1", "-print(j)", "+ans = 0", "+for n in range(A, B + 1):", "+ n = str(n)", "+ if n == n[::-1]:", "+ ans += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4538340874, "measured_runtime_v1": 0.3384370139, "runtime_lift": 1.340970605, "key": ["s018952102", "s778219351"]} {"user_id": "u811841526", "problem_id": "p02390", "language": "python", "submission_id_v0": "s941329471", "submission_id_v1": "s549187322", "cpu_time_v0": 40, "cpu_time_v1": 20, "memory_v0": 7664, "memory_v1": 5592, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 50.0, "input": "s = int(input())\n\nm, s = s // 60, s % 60\n\nh, m = m // 60, m % 60\n\nprint((':'.join(map(str, [h,m,s]))))", "target": "s = int(input())\n\n\n\nsecond = s % 60\n\ns = s // 60\n\nmin = s % 60\n\nhour = s // 60\n\n\n\nprint(f'{hour}:{min}:{second}')\n", "code_v0_loc": 4, "code_v1_loc": 8, "code_v0_num_chars": 100, "code_v1_num_chars": 114, "code_v0_no_empty_lines": "s = int(input())\nm, s = s // 60, s % 60\nh, m = m // 60, m % 60\nprint((\":\".join(map(str, [h, m, s]))))\n", "code_v1_no_empty_lines": "s = int(input())\nsecond = s % 60\ns = s // 60\nmin = s % 60\nhour = s // 60\nprint(f\"{hour}:{min}:{second}\")\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-m, s = s // 60, s % 60", "-h, m = m // 60, m % 60", "-print((\":\".join(map(str, [h, m, s]))))", "+second = s % 60", "+s = s // 60", "+min = s % 60", "+hour = s // 60", "+print(f\"{hour}:{min}:{second}\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1672595444, "measured_runtime_v1": 0.0066597962, "runtime_lift": 25.1148140492, "key": ["s941329471", "s549187322"]} {"user_id": "u488127128", "problem_id": "p03796", "language": "python", "submission_id_v0": "s848409194", "submission_id_v1": "s870468874", "cpu_time_v0": 231, "cpu_time_v1": 35, "memory_v0": 4020, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 84.85, "input": "import math\n\nN = int(input())\n\nprint((math.factorial(N)%(10**9+7)))", "target": "import math\n\nN = int(input())\n\na = 1\n\nfor n in range(2,N+1):\n\n a = a*n % (10**9+7)\n\nprint(a)", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 65, "code_v1_num_chars": 95, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nprint((math.factorial(N) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "import math\n\nN = int(input())\na = 1\nfor n in range(2, N + 1):\n a = a * n % (10**9 + 7)\nprint(a)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-print((math.factorial(N) % (10**9 + 7)))", "+a = 1", "+for n in range(2, N + 1):", "+ a = a * n % (10**9 + 7)", "+print(a)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.8454835632, "measured_runtime_v1": 0.3383059211, "runtime_lift": 2.4991686828, "key": ["s848409194", "s870468874"]} {"user_id": "u550574002", "problem_id": "p03126", "language": "python", "submission_id_v0": "s757696098", "submission_id_v1": "s038854174", "cpu_time_v0": 23, "cpu_time_v1": 19, "memory_v0": 3572, "memory_v1": 3316, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.39, "input": "import functools\n\nprint((len(functools.reduce(lambda x, y: x&y,[set(input().split()[1:]) for _ in [0]*int(input().split()[0])]))))", "target": "print((len(set.intersection(*[set(input().split()[1:]) for _ in [0]*int(input().split()[0])]))))", "code_v0_loc": 2, "code_v1_loc": 1, "code_v0_num_chars": 128, "code_v1_num_chars": 94, "code_v0_no_empty_lines": "import functools\n\nprint(\n (\n len(\n functools.reduce(\n lambda x, y: x & y,\n [set(input().split()[1:]) for _ in [0] * int(input().split()[0])],\n )\n )\n )\n)\n", "code_v1_no_empty_lines": "print(\n (\n len(\n set.intersection(\n *[set(input().split()[1:]) for _ in [0] * int(input().split()[0])]\n )\n )\n )\n)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-import functools", "-", "- functools.reduce(", "- lambda x, y: x & y,", "- [set(input().split()[1:]) for _ in [0] * int(input().split()[0])],", "+ set.intersection(", "+ *[set(input().split()[1:]) for _ in [0] * int(input().split()[0])]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2541026509, "measured_runtime_v1": 0.0938221338, "runtime_lift": 2.7083444025, "key": ["s757696098", "s038854174"]} {"user_id": "u801359367", "problem_id": "p03325", "language": "python", "submission_id_v0": "s586527827", "submission_id_v1": "s564078636", "cpu_time_v0": 89, "cpu_time_v1": 80, "memory_v0": 4148, "memory_v1": 4148, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.11, "input": "N = int(input())\n\nA = list(map(int,input().split()))\n\n\n\nSUM = 0\n\nfor i in A:\n\n count = 0\n\n while i%2 == 0:\n\n i//=2\n\n count += 1\n\n SUM+=count\n\nprint(SUM)", "target": "N = int(input())\n\nA = list(map(int,input().split()))\n\nSUM = 0\n\nfor i in A:\n\n while i%2 == 0:\n\n i//=2\n\n SUM += 1\n\nprint(SUM)", "code_v0_loc": 11, "code_v1_loc": 8, "code_v0_num_chars": 175, "code_v1_num_chars": 140, "code_v0_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nSUM = 0\nfor i in A:\n count = 0\n while i % 2 == 0:\n i //= 2\n count += 1\n SUM += count\nprint(SUM)\n", "code_v1_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nSUM = 0\nfor i in A:\n while i % 2 == 0:\n i //= 2\n SUM += 1\nprint(SUM)\n", "code_same": false, "relative_loc_diff_percent": 27.2727272727, "diff": ["- count = 0", "- count += 1", "- SUM += count", "+ SUM += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3107097435, "measured_runtime_v1": 0.2124449382, "runtime_lift": 1.4625424646, "key": ["s586527827", "s564078636"]} {"user_id": "u253681061", "problem_id": "p03796", "language": "python", "submission_id_v0": "s618901729", "submission_id_v1": "s057938516", "cpu_time_v0": 49, "cpu_time_v1": 34, "memory_v0": 6900, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 30.61, "input": "n = int(input())\n\n\n\nINF = 10**9 + 7\n\n\n\nans = [0] * (10**5 + 1)\n\nans[0] = 1\n\n\n\nfor i in range(1,10**5 + 1):\n\n ans[i] = ans[i-1] * i % INF\n\n\n\nprint((ans[n]))\n", "target": "n = int(input())\n\nmod = 10**9 + 7\n\n\n\nans = 1\n\n\n\nfor i in range(1,n+1):\n\n ans = ans * i % mod\n\n\n\nprint(ans)", "code_v0_loc": 11, "code_v1_loc": 9, "code_v0_num_chars": 157, "code_v1_num_chars": 109, "code_v0_no_empty_lines": "n = int(input())\nINF = 10**9 + 7\nans = [0] * (10**5 + 1)\nans[0] = 1\nfor i in range(1, 10**5 + 1):\n ans[i] = ans[i - 1] * i % INF\nprint((ans[n]))\n", "code_v1_no_empty_lines": "n = int(input())\nmod = 10**9 + 7\nans = 1\nfor i in range(1, n + 1):\n ans = ans * i % mod\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 18.1818181818, "diff": ["-INF = 10**9 + 7", "-ans = [0] * (10**5 + 1)", "-ans[0] = 1", "-for i in range(1, 10**5 + 1):", "- ans[i] = ans[i - 1] * i % INF", "-print((ans[n]))", "+mod = 10**9 + 7", "+ans = 1", "+for i in range(1, n + 1):", "+ ans = ans * i % mod", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.8708683834, "measured_runtime_v1": 0.4576160941, "runtime_lift": 1.9030545354, "key": ["s618901729", "s057938516"]} {"user_id": "u813450984", "problem_id": "p03371", "language": "python", "submission_id_v0": "s722861535", "submission_id_v1": "s015018251", "cpu_time_v0": 77, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 77.92, "input": "a, b, c, x, y = list(map(int, input().split()))\n\nans = a * x + b * y\n\nm = max(x, y)\n\nfor i in range(1, m+1):\n\n x -= 1\n\n y -= 1\n\n if x < 0:\n\n x = 0\n\n if y < 0:\n\n y = 0\n\n temp = c*(i*2) + x*a + y*b\n\n if temp < ans:\n\n ans = temp\n\n\n\nprint(ans)\n", "target": "a, b, c, x, y = list(map(int, input().split()))\n\nans = a * x + b * y\n\nans = min(c * max(x, y) * 2, ans)\n\nif x < y:\n\n ans = min(c * x * 2 + (y - x) * b, ans)\n\nelse:\n\n ans = min(c * y * 2 + (x - y) * a, ans)\n\n\n\nprint(ans)", "code_v0_loc": 15, "code_v1_loc": 9, "code_v0_num_chars": 249, "code_v1_num_chars": 219, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = a * x + b * y\nm = max(x, y)\nfor i in range(1, m + 1):\n x -= 1\n y -= 1\n if x < 0:\n x = 0\n if y < 0:\n y = 0\n temp = c * (i * 2) + x * a + y * b\n if temp < ans:\n ans = temp\nprint(ans)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = a * x + b * y\nans = min(c * max(x, y) * 2, ans)\nif x < y:\n ans = min(c * x * 2 + (y - x) * b, ans)\nelse:\n ans = min(c * y * 2 + (x - y) * a, ans)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 40.0, "diff": ["-m = max(x, y)", "-for i in range(1, m + 1):", "- x -= 1", "- y -= 1", "- if x < 0:", "- x = 0", "- if y < 0:", "- y = 0", "- temp = c * (i * 2) + x * a + y * b", "- if temp < ans:", "- ans = temp", "+ans = min(c * max(x, y) * 2, ans)", "+if x < y:", "+ ans = min(c * x * 2 + (y - x) * b, ans)", "+else:", "+ ans = min(c * y * 2 + (x - y) * a, ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2966257923, "measured_runtime_v1": 0.2002350025, "runtime_lift": 1.4813883113, "key": ["s722861535", "s015018251"]} {"user_id": "u945199633", "problem_id": "p02595", "language": "python", "submission_id_v0": "s028374925", "submission_id_v1": "s480019615", "cpu_time_v0": 580, "cpu_time_v1": 443, "memory_v0": 45308, "memory_v1": 9156, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 23.62, "input": "N, D = list(map(int, input().split()))\n\npoint = []\n\nfor i in range(N):\n\n point.append(list(map(int, input().split())))\n\n\n\nct = 0\n\nD2 = D * D\n\nfor i in point:\n\n if (i[0]**2 + i[1]**2) <= D2:\n\n ct += 1\n\n\n\nprint(ct)", "target": "N, D = list(map(int, input().split()))\n\n\n\nct = 0\n\nD2 = D * D\n\nfor i in range(N):\n\n X, Y = list(map(int, input().split()))\n\n if (X**2 + Y**2) <= D2:\n\n ct += 1\n\n\n\nprint(ct)", "code_v0_loc": 12, "code_v1_loc": 10, "code_v0_num_chars": 219, "code_v1_num_chars": 171, "code_v0_no_empty_lines": "N, D = list(map(int, input().split()))\npoint = []\nfor i in range(N):\n point.append(list(map(int, input().split())))\nct = 0\nD2 = D * D\nfor i in point:\n if (i[0] ** 2 + i[1] ** 2) <= D2:\n ct += 1\nprint(ct)\n", "code_v1_no_empty_lines": "N, D = list(map(int, input().split()))\nct = 0\nD2 = D * D\nfor i in range(N):\n X, Y = list(map(int, input().split()))\n if (X**2 + Y**2) <= D2:\n ct += 1\nprint(ct)\n", "code_same": false, "relative_loc_diff_percent": 16.6666666667, "diff": ["-point = []", "-for i in range(N):", "- point.append(list(map(int, input().split())))", "-for i in point:", "- if (i[0] ** 2 + i[1] ** 2) <= D2:", "+for i in range(N):", "+ X, Y = list(map(int, input().split()))", "+ if (X**2 + Y**2) <= D2:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.399467237, "measured_runtime_v1": 0.2084539161, "runtime_lift": 1.9163335691, "key": ["s028374925", "s480019615"]} {"user_id": "u624689667", "problem_id": "p03796", "language": "python", "submission_id_v0": "s800016333", "submission_id_v1": "s112879561", "cpu_time_v0": 271, "cpu_time_v1": 164, "memory_v0": 42736, "memory_v1": 38512, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 39.48, "input": "from math import factorial\n\n\n\nmod = 10**9 + 7\n\nn = int(input())\n\n\n\nans = factorial(n) % mod\n\nprint(ans)", "target": "N = int(input())\n\nMOD = 10**9 + 7\n\nans = 1\n\nfor i in range(2, N+1):\n\n ans *= i\n\n ans %= MOD\n\nprint(ans)\n", "code_v0_loc": 7, "code_v1_loc": 7, "code_v0_num_chars": 103, "code_v1_num_chars": 110, "code_v0_no_empty_lines": "from math import factorial\n\nmod = 10**9 + 7\nn = int(input())\nans = factorial(n) % mod\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nMOD = 10**9 + 7\nans = 1\nfor i in range(2, N + 1):\n ans *= i\n ans %= MOD\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-from math import factorial", "-", "-mod = 10**9 + 7", "-n = int(input())", "-ans = factorial(n) % mod", "+N = int(input())", "+MOD = 10**9 + 7", "+ans = 1", "+for i in range(2, N + 1):", "+ ans *= i", "+ ans %= MOD"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5071064572, "measured_runtime_v1": 0.006458343, "runtime_lift": 78.5195915066, "key": ["s800016333", "s112879561"]} {"user_id": "u297574184", "problem_id": "p02773", "language": "python", "submission_id_v0": "s609062581", "submission_id_v1": "s989407304", "cpu_time_v0": 358, "cpu_time_v1": 258, "memory_v0": 35944, "memory_v1": 38716, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 27.93, "input": "from collections import Counter\n\nimport sys\n\ninput = sys.stdin.readline\n\n\n\ndef solve():\n\n N = int(input())\n\n Sss = [input().rstrip() for _ in range(N)]\n\n\n\n cnt = Counter(Sss)\n\n #print('cnt:', cnt)\n\n\n\n maxNum = max(cnt.values())\n\n #print('maxNum:', maxNum)\n\n\n\n anss = []\n\n for key, value in list(cnt.items()):\n\n if value == maxNum:\n\n anss.append(key)\n\n #print('anss:', anss)\n\n\n\n anss.sort()\n\n\n\n print(('\\n'.join(anss)))\n\n\n\n\n\nsolve()\n", "target": "from collections import Counter\n\nimport sys\n\ninput = sys.stdin.readline\n\n\n\nN = int(input())\n\nSss = [input().rstrip() for _ in range(N)]\n\n\n\ncnt = Counter(Sss)\n\n\n\nnum = max(cnt.values())\n\n\n\nanss = []\n\nfor key in sorted(cnt.keys()):\n\n if cnt[key] == num:\n\n anss.append(key)\n\n\n\nprint(('\\n'.join(anss)))\n", "code_v0_loc": 26, "code_v1_loc": 17, "code_v0_num_chars": 475, "code_v1_num_chars": 307, "code_v0_no_empty_lines": "from collections import Counter\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef solve():\n N = int(input())\n Sss = [input().rstrip() for _ in range(N)]\n cnt = Counter(Sss)\n # print('cnt:', cnt)\n maxNum = max(cnt.values())\n # print('maxNum:', maxNum)\n anss = []\n for key, value in list(cnt.items()):\n if value == maxNum:\n anss.append(key)\n # print('anss:', anss)\n anss.sort()\n print((\"\\n\".join(anss)))\n\n\nsolve()\n", "code_v1_no_empty_lines": "from collections import Counter\nimport sys\n\ninput = sys.stdin.readline\nN = int(input())\nSss = [input().rstrip() for _ in range(N)]\ncnt = Counter(Sss)\nnum = max(cnt.values())\nanss = []\nfor key in sorted(cnt.keys()):\n if cnt[key] == num:\n anss.append(key)\nprint((\"\\n\".join(anss)))\n", "code_same": false, "relative_loc_diff_percent": 34.6153846154, "diff": ["-", "-", "-def solve():", "- N = int(input())", "- Sss = [input().rstrip() for _ in range(N)]", "- cnt = Counter(Sss)", "- # print('cnt:', cnt)", "- maxNum = max(cnt.values())", "- # print('maxNum:', maxNum)", "- anss = []", "- for key, value in list(cnt.items()):", "- if value == maxNum:", "- anss.append(key)", "- # print('anss:', anss)", "- anss.sort()", "- print((\"\\n\".join(anss)))", "-", "-", "-solve()", "+N = int(input())", "+Sss = [input().rstrip() for _ in range(N)]", "+cnt = Counter(Sss)", "+num = max(cnt.values())", "+anss = []", "+for key in sorted(cnt.keys()):", "+ if cnt[key] == num:", "+ anss.append(key)", "+print((\"\\n\".join(anss)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2647752221, "measured_runtime_v1": 0.1462080963, "runtime_lift": 1.8109477437, "key": ["s609062581", "s989407304"]} {"user_id": "u811436126", "problem_id": "p02555", "language": "python", "submission_id_v0": "s082576202", "submission_id_v1": "s465570710", "cpu_time_v0": 367, "cpu_time_v1": 30, "memory_v0": 9988, "memory_v1": 9128, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 91.83, "input": "from functools import lru_cache\n\nimport sys\n\n\n\nsys.setrecursionlimit(2000)\n\n\n\ns = int(input())\n\nmod = 10 ** 9 + 7\n\n\n\n\n\n@lru_cache(maxsize=None)\n\ndef dfs(n):\n\n if n <= 2:\n\n return 0\n\n elif 3<=n<=5:\n\n return 1\n\n else:\n\n count = 1\n\n for i in range(3, n + 1):\n\n count += dfs(n - i)\n\n count %= mod\n\n\n\n return count % mod\n\n\n\n\n\nans = dfs(s)\n\nprint(ans)\n", "target": "s = int(input())\n\nmod = 10 ** 9 + 7\n\n\n\ndp = [0] * (s + 1)\n\ndp[0] = 1\n\n\n\nx = 0\n\nfor i in range(3, s + 1):\n\n x += dp[i - 3]\n\n dp[i] = x % mod\n\n\n\nans = dp[s] % mod\n\nprint(ans)\n", "code_v0_loc": 26, "code_v1_loc": 13, "code_v0_num_chars": 412, "code_v1_num_chars": 179, "code_v0_no_empty_lines": "from functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(2000)\ns = int(input())\nmod = 10**9 + 7\n\n\n@lru_cache(maxsize=None)\ndef dfs(n):\n if n <= 2:\n return 0\n elif 3 <= n <= 5:\n return 1\n else:\n count = 1\n for i in range(3, n + 1):\n count += dfs(n - i)\n count %= mod\n return count % mod\n\n\nans = dfs(s)\nprint(ans)\n", "code_v1_no_empty_lines": "s = int(input())\nmod = 10**9 + 7\ndp = [0] * (s + 1)\ndp[0] = 1\nx = 0\nfor i in range(3, s + 1):\n x += dp[i - 3]\n dp[i] = x % mod\nans = dp[s] % mod\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-from functools import lru_cache", "-import sys", "-", "-sys.setrecursionlimit(2000)", "-", "-", "-@lru_cache(maxsize=None)", "-def dfs(n):", "- if n <= 2:", "- return 0", "- elif 3 <= n <= 5:", "- return 1", "- else:", "- count = 1", "- for i in range(3, n + 1):", "- count += dfs(n - i)", "- count %= mod", "- return count % mod", "-", "-", "-ans = dfs(s)", "+dp = [0] * (s + 1)", "+dp[0] = 1", "+x = 0", "+for i in range(3, s + 1):", "+ x += dp[i - 3]", "+ dp[i] = x % mod", "+ans = dp[s] % mod"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5571973288, "measured_runtime_v1": 0.21483691, "runtime_lift": 2.593582866, "key": ["s082576202", "s465570710"]} {"user_id": "u599114793", "problem_id": "p03721", "language": "python", "submission_id_v0": "s168629717", "submission_id_v1": "s331365181", "cpu_time_v0": 827, "cpu_time_v1": 370, "memory_v0": 54036, "memory_v1": 83348, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 55.26, "input": "n,k = list(map(int,input().split()))\n\nnum = 0\n\nq = []\n\nfor i in range(n):\n\n a,b = list(map(int,input().split()))\n\n q.append((a,b))\n\nq.sort()\n\nfor i in range(n):\n\n a, b = q[i][0], q[i][1]\n\n num += b\n\n if num >= k:\n\n print(a)\n\n exit()\n\n\n", "target": "n,k = list(map(int,input().split()))\n\ncnt = 0\n\nnum = []\n\nfor i in range(n):\n\n a,b = list(map(int,input().split()))\n\n num.append((a,b))\n\nnum.sort()\n\nfor i in range(n):\n\n cnt += num[i][1]\n\n if cnt >= k:\n\n print((num[i][0]))\n\n exit()", "code_v0_loc": 14, "code_v1_loc": 12, "code_v0_num_chars": 252, "code_v1_num_chars": 242, "code_v0_no_empty_lines": "n, k = list(map(int, input().split()))\nnum = 0\nq = []\nfor i in range(n):\n a, b = list(map(int, input().split()))\n q.append((a, b))\nq.sort()\nfor i in range(n):\n a, b = q[i][0], q[i][1]\n num += b\n if num >= k:\n print(a)\n exit()\n", "code_v1_no_empty_lines": "n, k = list(map(int, input().split()))\ncnt = 0\nnum = []\nfor i in range(n):\n a, b = list(map(int, input().split()))\n num.append((a, b))\nnum.sort()\nfor i in range(n):\n cnt += num[i][1]\n if cnt >= k:\n print((num[i][0]))\n exit()\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-num = 0", "-q = []", "+cnt = 0", "+num = []", "- q.append((a, b))", "-q.sort()", "+ num.append((a, b))", "+num.sort()", "- a, b = q[i][0], q[i][1]", "- num += b", "- if num >= k:", "- print(a)", "+ cnt += num[i][1]", "+ if cnt >= k:", "+ print((num[i][0]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3024329725, "measured_runtime_v1": 0.2289340452, "runtime_lift": 1.3210484801, "key": ["s168629717", "s331365181"]} {"user_id": "u094191970", "problem_id": "p03416", "language": "python", "submission_id_v0": "s196951264", "submission_id_v1": "s755826464", "cpu_time_v0": 127, "cpu_time_v1": 57, "memory_v0": 2940, "memory_v1": 9184, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 55.12, "input": "a,b=list(map(int, input().split()))\n\ncnt=0\n\nfor i in range(a,b+1):\n\n n=list(str(i))\n\n if n==list(reversed(n)):\n\n cnt+=1\n\nprint(cnt)", "target": "from sys import stdin\n\nnii=lambda:list(map(int,stdin.readline().split()))\n\nlnii=lambda:list(map(int,stdin.readline().split()))\n\n\n\na,b=nii()\n\nans=0\n\nfor i in range(a,b+1):\n\n s=str(i)\n\n if s==s[::-1]:\n\n ans+=1\n\n\n\nprint(ans)", "code_v0_loc": 7, "code_v1_loc": 12, "code_v0_num_chars": 138, "code_v1_num_chars": 220, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\ncnt = 0\nfor i in range(a, b + 1):\n n = list(str(i))\n if n == list(reversed(n)):\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "from sys import stdin\n\nnii = lambda: list(map(int, stdin.readline().split()))\nlnii = lambda: list(map(int, stdin.readline().split()))\na, b = nii()\nans = 0\nfor i in range(a, b + 1):\n s = str(i)\n if s == s[::-1]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 41.6666666667, "diff": ["-a, b = list(map(int, input().split()))", "-cnt = 0", "+from sys import stdin", "+", "+nii = lambda: list(map(int, stdin.readline().split()))", "+lnii = lambda: list(map(int, stdin.readline().split()))", "+a, b = nii()", "+ans = 0", "- n = list(str(i))", "- if n == list(reversed(n)):", "- cnt += 1", "-print(cnt)", "+ s = str(i)", "+ if s == s[::-1]:", "+ ans += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4537812017, "measured_runtime_v1": 0.1270140123, "runtime_lift": 3.5726861437, "key": ["s196951264", "s755826464"]} {"user_id": "u046187684", "problem_id": "p03416", "language": "python", "submission_id_v0": "s340270167", "submission_id_v1": "s097893502", "cpu_time_v0": 67, "cpu_time_v1": 60, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.45, "input": "a, b = list(map(int, input().strip().split(\" \")))\n\ncount = 0\n\nfor i in range(a, b + 1):\n\n if str(i) == str(i)[::-1]:\n\n count += 1\n\nprint(count)\n", "target": "def solve(string):\n\n a, b = list(map(int, string.split()))\n\n count = 0\n\n for i in range(a, b + 1):\n\n if str(i) == str(i)[::-1]:\n\n count += 1\n\n return str(count)\n\n\n\n\n\nif __name__ == '__main__':\n\n print((solve(input())))\n", "code_v0_loc": 6, "code_v1_loc": 11, "code_v0_num_chars": 148, "code_v1_num_chars": 244, "code_v0_no_empty_lines": "a, b = list(map(int, input().strip().split(\" \")))\ncount = 0\nfor i in range(a, b + 1):\n if str(i) == str(i)[::-1]:\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "def solve(string):\n a, b = list(map(int, string.split()))\n count = 0\n for i in range(a, b + 1):\n if str(i) == str(i)[::-1]:\n count += 1\n return str(count)\n\n\nif __name__ == \"__main__\":\n print((solve(input())))\n", "code_same": false, "relative_loc_diff_percent": 45.4545454545, "diff": ["-a, b = list(map(int, input().strip().split(\" \")))", "-count = 0", "-for i in range(a, b + 1):", "- if str(i) == str(i)[::-1]:", "- count += 1", "-print(count)", "+def solve(string):", "+ a, b = list(map(int, string.split()))", "+ count = 0", "+ for i in range(a, b + 1):", "+ if str(i) == str(i)[::-1]:", "+ count += 1", "+ return str(count)", "+", "+", "+if __name__ == \"__main__\":", "+ print((solve(input())))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2889559059, "measured_runtime_v1": 0.2039610577, "runtime_lift": 1.4167209624, "key": ["s340270167", "s097893502"]} {"user_id": "u257974487", "problem_id": "p03796", "language": "python", "submission_id_v0": "s235320519", "submission_id_v1": "s032021754", "cpu_time_v0": 230, "cpu_time_v1": 40, "memory_v0": 3980, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.61, "input": "import math\n\nN = int(input())\n\np = math.factorial(N)\n\nprint((p % 1000000007))", "target": "N = int(input())\n\np = 1\n\nfor i in range(1,N+1):\n\n p *= i\n\n p %= 1000000007\n\nprint(p)\n", "code_v0_loc": 4, "code_v1_loc": 6, "code_v0_num_chars": 75, "code_v1_num_chars": 91, "code_v0_no_empty_lines": "import math\n\nN = int(input())\np = math.factorial(N)\nprint((p % 1000000007))\n", "code_v1_no_empty_lines": "N = int(input())\np = 1\nfor i in range(1, N + 1):\n p *= i\n p %= 1000000007\nprint(p)\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-import math", "-", "-p = math.factorial(N)", "-print((p % 1000000007))", "+p = 1", "+for i in range(1, N + 1):", "+ p *= i", "+ p %= 1000000007", "+print(p)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.768677109, "measured_runtime_v1": 0.410683428, "runtime_lift": 1.8717022808, "key": ["s235320519", "s032021754"]} {"user_id": "u706929073", "problem_id": "p02881", "language": "python", "submission_id_v0": "s504662720", "submission_id_v1": "s470778572", "cpu_time_v0": 504, "cpu_time_v1": 137, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 72.82, "input": "N = int(input())\n\n\n\n\n\ndef dist(i, j):\n\n return i + j - 2\n\n\n\n\n\nmin = 10 ** 24\n\ni = 1\n\nwhile (i ** 2) <= N:\n\n if 0 == N % i:\n\n j = N // i\n\n d = dist(i, j)\n\n if min > d:\n\n min = d\n\n i += 1\n\nprint(d)\n", "target": "import math\n\nn = int(input())\n\n\n\nans = 0\n\nfor i in range(math.ceil(math.sqrt(n) + 1))[:0:-1]:\n\n if 0 == n % i:\n\n ans = i\n\n break\n\nans_partner = n // ans\n\nprint((ans + ans_partner - 2))\n", "code_v0_loc": 17, "code_v1_loc": 10, "code_v0_num_chars": 237, "code_v1_num_chars": 200, "code_v0_no_empty_lines": "N = int(input())\n\n\ndef dist(i, j):\n return i + j - 2\n\n\nmin = 10**24\ni = 1\nwhile (i**2) <= N:\n if 0 == N % i:\n j = N // i\n d = dist(i, j)\n if min > d:\n min = d\n i += 1\nprint(d)\n", "code_v1_no_empty_lines": "import math\n\nn = int(input())\nans = 0\nfor i in range(math.ceil(math.sqrt(n) + 1))[:0:-1]:\n if 0 == n % i:\n ans = i\n break\nans_partner = n // ans\nprint((ans + ans_partner - 2))\n", "code_same": false, "relative_loc_diff_percent": 41.1764705882, "diff": ["-N = int(input())", "+import math", "-", "-def dist(i, j):", "- return i + j - 2", "-", "-", "-min = 10**24", "-i = 1", "-while (i**2) <= N:", "- if 0 == N % i:", "- j = N // i", "- d = dist(i, j)", "- if min > d:", "- min = d", "- i += 1", "-print(d)", "+n = int(input())", "+ans = 0", "+for i in range(math.ceil(math.sqrt(n) + 1))[:0:-1]:", "+ if 0 == n % i:", "+ ans = i", "+ break", "+ans_partner = n // ans", "+print((ans + ans_partner - 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.327980933, "measured_runtime_v1": 0.2062122526, "runtime_lift": 1.5905016738, "key": ["s504662720", "s470778572"]} {"user_id": "u222668979", "problem_id": "p02552", "language": "python", "submission_id_v0": "s235847366", "submission_id_v1": "s896909207", "cpu_time_v0": 81, "cpu_time_v1": 70, "memory_v0": 61596, "memory_v1": 61788, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.58, "input": "n = int(input())\n\nprint((1 if n == 0 else 0))\n", "target": "n = int(input())\n\nprint((0 if n else 1))\n", "code_v0_loc": 2, "code_v1_loc": 2, "code_v0_num_chars": 44, "code_v1_num_chars": 39, "code_v0_no_empty_lines": "n = int(input())\nprint((1 if n == 0 else 0))\n", "code_v1_no_empty_lines": "n = int(input())\nprint((0 if n else 1))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-print((1 if n == 0 else 0))", "+print((0 if n else 1))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.340472885, "measured_runtime_v1": 0.2658090671, "runtime_lift": 1.2808926674, "key": ["s235847366", "s896909207"]} {"user_id": "u282228874", "problem_id": "p03013", "language": "python", "submission_id_v0": "s600331807", "submission_id_v1": "s809304917", "cpu_time_v0": 241, "cpu_time_v1": 180, "memory_v0": 9592, "memory_v1": 13192, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 25.31, "input": "N,M = list(map(int,input().split()))\n\nMOD = 10**9+7\n\ndp = [0]*(N+1)\n\ndp[0]=1\n\nA = [int(input()) for i in range(M)]\n\nban = [1]*(N+1)\n\nfor a in A:\n\n ban[a]=0\n\nfor i in range(N):\n\n if i-1>=0:\n\n dp[i+1]=dp[i]*ban[i]+dp[i-1]*ban[i-1]\n\n else:\n\n dp[i+1]=dp[i]*ban[i]\n\n dp[i+1] %= MOD \n\nprint((dp[N]))", "target": "N,M = list(map(int,input().split()))\n\nA = [int(input()) for i in range(M)]\n\nMOD = 10**9+7\n\nA = set(A)\n\ndp = [0]*(N+1)\n\ndp[0] = 1\n\nfor i in range(1,N+1):\n\n if i in A:\n\n continue\n\n if i == 1:\n\n dp[1] = dp[0]\n\n else:\n\n dp[i] = (dp[i-1]+dp[i-2])%MOD\n\nprint((dp[N]))", "code_v0_loc": 15, "code_v1_loc": 14, "code_v0_num_chars": 311, "code_v1_num_chars": 283, "code_v0_no_empty_lines": "N, M = list(map(int, input().split()))\nMOD = 10**9 + 7\ndp = [0] * (N + 1)\ndp[0] = 1\nA = [int(input()) for i in range(M)]\nban = [1] * (N + 1)\nfor a in A:\n ban[a] = 0\nfor i in range(N):\n if i - 1 >= 0:\n dp[i + 1] = dp[i] * ban[i] + dp[i - 1] * ban[i - 1]\n else:\n dp[i + 1] = dp[i] * ban[i]\n dp[i + 1] %= MOD\nprint((dp[N]))\n", "code_v1_no_empty_lines": "N, M = list(map(int, input().split()))\nA = [int(input()) for i in range(M)]\nMOD = 10**9 + 7\nA = set(A)\ndp = [0] * (N + 1)\ndp[0] = 1\nfor i in range(1, N + 1):\n if i in A:\n continue\n if i == 1:\n dp[1] = dp[0]\n else:\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n", "code_same": false, "relative_loc_diff_percent": 6.6666666667, "diff": ["+A = [int(input()) for i in range(M)]", "+A = set(A)", "-A = [int(input()) for i in range(M)]", "-ban = [1] * (N + 1)", "-for a in A:", "- ban[a] = 0", "-for i in range(N):", "- if i - 1 >= 0:", "- dp[i + 1] = dp[i] * ban[i] + dp[i - 1] * ban[i - 1]", "+for i in range(1, N + 1):", "+ if i in A:", "+ continue", "+ if i == 1:", "+ dp[1] = dp[0]", "- dp[i + 1] = dp[i] * ban[i]", "- dp[i + 1] %= MOD", "+ dp[i] = (dp[i - 1] + dp[i - 2]) % MOD"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2076114528, "measured_runtime_v1": 0.0063931749, "runtime_lift": 32.4739204186, "key": ["s600331807", "s809304917"]} {"user_id": "u562935282", "problem_id": "p03371", "language": "python", "submission_id_v0": "s471284270", "submission_id_v1": "s058926350", "cpu_time_v0": 98, "cpu_time_v1": 81, "memory_v0": 3064, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.35, "input": "def main():\n\n A, B, AB, X, Y = list(map(int, input().split()))\n\n M = max(X, Y)\n\n\n\n k = 0\n\n ans = A * X + B * Y\n\n while True:\n\n ans = min(\n\n ans,\n\n AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B\n\n )\n\n\n\n if k >= M: break\n\n k += 1\n\n\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "target": "def main():\n\n A, B, C, X, Y = list(map(int, input().split()))\n\n\n\n ans = 1 << 30\n\n c = 0 # even\n\n while True:\n\n j = c // 2\n\n t = A * max(0, X - j) + B * max(0, Y - j) + C * c\n\n if ans <= t: break\n\n ans = t\n\n c += 2\n\n\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "code_v0_loc": 20, "code_v1_loc": 17, "code_v0_num_chars": 353, "code_v1_num_chars": 318, "code_v0_no_empty_lines": "def main():\n A, B, AB, X, Y = list(map(int, input().split()))\n M = max(X, Y)\n k = 0\n ans = A * X + B * Y\n while True:\n ans = min(ans, AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B)\n if k >= M:\n break\n k += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "def main():\n A, B, C, X, Y = list(map(int, input().split()))\n ans = 1 << 30\n c = 0 # even\n while True:\n j = c // 2\n t = A * max(0, X - j) + B * max(0, Y - j) + C * c\n if ans <= t:\n break\n ans = t\n c += 2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 15.0, "diff": ["- A, B, AB, X, Y = list(map(int, input().split()))", "- M = max(X, Y)", "- k = 0", "- ans = A * X + B * Y", "+ A, B, C, X, Y = list(map(int, input().split()))", "+ ans = 1 << 30", "+ c = 0 # even", "- ans = min(ans, AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B)", "- if k >= M:", "+ j = c // 2", "+ t = A * max(0, X - j) + B * max(0, Y - j) + C * c", "+ if ans <= t:", "- k += 1", "+ ans = t", "+ c += 2"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3021148317, "measured_runtime_v1": 0.1545656888, "runtime_lift": 1.9546047633, "key": ["s471284270", "s058926350"]} {"user_id": "u021019433", "problem_id": "p02837", "language": "python", "submission_id_v0": "s456284110", "submission_id_v1": "s644980365", "cpu_time_v0": 95, "cpu_time_v1": 55, "memory_v0": 6500, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 42.11, "input": "def popcount(x):\n\n r, q = 0, x\n\n while x:\n\n r += 1\n\n x &= x - 1\n\n return r, q\n\n \n\nn = int(input())\n\nr = list(range(n))\n\na = [[0, 0] for _ in r]\n\nfor i in r:\n\n for _ in range(int(input())):\n\n x, y = list(map(int, input().split()))\n\n a[i][y] |= 1 << (x - 1)\n\nl = (1 << n) - 1 \n\nb = sorted(map(popcount, list(range(1, l + 1))))\n\nans = next((i for i, x in reversed(b)\n\n if all(a[j][0] & x == a[j][1] & l - x == 0 for j in r if x >> j & 1)), 0)\n\nprint(ans)\n", "target": "from itertools import combinations, count\n\n \n\nn = int(input())\n\nr = list(range(n))\n\na = [(set(), set()) for _ in r]\n\nfor i in r:\n\n for _ in range(int(input())):\n\n x, y = list(map(int, input().split()))\n\n a[i][y].add(x - 1)\n\nr = next(i for i in count(n, - 1) for x in map(set, combinations(r, i))\n\n if all(a[j][0].isdisjoint(x) and a[j][1] < x for j in x))\n\nprint(r)\n", "code_v0_loc": 19, "code_v1_loc": 12, "code_v0_num_chars": 460, "code_v1_num_chars": 369, "code_v0_no_empty_lines": "def popcount(x):\n r, q = 0, x\n while x:\n r += 1\n x &= x - 1\n return r, q\n\n\nn = int(input())\nr = list(range(n))\na = [[0, 0] for _ in r]\nfor i in r:\n for _ in range(int(input())):\n x, y = list(map(int, input().split()))\n a[i][y] |= 1 << (x - 1)\nl = (1 << n) - 1\nb = sorted(map(popcount, list(range(1, l + 1))))\nans = next(\n (\n i\n for i, x in reversed(b)\n if all(a[j][0] & x == a[j][1] & l - x == 0 for j in r if x >> j & 1)\n ),\n 0,\n)\nprint(ans)\n", "code_v1_no_empty_lines": "from itertools import combinations, count\n\nn = int(input())\nr = list(range(n))\na = [(set(), set()) for _ in r]\nfor i in r:\n for _ in range(int(input())):\n x, y = list(map(int, input().split()))\n a[i][y].add(x - 1)\nr = next(\n i\n for i in count(n, -1)\n for x in map(set, combinations(r, i))\n if all(a[j][0].isdisjoint(x) and a[j][1] < x for j in x)\n)\nprint(r)\n", "code_same": false, "relative_loc_diff_percent": 36.8421052632, "diff": ["-def popcount(x):", "- r, q = 0, x", "- while x:", "- r += 1", "- x &= x - 1", "- return r, q", "-", "+from itertools import combinations, count", "-a = [[0, 0] for _ in r]", "+a = [(set(), set()) for _ in r]", "- a[i][y] |= 1 << (x - 1)", "-l = (1 << n) - 1", "-b = sorted(map(popcount, list(range(1, l + 1))))", "-ans = next(", "- (", "- i", "- for i, x in reversed(b)", "- if all(a[j][0] & x == a[j][1] & l - x == 0 for j in r if x >> j & 1)", "- ),", "- 0,", "+ a[i][y].add(x - 1)", "+r = next(", "+ i", "+ for i in count(n, -1)", "+ for x in map(set, combinations(r, i))", "+ if all(a[j][0].isdisjoint(x) and a[j][1] < x for j in x)", "-print(ans)", "+print(r)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3135637941, "measured_runtime_v1": 0.2051509681, "runtime_lift": 1.5284538848, "key": ["s456284110", "s644980365"]} {"user_id": "u227438830", "problem_id": "p02394", "language": "python", "submission_id_v0": "s015330345", "submission_id_v1": "s144446421", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 7644, "memory_v1": 5592, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "W,H,x,y,r = [int(i) for i in input().split()]\n\nif x - r >= 0 and x + r <= W and y - r >= 0 and y + r <= H:\n\n print(\"Yes\")\n\nelse:\n\n print(\"No\")", "target": "W, H, x, y, r = list(map(int, input().split()))\n\nif r <= x <= W-r and r <= y <= H-r:\n\n print('Yes')\n\nelse:\n\n print('No')\n", "code_v0_loc": 5, "code_v1_loc": 5, "code_v0_num_chars": 148, "code_v1_num_chars": 121, "code_v0_no_empty_lines": "W, H, x, y, r = [int(i) for i in input().split()]\nif x - r >= 0 and x + r <= W and y - r >= 0 and y + r <= H:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_v1_no_empty_lines": "W, H, x, y, r = list(map(int, input().split()))\nif r <= x <= W - r and r <= y <= H - r:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-W, H, x, y, r = [int(i) for i in input().split()]", "-if x - r >= 0 and x + r <= W and y - r >= 0 and y + r <= H:", "+W, H, x, y, r = list(map(int, input().split()))", "+if r <= x <= W - r and r <= y <= H - r:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1765992579, "measured_runtime_v1": 0.0064357525, "runtime_lift": 27.44034336, "key": ["s015330345", "s144446421"]} {"user_id": "u353895424", "problem_id": "p03325", "language": "python", "submission_id_v0": "s954474488", "submission_id_v1": "s311308759", "cpu_time_v0": 81, "cpu_time_v1": 56, "memory_v0": 4148, "memory_v1": 10088, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 30.86, "input": "from math import log2\n\nn = int(input())\n\na = list(map(int, input().split()))\n\nans = 0\n\n\n\nfor _a in a:\n\n if _a%2 == 0:\n\n cnt =0\n\n while _a%2 == 0:\n\n _a //= 2\n\n cnt += 1\n\n ans += cnt\n\n\n\nprint((int(ans)))", "target": "def f(k):\n\n cnt = 0\n\n while k%2 == 0:\n\n k //= 2\n\n cnt += 1\n\n # print(k)\n\n # print(\"-----\")\n\n return cnt\n\n\n\nn = int(input())\n\nA = list(map(int, input().split()))\n\nans = 0\n\n\n\nfor a in A:\n\n if a%2 == 0:\n\n ans += f(a)\n\nprint(ans)", "code_v0_loc": 14, "code_v1_loc": 17, "code_v0_num_chars": 245, "code_v1_num_chars": 272, "code_v0_no_empty_lines": "from math import log2\n\nn = int(input())\na = list(map(int, input().split()))\nans = 0\nfor _a in a:\n if _a % 2 == 0:\n cnt = 0\n while _a % 2 == 0:\n _a //= 2\n cnt += 1\n ans += cnt\nprint((int(ans)))\n", "code_v1_no_empty_lines": "def f(k):\n cnt = 0\n while k % 2 == 0:\n k //= 2\n cnt += 1\n # print(k)\n # print(\"-----\")\n return cnt\n\n\nn = int(input())\nA = list(map(int, input().split()))\nans = 0\nfor a in A:\n if a % 2 == 0:\n ans += f(a)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 17.6470588235, "diff": ["-from math import log2", "+def f(k):", "+ cnt = 0", "+ while k % 2 == 0:", "+ k //= 2", "+ cnt += 1", "+ # print(k)", "+ return cnt", "+", "-a = list(map(int, input().split()))", "+A = list(map(int, input().split()))", "-for _a in a:", "- if _a % 2 == 0:", "- cnt = 0", "- while _a % 2 == 0:", "- _a //= 2", "- cnt += 1", "- ans += cnt", "-print((int(ans)))", "+for a in A:", "+ if a % 2 == 0:", "+ ans += f(a)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3309142907, "measured_runtime_v1": 0.2479304838, "runtime_lift": 1.3347059448, "key": ["s954474488", "s311308759"]} {"user_id": "u133936772", "problem_id": "p02685", "language": "python", "submission_id_v0": "s693454638", "submission_id_v1": "s088786085", "cpu_time_v0": 1252, "cpu_time_v1": 782, "memory_v0": 9184, "memory_v1": 9192, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 37.54, "input": "M=998244353\n\nn,m,k=list(map(int,input().split()))\n\na=0\n\nc=1\n\nfor i in range(k+1):\n\n a+=c*m*pow(m-1,n-i-1,M)\n\n c=c*(n-i-1)*pow(i+1,M-2,M)%M\n\nprint((a%M))", "target": "M=998244353\n\nn,m,k=list(map(int,input().split()))\n\na,c=0,1\n\nfor i in range(k+1):\n\n a+=c*m*pow(m-1,n+~i,M)\n\n c=c*(n+~i)*pow(i+1,-1,M)%M\n\nprint((a%M))", "code_v0_loc": 8, "code_v1_loc": 7, "code_v0_num_chars": 146, "code_v1_num_chars": 142, "code_v0_no_empty_lines": "M = 998244353\nn, m, k = list(map(int, input().split()))\na = 0\nc = 1\nfor i in range(k + 1):\n a += c * m * pow(m - 1, n - i - 1, M)\n c = c * (n - i - 1) * pow(i + 1, M - 2, M) % M\nprint((a % M))\n", "code_v1_no_empty_lines": "M = 998244353\nn, m, k = list(map(int, input().split()))\na, c = 0, 1\nfor i in range(k + 1):\n a += c * m * pow(m - 1, n + ~i, M)\n c = c * (n + ~i) * pow(i + 1, -1, M) % M\nprint((a % M))\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-a = 0", "-c = 1", "+a, c = 0, 1", "- a += c * m * pow(m - 1, n - i - 1, M)", "- c = c * (n - i - 1) * pow(i + 1, M - 2, M) % M", "+ a += c * m * pow(m - 1, n + ~i, M)", "+ c = c * (n + ~i) * pow(i + 1, -1, M) % M"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5053028598, "measured_runtime_v1": 0.3381624324, "runtime_lift": 1.4942607792, "key": ["s693454638", "s088786085"]} {"user_id": "u038408819", "problem_id": "p03680", "language": "python", "submission_id_v0": "s808331415", "submission_id_v1": "s267927939", "cpu_time_v0": 450, "cpu_time_v1": 202, "memory_v0": 7084, "memory_v1": 7084, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 55.11, "input": "N = int(input())\n\na = [int(input()) for _ in range(N)]\n\n\n\ncnt, i = 0, 0\n\nfor j in range(10 ** 6):\n\n cnt += 1\n\n if a[i] == 2:\n\n print(cnt)\n\n #break\n\n quit()\n\n else:\n\n i = a[i] - 1\n\nprint((-1))", "target": "N = int(input())\n\na = [int(input()) for _ in range(N)]\n\n\n\ncnt, i = 0, 0\n\nfor j in range(len(a)):\n\n cnt += 1\n\n if a[i] == 2:\n\n print(cnt)\n\n #break\n\n quit()\n\n else:\n\n i = a[i] - 1\n\nprint((-1))", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 226, "code_v1_num_chars": 225, "code_v0_no_empty_lines": "N = int(input())\na = [int(input()) for _ in range(N)]\ncnt, i = 0, 0\nfor j in range(10**6):\n cnt += 1\n if a[i] == 2:\n print(cnt)\n # break\n quit()\n else:\n i = a[i] - 1\nprint((-1))\n", "code_v1_no_empty_lines": "N = int(input())\na = [int(input()) for _ in range(N)]\ncnt, i = 0, 0\nfor j in range(len(a)):\n cnt += 1\n if a[i] == 2:\n print(cnt)\n # break\n quit()\n else:\n i = a[i] - 1\nprint((-1))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-for j in range(10**6):", "+for j in range(len(a)):"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6719723573, "measured_runtime_v1": 0.1459480231, "runtime_lift": 4.6041895124, "key": ["s808331415", "s267927939"]} {"user_id": "u581511366", "problem_id": "p02555", "language": "python", "submission_id_v0": "s399411060", "submission_id_v1": "s856192378", "cpu_time_v0": 183, "cpu_time_v1": 64, "memory_v0": 72444, "memory_v1": 63820, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 65.03, "input": "import math\n\n\n\n\n\ndef combinations_count(n, r):\n\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\n\n\n\ndef combinations_with_replacement_count(n, r):\n\n return combinations_count(n + r - 1, r)\n\n\n\n\n\ndef main():\n\n s = int(input())\n\n ans = 0\n\n n = s // 3\n\n\n\n for i in range(1, n + 1):\n\n ans += combinations_with_replacement_count(i, 3*(n-i)+s % 3)\n\n\n\n print((ans % (10**9 + 7)))\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "target": "def main():\n\n s = int(input())\n\n dp = [0] * 3 + [1] * 3 + [0 for _ in range(s)]\n\n\n\n for i in range(6, s+1):\n\n dp[i] = dp[i-1] + dp[i-3]\n\n\n\n print((dp[s] % (10**9+7)))\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "code_v0_loc": 24, "code_v1_loc": 12, "code_v0_num_chars": 468, "code_v1_num_chars": 228, "code_v0_no_empty_lines": "import math\n\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\ndef combinations_with_replacement_count(n, r):\n return combinations_count(n + r - 1, r)\n\n\ndef main():\n s = int(input())\n ans = 0\n n = s // 3\n for i in range(1, n + 1):\n ans += combinations_with_replacement_count(i, 3 * (n - i) + s % 3)\n print((ans % (10**9 + 7)))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "def main():\n s = int(input())\n dp = [0] * 3 + [1] * 3 + [0 for _ in range(s)]\n for i in range(6, s + 1):\n dp[i] = dp[i - 1] + dp[i - 3]\n print((dp[s] % (10**9 + 7)))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-import math", "-", "-", "-def combinations_count(n, r):", "- return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))", "-", "-", "-def combinations_with_replacement_count(n, r):", "- return combinations_count(n + r - 1, r)", "-", "-", "- ans = 0", "- n = s // 3", "- for i in range(1, n + 1):", "- ans += combinations_with_replacement_count(i, 3 * (n - i) + s % 3)", "- print((ans % (10**9 + 7)))", "+ dp = [0] * 3 + [1] * 3 + [0 for _ in range(s)]", "+ for i in range(6, s + 1):", "+ dp[i] = dp[i - 1] + dp[i - 3]", "+ print((dp[s] % (10**9 + 7)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2865847409, "measured_runtime_v1": 0.2083418293, "runtime_lift": 1.3755506603, "key": ["s399411060", "s856192378"]} {"user_id": "u170183831", "problem_id": "p03568", "language": "python", "submission_id_v0": "s971455595", "submission_id_v1": "s272804435", "cpu_time_v0": 148, "cpu_time_v1": 29, "memory_v0": 9116, "memory_v1": 9072, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 80.41, "input": "from itertools import product\n\n\n\nn = int(input())\n\nA = list(map(int, input().split()))\n\n\n\ncount = 0\n\nfor C in product((-1, 0, 1), repeat=n):\n\n total = 1\n\n for a, c in zip(A, C):\n\n total *= (a + c)\n\n if total % 2 == 0:\n\n count += 1\n\nprint(count)", "target": "n = int(input())\n\nA = list(map(int, input().split()))\n\n\n\ncount = 1\n\nfor a in A:\n\n count *= 2 if a % 2 == 0 else 1\n\nprint((3 ** n - count))", "code_v0_loc": 13, "code_v1_loc": 7, "code_v0_num_chars": 253, "code_v1_num_chars": 137, "code_v0_no_empty_lines": "from itertools import product\n\nn = int(input())\nA = list(map(int, input().split()))\ncount = 0\nfor C in product((-1, 0, 1), repeat=n):\n total = 1\n for a, c in zip(A, C):\n total *= a + c\n if total % 2 == 0:\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "n = int(input())\nA = list(map(int, input().split()))\ncount = 1\nfor a in A:\n count *= 2 if a % 2 == 0 else 1\nprint((3**n - count))\n", "code_same": false, "relative_loc_diff_percent": 46.1538461538, "diff": ["-from itertools import product", "-", "-count = 0", "-for C in product((-1, 0, 1), repeat=n):", "- total = 1", "- for a, c in zip(A, C):", "- total *= a + c", "- if total % 2 == 0:", "- count += 1", "-print(count)", "+count = 1", "+for a in A:", "+ count *= 2 if a % 2 == 0 else 1", "+print((3**n - count))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2956474931, "measured_runtime_v1": 0.0067464924, "runtime_lift": 43.8224007049, "key": ["s971455595", "s272804435"]} {"user_id": "u023958502", "problem_id": "p02899", "language": "python", "submission_id_v0": "s601919152", "submission_id_v1": "s937084523", "cpu_time_v0": 140, "cpu_time_v1": 86, "memory_v0": 19300, "memory_v1": 15588, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 38.57, "input": "n = int(input())\n\na = list(map(int,input().split()))\n\nans = [i for i in range(n)]\n\na1 = sorted(a)\n\nfor i in range(n):\n\n num = a[i]\n\n ans[num - 1] = str(i + 1)\n\n \n\nprint((' '.join(ans)))", "target": "n = int(input())\n\n# n,k = map(int,input().split())\n\na = list(map(int,input().split()))\n\nans = [0 for _ in range(n)]\n\nfor i in range(n):\n\n ans[a[i] - 1] = str(i + 1)\n\nprint((\" \".join(ans)))", "code_v0_loc": 9, "code_v1_loc": 7, "code_v0_num_chars": 192, "code_v1_num_chars": 187, "code_v0_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\nans = [i for i in range(n)]\na1 = sorted(a)\nfor i in range(n):\n num = a[i]\n ans[num - 1] = str(i + 1)\nprint((\" \".join(ans)))\n", "code_v1_no_empty_lines": "n = int(input())\n# n,k = map(int,input().split())\na = list(map(int, input().split()))\nans = [0 for _ in range(n)]\nfor i in range(n):\n ans[a[i] - 1] = str(i + 1)\nprint((\" \".join(ans)))\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["+# n,k = map(int,input().split())", "-ans = [i for i in range(n)]", "-a1 = sorted(a)", "+ans = [0 for _ in range(n)]", "- num = a[i]", "- ans[num - 1] = str(i + 1)", "+ ans[a[i] - 1] = str(i + 1)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2984062884, "measured_runtime_v1": 0.2260574257, "runtime_lift": 1.3200463887, "key": ["s601919152", "s937084523"]} {"user_id": "u768896740", "problem_id": "p02951", "language": "python", "submission_id_v0": "s688063139", "submission_id_v1": "s870650241", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "a, b, c = list(map(int, input().split()))\n\n\n\nif a < b + c:\n\n print((b+c-a))\n\nelse:\n\n print((0))", "target": "a,b,c = list(map(int, input().split()))\n\n\n\nprint((max(0, c-(a-b))))", "code_v0_loc": 6, "code_v1_loc": 3, "code_v0_num_chars": 91, "code_v1_num_chars": 59, "code_v0_no_empty_lines": "a, b, c = list(map(int, input().split()))\nif a < b + c:\n print((b + c - a))\nelse:\n print((0))\n", "code_v1_no_empty_lines": "a, b, c = list(map(int, input().split()))\nprint((max(0, c - (a - b))))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-if a < b + c:", "- print((b + c - a))", "-else:", "- print((0))", "+print((max(0, c - (a - b))))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2555535069, "measured_runtime_v1": 0.0829026203, "runtime_lift": 3.0825745416, "key": ["s688063139", "s870650241"]} {"user_id": "u075012704", "problem_id": "p03038", "language": "python", "submission_id_v0": "s846597544", "submission_id_v1": "s758849446", "cpu_time_v0": 756, "cpu_time_v1": 520, "memory_v0": 43296, "memory_v1": 25512, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 31.22, "input": "from collections import Counter\n\nN, M = list(map(int, input().split()))\n\nA = list(map(int, input().split()))\n\n\n\nX = Counter(A)\n\nfor i in range(M):\n\n B, C = list(map(int, input().split()))\n\n X[C] += B\n\n\n\nZ = []\n\nfor key, value in list(X.items()):\n\n Z.append((key, value))\n\n\n\nZ.sort(key=lambda x: x[0], reverse=True)\n\n\n\nans = 0\n\ncnt = 0\n\n\n\nfor value, key in Z:\n\n if cnt + key <= N:\n\n ans += key * value\n\n cnt += key\n\n else:\n\n ans += (N - cnt) * value\n\n break\n\n\n\nprint(ans)\n", "target": "N, M = list(map(int, input().split()))\n\nA = sorted(list(map(int, input().split())))\n\nquery = []\n\nfor i in range(M):\n\n b, c = list(map(int, input().split()))\n\n query.append([b, c])\n\nquery.sort(key=lambda q: q[1], reverse=True)\n\n\n\n\n\ni = 0\n\nfor b, c in query:\n\n while i < N and b > 0:\n\n if A[i] < c:\n\n A[i] = c\n\n b -= 1\n\n i += 1\n\n\n\nprint((sum(A)))\n", "code_v0_loc": 27, "code_v1_loc": 18, "code_v0_num_chars": 496, "code_v1_num_chars": 376, "code_v0_no_empty_lines": "from collections import Counter\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nX = Counter(A)\nfor i in range(M):\n B, C = list(map(int, input().split()))\n X[C] += B\nZ = []\nfor key, value in list(X.items()):\n Z.append((key, value))\nZ.sort(key=lambda x: x[0], reverse=True)\nans = 0\ncnt = 0\nfor value, key in Z:\n if cnt + key <= N:\n ans += key * value\n cnt += key\n else:\n ans += (N - cnt) * value\n break\nprint(ans)\n", "code_v1_no_empty_lines": "N, M = list(map(int, input().split()))\nA = sorted(list(map(int, input().split())))\nquery = []\nfor i in range(M):\n b, c = list(map(int, input().split()))\n query.append([b, c])\nquery.sort(key=lambda q: q[1], reverse=True)\ni = 0\nfor b, c in query:\n while i < N and b > 0:\n if A[i] < c:\n A[i] = c\n b -= 1\n i += 1\nprint((sum(A)))\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-from collections import Counter", "-", "-A = list(map(int, input().split()))", "-X = Counter(A)", "+A = sorted(list(map(int, input().split())))", "+query = []", "- B, C = list(map(int, input().split()))", "- X[C] += B", "-Z = []", "-for key, value in list(X.items()):", "- Z.append((key, value))", "-Z.sort(key=lambda x: x[0], reverse=True)", "-ans = 0", "-cnt = 0", "-for value, key in Z:", "- if cnt + key <= N:", "- ans += key * value", "- cnt += key", "- else:", "- ans += (N - cnt) * value", "- break", "-print(ans)", "+ b, c = list(map(int, input().split()))", "+ query.append([b, c])", "+query.sort(key=lambda q: q[1], reverse=True)", "+i = 0", "+for b, c in query:", "+ while i < N and b > 0:", "+ if A[i] < c:", "+ A[i] = c", "+ b -= 1", "+ i += 1", "+print((sum(A)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.254084451, "measured_runtime_v1": 0.0066267376, "runtime_lift": 38.3423135365, "key": ["s846597544", "s758849446"]} {"user_id": "u576335153", "problem_id": "p03723", "language": "python", "submission_id_v0": "s032726803", "submission_id_v1": "s012708150", "cpu_time_v0": 58, "cpu_time_v1": 26, "memory_v0": 32492, "memory_v1": 9200, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 55.17, "input": "a, b, c = list(map(int, input().split()))\n\n\n\nif any(i % 2 != 0 for i in [a, b, c]):\n\n print((0))\n\n exit()\n\n\n\nif a == b and b == c:\n\n print((-1))\n\n exit()\n\n\n\ncnt = 0\n\na_list = [0]*(1001001)\n\nb_list = [0]*(1001001)\n\nc_list = [0]*(1001001)\n\na_list[0] = a\n\nb_list[0] = b\n\nc_list[0] = c\n\n\n\nfor i in range(1, 1001001):\n\n a_list[i] = (b_list[i-1] + c_list[i-1]) // 2\n\n b_list[i] = (c_list[i-1] + a_list[i-1]) // 2\n\n c_list[i] = (a_list[i-1] + b_list[i-1]) // 2\n\n cnt += 1\n\n if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:\n\n break\n\n\n\nprint(cnt)\n", "target": "def solve(a, b, c):\n\n if any(i % 2 == 1 for i in [a, b, c]):\n\n return 0\n\n if a == b == c:\n\n return -1\n\n a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2\n\n return solve(a, b, c) + 1\n\n\n\na, b, c = list(map(int, input().split()))\n\n\n\nprint((solve(a, b, c)))", "code_v0_loc": 27, "code_v1_loc": 11, "code_v0_num_chars": 580, "code_v1_num_chars": 272, "code_v0_no_empty_lines": "a, b, c = list(map(int, input().split()))\nif any(i % 2 != 0 for i in [a, b, c]):\n print((0))\n exit()\nif a == b and b == c:\n print((-1))\n exit()\ncnt = 0\na_list = [0] * (1001001)\nb_list = [0] * (1001001)\nc_list = [0] * (1001001)\na_list[0] = a\nb_list[0] = b\nc_list[0] = c\nfor i in range(1, 1001001):\n a_list[i] = (b_list[i - 1] + c_list[i - 1]) // 2\n b_list[i] = (c_list[i - 1] + a_list[i - 1]) // 2\n c_list[i] = (a_list[i - 1] + b_list[i - 1]) // 2\n cnt += 1\n if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:\n break\nprint(cnt)\n", "code_v1_no_empty_lines": "def solve(a, b, c):\n if any(i % 2 == 1 for i in [a, b, c]):\n return 0\n if a == b == c:\n return -1\n a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2\n return solve(a, b, c) + 1\n\n\na, b, c = list(map(int, input().split()))\nprint((solve(a, b, c)))\n", "code_same": false, "relative_loc_diff_percent": 59.2592592593, "diff": ["+def solve(a, b, c):", "+ if any(i % 2 == 1 for i in [a, b, c]):", "+ return 0", "+ if a == b == c:", "+ return -1", "+ a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2", "+ return solve(a, b, c) + 1", "+", "+", "-if any(i % 2 != 0 for i in [a, b, c]):", "- print((0))", "- exit()", "-if a == b and b == c:", "- print((-1))", "- exit()", "-cnt = 0", "-a_list = [0] * (1001001)", "-b_list = [0] * (1001001)", "-c_list = [0] * (1001001)", "-a_list[0] = a", "-b_list[0] = b", "-c_list[0] = c", "-for i in range(1, 1001001):", "- a_list[i] = (b_list[i - 1] + c_list[i - 1]) // 2", "- b_list[i] = (c_list[i - 1] + a_list[i - 1]) // 2", "- c_list[i] = (a_list[i - 1] + b_list[i - 1]) // 2", "- cnt += 1", "- if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:", "- break", "-print(cnt)", "+print((solve(a, b, c)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6101216149, "measured_runtime_v1": 0.3266951015, "runtime_lift": 1.8675566671, "key": ["s032726803", "s012708150"]} {"user_id": "u254871849", "problem_id": "p02921", "language": "python", "submission_id_v0": "s533958811", "submission_id_v1": "s140590362", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "# 2019-11-17 20:44:23(JST)\n\nimport sys\n\n# import collections\n\n# import math\n\n# from string import ascii_lowercase, ascii_uppercase, digits\n\n# from bisect import bisect_left as bi_l, bisect_right as bi_r\n\n# import itertools\n\n# from functools import reduce\n\n# import operator as op\n\n# import re\n\n# import heapq\n\n# import array\n\n# from scipy.misc import comb # (default: exact=False)\n\n# import numpy as np \n\n\n\n\n\ndef main():\n\n s, t = sys.stdin.read().split()\n\n\n\n count = 0\n\n for i in range(3):\n\n if s[i] == t[i]:\n\n count += 1\n\n print(count)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()\n", "target": "import sys\n\n\n\ns, t = sys.stdin.read().split()\n\n\n\ndef main():\n\n cnt = 0\n\n for i in range(3):\n\n if s[i] == t[i]:\n\n cnt += 1\n\n return cnt\n\n \n\nif __name__ == '__main__':\n\n ans = main()\n\n print(ans)", "code_v0_loc": 28, "code_v1_loc": 14, "code_v0_num_chars": 611, "code_v1_num_chars": 229, "code_v0_no_empty_lines": "# 2019-11-17 20:44:23(JST)\nimport sys\n\n# import collections\n# import math\n# from string import ascii_lowercase, ascii_uppercase, digits\n# from bisect import bisect_left as bi_l, bisect_right as bi_r\n# import itertools\n# from functools import reduce\n# import operator as op\n# import re\n# import heapq\n# import array\n# from scipy.misc import comb # (default: exact=False)\n# import numpy as np\ndef main():\n s, t = sys.stdin.read().split()\n count = 0\n for i in range(3):\n if s[i] == t[i]:\n count += 1\n print(count)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "import sys\n\ns, t = sys.stdin.read().split()\n\n\ndef main():\n cnt = 0\n for i in range(3):\n if s[i] == t[i]:\n cnt += 1\n return cnt\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-# 2019-11-17 20:44:23(JST)", "-# import collections", "-# import math", "-# from string import ascii_lowercase, ascii_uppercase, digits", "-# from bisect import bisect_left as bi_l, bisect_right as bi_r", "-# import itertools", "-# from functools import reduce", "-# import operator as op", "-# import re", "-# import heapq", "-# import array", "-# from scipy.misc import comb # (default: exact=False)", "-# import numpy as np", "+s, t = sys.stdin.read().split()", "+", "+", "- s, t = sys.stdin.read().split()", "- count = 0", "+ cnt = 0", "- count += 1", "- print(count)", "+ cnt += 1", "+ return cnt", "- main()", "+ ans = main()", "+ print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2871051877, "measured_runtime_v1": 0.085240711, "runtime_lift": 3.3681697905, "key": ["s533958811", "s140590362"]} {"user_id": "u729939940", "problem_id": "p02767", "language": "python", "submission_id_v0": "s286517602", "submission_id_v1": "s316820501", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "N = int(input())\n\nX = list(map(int, input().split()))\n\nX = list(sorted(X))\n\nif N == 1:\n\n print((0))\n\n exit()\n\nans = float('inf')\n\nfor p in range(X[0], X[N - 1] + 1):\n\n sum = 0\n\n for x in X:\n\n sum += (x - p) ** 2\n\n ans = min(sum, ans)\n\nprint(ans)", "target": "N = int(input())\n\nX = list(map(int, input().split()))\n\navg = round(sum(X) / N)\n\nprint((sum([(x - avg) ** 2 for x in X])))", "code_v0_loc": 13, "code_v1_loc": 4, "code_v0_num_chars": 251, "code_v1_num_chars": 119, "code_v0_no_empty_lines": "N = int(input())\nX = list(map(int, input().split()))\nX = list(sorted(X))\nif N == 1:\n print((0))\n exit()\nans = float(\"inf\")\nfor p in range(X[0], X[N - 1] + 1):\n sum = 0\n for x in X:\n sum += (x - p) ** 2\n ans = min(sum, ans)\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nX = list(map(int, input().split()))\navg = round(sum(X) / N)\nprint((sum([(x - avg) ** 2 for x in X])))\n", "code_same": false, "relative_loc_diff_percent": 69.2307692308, "diff": ["-X = list(sorted(X))", "-if N == 1:", "- print((0))", "- exit()", "-ans = float(\"inf\")", "-for p in range(X[0], X[N - 1] + 1):", "- sum = 0", "- for x in X:", "- sum += (x - p) ** 2", "- ans = min(sum, ans)", "-print(ans)", "+avg = round(sum(X) / N)", "+print((sum([(x - avg) ** 2 for x in X])))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2590025333, "measured_runtime_v1": 0.1089487125, "runtime_lift": 2.3772886094, "key": ["s286517602", "s316820501"]} {"user_id": "u628335443", "problem_id": "p02725", "language": "python", "submission_id_v0": "s320196234", "submission_id_v1": "s733866625", "cpu_time_v0": 189, "cpu_time_v1": 163, "memory_v0": 26444, "memory_v1": 26444, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.76, "input": "k, n = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\nd = [0] * n\n\nd_max = 0\n\n\n\nfor i in range(n - 1):\n\n d[i] = a[i + 1] - a[i]\n\n d_max = max(d_max, d[i])\n\n\n\nd[-1] = (k - a[-1]) + a[0]\n\nd_max = max(d_max, d[-1])\n\n\n\nprint((k - d_max))\n", "target": "k, n = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\nd_max = 0\n\n\n\nfor i in range(n - 1):\n\n d = a[i + 1] - a[i]\n\n d_max = max(d_max, d)\n\n\n\nd = (k - a[-1]) + a[0]\n\nd_max = max(d_max, d)\n\n\n\nprint((k - d_max))\n", "code_v0_loc": 13, "code_v1_loc": 12, "code_v0_num_chars": 255, "code_v1_num_chars": 228, "code_v0_no_empty_lines": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\nd = [0] * n\nd_max = 0\nfor i in range(n - 1):\n d[i] = a[i + 1] - a[i]\n d_max = max(d_max, d[i])\nd[-1] = (k - a[-1]) + a[0]\nd_max = max(d_max, d[-1])\nprint((k - d_max))\n", "code_v1_no_empty_lines": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\nd_max = 0\nfor i in range(n - 1):\n d = a[i + 1] - a[i]\n d_max = max(d_max, d)\nd = (k - a[-1]) + a[0]\nd_max = max(d_max, d)\nprint((k - d_max))\n", "code_same": false, "relative_loc_diff_percent": 7.6923076923, "diff": ["-d = [0] * n", "- d[i] = a[i + 1] - a[i]", "- d_max = max(d_max, d[i])", "-d[-1] = (k - a[-1]) + a[0]", "-d_max = max(d_max, d[-1])", "+ d = a[i + 1] - a[i]", "+ d_max = max(d_max, d)", "+d = (k - a[-1]) + a[0]", "+d_max = max(d_max, d)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3049341288, "measured_runtime_v1": 0.200526454, "runtime_lift": 1.5206678356, "key": ["s320196234", "s733866625"]} {"user_id": "u301624971", "problem_id": "p03796", "language": "python", "submission_id_v0": "s825153134", "submission_id_v1": "s210395809", "cpu_time_v0": 230, "cpu_time_v1": 29, "memory_v0": 3972, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 87.39, "input": "from math import factorial\n\ndef myAnswer(N:int) ->int:\n\n ans =factorial(N)\n\n return ans % (10**9 + 7)\n\n\n\ndef modelAnswer():\n\n tmp=1\n\ndef main():\n\n N = int(input())\n\n print((myAnswer(N)))\n\n\n\n\n\nif __name__ == '__main__':\n\n main()", "target": "def modelAnswer(N:int) -> int:\n\n ans = 1\n\n for i in range(1,N+1):\n\n ans = (ans*i) % (10**9 + 7)\n\n return ans \n\ndef main():\n\n N = int(input())\n\n print((modelAnswer(N)))\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "code_v0_loc": 14, "code_v1_loc": 12, "code_v0_num_chars": 237, "code_v1_num_chars": 224, "code_v0_no_empty_lines": "from math import factorial\n\n\ndef myAnswer(N: int) -> int:\n ans = factorial(N)\n return ans % (10**9 + 7)\n\n\ndef modelAnswer():\n tmp = 1\n\n\ndef main():\n N = int(input())\n print((myAnswer(N)))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "def modelAnswer(N: int) -> int:\n ans = 1\n for i in range(1, N + 1):\n ans = (ans * i) % (10**9 + 7)\n return ans\n\n\ndef main():\n N = int(input())\n print((modelAnswer(N)))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 14.2857142857, "diff": ["-from math import factorial", "-", "-", "-def myAnswer(N: int) -> int:", "- ans = factorial(N)", "- return ans % (10**9 + 7)", "-", "-", "-def modelAnswer():", "- tmp = 1", "+def modelAnswer(N: int) -> int:", "+ ans = 1", "+ for i in range(1, N + 1):", "+ ans = (ans * i) % (10**9 + 7)", "+ return ans", "- print((myAnswer(N)))", "+ print((modelAnswer(N)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7093277271, "measured_runtime_v1": 0.3704600389, "runtime_lift": 1.9147212994, "key": ["s825153134", "s210395809"]} {"user_id": "u991567869", "problem_id": "p03854", "language": "python", "submission_id_v0": "s135519212", "submission_id_v1": "s896370774", "cpu_time_v0": 59, "cpu_time_v1": 42, "memory_v0": 9264, "memory_v1": 12828, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 28.81, "input": "s = input()[::-1]\n\n\n\nwhile True:\n\n if len(s) == 0:\n\n break\n\n if s[:7] == \"remaerd\":\n\n s = s[7:]\n\n elif s[:6] == \"resare\":\n\n s = s[6:]\n\n elif s[:5] == \"maerd\" or s[:5] == \"esare\":\n\n s = s[5:]\n\n else:\n\n print(\"NO\")\n\n exit()\n\n\n\nprint(\"YES\")", "target": "import re\n\n\n\ns = input()\n\n\n\nif re.fullmatch(r\"(dream|dreamer|erase|eraser)+\", s):\n\n print(\"YES\")\n\nelse:\n\n print(\"NO\")", "code_v0_loc": 16, "code_v1_loc": 8, "code_v0_num_chars": 294, "code_v1_num_chars": 123, "code_v0_no_empty_lines": "s = input()[::-1]\nwhile True:\n if len(s) == 0:\n break\n if s[:7] == \"remaerd\":\n s = s[7:]\n elif s[:6] == \"resare\":\n s = s[6:]\n elif s[:5] == \"maerd\" or s[:5] == \"esare\":\n s = s[5:]\n else:\n print(\"NO\")\n exit()\nprint(\"YES\")\n", "code_v1_no_empty_lines": "import re\n\ns = input()\nif re.fullmatch(r\"(dream|dreamer|erase|eraser)+\", s):\n print(\"YES\")\nelse:\n print(\"NO\")\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-s = input()[::-1]", "-while True:", "- if len(s) == 0:", "- break", "- if s[:7] == \"remaerd\":", "- s = s[7:]", "- elif s[:6] == \"resare\":", "- s = s[6:]", "- elif s[:5] == \"maerd\" or s[:5] == \"esare\":", "- s = s[5:]", "- else:", "- print(\"NO\")", "- exit()", "-print(\"YES\")", "+import re", "+", "+s = input()", "+if re.fullmatch(r\"(dream|dreamer|erase|eraser)+\", s):", "+ print(\"YES\")", "+else:", "+ print(\"NO\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1782437842, "measured_runtime_v1": 0.0065195048, "runtime_lift": 27.340080233, "key": ["s135519212", "s896370774"]} {"user_id": "u886655280", "problem_id": "p03416", "language": "python", "submission_id_v0": "s576934995", "submission_id_v1": "s588523024", "cpu_time_v0": 174, "cpu_time_v1": 53, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 69.54, "input": "A, B = list(map(int, input().split()))\n\ncount_target = 0\n\n\n\nfor i in range(A, B + 1):\n\n str_i = str(i)\n\n reversed_i = ''\n\n for n_th_i in reversed(list(range(len(str_i)))):\n\n reversed_i += str_i[n_th_i]\n\n\n\n if str_i == reversed_i:\n\n count_target += 1\n\n\n\nprint(count_target)", "target": "A, B = list(map(int, input().split()))\n\ncount_target = 0\n\n\n\nfor i in range(A, B+1):\n\n str_i = str(i)\n\n reversed_i = str_i[::-1]\n\n\n\n if str_i == reversed_i:\n\n count_target += 1\n\n\n\nprint(count_target)\n", "code_v0_loc": 13, "code_v1_loc": 11, "code_v0_num_chars": 286, "code_v1_num_chars": 209, "code_v0_no_empty_lines": "A, B = list(map(int, input().split()))\ncount_target = 0\nfor i in range(A, B + 1):\n str_i = str(i)\n reversed_i = \"\"\n for n_th_i in reversed(list(range(len(str_i)))):\n reversed_i += str_i[n_th_i]\n if str_i == reversed_i:\n count_target += 1\nprint(count_target)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\ncount_target = 0\nfor i in range(A, B + 1):\n str_i = str(i)\n reversed_i = str_i[::-1]\n if str_i == reversed_i:\n count_target += 1\nprint(count_target)\n", "code_same": false, "relative_loc_diff_percent": 15.3846153846, "diff": ["- reversed_i = \"\"", "- for n_th_i in reversed(list(range(len(str_i)))):", "- reversed_i += str_i[n_th_i]", "+ reversed_i = str_i[::-1]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5743804177, "measured_runtime_v1": 0.3217681063, "runtime_lift": 1.7850756691, "key": ["s576934995", "s588523024"]} {"user_id": "u721446434", "problem_id": "p02390", "language": "python", "submission_id_v0": "s466287089", "submission_id_v1": "s267092190", "cpu_time_v0": 40, "cpu_time_v1": 30, "memory_v0": 7676, "memory_v1": 7660, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 25.0, "input": "a = int(input())\n\nh = int(a / 3600)\n\nm = int((a - h * 3600) / 60)\n\ns = int(a - h * 3600 - m * 60)\n\nprint((\":\" .join(map(str, [h, m, s]))))", "target": "num = int(input())\n\nprint(int(num/3600), int((num%3600)/60), num%60, sep=\":\")\n", "code_v0_loc": 5, "code_v1_loc": 2, "code_v0_num_chars": 136, "code_v1_num_chars": 77, "code_v0_no_empty_lines": "a = int(input())\nh = int(a / 3600)\nm = int((a - h * 3600) / 60)\ns = int(a - h * 3600 - m * 60)\nprint((\":\".join(map(str, [h, m, s]))))\n", "code_v1_no_empty_lines": "num = int(input())\nprint(int(num / 3600), int((num % 3600) / 60), num % 60, sep=\":\")\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-a = int(input())", "-h = int(a / 3600)", "-m = int((a - h * 3600) / 60)", "-s = int(a - h * 3600 - m * 60)", "-print((\":\".join(map(str, [h, m, s]))))", "+num = int(input())", "+print(int(num / 3600), int((num % 3600) / 60), num % 60, sep=\":\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3158221226, "measured_runtime_v1": 0.2260731559, "runtime_lift": 1.3969908162, "key": ["s466287089", "s267092190"]} {"user_id": "u141786930", "problem_id": "p02899", "language": "python", "submission_id_v0": "s528079976", "submission_id_v1": "s501403941", "cpu_time_v0": 88, "cpu_time_v1": 79, "memory_v0": 17832, "memory_v1": 17764, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.23, "input": "n = int(input())\n\na = [int(x) for x in input().split()]\n\n\n\nans = list(range(n))\n\n\n\nfor i in range(n):\n\n ans[a[i]-1] = i+1\n\n \n\nprint((' '.join(map(str,ans))))", "target": "def main():\n\n\n\n N = int(input())\n\n A = list(int(x) for x in input().split())\n\n ans = [0] * N\n\n\n\n for i, a in enumerate(A):\n\n ans[a-1] = i+1\n\n\n\n print((' '.join(map(str, ans))))\n\n \n\nif __name__ == '__main__':\n\n main()", "code_v0_loc": 9, "code_v1_loc": 13, "code_v0_num_chars": 161, "code_v1_num_chars": 242, "code_v0_no_empty_lines": "n = int(input())\na = [int(x) for x in input().split()]\nans = list(range(n))\nfor i in range(n):\n ans[a[i] - 1] = i + 1\nprint((\" \".join(map(str, ans))))\n", "code_v1_no_empty_lines": "def main():\n N = int(input())\n A = list(int(x) for x in input().split())\n ans = [0] * N\n for i, a in enumerate(A):\n ans[a - 1] = i + 1\n print((\" \".join(map(str, ans))))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 30.7692307692, "diff": ["-n = int(input())", "-a = [int(x) for x in input().split()]", "-ans = list(range(n))", "-for i in range(n):", "- ans[a[i] - 1] = i + 1", "-print((\" \".join(map(str, ans))))", "+def main():", "+ N = int(input())", "+ A = list(int(x) for x in input().split())", "+ ans = [0] * N", "+ for i, a in enumerate(A):", "+ ans[a - 1] = i + 1", "+ print((\" \".join(map(str, ans))))", "+", "+", "+if __name__ == \"__main__\":", "+ main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3514640877, "measured_runtime_v1": 0.2437312019, "runtime_lift": 1.4420151581, "key": ["s528079976", "s501403941"]} {"user_id": "u562935282", "problem_id": "p03416", "language": "python", "submission_id_v0": "s637446217", "submission_id_v1": "s864775628", "cpu_time_v0": 111, "cpu_time_v1": 46, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 58.56, "input": "a, b = list(map(int, input().split()))\n\ncnt = 0\n\nfor x in range(a, b + 1):\n\n s = str(x)\n\n l = len(s)\n\n flg = True\n\n for i in range(l // 2):\n\n if s[i] != s[l - 1 - i]:\n\n flg = False\n\n break\n\n if flg:\n\n cnt += 1\n\nprint(cnt)\n", "target": "a, b = list(map(int, input().split()))\n\ncnt = 0\n\nfor i in range(a, b + 1):\n\n s = str(i)\n\n if s[0] == s[4] and s[1] == s[3]:\n\n cnt += 1\n\nprint(cnt)", "code_v0_loc": 13, "code_v1_loc": 7, "code_v0_num_chars": 267, "code_v1_num_chars": 153, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\ncnt = 0\nfor x in range(a, b + 1):\n s = str(x)\n l = len(s)\n flg = True\n for i in range(l // 2):\n if s[i] != s[l - 1 - i]:\n flg = False\n break\n if flg:\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\ncnt = 0\nfor i in range(a, b + 1):\n s = str(i)\n if s[0] == s[4] and s[1] == s[3]:\n cnt += 1\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 46.1538461538, "diff": ["-for x in range(a, b + 1):", "- s = str(x)", "- l = len(s)", "- flg = True", "- for i in range(l // 2):", "- if s[i] != s[l - 1 - i]:", "- flg = False", "- break", "- if flg:", "+for i in range(a, b + 1):", "+ s = str(i)", "+ if s[0] == s[4] and s[1] == s[3]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.334243765, "measured_runtime_v1": 0.2510879046, "runtime_lift": 1.3311822625, "key": ["s637446217", "s864775628"]} {"user_id": "u803617136", "problem_id": "p02959", "language": "python", "submission_id_v0": "s395849964", "submission_id_v1": "s383743178", "cpu_time_v0": 279, "cpu_time_v1": 251, "memory_v0": 82148, "memory_v1": 18624, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.04, "input": "N = int(input())\n\na = list(map(int, input().split()))\n\nb = list(map(int, input().split()))\n\na.reverse()\n\nb.reverse()\n\nans = 0\n\ncapacity = 0\n\nfor i in range(N):\n\n ans += min(b[i] + capacity, a[i])\n\n capacity = max(b[i] - max(a[i] - capacity, 0), 0)\n\nans += min(a[-1], capacity)\n\nprint(ans)", "target": "n = int(input())\n\na = list(map(int, input().split()))\n\nb = list(map(int, input().split()))\n\n\n\na = a[::-1]\n\nb = b[::-1]\n\nans = 0\n\nfor i, bi in enumerate(b):\n\n ans += min(a[i], b[i])\n\n remain = max(0, b[i] - a[i])\n\n ans += min(a[i + 1], remain)\n\n a[i + 1] = max(0, a[i + 1] - remain)\n\nprint(ans)", "code_v0_loc": 12, "code_v1_loc": 13, "code_v0_num_chars": 294, "code_v1_num_chars": 305, "code_v0_no_empty_lines": "N = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\na.reverse()\nb.reverse()\nans = 0\ncapacity = 0\nfor i in range(N):\n ans += min(b[i] + capacity, a[i])\n capacity = max(b[i] - max(a[i] - capacity, 0), 0)\nans += min(a[-1], capacity)\nprint(ans)\n", "code_v1_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\na = a[::-1]\nb = b[::-1]\nans = 0\nfor i, bi in enumerate(b):\n ans += min(a[i], b[i])\n remain = max(0, b[i] - a[i])\n ans += min(a[i + 1], remain)\n a[i + 1] = max(0, a[i + 1] - remain)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 7.6923076923, "diff": ["-N = int(input())", "+n = int(input())", "-a.reverse()", "-b.reverse()", "+a = a[::-1]", "+b = b[::-1]", "-capacity = 0", "-for i in range(N):", "- ans += min(b[i] + capacity, a[i])", "- capacity = max(b[i] - max(a[i] - capacity, 0), 0)", "-ans += min(a[-1], capacity)", "+for i, bi in enumerate(b):", "+ ans += min(a[i], b[i])", "+ remain = max(0, b[i] - a[i])", "+ ans += min(a[i + 1], remain)", "+ a[i + 1] = max(0, a[i + 1] - remain)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2854677742, "measured_runtime_v1": 0.2055514226, "runtime_lift": 1.3887900679, "key": ["s395849964", "s383743178"]} {"user_id": "u537976628", "problem_id": "p04044", "language": "python", "submission_id_v0": "s532034645", "submission_id_v1": "s761755032", "cpu_time_v0": 23, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 26.09, "input": "N, L = list(map(int, input().split()))\n\nS = list(input() for i in range(N))\n\nstr = \"\"\n\nfor i in range(N-1):\n\n for j in range(N-1):\n\n if S[j+1] + S[j] <= S[j] + S[j+1]:\n\n S[j], S[j+1] = S[j+1], S[j]\n\nfor i in S:\n\n str += i\n\nprint(str)\n", "target": "N, L = list(map(int, input().split()))\n\nS = list(input() for i in range(N))\n\nS.sort()\n\nstr = \"\"\n\nfor i in S:\n\n str += i\n\nprint(str)\n", "code_v0_loc": 10, "code_v1_loc": 7, "code_v0_num_chars": 252, "code_v1_num_chars": 129, "code_v0_no_empty_lines": "N, L = list(map(int, input().split()))\nS = list(input() for i in range(N))\nstr = \"\"\nfor i in range(N - 1):\n for j in range(N - 1):\n if S[j + 1] + S[j] <= S[j] + S[j + 1]:\n S[j], S[j + 1] = S[j + 1], S[j]\nfor i in S:\n str += i\nprint(str)\n", "code_v1_no_empty_lines": "N, L = list(map(int, input().split()))\nS = list(input() for i in range(N))\nS.sort()\nstr = \"\"\nfor i in S:\n str += i\nprint(str)\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["+S.sort()", "-for i in range(N - 1):", "- for j in range(N - 1):", "- if S[j + 1] + S[j] <= S[j] + S[j + 1]:", "- S[j], S[j + 1] = S[j + 1], S[j]"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3469125528, "measured_runtime_v1": 0.2633319349, "runtime_lift": 1.317396437, "key": ["s532034645", "s761755032"]} {"user_id": "u617990214", "problem_id": "p02412", "language": "python", "submission_id_v0": "s470319892", "submission_id_v1": "s042746843", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 6348, "memory_v1": 6436, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "while True:\n\n\tk=list(map(int,input().split(\" \")))\n\n\tif k[0]==k[1]==0:\n\n\t\tbreak\n\n\tct=0\n\n\ta=0\n\n\tb=0\n\n\tc=0\t\n\n\tmax=k[0]\n\n\tsum=k[1]\n\n\ta=max+1\n\n\t\n\n\twhile True:\n\n\t\ta-=1\n\n\t\tb=a-1\n\n\t\tc=sum-a-b\n\n\t\tif not a>b>c:\n\n\t\t\tprint(ct)\n\n\t\t\tbreak\n\n\t\twhile a>b>c:\n\n\t\t\tif a>b>c>0:\n\n\t\t\t\tct+=1\n\n\t\t\tb-=1\n\n\t\t\tc+=1\n\n\t\t\t", "target": "while True:\n\n\tk=list(map(int,input().split(\" \")))\n\n\tif k[0]==k[1]==0:\n\n\t\tbreak\n\n\tct=0\n\n\ta=0\n\n\tb=0\n\n\tc=0\t\n\n\tmax=k[0]\n\n\tsum=k[1]\n\n\ta=max+1\n\n\twhile True:\n\n\t\ta-=1\n\n\t\tb=a-1\n\n\t\tc=sum-a-b\n\n\t\tif not a>c:\n\n\t\t\tprint(ct)\n\n\t\t\tbreak\n\n\t\twhile b>c:\n\n\t\t\tif c>0:\n\n\t\t\t\tct+=1\n\n\t\t\tb-=1\n\n\t\t\tc+=1", "code_v0_loc": 25, "code_v1_loc": 23, "code_v0_num_chars": 287, "code_v1_num_chars": 271, "code_v0_no_empty_lines": "while True:\n k = list(map(int, input().split(\" \")))\n if k[0] == k[1] == 0:\n break\n ct = 0\n a = 0\n b = 0\n c = 0\n max = k[0]\n sum = k[1]\n a = max + 1\n while True:\n a -= 1\n b = a - 1\n c = sum - a - b\n if not a > b > c:\n print(ct)\n break\n while a > b > c:\n if a > b > c > 0:\n ct += 1\n b -= 1\n c += 1\n", "code_v1_no_empty_lines": "while True:\n k = list(map(int, input().split(\" \")))\n if k[0] == k[1] == 0:\n break\n ct = 0\n a = 0\n b = 0\n c = 0\n max = k[0]\n sum = k[1]\n a = max + 1\n while True:\n a -= 1\n b = a - 1\n c = sum - a - b\n if not a > c:\n print(ct)\n break\n while b > c:\n if c > 0:\n ct += 1\n b -= 1\n c += 1\n", "code_same": false, "relative_loc_diff_percent": 8.0, "diff": ["- if not a > b > c:", "+ if not a > c:", "- while a > b > c:", "- if a > b > c > 0:", "+ while b > c:", "+ if c > 0:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2289849162, "measured_runtime_v1": 0.1798006518, "runtime_lift": 1.273548866, "key": ["s470319892", "s042746843"]} {"user_id": "u536034761", "problem_id": "p04044", "language": "python", "submission_id_v0": "s161300550", "submission_id_v1": "s718856768", "cpu_time_v0": 29, "cpu_time_v1": 24, "memory_v0": 9032, "memory_v1": 9016, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 17.24, "input": "n, l = list(map(int, input().split()))\n\nS = [input() for i in range(n)]\n\nS.sort()\n\nprint((\"\".join(S)))", "target": "n, l = list(map(int, input().split()))\n\nA = [input() for _ in range(n)]\n\nA.sort()\n\nprint((\"\".join(A)))\n", "code_v0_loc": 4, "code_v1_loc": 4, "code_v0_num_chars": 94, "code_v1_num_chars": 95, "code_v0_no_empty_lines": "n, l = list(map(int, input().split()))\nS = [input() for i in range(n)]\nS.sort()\nprint((\"\".join(S)))\n", "code_v1_no_empty_lines": "n, l = list(map(int, input().split()))\nA = [input() for _ in range(n)]\nA.sort()\nprint((\"\".join(A)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-S = [input() for i in range(n)]", "-S.sort()", "-print((\"\".join(S)))", "+A = [input() for _ in range(n)]", "+A.sort()", "+print((\"\".join(A)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3658422339, "measured_runtime_v1": 0.2564776862, "runtime_lift": 1.4264096006, "key": ["s161300550", "s718856768"]} {"user_id": "u996564551", "problem_id": "p03644", "language": "python", "submission_id_v0": "s317462383", "submission_id_v1": "s803396146", "cpu_time_v0": 32, "cpu_time_v1": 25, "memory_v0": 9180, "memory_v1": 9176, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.88, "input": "N = int(input())\n\nif N < 2:\n\n print(N)\n\nelif 2<=N<4:\n\n print((2))\n\nelif 4<=N<8:\n\n print((4))\n\nelif 8<=N<16:\n\n print((8))\n\nelif 16<=N<32:\n\n print((16))\n\nelif 32<=N<64:\n\n print((32))\n\nelif 64<=N:\n\n print((64))", "target": "N = int(input())\n\nNum = [int(2**i) for i in range(7)]\n\nif N in Num:\n\n print(N)\n\nelse:\n\n Num.append(N)\n\n Num = sorted(Num)\n\n print((2 ** (Num.index(N) - 1)))", "code_v0_loc": 15, "code_v1_loc": 8, "code_v0_num_chars": 202, "code_v1_num_chars": 158, "code_v0_no_empty_lines": "N = int(input())\nif N < 2:\n print(N)\nelif 2 <= N < 4:\n print((2))\nelif 4 <= N < 8:\n print((4))\nelif 8 <= N < 16:\n print((8))\nelif 16 <= N < 32:\n print((16))\nelif 32 <= N < 64:\n print((32))\nelif 64 <= N:\n print((64))\n", "code_v1_no_empty_lines": "N = int(input())\nNum = [int(2**i) for i in range(7)]\nif N in Num:\n print(N)\nelse:\n Num.append(N)\n Num = sorted(Num)\n print((2 ** (Num.index(N) - 1)))\n", "code_same": false, "relative_loc_diff_percent": 46.6666666667, "diff": ["-if N < 2:", "+Num = [int(2**i) for i in range(7)]", "+if N in Num:", "-elif 2 <= N < 4:", "- print((2))", "-elif 4 <= N < 8:", "- print((4))", "-elif 8 <= N < 16:", "- print((8))", "-elif 16 <= N < 32:", "- print((16))", "-elif 32 <= N < 64:", "- print((32))", "-elif 64 <= N:", "- print((64))", "+else:", "+ Num.append(N)", "+ Num = sorted(Num)", "+ print((2 ** (Num.index(N) - 1)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3866926632, "measured_runtime_v1": 0.2723876703, "runtime_lift": 1.4196408479, "key": ["s317462383", "s803396146"]} {"user_id": "u815878613", "problem_id": "p03037", "language": "python", "submission_id_v0": "s043802358", "submission_id_v1": "s120994164", "cpu_time_v0": 220, "cpu_time_v1": 195, "memory_v0": 27220, "memory_v1": 9100, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.36, "input": "N, M = list(map(int, input().split()))\n\nLR = [list(map(int, input().split())) for _ in range(M)]\n\n\n\nleft = 1\n\nright = N\n\n\n\nfor l, r in LR:\n\n if left < l:\n\n left = l\n\n if right > r:\n\n right = r\n\n\n\nans = right - left\n\n\n\nprint((ans + 1 if ans >= 0 else 0))\n", "target": "N, M = list(map(int, input().split()))\n\n\n\nleft = 1\n\nright = N\n\n\n\nfor _ in range(M):\n\n l, r = list(map(int, input().split()))\n\n\n\n if left < l:\n\n left = l\n\n if right > r:\n\n right = r\n\n\n\nans = right - left\n\n\n\nprint((ans + 1 if ans >= 0 else 0))\n", "code_v0_loc": 15, "code_v1_loc": 16, "code_v0_num_chars": 266, "code_v1_num_chars": 251, "code_v0_no_empty_lines": "N, M = list(map(int, input().split()))\nLR = [list(map(int, input().split())) for _ in range(M)]\nleft = 1\nright = N\nfor l, r in LR:\n if left < l:\n left = l\n if right > r:\n right = r\nans = right - left\nprint((ans + 1 if ans >= 0 else 0))\n", "code_v1_no_empty_lines": "N, M = list(map(int, input().split()))\nleft = 1\nright = N\nfor _ in range(M):\n l, r = list(map(int, input().split()))\n if left < l:\n left = l\n if right > r:\n right = r\nans = right - left\nprint((ans + 1 if ans >= 0 else 0))\n", "code_same": false, "relative_loc_diff_percent": 6.25, "diff": ["-LR = [list(map(int, input().split())) for _ in range(M)]", "-for l, r in LR:", "+for _ in range(M):", "+ l, r = list(map(int, input().split()))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2458969798, "measured_runtime_v1": 0.1910107524, "runtime_lift": 1.2873462706, "key": ["s043802358", "s120994164"]} {"user_id": "u282228874", "problem_id": "p03293", "language": "python", "submission_id_v0": "s664706993", "submission_id_v1": "s616247709", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "s = input()\n\nt = input()\n\nfor i in range(len(s)):\n\n if s[i:]+s[:i]==t:\n\n print('Yes')\n\n exit()\n\nprint('No')", "target": "s = input()\n\nt = input()\n\n\n\nfor i in range(len(s)):\n\n s = s[1:] + s[0]\n\n if s == t:\n\n print(\"Yes\")\n\n exit()\n\nprint(\"No\")", "code_v0_loc": 7, "code_v1_loc": 9, "code_v0_num_chars": 144, "code_v1_num_chars": 140, "code_v0_no_empty_lines": "s = input()\nt = input()\nfor i in range(len(s)):\n if s[i:] + s[:i] == t:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "code_v1_no_empty_lines": "s = input()\nt = input()\nfor i in range(len(s)):\n s = s[1:] + s[0]\n if s == t:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["- if s[i:] + s[:i] == t:", "+ s = s[1:] + s[0]", "+ if s == t:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1894659722, "measured_runtime_v1": 0.0060859642, "runtime_lift": 31.1316277188, "key": ["s664706993", "s616247709"]} {"user_id": "u285121325", "problem_id": "p03060", "language": "python", "submission_id_v0": "s176163369", "submission_id_v1": "s307096938", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "n = int(input())\n\nv = list(map(int, input().split()))\n\nc = list(map(int, input().split()))\n\nresult = 0\n\nfor i in range(n):\n\n if v[i] > c[i]:\n\n result += v[i] - c[i]\n\nprint(result)", "target": "N = int(input())\n\nV = list(map(int, input().split()))\n\nC = list(map(int, input().split()))\n\nprint((sum([V[i] - C[i] for i in range(N) if V[i] > C[i]])))\n", "code_v0_loc": 8, "code_v1_loc": 4, "code_v0_num_chars": 183, "code_v1_num_chars": 151, "code_v0_no_empty_lines": "n = int(input())\nv = list(map(int, input().split()))\nc = list(map(int, input().split()))\nresult = 0\nfor i in range(n):\n if v[i] > c[i]:\n result += v[i] - c[i]\nprint(result)\n", "code_v1_no_empty_lines": "N = int(input())\nV = list(map(int, input().split()))\nC = list(map(int, input().split()))\nprint((sum([V[i] - C[i] for i in range(N) if V[i] > C[i]])))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-n = int(input())", "-v = list(map(int, input().split()))", "-c = list(map(int, input().split()))", "-result = 0", "-for i in range(n):", "- if v[i] > c[i]:", "- result += v[i] - c[i]", "-print(result)", "+N = int(input())", "+V = list(map(int, input().split()))", "+C = list(map(int, input().split()))", "+print((sum([V[i] - C[i] for i in range(N) if V[i] > C[i]])))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1697382522, "measured_runtime_v1": 0.0057968805, "runtime_lift": 29.2809645377, "key": ["s176163369", "s307096938"]} {"user_id": "u879870653", "problem_id": "p03416", "language": "python", "submission_id_v0": "s279175230", "submission_id_v1": "s789865740", "cpu_time_v0": 111, "cpu_time_v1": 45, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 59.46, "input": "a,b = list(map(int,input().split()))\n\nanswer = 0\n\nfor i in range(a,b+1) :\n\n j = str(i)\n\n p1 = j[4]\n\n p2 = j[3]\n\n p3 = j[2]\n\n p4 = j[1]\n\n p5 = j[0]\n\n k = int(p1+p2+p3+p4+p5)\n\n if i == k :\n\n answer += 1\n\nprint(answer)\n\n\n", "target": "A,B = list(map(int,input().split()))\n\nans = 0\n\nfor i in range(A,B+1) :\n\n l = str(i)\n\n if l[0] == l[4] and l[1] == l[3] :\n\n ans += 1\n\nprint(ans)\n", "code_v0_loc": 14, "code_v1_loc": 7, "code_v0_num_chars": 243, "code_v1_num_chars": 151, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\nanswer = 0\nfor i in range(a, b + 1):\n j = str(i)\n p1 = j[4]\n p2 = j[3]\n p3 = j[2]\n p4 = j[1]\n p5 = j[0]\n k = int(p1 + p2 + p3 + p4 + p5)\n if i == k:\n answer += 1\nprint(answer)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\nans = 0\nfor i in range(A, B + 1):\n l = str(i)\n if l[0] == l[4] and l[1] == l[3]:\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-a, b = list(map(int, input().split()))", "-answer = 0", "-for i in range(a, b + 1):", "- j = str(i)", "- p1 = j[4]", "- p2 = j[3]", "- p3 = j[2]", "- p4 = j[1]", "- p5 = j[0]", "- k = int(p1 + p2 + p3 + p4 + p5)", "- if i == k:", "- answer += 1", "-print(answer)", "+A, B = list(map(int, input().split()))", "+ans = 0", "+for i in range(A, B + 1):", "+ l = str(i)", "+ if l[0] == l[4] and l[1] == l[3]:", "+ ans += 1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5475045266, "measured_runtime_v1": 0.378210106, "runtime_lift": 1.4476200343, "key": ["s279175230", "s789865740"]} {"user_id": "u936985471", "problem_id": "p03721", "language": "python", "submission_id_v0": "s865752287", "submission_id_v1": "s921873406", "cpu_time_v0": 343, "cpu_time_v1": 288, "memory_v0": 15072, "memory_v1": 29824, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.03, "input": "N,K=list(map(int,input().split()))\n\ndic={}\n\nfor i in range(N):\n\n a,b=list(map(int,input().split()))\n\n if a in dic:\n\n dic[a]+=b\n\n else:\n\n dic[a]=b\n\n \n\ndic=sorted(list(dic.items()),key=lambda x:x[0])\n\nfor d in range(len(dic)):\n\n amount=dic[d][1]\n\n if amount>=K:\n\n print((dic[d][0]))\n\n exit(0)\n\n else:\n\n K-=amount\n\n ", "target": "import sys\n\nreadline = sys.stdin.readline\n\n\n\nN,K = list(map(int,readline().split()))\n\n\n\nAB = [list(map(int,readline().split())) for i in range(N)]\n\n\n\nAB = sorted(AB, key = lambda x:x[0])\n\namount = 0\n\nfor a,b in AB:\n\n amount += b\n\n if amount >= K:\n\n print(a)\n\n break\n", "code_v0_loc": 18, "code_v1_loc": 14, "code_v0_num_chars": 318, "code_v1_num_chars": 268, "code_v0_no_empty_lines": "N, K = list(map(int, input().split()))\ndic = {}\nfor i in range(N):\n a, b = list(map(int, input().split()))\n if a in dic:\n dic[a] += b\n else:\n dic[a] = b\ndic = sorted(list(dic.items()), key=lambda x: x[0])\nfor d in range(len(dic)):\n amount = dic[d][1]\n if amount >= K:\n print((dic[d][0]))\n exit(0)\n else:\n K -= amount\n", "code_v1_no_empty_lines": "import sys\n\nreadline = sys.stdin.readline\nN, K = list(map(int, readline().split()))\nAB = [list(map(int, readline().split())) for i in range(N)]\nAB = sorted(AB, key=lambda x: x[0])\namount = 0\nfor a, b in AB:\n amount += b\n if amount >= K:\n print(a)\n break\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["-N, K = list(map(int, input().split()))", "-dic = {}", "-for i in range(N):", "- a, b = list(map(int, input().split()))", "- if a in dic:", "- dic[a] += b", "- else:", "- dic[a] = b", "-dic = sorted(list(dic.items()), key=lambda x: x[0])", "-for d in range(len(dic)):", "- amount = dic[d][1]", "+import sys", "+", "+readline = sys.stdin.readline", "+N, K = list(map(int, readline().split()))", "+AB = [list(map(int, readline().split())) for i in range(N)]", "+AB = sorted(AB, key=lambda x: x[0])", "+amount = 0", "+for a, b in AB:", "+ amount += b", "- print((dic[d][0]))", "- exit(0)", "- else:", "- K -= amount", "+ print(a)", "+ break"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3684674098, "measured_runtime_v1": 0.2810288085, "runtime_lift": 1.3111375012, "key": ["s865752287", "s921873406"]} {"user_id": "u821588465", "problem_id": "p03000", "language": "python", "submission_id_v0": "s259788442", "submission_id_v1": "s163625054", "cpu_time_v0": 29, "cpu_time_v1": 25, "memory_v0": 9172, "memory_v1": 8984, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.79, "input": "from itertools import accumulate\n\nfrom bisect import *\n\nN, X = list(map(int, input().split()))\n\nL = list(tuple(map(int, input().split())))\n\n\n\nacc = sorted(list(accumulate(L)) + [0])\n\n\n\nn = bisect_right(acc,X)\n\nprint(n)\n\n\n", "target": "N,X = list(map(int,input().split()))\n\nL = list(map(int,input().split()))\n\nList = [0]*(N+1)\n\nfor i in range(1,N+1):\n\n List[i] = List[i-1] + L[i-1]\n\nA = [i for i in List if i <=X]\n\nprint((len(A)))", "code_v0_loc": 10, "code_v1_loc": 7, "code_v0_num_chars": 215, "code_v1_num_chars": 189, "code_v0_no_empty_lines": "from itertools import accumulate\nfrom bisect import *\n\nN, X = list(map(int, input().split()))\nL = list(tuple(map(int, input().split())))\nacc = sorted(list(accumulate(L)) + [0])\nn = bisect_right(acc, X)\nprint(n)\n", "code_v1_no_empty_lines": "N, X = list(map(int, input().split()))\nL = list(map(int, input().split()))\nList = [0] * (N + 1)\nfor i in range(1, N + 1):\n List[i] = List[i - 1] + L[i - 1]\nA = [i for i in List if i <= X]\nprint((len(A)))\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["-from itertools import accumulate", "-from bisect import *", "-", "-L = list(tuple(map(int, input().split())))", "-acc = sorted(list(accumulate(L)) + [0])", "-n = bisect_right(acc, X)", "-print(n)", "+L = list(map(int, input().split()))", "+List = [0] * (N + 1)", "+for i in range(1, N + 1):", "+ List[i] = List[i - 1] + L[i - 1]", "+A = [i for i in List if i <= X]", "+print((len(A)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2199657279, "measured_runtime_v1": 0.1756561113, "runtime_lift": 1.2522520635, "key": ["s259788442", "s163625054"]} {"user_id": "u460245024", "problem_id": "p03416", "language": "python", "submission_id_v0": "s770002751", "submission_id_v1": "s323286862", "cpu_time_v0": 51, "cpu_time_v1": 32, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 37.25, "input": "A, B = list(map(int, input().split()))\n\n\n\ncnt = 0\n\nfor n in range(A, B+1):\n\n n_s = str(n)\n\n n_s_rvs = n_s[::-1]\n\n if n_s == n_s_rvs:\n\n cnt += 1\n\n\n\nprint(cnt)\n", "target": "A, B = list(map(int, input().split()))\n\n\n\ncnt = 0\n\nfor n in range(A, B+1):\n\n if n//10000 == n%10 and (n//1000)%10 == (n//10)%10:\n\n cnt += 1\n\n\n\nprint(cnt)\n", "code_v0_loc": 10, "code_v1_loc": 8, "code_v0_num_chars": 168, "code_v1_num_chars": 158, "code_v0_no_empty_lines": "A, B = list(map(int, input().split()))\ncnt = 0\nfor n in range(A, B + 1):\n n_s = str(n)\n n_s_rvs = n_s[::-1]\n if n_s == n_s_rvs:\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "A, B = list(map(int, input().split()))\ncnt = 0\nfor n in range(A, B + 1):\n if n // 10000 == n % 10 and (n // 1000) % 10 == (n // 10) % 10:\n cnt += 1\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["- n_s = str(n)", "- n_s_rvs = n_s[::-1]", "- if n_s == n_s_rvs:", "+ if n // 10000 == n % 10 and (n // 1000) % 10 == (n // 10) % 10:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3429904201, "measured_runtime_v1": 0.2179555298, "runtime_lift": 1.5736715671, "key": ["s770002751", "s323286862"]} {"user_id": "u597374218", "problem_id": "p03796", "language": "python", "submission_id_v0": "s636787028", "submission_id_v1": "s575140392", "cpu_time_v0": 154, "cpu_time_v1": 44, "memory_v0": 10168, "memory_v1": 9028, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 71.43, "input": "import math\n\nN=int(input())\n\nprint((math.factorial(N)%(10**9+7)))", "target": "N=int(input())\n\npower=1\n\nfor i in range(1,N+1):\n\n power*=i\n\n power%=10**9+7\n\nprint(power)", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 63, "code_v1_num_chars": 95, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nprint((math.factorial(N) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "N = int(input())\npower = 1\nfor i in range(1, N + 1):\n power *= i\n power %= 10**9 + 7\nprint(power)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-import math", "-", "-print((math.factorial(N) % (10**9 + 7)))", "+power = 1", "+for i in range(1, N + 1):", "+ power *= i", "+ power %= 10**9 + 7", "+print(power)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6653705416, "measured_runtime_v1": 0.3042658694, "runtime_lift": 2.1868063707, "key": ["s636787028", "s575140392"]} {"user_id": "u970197315", "problem_id": "p03371", "language": "python", "submission_id_v0": "s588181559", "submission_id_v1": "s154731902", "cpu_time_v0": 63, "cpu_time_v1": 17, "memory_v0": 3064, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 73.02, "input": "# ABC95 C -Half and Half\n\na,b,c,x,y = list(map(float,input().split()))\n\nans = 0\n\nif a+b > 2*c:\n\n while x != 0.0 and y != 0.0:\n\n ans += 2*c\n\n x -= 1.0\n\n y -= 1.0\n\n if y == 0.0:\n\n while x != 0.0:\n\n if a > 2*c:\n\n ans += 2*c\n\n x -= 1.0\n\n else:\n\n ans += a\n\n x -= 1.0\n\n if x == 0.0:\n\n while y != 0.0:\n\n if b > 2*c:\n\n ans += 2*c\n\n y -= 1.0\n\n else:\n\n ans += b\n\n y -= 1.0\n\nelse:\n\n ans += a*x + b*y\n\nprint((int(ans)))\n\n\n\n ", "target": "a,b,c,x,y=list(map(int,input().split()))\n\nans=0\n\nans1=0\n\n\n\ne=max(x,y)\n\nans1=e*(2*c)\n\nif 2*c 2 * c:\n while x != 0.0 and y != 0.0:\n ans += 2 * c\n x -= 1.0\n y -= 1.0\n if y == 0.0:\n while x != 0.0:\n if a > 2 * c:\n ans += 2 * c\n x -= 1.0\n else:\n ans += a\n x -= 1.0\n if x == 0.0:\n while y != 0.0:\n if b > 2 * c:\n ans += 2 * c\n y -= 1.0\n else:\n ans += b\n y -= 1.0\nelse:\n ans += a * x + b * y\nprint((int(ans)))\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nans = 0\nans1 = 0\ne = max(x, y)\nans1 = e * (2 * c)\nif 2 * c < a + b:\n d = min(x, y)\n ans += c * (2 * d)\n x -= d\n y -= d\nelse:\n ans = a * x + b * y\n x -= x\n y -= y\nans += x * a\nans += y * b\nprint((min(ans, ans1)))\n", "code_same": false, "relative_loc_diff_percent": 37.9310344828, "diff": ["-# ABC95 C -Half and Half", "-a, b, c, x, y = list(map(float, input().split()))", "+a, b, c, x, y = list(map(int, input().split()))", "-if a + b > 2 * c:", "- while x != 0.0 and y != 0.0:", "- ans += 2 * c", "- x -= 1.0", "- y -= 1.0", "- if y == 0.0:", "- while x != 0.0:", "- if a > 2 * c:", "- ans += 2 * c", "- x -= 1.0", "- else:", "- ans += a", "- x -= 1.0", "- if x == 0.0:", "- while y != 0.0:", "- if b > 2 * c:", "- ans += 2 * c", "- y -= 1.0", "- else:", "- ans += b", "- y -= 1.0", "+ans1 = 0", "+e = max(x, y)", "+ans1 = e * (2 * c)", "+if 2 * c < a + b:", "+ d = min(x, y)", "+ ans += c * (2 * d)", "+ x -= d", "+ y -= d", "- ans += a * x + b * y", "-print((int(ans)))", "+ ans = a * x + b * y", "+ x -= x", "+ y -= y", "+ans += x * a", "+ans += y * b", "+print((min(ans, ans1)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3221288462, "measured_runtime_v1": 0.2473681471, "runtime_lift": 1.3022244371, "key": ["s588181559", "s154731902"]} {"user_id": "u632413369", "problem_id": "p02595", "language": "python", "submission_id_v0": "s512106161", "submission_id_v1": "s251902862", "cpu_time_v0": 491, "cpu_time_v1": 390, "memory_v0": 9080, "memory_v1": 9188, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 20.57, "input": "N, D = list(map(int, input().split()))\n\ncnt = 0\n\nfor _ in range(N):\n\n x, y = list(map(int, input().split()))\n\n if x ** 2 + y ** 2 <= D ** 2:\n\n cnt += 1\n\n \n\nprint(cnt)", "target": "N, D = list(map(int, input().split()))\n\ncnt = 0\n\nfor _ in range(N):\n\n x, y = list(map(int, input().split()))\n\n if x * x + y * y <= D * D:\n\n cnt += 1\n\n \n\nprint(cnt)", "code_v0_loc": 8, "code_v1_loc": 8, "code_v0_num_chars": 174, "code_v1_num_chars": 171, "code_v0_no_empty_lines": "N, D = list(map(int, input().split()))\ncnt = 0\nfor _ in range(N):\n x, y = list(map(int, input().split()))\n if x**2 + y**2 <= D**2:\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "N, D = list(map(int, input().split()))\ncnt = 0\nfor _ in range(N):\n x, y = list(map(int, input().split()))\n if x * x + y * y <= D * D:\n cnt += 1\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- if x**2 + y**2 <= D**2:", "+ if x * x + y * y <= D * D:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1756704731, "measured_runtime_v1": 0.0073727348, "runtime_lift": 23.8270435573, "key": ["s512106161", "s251902862"]} {"user_id": "u209275335", "problem_id": "p02693", "language": "python", "submission_id_v0": "s337733409", "submission_id_v1": "s217218479", "cpu_time_v0": 61, "cpu_time_v1": 22, "memory_v0": 61660, "memory_v1": 9172, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 63.93, "input": "S = int(input())\n\na = 0\n\ncount = 0\n\nn,m = list(map(int,input().split()))\n\nwhile count == 0:\n\n a += S\n\n if n <= a and m >= a:\n\n count = 1\n\n if a >= 1000:\n\n break\n\nif count == 0:\n\n print(\"NG\")\n\nelse:\n\n print(\"OK\")", "target": "k = int(input())\n\nn = 0\n\na,b = list(map(int,input().split()))\n\nwhile True:\n\n n += k\n\n if n >= a and n <= b:\n\n print(\"OK\")\n\n break\n\n if n > b:\n\n print(\"NG\")\n\n break", "code_v0_loc": 14, "code_v1_loc": 11, "code_v0_num_chars": 234, "code_v1_num_chars": 194, "code_v0_no_empty_lines": "S = int(input())\na = 0\ncount = 0\nn, m = list(map(int, input().split()))\nwhile count == 0:\n a += S\n if n <= a and m >= a:\n count = 1\n if a >= 1000:\n break\nif count == 0:\n print(\"NG\")\nelse:\n print(\"OK\")\n", "code_v1_no_empty_lines": "k = int(input())\nn = 0\na, b = list(map(int, input().split()))\nwhile True:\n n += k\n if n >= a and n <= b:\n print(\"OK\")\n break\n if n > b:\n print(\"NG\")\n break\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["-S = int(input())", "-a = 0", "-count = 0", "-n, m = list(map(int, input().split()))", "-while count == 0:", "- a += S", "- if n <= a and m >= a:", "- count = 1", "- if a >= 1000:", "+k = int(input())", "+n = 0", "+a, b = list(map(int, input().split()))", "+while True:", "+ n += k", "+ if n >= a and n <= b:", "+ print(\"OK\")", "-if count == 0:", "- print(\"NG\")", "-else:", "- print(\"OK\")", "+ if n > b:", "+ print(\"NG\")", "+ break"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2075882792, "measured_runtime_v1": 0.0060749435, "runtime_lift": 34.1712276754, "key": ["s337733409", "s217218479"]} {"user_id": "u754022296", "problem_id": "p03796", "language": "python", "submission_id_v0": "s893557911", "submission_id_v1": "s686331748", "cpu_time_v0": 230, "cpu_time_v1": 48, "memory_v0": 3984, "memory_v1": 9008, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 79.13, "input": "from math import factorial as fc\n\na = int(input())\n\nprint((fc(a)%(10**9+7)))", "target": "n = int(input())\n\nm = 10**9+7\n\nans = 1\n\nfor i in range(1, n+1):\n\n ans *= i\n\n ans %= m\n\nprint(ans)", "code_v0_loc": 3, "code_v1_loc": 7, "code_v0_num_chars": 74, "code_v1_num_chars": 99, "code_v0_no_empty_lines": "from math import factorial as fc\n\na = int(input())\nprint((fc(a) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\nm = 10**9 + 7\nans = 1\nfor i in range(1, n + 1):\n ans *= i\n ans %= m\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 57.1428571429, "diff": ["-from math import factorial as fc", "-", "-a = int(input())", "-print((fc(a) % (10**9 + 7)))", "+n = int(input())", "+m = 10**9 + 7", "+ans = 1", "+for i in range(1, n + 1):", "+ ans *= i", "+ ans %= m", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4826196883, "measured_runtime_v1": 0.2178869207, "runtime_lift": 2.2150007294, "key": ["s893557911", "s686331748"]} {"user_id": "u234052535", "problem_id": "p00003", "language": "python", "submission_id_v0": "s822995507", "submission_id_v1": "s034189952", "cpu_time_v0": 50, "cpu_time_v1": 30, "memory_v0": 7724, "memory_v1": 7764, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 40.0, "input": "for i in range(0, int(input())):\n\n sidelen = [int(j) for j in input().split(\" \")]\n\n sidelen.sort(reverse=True)\n\n if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2):\n\n print(\"YES\")\n\n else:\n\n print(\"NO\")", "target": "import sys\n\nfor i in sys.stdin:\n\n try:\n\n sidelen = [int(j) for j in i.split(\" \")]\n\n sidelen.sort(reverse=True)\n\n if(sidelen[0]**2 == sidelen[1]**2 + sidelen[2]**2):\n\n print(\"YES\")\n\n else:\n\n print(\"NO\")\n\n except:\n\n continue", "code_v0_loc": 7, "code_v1_loc": 11, "code_v0_num_chars": 227, "code_v1_num_chars": 285, "code_v0_no_empty_lines": "for i in range(0, int(input())):\n sidelen = [int(j) for j in input().split(\" \")]\n sidelen.sort(reverse=True)\n if sidelen[0] ** 2 == sidelen[1] ** 2 + sidelen[2] ** 2:\n print(\"YES\")\n else:\n print(\"NO\")\n", "code_v1_no_empty_lines": "import sys\n\nfor i in sys.stdin:\n try:\n sidelen = [int(j) for j in i.split(\" \")]\n sidelen.sort(reverse=True)\n if sidelen[0] ** 2 == sidelen[1] ** 2 + sidelen[2] ** 2:\n print(\"YES\")\n else:\n print(\"NO\")\n except:\n continue\n", "code_same": false, "relative_loc_diff_percent": 36.3636363636, "diff": ["-for i in range(0, int(input())):", "- sidelen = [int(j) for j in input().split(\" \")]", "- sidelen.sort(reverse=True)", "- if sidelen[0] ** 2 == sidelen[1] ** 2 + sidelen[2] ** 2:", "- print(\"YES\")", "- else:", "- print(\"NO\")", "+import sys", "+", "+for i in sys.stdin:", "+ try:", "+ sidelen = [int(j) for j in i.split(\" \")]", "+ sidelen.sort(reverse=True)", "+ if sidelen[0] ** 2 == sidelen[1] ** 2 + sidelen[2] ** 2:", "+ print(\"YES\")", "+ else:", "+ print(\"NO\")", "+ except:", "+ continue"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3279889946, "measured_runtime_v1": 0.2582271154, "runtime_lift": 1.2701570634, "key": ["s822995507", "s034189952"]} {"user_id": "u341543478", "problem_id": "p03424", "language": "python", "submission_id_v0": "s841365629", "submission_id_v1": "s932855105", "cpu_time_v0": 29, "cpu_time_v1": 25, "memory_v0": 9156, "memory_v1": 8908, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.79, "input": "n = int(input())\n\ns = input().split()\n\ns = set(s)\n\nprint(('Four' if len(s) == 4 else 'Three'))", "target": "n = int(input())\n\ns = input().split()\n\nprint(('Four' if len(set(s)) == 4 else 'Three'))", "code_v0_loc": 4, "code_v1_loc": 3, "code_v0_num_chars": 92, "code_v1_num_chars": 85, "code_v0_no_empty_lines": "n = int(input())\ns = input().split()\ns = set(s)\nprint((\"Four\" if len(s) == 4 else \"Three\"))\n", "code_v1_no_empty_lines": "n = int(input())\ns = input().split()\nprint((\"Four\" if len(set(s)) == 4 else \"Three\"))\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-s = set(s)", "-print((\"Four\" if len(s) == 4 else \"Three\"))", "+print((\"Four\" if len(set(s)) == 4 else \"Three\"))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2928216946, "measured_runtime_v1": 0.09356422, "runtime_lift": 3.1296332587, "key": ["s841365629", "s932855105"]} {"user_id": "u990900604", "problem_id": "p02390", "language": "python", "submission_id_v0": "s359089221", "submission_id_v1": "s084524983", "cpu_time_v0": 50, "cpu_time_v1": 10, "memory_v0": 9852, "memory_v1": 4632, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 80.0, "input": "import sys\n\n\n\nif __name__ == '__main__':\n\n import doctest\n\n doctest.testmod()\n\n S = int(sys.stdin.read())\n\n h = S / 3600\n\n m = (S % 3600) / 60\n\n s = S % 60\n\n print(\"%d:%d:%d\" % (h, m, s))\n", "target": "#!/usr/bin/env python\n\n#-*- coding: utf-8 -*-\n\n\n\n# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_D\n\n\n\nif __name__ == '__main__':\n\n S = int(input())\n\n h = S / 3600\n\n m = (S % 3600) / 60\n\n s = S % 60\n\n print(\"%d:%d:%d\" % (h, m, s))\n", "code_v0_loc": 10, "code_v1_loc": 11, "code_v0_num_chars": 208, "code_v1_num_chars": 266, "code_v0_no_empty_lines": "import sys\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n S = int(sys.stdin.read())\n h = S / 3600\n m = (S % 3600) / 60\n s = S % 60\n print(\"%d:%d:%d\" % (h, m, s))\n", "code_v1_no_empty_lines": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_D\nif __name__ == \"__main__\":\n S = int(input())\n h = S / 3600\n m = (S % 3600) / 60\n s = S % 60\n print(\"%d:%d:%d\" % (h, m, s))\n", "code_same": false, "relative_loc_diff_percent": 9.0909090909, "diff": ["-import sys", "-", "+#!/usr/bin/env python", "+# -*- coding: utf-8 -*-", "+# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_D", "- import doctest", "-", "- doctest.testmod()", "- S = int(sys.stdin.read())", "+ S = int(input())"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7406475422, "measured_runtime_v1": 0.2172099149, "runtime_lift": 3.4098238217, "key": ["s359089221", "s084524983"]} {"user_id": "u780698286", "problem_id": "p02880", "language": "python", "submission_id_v0": "s530137772", "submission_id_v1": "s289678775", "cpu_time_v0": 31, "cpu_time_v1": 26, "memory_v0": 9160, "memory_v1": 9096, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.13, "input": "n = int(input())\n\ns = []\n\nfor i in range(1, 10):\n\n for j in range(1, 10):\n\n s.append(i*j)\n\nif n in s:\n\n print(\"Yes\")\n\nelse:\n\n print(\"No\")", "target": "import sys\n\n\n\nn = int(input())\n\nfor i in range(1, 10):\n\n for j in range(1, 10):\n\n if i*j == n:\n\n print(\"Yes\")\n\n sys.exit()\n\nprint(\"No\")\n", "code_v0_loc": 9, "code_v1_loc": 9, "code_v0_num_chars": 143, "code_v1_num_chars": 150, "code_v0_no_empty_lines": "n = int(input())\ns = []\nfor i in range(1, 10):\n for j in range(1, 10):\n s.append(i * j)\nif n in s:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "code_v1_no_empty_lines": "import sys\n\nn = int(input())\nfor i in range(1, 10):\n for j in range(1, 10):\n if i * j == n:\n print(\"Yes\")\n sys.exit()\nprint(\"No\")\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["+import sys", "+", "-s = []", "- s.append(i * j)", "-if n in s:", "- print(\"Yes\")", "-else:", "- print(\"No\")", "+ if i * j == n:", "+ print(\"Yes\")", "+ sys.exit()", "+print(\"No\")"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2618995297, "measured_runtime_v1": 0.0062340605, "runtime_lift": 42.0110661723, "key": ["s530137772", "s289678775"]} {"user_id": "u814986259", "problem_id": "p03796", "language": "python", "submission_id_v0": "s294020052", "submission_id_v1": "s579876547", "cpu_time_v0": 229, "cpu_time_v1": 40, "memory_v0": 3968, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.53, "input": "import math\n\nN=int(input())\n\nans=math.factorial(N)\n\nprint((ans%(10**9 +7)))", "target": "mod=10**9+7\n\nN=int(input())\n\nans=1\n\nfor i in range(1,N+1):\n\n ans*=i\n\n ans%=mod\n\nprint(ans)", "code_v0_loc": 4, "code_v1_loc": 7, "code_v0_num_chars": 73, "code_v1_num_chars": 92, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nans = math.factorial(N)\nprint((ans % (10**9 + 7)))\n", "code_v1_no_empty_lines": "mod = 10**9 + 7\nN = int(input())\nans = 1\nfor i in range(1, N + 1):\n ans *= i\n ans %= mod\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 42.8571428571, "diff": ["-import math", "-", "+mod = 10**9 + 7", "-ans = math.factorial(N)", "-print((ans % (10**9 + 7)))", "+ans = 1", "+for i in range(1, N + 1):", "+ ans *= i", "+ ans %= mod", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3063099709, "measured_runtime_v1": 0.2071282012, "runtime_lift": 1.4788424222, "key": ["s294020052", "s579876547"]} {"user_id": "u724687935", "problem_id": "p02622", "language": "python", "submission_id_v0": "s346270661", "submission_id_v1": "s299240564", "cpu_time_v0": 67, "cpu_time_v1": 60, "memory_v0": 9408, "memory_v1": 9320, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.45, "input": "S = input()\n\nT = input()\n\nN = len(S)\n\ncnt = 0\n\nfor i in range(N):\n\n cnt += (S[i] != T[i])\n\n\n\nprint(cnt)\n", "target": "S = input()\n\nT = input()\n\ncnt = 0\n\nfor i in range(len(S)):\n\n cnt += (S[i] != T[i])\n\n\n\nprint(cnt)", "code_v0_loc": 8, "code_v1_loc": 7, "code_v0_num_chars": 107, "code_v1_num_chars": 99, "code_v0_no_empty_lines": "S = input()\nT = input()\nN = len(S)\ncnt = 0\nfor i in range(N):\n cnt += S[i] != T[i]\nprint(cnt)\n", "code_v1_no_empty_lines": "S = input()\nT = input()\ncnt = 0\nfor i in range(len(S)):\n cnt += S[i] != T[i]\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-N = len(S)", "-for i in range(N):", "+for i in range(len(S)):"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3924936354, "measured_runtime_v1": 0.2147260756, "runtime_lift": 1.8278806345, "key": ["s346270661", "s299240564"]} {"user_id": "u629538480", "problem_id": "p02688", "language": "python", "submission_id_v0": "s093466568", "submission_id_v1": "s996398988", "cpu_time_v0": 24, "cpu_time_v1": 21, "memory_v0": 9192, "memory_v1": 8948, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.5, "input": "N,K = list(map(int, input().split(' ')))\n\na=list(range(1,N+1))\n\nfor i in range(K):\n\n count=int(input())\n\n b=input().split(' ')\n\n for j in range(count):\n\n if int(b[j]) in a:\n\n a.remove(int(b[j]))\n\nprint((len(a)))", "target": "N,K = list(map(int, input().split(' ')))\n\na=list(range(1,N+1))\n\nfor i in range(K):\n\n count=int(input())\n\n b=[int(x.strip()) for x in input().split(' ')]\n\n for j in range(count):\n\n if b[j] in a:\n\n a.remove(b[j])\n\nprint((len(a)))", "code_v0_loc": 9, "code_v1_loc": 9, "code_v0_num_chars": 214, "code_v1_num_chars": 230, "code_v0_no_empty_lines": "N, K = list(map(int, input().split(\" \")))\na = list(range(1, N + 1))\nfor i in range(K):\n count = int(input())\n b = input().split(\" \")\n for j in range(count):\n if int(b[j]) in a:\n a.remove(int(b[j]))\nprint((len(a)))\n", "code_v1_no_empty_lines": "N, K = list(map(int, input().split(\" \")))\na = list(range(1, N + 1))\nfor i in range(K):\n count = int(input())\n b = [int(x.strip()) for x in input().split(\" \")]\n for j in range(count):\n if b[j] in a:\n a.remove(b[j])\nprint((len(a)))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- b = input().split(\" \")", "+ b = [int(x.strip()) for x in input().split(\" \")]", "- if int(b[j]) in a:", "- a.remove(int(b[j]))", "+ if b[j] in a:", "+ a.remove(b[j])"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2616522854, "measured_runtime_v1": 0.1381282375, "runtime_lift": 1.8942707889, "key": ["s093466568", "s996398988"]} {"user_id": "u780342333", "problem_id": "p02416", "language": "python", "submission_id_v0": "s248122741", "submission_id_v1": "s360997133", "cpu_time_v0": 30, "cpu_time_v1": 20, "memory_v0": 7732, "memory_v1": 5624, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "res = []\n\nwhile True:\n\n s = input()\n\n if s == '0':\n\n break\n\n\n\n res.append(sum([int(x) for x in s]))\n\n\n\nfor e in res:\n\n print(e)", "target": "def sum_of_numbers(n):\n\n '''\n\n (* int -> int *)\n\n '''\n\n res = [int(n) for n in list(str(n))]\n\n \n\n return sum(res)\n\n\n\nif __name__ == \"__main__\":\n\n while True:\n\n n = input()\n\n if n == '0':\n\n break\n\n print((sum_of_numbers(n)))\n", "code_v0_loc": 10, "code_v1_loc": 14, "code_v0_num_chars": 146, "code_v1_num_chars": 275, "code_v0_no_empty_lines": "res = []\nwhile True:\n s = input()\n if s == \"0\":\n break\n res.append(sum([int(x) for x in s]))\nfor e in res:\n print(e)\n", "code_v1_no_empty_lines": "def sum_of_numbers(n):\n \"\"\"\n (* int -> int *)\n \"\"\"\n res = [int(n) for n in list(str(n))]\n return sum(res)\n\n\nif __name__ == \"__main__\":\n while True:\n n = input()\n if n == \"0\":\n break\n print((sum_of_numbers(n)))\n", "code_same": false, "relative_loc_diff_percent": 28.5714285714, "diff": ["-res = []", "-while True:", "- s = input()", "- if s == \"0\":", "- break", "- res.append(sum([int(x) for x in s]))", "-for e in res:", "- print(e)", "+def sum_of_numbers(n):", "+ \"\"\"", "+ (* int -> int *)", "+ \"\"\"", "+ res = [int(n) for n in list(str(n))]", "+ return sum(res)", "+", "+", "+if __name__ == \"__main__\":", "+ while True:", "+ n = input()", "+ if n == \"0\":", "+ break", "+ print((sum_of_numbers(n)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2668570542, "measured_runtime_v1": 0.0949980106, "runtime_lift": 2.8090804473, "key": ["s248122741", "s360997133"]} {"user_id": "u729133443", "problem_id": "p03086", "language": "python", "submission_id_v0": "s780520490", "submission_id_v1": "s016683067", "cpu_time_v0": 19, "cpu_time_v1": 17, "memory_v0": 3188, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.53, "input": "import re;print((max(list(map(len,re.split('[^ACGT]',input()))))))", "target": "p=m=0\n\nfor c in input():p=-~p*(c in'ATGC');m=max(m,p)\n\nprint(m)", "code_v0_loc": 1, "code_v1_loc": 3, "code_v0_num_chars": 58, "code_v1_num_chars": 63, "code_v0_no_empty_lines": "import re\n\nprint((max(list(map(len, re.split(\"[^ACGT]\", input()))))))\n", "code_v1_no_empty_lines": "p = m = 0\nfor c in input():\n p = -~p * (c in \"ATGC\")\n m = max(m, p)\nprint(m)\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-import re", "-", "-print((max(list(map(len, re.split(\"[^ACGT]\", input()))))))", "+p = m = 0", "+for c in input():", "+ p = -~p * (c in \"ATGC\")", "+ m = max(m, p)", "+print(m)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2963340635, "measured_runtime_v1": 0.1579363909, "runtime_lift": 1.8762874209, "key": ["s780520490", "s016683067"]} {"user_id": "u513081876", "problem_id": "p03325", "language": "python", "submission_id_v0": "s352799823", "submission_id_v1": "s651648403", "cpu_time_v0": 118, "cpu_time_v1": 82, "memory_v0": 4148, "memory_v1": 4148, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 30.51, "input": "N = int(input())\n\nA = [int(i) for i in input().split()]\n\nans = 0\n\ncheck = [0]*30\n\nfor i in range(1, 31):\n\n check[i-1] = 2**i\n\n\n\nfor i in A:\n\n if i % 2 == 0:\n\n j = 0\n\n while check[j] <= i:\n\n if i % check[j] == 0:\n\n add = check[j]\n\n else:\n\n break\n\n \n\n j += 1\n\n ans += j\n\n \n\nprint(ans)", "target": "N = int(input())\n\na = [int(i) for i in input().split()]\n\nans = 0\n\n\n\nfor i in a:\n\n while i % 2 == 0:\n\n i //= 2\n\n ans += 1\n\nprint(ans)", "code_v0_loc": 20, "code_v1_loc": 9, "code_v0_num_chars": 394, "code_v1_num_chars": 149, "code_v0_no_empty_lines": "N = int(input())\nA = [int(i) for i in input().split()]\nans = 0\ncheck = [0] * 30\nfor i in range(1, 31):\n check[i - 1] = 2**i\nfor i in A:\n if i % 2 == 0:\n j = 0\n while check[j] <= i:\n if i % check[j] == 0:\n add = check[j]\n else:\n break\n j += 1\n ans += j\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\na = [int(i) for i in input().split()]\nans = 0\nfor i in a:\n while i % 2 == 0:\n i //= 2\n ans += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 55.0, "diff": ["-A = [int(i) for i in input().split()]", "+a = [int(i) for i in input().split()]", "-check = [0] * 30", "-for i in range(1, 31):", "- check[i - 1] = 2**i", "-for i in A:", "- if i % 2 == 0:", "- j = 0", "- while check[j] <= i:", "- if i % check[j] == 0:", "- add = check[j]", "- else:", "- break", "- j += 1", "- ans += j", "+for i in a:", "+ while i % 2 == 0:", "+ i //= 2", "+ ans += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3522037606, "measured_runtime_v1": 0.279608284, "runtime_lift": 1.2596327819, "key": ["s352799823", "s651648403"]} {"user_id": "u513081876", "problem_id": "p03845", "language": "python", "submission_id_v0": "s710663686", "submission_id_v1": "s021252857", "cpu_time_v0": 28, "cpu_time_v1": 17, "memory_v0": 3316, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 39.29, "input": "N = int(input())\n\nT = list(map(int, input().split()))\n\nM = int(input())\n\np = []\n\nx = []\n\nans = []\n\nfor i in range(M):\n\n p, x = list(map(int, input().split()))\n\n ans.append(sum(T[:p-1])+x+sum(T[p:]))\n\n\n\nfor _ in ans:\n\n print(_)", "target": "N = int(input())\n\nT = list(map(int, input().split()))\n\nM = int(input())\n\nP, X, ans = [0]*M, [0]*M, []\n\nbase = sum(T)\n\n\n\nfor i in range(M):\n\n P, X = list(map(int, input().split()))\n\n ans.append(base-T[P-1]+X)\n\n\n\nfor i in ans:\n\n print(i)", "code_v0_loc": 12, "code_v1_loc": 12, "code_v0_num_chars": 229, "code_v1_num_chars": 238, "code_v0_no_empty_lines": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\np = []\nx = []\nans = []\nfor i in range(M):\n p, x = list(map(int, input().split()))\n ans.append(sum(T[: p - 1]) + x + sum(T[p:]))\nfor _ in ans:\n print(_)\n", "code_v1_no_empty_lines": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nP, X, ans = [0] * M, [0] * M, []\nbase = sum(T)\nfor i in range(M):\n P, X = list(map(int, input().split()))\n ans.append(base - T[P - 1] + X)\nfor i in ans:\n print(i)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-p = []", "-x = []", "-ans = []", "+P, X, ans = [0] * M, [0] * M, []", "+base = sum(T)", "- p, x = list(map(int, input().split()))", "- ans.append(sum(T[: p - 1]) + x + sum(T[p:]))", "-for _ in ans:", "- print(_)", "+ P, X = list(map(int, input().split()))", "+ ans.append(base - T[P - 1] + X)", "+for i in ans:", "+ print(i)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2214040067, "measured_runtime_v1": 0.1726463588, "runtime_lift": 1.2824134157, "key": ["s710663686", "s021252857"]} {"user_id": "u581603131", "problem_id": "p03796", "language": "python", "submission_id_v0": "s669812244", "submission_id_v1": "s638032890", "cpu_time_v0": 230, "cpu_time_v1": 41, "memory_v0": 3984, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.17, "input": "import math\n\nN = int(input())\n\nprint((math.factorial(N)%(10**9+7)))", "target": "ans=1\n\nn=int(input())\n\nfor i in range(1,n+1):\n\n ans*=i\n\n ans=ans%(10**9+7)\n\nprint(ans)", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 65, "code_v1_num_chars": 92, "code_v0_no_empty_lines": "import math\n\nN = int(input())\nprint((math.factorial(N) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "ans = 1\nn = int(input())\nfor i in range(1, n + 1):\n ans *= i\n ans = ans % (10**9 + 7)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-import math", "-", "-N = int(input())", "-print((math.factorial(N) % (10**9 + 7)))", "+ans = 1", "+n = int(input())", "+for i in range(1, n + 1):", "+ ans *= i", "+ ans = ans % (10**9 + 7)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.8658925366, "measured_runtime_v1": 0.3537542467, "runtime_lift": 2.4477233692, "key": ["s669812244", "s638032890"]} {"user_id": "u197300773", "problem_id": "p02901", "language": "python", "submission_id_v0": "s172477662", "submission_id_v1": "s096488733", "cpu_time_v0": 1463, "cpu_time_v1": 1316, "memory_v0": 36468, "memory_v1": 3188, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.05, "input": "def main():\n\n import math\n\n N,M=list(map(int,input().split()))\n\n a=[]\n\n for i in range(M):\n\n tmp=list(map(int,input().split()))\n\n tmpc=list(map(int,input().split()))\n\n c=0\n\n for j in range(len(tmpc)):\n\n c+=2**(tmpc[j]-1)\n\n tmp[1]=c\n\n a+=[tmp]\n\n\n\n\n\n dp=[[10**10 for j in range(2**N)] for i in range(M)]\n\n dp[0][0]=0\n\n dp[0][a[0][1]]=a[0][0]\n\n\n\n\n\n for i in range(1,M):\n\n dp[i]=dp[i-1]\n\n for j in range(2**N):\n\n z,p=a[i][0],a[i][1]\n\n q=j|p\n\n x=dp[i-1][j]+z\n\n if dp[i][q]>x: dp[i][q]=x\n\n\n\n ans=dp[M-1][2**N-1]\n\n print((ans if ans<10**10 else -1))\n\n\n\nif __name__ == '__main__':\n\n main()\n", "target": "n,m=list(map(int,input().split()))\n\nL=2**n\n\ncost=[0]+[10**8 for i in range(L-1)]\n\n\n\nfor i in range(m):\n\n a,b=list(map(int,input().split()))\n\n c=sum([2**(int(i)-1) for i in input().split()])\n\n for j in range(L):\n\n q=j|c\n\n x=cost[j]+a\n\n if cost[q]>x:\n\n cost[q]=x\n\nprint((cost[L-1] if cost[L-1]<10**8 else -1))", "code_v0_loc": 32, "code_v1_loc": 13, "code_v0_num_chars": 718, "code_v1_num_chars": 334, "code_v0_no_empty_lines": "def main():\n import math\n\n N, M = list(map(int, input().split()))\n a = []\n for i in range(M):\n tmp = list(map(int, input().split()))\n tmpc = list(map(int, input().split()))\n c = 0\n for j in range(len(tmpc)):\n c += 2 ** (tmpc[j] - 1)\n tmp[1] = c\n a += [tmp]\n dp = [[10**10 for j in range(2**N)] for i in range(M)]\n dp[0][0] = 0\n dp[0][a[0][1]] = a[0][0]\n for i in range(1, M):\n dp[i] = dp[i - 1]\n for j in range(2**N):\n z, p = a[i][0], a[i][1]\n q = j | p\n x = dp[i - 1][j] + z\n if dp[i][q] > x:\n dp[i][q] = x\n ans = dp[M - 1][2**N - 1]\n print((ans if ans < 10**10 else -1))\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "n, m = list(map(int, input().split()))\nL = 2**n\ncost = [0] + [10**8 for i in range(L - 1)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n c = sum([2 ** (int(i) - 1) for i in input().split()])\n for j in range(L):\n q = j | c\n x = cost[j] + a\n if cost[q] > x:\n cost[q] = x\nprint((cost[L - 1] if cost[L - 1] < 10**8 else -1))\n", "code_same": false, "relative_loc_diff_percent": 59.375, "diff": ["-def main():", "- import math", "-", "- N, M = list(map(int, input().split()))", "- a = []", "- for i in range(M):", "- tmp = list(map(int, input().split()))", "- tmpc = list(map(int, input().split()))", "- c = 0", "- for j in range(len(tmpc)):", "- c += 2 ** (tmpc[j] - 1)", "- tmp[1] = c", "- a += [tmp]", "- dp = [[10**10 for j in range(2**N)] for i in range(M)]", "- dp[0][0] = 0", "- dp[0][a[0][1]] = a[0][0]", "- for i in range(1, M):", "- dp[i] = dp[i - 1]", "- for j in range(2**N):", "- z, p = a[i][0], a[i][1]", "- q = j | p", "- x = dp[i - 1][j] + z", "- if dp[i][q] > x:", "- dp[i][q] = x", "- ans = dp[M - 1][2**N - 1]", "- print((ans if ans < 10**10 else -1))", "-", "-", "-if __name__ == \"__main__\":", "- main()", "+n, m = list(map(int, input().split()))", "+L = 2**n", "+cost = [0] + [10**8 for i in range(L - 1)]", "+for i in range(m):", "+ a, b = list(map(int, input().split()))", "+ c = sum([2 ** (int(i) - 1) for i in input().split()])", "+ for j in range(L):", "+ q = j | c", "+ x = cost[j] + a", "+ if cost[q] > x:", "+ cost[q] = x", "+print((cost[L - 1] if cost[L - 1] < 10**8 else -1))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3366471643, "measured_runtime_v1": 0.2183672116, "runtime_lift": 1.5416561941, "key": ["s172477662", "s096488733"]} {"user_id": "u987846648", "problem_id": "p02627", "language": "python", "submission_id_v0": "s793826721", "submission_id_v1": "s875451520", "cpu_time_v0": 75, "cpu_time_v1": 67, "memory_v0": 61796, "memory_v1": 61608, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.67, "input": "alph = input()\n\nif alph.isupper():\n\n print(\"A\")\n\nelse:\n\n print(\"a\")\n", "target": "a = input()\n\n\n\nif a.isupper():\n\n print(\"A\")\n\nelse:\n\n print(\"a\")", "code_v0_loc": 5, "code_v1_loc": 6, "code_v0_num_chars": 74, "code_v1_num_chars": 69, "code_v0_no_empty_lines": "alph = input()\nif alph.isupper():\n print(\"A\")\nelse:\n print(\"a\")\n", "code_v1_no_empty_lines": "a = input()\nif a.isupper():\n print(\"A\")\nelse:\n print(\"a\")\n", "code_same": false, "relative_loc_diff_percent": 16.6666666667, "diff": ["-alph = input()", "-if alph.isupper():", "+a = input()", "+if a.isupper():"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1834881261, "measured_runtime_v1": 0.0064039894, "runtime_lift": 28.6521595413, "key": ["s793826721", "s875451520"]} {"user_id": "u729133443", "problem_id": "p03371", "language": "python", "submission_id_v0": "s416055764", "submission_id_v1": "s218640380", "cpu_time_v0": 227, "cpu_time_v1": 17, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 92.51, "input": "a,b,c,x,y=list(map(int,input().split()));print((min(k*c*2+a*max(x-k,0)+b*max(y-k,0)for k in range(max(x,y)*3))))", "target": "a,b,c,x,y=list(map(int,input().split()));print((min(x*a+y*b,2*x*c+b*max(0,y-x),2*y*c+a*max(0,x-y))))", "code_v0_loc": 1, "code_v1_loc": 1, "code_v0_num_chars": 104, "code_v1_num_chars": 92, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nprint(\n (\n min(\n k * c * 2 + a * max(x - k, 0) + b * max(y - k, 0)\n for k in range(max(x, y) * 3)\n )\n )\n)\n", "code_v1_no_empty_lines": "a, b, c, x, y = list(map(int, input().split()))\nprint(\n (min(x * a + y * b, 2 * x * c + b * max(0, y - x), 2 * y * c + a * max(0, x - y)))\n)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- (", "- min(", "- k * c * 2 + a * max(x - k, 0) + b * max(y - k, 0)", "- for k in range(max(x, y) * 3)", "- )", "- )", "+ (min(x * a + y * b, 2 * x * c + b * max(0, y - x), 2 * y * c + a * max(0, x - y)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4340552337, "measured_runtime_v1": 0.2001633718, "runtime_lift": 2.1685048058, "key": ["s416055764", "s218640380"]} {"user_id": "u064408584", "problem_id": "p03723", "language": "python", "submission_id_v0": "s414644536", "submission_id_v1": "s610159769", "cpu_time_v0": 146, "cpu_time_v1": 26, "memory_v0": 2940, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.19, "input": "a,b,c=list(map(int, input().split()))\n\nd=0\n\nwhile d<10**5:\n\n if a%2==1 or b%2==1 or c%2==1:break\n\n a,b,c=b/2+c/2,a/2+c/2,a/2+b/2\n\n d+=1\n\nelse:d=-1\n\nprint(d)", "target": "a,b,c=list(map(int, input().split()))\n\nans=0\n\nwhile a%2==0 and b%2==0 and c%2==0 and ans<10000:\n\n a,b,c=b//2+c//2,a//2+c//2,a//2+b//2\n\n ans+=1\n\nif ans==10000:ans=-1\n\nprint(ans)", "code_v0_loc": 8, "code_v1_loc": 7, "code_v0_num_chars": 159, "code_v1_num_chars": 176, "code_v0_no_empty_lines": "a, b, c = list(map(int, input().split()))\nd = 0\nwhile d < 10**5:\n if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:\n break\n a, b, c = b / 2 + c / 2, a / 2 + c / 2, a / 2 + b / 2\n d += 1\nelse:\n d = -1\nprint(d)\n", "code_v1_no_empty_lines": "a, b, c = list(map(int, input().split()))\nans = 0\nwhile a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and ans < 10000:\n a, b, c = b // 2 + c // 2, a // 2 + c // 2, a // 2 + b // 2\n ans += 1\nif ans == 10000:\n ans = -1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-d = 0", "-while d < 10**5:", "- if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:", "- break", "- a, b, c = b / 2 + c / 2, a / 2 + c / 2, a / 2 + b / 2", "- d += 1", "-else:", "- d = -1", "-print(d)", "+ans = 0", "+while a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and ans < 10000:", "+ a, b, c = b // 2 + c // 2, a // 2 + c // 2, a // 2 + b // 2", "+ ans += 1", "+if ans == 10000:", "+ ans = -1", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5153860836, "measured_runtime_v1": 0.3941329796, "runtime_lift": 1.307645161, "key": ["s414644536", "s610159769"]} {"user_id": "u285443936", "problem_id": "p03309", "language": "python", "submission_id_v0": "s057200482", "submission_id_v1": "s045600813", "cpu_time_v0": 246, "cpu_time_v1": 216, "memory_v0": 27232, "memory_v1": 25200, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 12.2, "input": "import statistics\n\nN = int(input())\n\na = [int(i) for i in input().split()]\n\nans = 0\n\n\n\nfor i in range(1,N+1):\n\n a[i-1] -= i\n\n\n\nb = statistics.median(a)\n\nfor i in range(N):\n\n ans += abs(a[i]-b)\n\nprint((int(ans)))", "target": "N = int(input())\n\nA = [int(i) for i in input().split()]\n\nC = [A[i]-i for i in range(N)]\n\nC.sort()\n\nans = 0\n\nmed = C[N//2]\n\nfor i in range(N):\n\n ans += abs(C[i]-med)\n\nprint(ans)", "code_v0_loc": 12, "code_v1_loc": 9, "code_v0_num_chars": 211, "code_v1_num_chars": 177, "code_v0_no_empty_lines": "import statistics\n\nN = int(input())\na = [int(i) for i in input().split()]\nans = 0\nfor i in range(1, N + 1):\n a[i - 1] -= i\nb = statistics.median(a)\nfor i in range(N):\n ans += abs(a[i] - b)\nprint((int(ans)))\n", "code_v1_no_empty_lines": "N = int(input())\nA = [int(i) for i in input().split()]\nC = [A[i] - i for i in range(N)]\nC.sort()\nans = 0\nmed = C[N // 2]\nfor i in range(N):\n ans += abs(C[i] - med)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-import statistics", "-", "-a = [int(i) for i in input().split()]", "+A = [int(i) for i in input().split()]", "+C = [A[i] - i for i in range(N)]", "+C.sort()", "-for i in range(1, N + 1):", "- a[i - 1] -= i", "-b = statistics.median(a)", "+med = C[N // 2]", "- ans += abs(a[i] - b)", "-print((int(ans)))", "+ ans += abs(C[i] - med)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2933883266, "measured_runtime_v1": 0.2086455548, "runtime_lift": 1.406156613, "key": ["s057200482", "s045600813"]} {"user_id": "u060896757", "problem_id": "p02691", "language": "python", "submission_id_v0": "s720467562", "submission_id_v1": "s807450341", "cpu_time_v0": 266, "cpu_time_v1": 106, "memory_v0": 97968, "memory_v1": 92728, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 60.15, "input": "N = int(input())\n\nA = [int(i) for i in input().split()]\n\ndp = [0] * 10 ** 7\n\nans = 0\n\nfor i in range(N):\n\n x = i + 1 - A[i]\n\n if x >= 0:\n\n ans += dp[x]\n\n y = i + 1 + A[i]\n\n if y < 10 ** 7:\n\n dp[y] += 1\n\n\n\nprint(ans)\n", "target": "N = int(input())\n\nA = [int(i) for i in input().split()]\n\nINF = 2 * 10 ** 5\n\ndp = [0] * INF\n\nans = 0\n\nfor i in range(N):\n\n i_i_ = i + 1 - A[i]\n\n if 0 < i_i_ < INF:\n\n ans += dp[i_i_]\n\n i_ = i + 1 + A[i]\n\n if 0 < i_ < INF:\n\n dp[i_] += 1\n\n\n\nprint(ans)", "code_v0_loc": 13, "code_v1_loc": 14, "code_v0_num_chars": 242, "code_v1_num_chars": 273, "code_v0_no_empty_lines": "N = int(input())\nA = [int(i) for i in input().split()]\ndp = [0] * 10**7\nans = 0\nfor i in range(N):\n x = i + 1 - A[i]\n if x >= 0:\n ans += dp[x]\n y = i + 1 + A[i]\n if y < 10**7:\n dp[y] += 1\nprint(ans)\n", "code_v1_no_empty_lines": "N = int(input())\nA = [int(i) for i in input().split()]\nINF = 2 * 10**5\ndp = [0] * INF\nans = 0\nfor i in range(N):\n i_i_ = i + 1 - A[i]\n if 0 < i_i_ < INF:\n ans += dp[i_i_]\n i_ = i + 1 + A[i]\n if 0 < i_ < INF:\n dp[i_] += 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 7.1428571429, "diff": ["-dp = [0] * 10**7", "+INF = 2 * 10**5", "+dp = [0] * INF", "- x = i + 1 - A[i]", "- if x >= 0:", "- ans += dp[x]", "- y = i + 1 + A[i]", "- if y < 10**7:", "- dp[y] += 1", "+ i_i_ = i + 1 - A[i]", "+ if 0 < i_i_ < INF:", "+ ans += dp[i_i_]", "+ i_ = i + 1 + A[i]", "+ if 0 < i_ < INF:", "+ dp[i_] += 1"], "diff_only_import_comment": false, "measured_runtime_v0": 1.4942608066, "measured_runtime_v1": 0.2557353399, "runtime_lift": 5.8429969327, "key": ["s720467562", "s807450341"]} {"user_id": "u880730787", "problem_id": "p02555", "language": "python", "submission_id_v0": "s669686668", "submission_id_v1": "s427616795", "cpu_time_v0": 487, "cpu_time_v1": 297, "memory_v0": 9116, "memory_v1": 9128, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 39.01, "input": "S = int(input())\n\nmod = 10**9+7\n\n\n\ndp = [0]*(S+1)\n\ndp[0] = 1\n\nfor i in range(1,S+1):\n\n for j in range(0,(i-3)+1):\n\n dp[i] += dp[j]\n\n dp[i] %= mod\n\nprint((dp[S]))", "target": "S = int(input())\n\nmod = 10**9+7\n\n\n\ndp = [0]*(S+1)\n\ndp[0] = 1\n\nfor i in range(1,S+1):\n\n for j in range(0,(i-3)+1):\n\n dp[i] += dp[j]\n\n dp[i] %= mod\n\nprint((dp[S]))", "code_v0_loc": 10, "code_v1_loc": 10, "code_v0_num_chars": 176, "code_v1_num_chars": 172, "code_v0_no_empty_lines": "S = int(input())\nmod = 10**9 + 7\ndp = [0] * (S + 1)\ndp[0] = 1\nfor i in range(1, S + 1):\n for j in range(0, (i - 3) + 1):\n dp[i] += dp[j]\n dp[i] %= mod\nprint((dp[S]))\n", "code_v1_no_empty_lines": "S = int(input())\nmod = 10**9 + 7\ndp = [0] * (S + 1)\ndp[0] = 1\nfor i in range(1, S + 1):\n for j in range(0, (i - 3) + 1):\n dp[i] += dp[j]\n dp[i] %= mod\nprint((dp[S]))\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["- dp[i] %= mod", "+ dp[i] %= mod"], "diff_only_import_comment": false, "measured_runtime_v0": 0.6781705019, "measured_runtime_v1": 0.481741133, "runtime_lift": 1.4077488002, "key": ["s669686668", "s427616795"]} {"user_id": "u733814820", "problem_id": "p03107", "language": "python", "submission_id_v0": "s607050481", "submission_id_v1": "s627055692", "cpu_time_v0": 41, "cpu_time_v1": 35, "memory_v0": 3316, "memory_v1": 3956, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 14.63, "input": "# ABC 120 C\n\n\n\nimport re\n\n\n\nS = input()\n\n\n\nl0 = 0\n\nl1 = 0\n\n\n\nfor i in range(len(S)):\n\n if S[i] == '0':\n\n l0 += 1\n\n elif S[i] == '1':\n\n l1 += 1\n\n\n\nprint((min(l0, l1) * 2))\n", "target": "def resolve():\n\n S = input()\n\n arr = []\n\n for s in S:\n\n if len(arr) != 0 and arr[-1] != s:\n\n arr.pop()\n\n else:\n\n arr.append(s)\n\n\n\n print((len(S) - len(arr)))\n\n return\n\n\n\nif __name__ == \"__main__\":\n\n resolve()\n", "code_v0_loc": 16, "code_v1_loc": 14, "code_v0_num_chars": 189, "code_v1_num_chars": 229, "code_v0_no_empty_lines": "# ABC 120 C\nimport re\n\nS = input()\nl0 = 0\nl1 = 0\nfor i in range(len(S)):\n if S[i] == \"0\":\n l0 += 1\n elif S[i] == \"1\":\n l1 += 1\nprint((min(l0, l1) * 2))\n", "code_v1_no_empty_lines": "def resolve():\n S = input()\n arr = []\n for s in S:\n if len(arr) != 0 and arr[-1] != s:\n arr.pop()\n else:\n arr.append(s)\n print((len(S) - len(arr)))\n return\n\n\nif __name__ == \"__main__\":\n resolve()\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-# ABC 120 C", "-import re", "+def resolve():", "+ S = input()", "+ arr = []", "+ for s in S:", "+ if len(arr) != 0 and arr[-1] != s:", "+ arr.pop()", "+ else:", "+ arr.append(s)", "+ print((len(S) - len(arr)))", "+ return", "-S = input()", "-l0 = 0", "-l1 = 0", "-for i in range(len(S)):", "- if S[i] == \"0\":", "- l0 += 1", "- elif S[i] == \"1\":", "- l1 += 1", "-print((min(l0, l1) * 2))", "+", "+if __name__ == \"__main__\":", "+ resolve()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4207458491, "measured_runtime_v1": 0.3073607309, "runtime_lift": 1.3688991691, "key": ["s607050481", "s627055692"]} {"user_id": "u075304271", "problem_id": "p02657", "language": "python", "submission_id_v0": "s027336468", "submission_id_v1": "s218994202", "cpu_time_v0": 65, "cpu_time_v1": 22, "memory_v0": 61680, "memory_v1": 9168, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 66.15, "input": "def iput(): return int(input())\n\ndef mput(): return list(map(int, input().split()))\n\ndef lput(): return list(map(int, input().split()))\n\n\n\ndef solve():\n\n a, b = mput()\n\n print((a*b))\n\n return 0\n\n\n\nif __name__ == \"__main__\":\n\n solve()", "target": "import math\n\ndef solve():\n\n a, b = input().split()\n\n a = int(a)\n\n b = float(b)\n\n print((int(a*b)))\n\n return 0\n\n \n\nif __name__ == \"__main__\":\n\n solve()", "code_v0_loc": 11, "code_v1_loc": 10, "code_v0_num_chars": 237, "code_v1_num_chars": 166, "code_v0_no_empty_lines": "def iput():\n return int(input())\n\n\ndef mput():\n return list(map(int, input().split()))\n\n\ndef lput():\n return list(map(int, input().split()))\n\n\ndef solve():\n a, b = mput()\n print((a * b))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "code_v1_no_empty_lines": "import math\n\n\ndef solve():\n a, b = input().split()\n a = int(a)\n b = float(b)\n print((int(a * b)))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "code_same": false, "relative_loc_diff_percent": 9.0909090909, "diff": ["-def iput():", "- return int(input())", "-", "-", "-def mput():", "- return list(map(int, input().split()))", "-", "-", "-def lput():", "- return list(map(int, input().split()))", "+import math", "- a, b = mput()", "- print((a * b))", "+ a, b = input().split()", "+ a = int(a)", "+ b = float(b)", "+ print((int(a * b)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2298483524, "measured_runtime_v1": 0.0062991838, "runtime_lift": 36.4885924311, "key": ["s027336468", "s218994202"]} {"user_id": "u762420987", "problem_id": "p03759", "language": "python", "submission_id_v0": "s246152829", "submission_id_v1": "s501080791", "cpu_time_v0": 20, "cpu_time_v1": 17, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 15.0, "input": "a, b, c = list(map(int, input().split()))\n\nif (b - a) == (c - b):\n\n print(\"YES\")\n\nelse:\n\n print(\"NO\")", "target": "a, b, c = list(map(int, input().split()))\n\nif b - a == c - b:\n\n print(\"YES\")\n\nelse:\n\n print(\"NO\")", "code_v0_loc": 5, "code_v1_loc": 5, "code_v0_num_chars": 101, "code_v1_num_chars": 97, "code_v0_no_empty_lines": "a, b, c = list(map(int, input().split()))\nif (b - a) == (c - b):\n print(\"YES\")\nelse:\n print(\"NO\")\n", "code_v1_no_empty_lines": "a, b, c = list(map(int, input().split()))\nif b - a == c - b:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-if (b - a) == (c - b):", "+if b - a == c - b:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.1914725397, "measured_runtime_v1": 0.0060755644, "runtime_lift": 31.5151856242, "key": ["s246152829", "s501080791"]} {"user_id": "u033606236", "problem_id": "p03796", "language": "python", "submission_id_v0": "s645296559", "submission_id_v1": "s055332014", "cpu_time_v0": 229, "cpu_time_v1": 39, "memory_v0": 4020, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 82.97, "input": "import math\n\nprint((math.factorial(int(input()))%1000000007))", "target": "num = int(input())\n\nresult = 1\n\nfor i in range(1,num+1):\n\n result = result *i % 1000000007\n\nprint(result)", "code_v0_loc": 2, "code_v1_loc": 5, "code_v0_num_chars": 59, "code_v1_num_chars": 108, "code_v0_no_empty_lines": "import math\n\nprint((math.factorial(int(input())) % 1000000007))\n", "code_v1_no_empty_lines": "num = int(input())\nresult = 1\nfor i in range(1, num + 1):\n result = result * i % 1000000007\nprint(result)\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-import math", "-", "-print((math.factorial(int(input())) % 1000000007))", "+num = int(input())", "+result = 1", "+for i in range(1, num + 1):", "+ result = result * i % 1000000007", "+print(result)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7005937328, "measured_runtime_v1": 0.3298725822, "runtime_lift": 2.1238313537, "key": ["s645296559", "s055332014"]} {"user_id": "u488127128", "problem_id": "p03416", "language": "python", "submission_id_v0": "s570028181", "submission_id_v1": "s434791726", "cpu_time_v0": 103, "cpu_time_v1": 46, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 55.34, "input": "a,b = list(map(int, input().split()))\n\ncount = 0\n\nfor i in range(a,b+1):\n\n j = str(i)\n\n if j==''.join(reversed(j)):\n\n count += 1\n\nprint(count)", "target": "a,b = list(map(int, input().split()))\n\nn = [i for i in map(str, list(range(a,b+1))) if i==i[::-1]]\n\nprint((len(n)))", "code_v0_loc": 7, "code_v1_loc": 3, "code_v0_num_chars": 149, "code_v1_num_chars": 101, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\ncount = 0\nfor i in range(a, b + 1):\n j = str(i)\n if j == \"\".join(reversed(j)):\n count += 1\nprint(count)\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\nn = [i for i in map(str, list(range(a, b + 1))) if i == i[::-1]]\nprint((len(n)))\n", "code_same": false, "relative_loc_diff_percent": 57.1428571429, "diff": ["-count = 0", "-for i in range(a, b + 1):", "- j = str(i)", "- if j == \"\".join(reversed(j)):", "- count += 1", "-print(count)", "+n = [i for i in map(str, list(range(a, b + 1))) if i == i[::-1]]", "+print((len(n)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4183517286, "measured_runtime_v1": 0.2983190859, "runtime_lift": 1.4023632692, "key": ["s570028181", "s434791726"]} {"user_id": "u642883360", "problem_id": "p03796", "language": "python", "submission_id_v0": "s671319819", "submission_id_v1": "s345697128", "cpu_time_v0": 230, "cpu_time_v1": 167, "memory_v0": 3984, "memory_v1": 38512, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 27.39, "input": "#!/usr/bin/env pypy3\n\n\n\nimport math\n\nprint((math.factorial(int(input())) % 1000000007))", "target": "n = int(input())\n\nfor i in range(n - 1, 1, -1):\n\n\tn *= i\n\n\tn %= 10**9 + 7\n\nprint(n)", "code_v0_loc": 4, "code_v1_loc": 5, "code_v0_num_chars": 85, "code_v1_num_chars": 83, "code_v0_no_empty_lines": "#!/usr/bin/env pypy3\nimport math\n\nprint((math.factorial(int(input())) % 1000000007))\n", "code_v1_no_empty_lines": "n = int(input())\nfor i in range(n - 1, 1, -1):\n n *= i\n n %= 10**9 + 7\nprint(n)\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-#!/usr/bin/env pypy3", "-import math", "-", "-print((math.factorial(int(input())) % 1000000007))", "+n = int(input())", "+for i in range(n - 1, 1, -1):", "+ n *= i", "+ n %= 10**9 + 7", "+print(n)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5574923191, "measured_runtime_v1": 0.2242465372, "runtime_lift": 2.4860687974, "key": ["s671319819", "s345697128"]} {"user_id": "u888092736", "problem_id": "p03721", "language": "python", "submission_id_v0": "s705162733", "submission_id_v1": "s360654843", "cpu_time_v0": 281, "cpu_time_v1": 145, "memory_v0": 28552, "memory_v1": 31636, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 48.4, "input": "(N, K), *AB = [list(map(int, s.split())) for s in open(0)]\n\nfor a, b in sorted(AB):\n\n K -= b\n\n if K <= 0:\n\n print(a)\n\n break\n", "target": "N, K, *AB = list(map(int, open(0).read().split()))\n\nli = [(a, b) for a, b in zip(*[iter(AB)] * 2)]\n\nli.sort()\n\nfor a, b in li:\n\n if K > b:\n\n K -= b\n\n else:\n\n print(a)\n\n break\n", "code_v0_loc": 6, "code_v1_loc": 9, "code_v0_num_chars": 145, "code_v1_num_chars": 196, "code_v0_no_empty_lines": "(N, K), *AB = [list(map(int, s.split())) for s in open(0)]\nfor a, b in sorted(AB):\n K -= b\n if K <= 0:\n print(a)\n break\n", "code_v1_no_empty_lines": "N, K, *AB = list(map(int, open(0).read().split()))\nli = [(a, b) for a, b in zip(*[iter(AB)] * 2)]\nli.sort()\nfor a, b in li:\n if K > b:\n K -= b\n else:\n print(a)\n break\n", "code_same": false, "relative_loc_diff_percent": 33.3333333333, "diff": ["-(N, K), *AB = [list(map(int, s.split())) for s in open(0)]", "-for a, b in sorted(AB):", "- K -= b", "- if K <= 0:", "+N, K, *AB = list(map(int, open(0).read().split()))", "+li = [(a, b) for a, b in zip(*[iter(AB)] * 2)]", "+li.sort()", "+for a, b in li:", "+ if K > b:", "+ K -= b", "+ else:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2949739402, "measured_runtime_v1": 0.0817868489, "runtime_lift": 3.6066182276, "key": ["s705162733", "s360654843"]} {"user_id": "u254871849", "problem_id": "p03796", "language": "python", "submission_id_v0": "s710953077", "submission_id_v1": "s484408635", "cpu_time_v0": 36, "cpu_time_v1": 32, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.11, "input": "mod = int(1e9+7)\n\nn = int(input())\n\n\n\npower = 1\n\nfor i in range(1, n+1):\n\n power = power * i % mod\n\nprint(power)", "target": "import sys\n\n\n\nMOD = 10 ** 9 + 7\n\nn = int(sys.stdin.readline().rstrip())\n\n\n\ndef main():\n\n res = 1\n\n for i in range(1, n+1):\n\n res *= i\n\n res %= MOD\n\n\n\n return res\n\n\n\nif __name__ == '__main__':\n\n ans = main()\n\n print(ans)", "code_v0_loc": 7, "code_v1_loc": 16, "code_v0_num_chars": 115, "code_v1_num_chars": 248, "code_v0_no_empty_lines": "mod = int(1e9 + 7)\nn = int(input())\npower = 1\nfor i in range(1, n + 1):\n power = power * i % mod\nprint(power)\n", "code_v1_no_empty_lines": "import sys\n\nMOD = 10**9 + 7\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n res = 1\n for i in range(1, n + 1):\n res *= i\n res %= MOD\n return res\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "code_same": false, "relative_loc_diff_percent": 56.25, "diff": ["-mod = int(1e9 + 7)", "-n = int(input())", "-power = 1", "-for i in range(1, n + 1):", "- power = power * i % mod", "-print(power)", "+import sys", "+", "+MOD = 10**9 + 7", "+n = int(sys.stdin.readline().rstrip())", "+", "+", "+def main():", "+ res = 1", "+ for i in range(1, n + 1):", "+ res *= i", "+ res %= MOD", "+ return res", "+", "+", "+if __name__ == \"__main__\":", "+ ans = main()", "+ print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3650334806, "measured_runtime_v1": 0.2122802832, "runtime_lift": 1.7195825967, "key": ["s710953077", "s484408635"]} {"user_id": "u494927057", "problem_id": "p03814", "language": "python", "submission_id_v0": "s883482084", "submission_id_v1": "s072538424", "cpu_time_v0": 59, "cpu_time_v1": 35, "memory_v0": 3516, "memory_v1": 3516, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 40.68, "input": "s = input()\n\n\n\nstart = -1\n\nend = 0\n\nfor i in range(len(s)):\n\n if s[i] == 'A' and start < 0:\n\n start = i\n\n elif s[i] == 'Z':\n\n end = i\n\nprint((end - start + 1))\n", "target": "s = input()\n\n\n\nstart = 0\n\nfor i in range(len(s)):\n\n if s[i] == 'A':\n\n start = i\n\n break\n\n\n\nend = 0\n\nfor i in reversed(list(range(len(s)))):\n\n if s[i] == 'Z':\n\n end = i\n\n break\n\nprint((end - start + 1))\n", "code_v0_loc": 10, "code_v1_loc": 14, "code_v0_num_chars": 178, "code_v1_num_chars": 228, "code_v0_no_empty_lines": "s = input()\nstart = -1\nend = 0\nfor i in range(len(s)):\n if s[i] == \"A\" and start < 0:\n start = i\n elif s[i] == \"Z\":\n end = i\nprint((end - start + 1))\n", "code_v1_no_empty_lines": "s = input()\nstart = 0\nfor i in range(len(s)):\n if s[i] == \"A\":\n start = i\n break\nend = 0\nfor i in reversed(list(range(len(s)))):\n if s[i] == \"Z\":\n end = i\n break\nprint((end - start + 1))\n", "code_same": false, "relative_loc_diff_percent": 28.5714285714, "diff": ["-start = -1", "+start = 0", "+for i in range(len(s)):", "+ if s[i] == \"A\":", "+ start = i", "+ break", "-for i in range(len(s)):", "- if s[i] == \"A\" and start < 0:", "- start = i", "- elif s[i] == \"Z\":", "+for i in reversed(list(range(len(s)))):", "+ if s[i] == \"Z\":", "+ break"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2661928608, "measured_runtime_v1": 0.1145644054, "runtime_lift": 2.3235215143, "key": ["s883482084", "s072538424"]} {"user_id": "u150984829", "problem_id": "p02412", "language": "python", "submission_id_v0": "s777094380", "submission_id_v1": "s391711407", "cpu_time_v0": 40, "cpu_time_v1": 30, "memory_v0": 5608, "memory_v1": 5612, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 25.0, "input": "while 1:\n\n n,x=list(map(int,input().split()))\n\n if n+x==0:break\n\n print((len([1 for i in range(3,n+1)for j in range(2,x-i)if x-i-j s:\n\n break\n\n elif s - i - j <= k:\n\n cnt += 1\n\nprint(cnt)\n", "target": "k, s = list(map(int, input().split()))\n\ncnt = 0\n\nfor i in range(k + 1):\n\n for j in range(k + 1):\n\n if 0 <= s - i - j <= k:\n\n cnt += 1\n\nprint(cnt)\n", "code_v0_loc": 9, "code_v1_loc": 7, "code_v0_num_chars": 200, "code_v1_num_chars": 161, "code_v0_no_empty_lines": "k, s = list(map(int, input().split()))\ncnt = 0\nfor i in range(k + 1):\n for j in range(k + 1):\n if i + j > s:\n break\n elif s - i - j <= k:\n cnt += 1\nprint(cnt)\n", "code_v1_no_empty_lines": "k, s = list(map(int, input().split()))\ncnt = 0\nfor i in range(k + 1):\n for j in range(k + 1):\n if 0 <= s - i - j <= k:\n cnt += 1\nprint(cnt)\n", "code_same": false, "relative_loc_diff_percent": 22.2222222222, "diff": ["- if i + j > s:", "- break", "- elif s - i - j <= k:", "+ if 0 <= s - i - j <= k:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3744940901, "measured_runtime_v1": 0.2492418245, "runtime_lift": 1.5025330956, "key": ["s742815481", "s376437490"]} {"user_id": "u882564128", "problem_id": "p03371", "language": "python", "submission_id_v0": "s136733954", "submission_id_v1": "s827725289", "cpu_time_v0": 100, "cpu_time_v1": 70, "memory_v0": 9180, "memory_v1": 9068, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 30.0, "input": "a, b, c, x, y = list(map(int, input().split(' ')))\n\n\n\nc = int(c*2)\n\nm = float('inf')\n\nfor i in range(10**5+1):\n\n m = min(m, a*max(0, x-i)+b*max(0,y-i)+c*i)\n\nprint(m)", "target": "import math\n\na, b, c, x, y = list(map(int, input().split(' ')))\n\nans = float('inf')\n\nc = c*2\n\nfor i in range(max(x, y)+1):\n\n if i > x:\n\n price = b*(y-i) + c*i\n\n elif i > y:\n\n price = a*(x-i) + c*i\n\n else:\n\n price = a*(x-i) + b*(y-i) + c*i\n\n\n\n if ans > price:\n\n ans = price\n\nprint(ans)", "code_v0_loc": 7, "code_v1_loc": 15, "code_v0_num_chars": 162, "code_v1_num_chars": 318, "code_v0_no_empty_lines": "a, b, c, x, y = list(map(int, input().split(\" \")))\nc = int(c * 2)\nm = float(\"inf\")\nfor i in range(10**5 + 1):\n m = min(m, a * max(0, x - i) + b * max(0, y - i) + c * i)\nprint(m)\n", "code_v1_no_empty_lines": "import math\n\na, b, c, x, y = list(map(int, input().split(\" \")))\nans = float(\"inf\")\nc = c * 2\nfor i in range(max(x, y) + 1):\n if i > x:\n price = b * (y - i) + c * i\n elif i > y:\n price = a * (x - i) + c * i\n else:\n price = a * (x - i) + b * (y - i) + c * i\n if ans > price:\n ans = price\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 53.3333333333, "diff": ["+import math", "+", "-c = int(c * 2)", "-m = float(\"inf\")", "-for i in range(10**5 + 1):", "- m = min(m, a * max(0, x - i) + b * max(0, y - i) + c * i)", "-print(m)", "+ans = float(\"inf\")", "+c = c * 2", "+for i in range(max(x, y) + 1):", "+ if i > x:", "+ price = b * (y - i) + c * i", "+ elif i > y:", "+ price = a * (x - i) + c * i", "+ else:", "+ price = a * (x - i) + b * (y - i) + c * i", "+ if ans > price:", "+ ans = price", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 1.0457227323, "measured_runtime_v1": 0.348341011, "runtime_lift": 3.0020086614, "key": ["s136733954", "s827725289"]} {"user_id": "u729133443", "problem_id": "p02983", "language": "python", "submission_id_v0": "s140577970", "submission_id_v1": "s371672772", "cpu_time_v0": 591, "cpu_time_v1": 74, "memory_v0": 40556, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 87.48, "input": "l,r=list(map(int,input().split()))\n\ns=list(range(l,r+1))[:2019]\n\nprint((min(i*j%2019for i in s for j in s if i= Y:\n\n tmp = min(tmp,2*Y*C+(X-Y)*A)\n\nelse:\n\n tmp = min(tmp,2*X*C+(Y-X)*B)\n\ntmp = min(tmp,max(X,Y)*2*C)\n\nprint(tmp)", "code_v0_loc": 6, "code_v1_loc": 8, "code_v0_num_chars": 178, "code_v1_num_chars": 186, "code_v0_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(max(X, Y) + 1):\n cost = 2 * C * i + max(0, X - i) * A + max(0, Y - i) * B\n ans = min(ans, cost)\nprint(ans)\n", "code_v1_no_empty_lines": "A, B, C, X, Y = list(map(int, input().split()))\ntmp = A * X + B * Y\nif X >= Y:\n tmp = min(tmp, 2 * Y * C + (X - Y) * A)\nelse:\n tmp = min(tmp, 2 * X * C + (Y - X) * B)\ntmp = min(tmp, max(X, Y) * 2 * C)\nprint(tmp)\n", "code_same": false, "relative_loc_diff_percent": 25.0, "diff": ["-ans = float(\"inf\")", "-for i in range(max(X, Y) + 1):", "- cost = 2 * C * i + max(0, X - i) * A + max(0, Y - i) * B", "- ans = min(ans, cost)", "-print(ans)", "+tmp = A * X + B * Y", "+if X >= Y:", "+ tmp = min(tmp, 2 * Y * C + (X - Y) * A)", "+else:", "+ tmp = min(tmp, 2 * X * C + (Y - X) * B)", "+tmp = min(tmp, max(X, Y) * 2 * C)", "+print(tmp)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.571060118, "measured_runtime_v1": 0.3373241339, "runtime_lift": 1.6929121299, "key": ["s614340278", "s677161923"]} {"user_id": "u678167152", "problem_id": "p03814", "language": "python", "submission_id_v0": "s292011694", "submission_id_v1": "s577750700", "cpu_time_v0": 173, "cpu_time_v1": 33, "memory_v0": 41456, "memory_v1": 9328, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 80.92, "input": "s = input()\n\na = s.find('A')\n\nz = s[::-1].find('Z')\n\nans = len(s)-a-z\n\n\n\nprint(ans)\n\n\n\n#print(*ans, sep='\\n')", "target": "def solve():\n\n S = input()\n\n a = S.find('A')\n\n z = S[::-1].find('Z')\n\n ans = len(S)-a-z\n\n return ans\n\nprint((solve()))", "code_v0_loc": 8, "code_v1_loc": 7, "code_v0_num_chars": 109, "code_v1_num_chars": 121, "code_v0_no_empty_lines": "s = input()\na = s.find(\"A\")\nz = s[::-1].find(\"Z\")\nans = len(s) - a - z\nprint(ans)\n# print(*ans, sep='\\n')\n", "code_v1_no_empty_lines": "def solve():\n S = input()\n a = S.find(\"A\")\n z = S[::-1].find(\"Z\")\n ans = len(S) - a - z\n return ans\n\n\nprint((solve()))\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-s = input()", "-a = s.find(\"A\")", "-z = s[::-1].find(\"Z\")", "-ans = len(s) - a - z", "-print(ans)", "-# print(*ans, sep='\\n')", "+def solve():", "+ S = input()", "+ a = S.find(\"A\")", "+ z = S[::-1].find(\"Z\")", "+ ans = len(S) - a - z", "+ return ans", "+", "+", "+print((solve()))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3115016568, "measured_runtime_v1": 0.2242342863, "runtime_lift": 1.3891794243, "key": ["s292011694", "s577750700"]} {"user_id": "u729133443", "problem_id": "p03494", "language": "python", "submission_id_v0": "s130510697", "submission_id_v1": "s993121873", "cpu_time_v0": 166, "cpu_time_v1": 32, "memory_v0": 38256, "memory_v1": 9048, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 80.72, "input": "_,t=open(0);n=eval(t.replace(' ','|'));print((len(bin(n&-n))-3))", "target": "n=eval([*open(0)][1].replace(*' |'))\n\nprint((len(bin(n&-n))-3))", "code_v0_loc": 1, "code_v1_loc": 2, "code_v0_num_chars": 62, "code_v1_num_chars": 61, "code_v0_no_empty_lines": "_, t = open(0)\nn = eval(t.replace(\" \", \"|\"))\nprint((len(bin(n & -n)) - 3))\n", "code_v1_no_empty_lines": "n = eval([*open(0)][1].replace(*\" |\"))\nprint((len(bin(n & -n)) - 3))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-_, t = open(0)", "-n = eval(t.replace(\" \", \"|\"))", "+n = eval([*open(0)][1].replace(*\" |\"))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2380404282, "measured_runtime_v1": 0.1070810323, "runtime_lift": 2.2229934012, "key": ["s130510697", "s993121873"]} {"user_id": "u923662841", "problem_id": "p03309", "language": "python", "submission_id_v0": "s990999147", "submission_id_v1": "s307361938", "cpu_time_v0": 211, "cpu_time_v1": 159, "memory_v0": 34024, "memory_v1": 31160, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 24.64, "input": "import statistics\n\nN = int(input())\n\nA = [int(a)-i-1 for i,a in enumerate(input().split(),1)]\n\nb = statistics.median_low(A)\n\nc = statistics.median_high(A)\n\nd = sum([abs(x-b) for x in A])\n\ne = sum([abs(x-c) for x in A])\n\nprint((min(d,e)))", "target": "N=int(input())\n\nA=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))\n\nprint((sum(abs(a-A[N//2]) for a in A)))", "code_v0_loc": 8, "code_v1_loc": 3, "code_v0_num_chars": 241, "code_v1_num_chars": 117, "code_v0_no_empty_lines": "import statistics\n\nN = int(input())\nA = [int(a) - i - 1 for i, a in enumerate(input().split(), 1)]\nb = statistics.median_low(A)\nc = statistics.median_high(A)\nd = sum([abs(x - b) for x in A])\ne = sum([abs(x - c) for x in A])\nprint((min(d, e)))\n", "code_v1_no_empty_lines": "N = int(input())\nA = sorted(a - i - 1 for i, a in enumerate(map(int, input().split())))\nprint((sum(abs(a - A[N // 2]) for a in A)))\n", "code_same": false, "relative_loc_diff_percent": 62.5, "diff": ["-import statistics", "-", "-A = [int(a) - i - 1 for i, a in enumerate(input().split(), 1)]", "-b = statistics.median_low(A)", "-c = statistics.median_high(A)", "-d = sum([abs(x - b) for x in A])", "-e = sum([abs(x - c) for x in A])", "-print((min(d, e)))", "+A = sorted(a - i - 1 for i, a in enumerate(map(int, input().split())))", "+print((sum(abs(a - A[N // 2]) for a in A)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3014758439, "measured_runtime_v1": 0.2369829128, "runtime_lift": 1.2721416931, "key": ["s990999147", "s307361938"]} {"user_id": "u294385082", "problem_id": "p03416", "language": "python", "submission_id_v0": "s823919342", "submission_id_v1": "s499216276", "cpu_time_v0": 175, "cpu_time_v1": 125, "memory_v0": 2940, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 28.57, "input": "a,b = list(map(int,input().split()))\n\nc = 0\n\n\n\nfor i in range(a,b+1):\n\n new = list(reversed(list(str(i))))\n\n if new == list(str(i)):\n\n c += 1\n\n \n\n \n\nprint(c)", "target": "a,b = list(map(int,input().split()))\n\nc = 0\n\n\n\nfor i in range(a,b+1):\n\n if list(str(i)) == list(str(i))[::-1]:\n\n c += 1\n\n \n\n \n\nprint(c)", "code_v0_loc": 10, "code_v1_loc": 9, "code_v0_num_chars": 162, "code_v1_num_chars": 139, "code_v0_no_empty_lines": "a, b = list(map(int, input().split()))\nc = 0\nfor i in range(a, b + 1):\n new = list(reversed(list(str(i))))\n if new == list(str(i)):\n c += 1\nprint(c)\n", "code_v1_no_empty_lines": "a, b = list(map(int, input().split()))\nc = 0\nfor i in range(a, b + 1):\n if list(str(i)) == list(str(i))[::-1]:\n c += 1\nprint(c)\n", "code_same": false, "relative_loc_diff_percent": 10.0, "diff": ["- new = list(reversed(list(str(i))))", "- if new == list(str(i)):", "+ if list(str(i)) == list(str(i))[::-1]:"], "diff_only_import_comment": false, "measured_runtime_v0": 0.7237584333, "measured_runtime_v1": 0.3522657444, "runtime_lift": 2.0545807954, "key": ["s823919342", "s499216276"]} {"user_id": "u089230684", "problem_id": "p03796", "language": "python", "submission_id_v0": "s560811979", "submission_id_v1": "s868944422", "cpu_time_v0": 230, "cpu_time_v1": 37, "memory_v0": 3984, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 83.91, "input": "import math\n\nx = int(input())\n\nprint((math.factorial(x) % (10**9 + 7)))", "target": "n = int(input())\n\nfact = 1\n\nfor i in range(1,n+1):\n\n fact = fact * i % (10**9 +7)\n\nres = fact % (10**9 + 7)\n\nprint(res)", "code_v0_loc": 3, "code_v1_loc": 6, "code_v0_num_chars": 69, "code_v1_num_chars": 120, "code_v0_no_empty_lines": "import math\n\nx = int(input())\nprint((math.factorial(x) % (10**9 + 7)))\n", "code_v1_no_empty_lines": "n = int(input())\nfact = 1\nfor i in range(1, n + 1):\n fact = fact * i % (10**9 + 7)\nres = fact % (10**9 + 7)\nprint(res)\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-import math", "-", "-x = int(input())", "-print((math.factorial(x) % (10**9 + 7)))", "+n = int(input())", "+fact = 1", "+for i in range(1, n + 1):", "+ fact = fact * i % (10**9 + 7)", "+res = fact % (10**9 + 7)", "+print(res)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5532854562, "measured_runtime_v1": 0.2473686228, "runtime_lift": 2.2366840626, "key": ["s560811979", "s868944422"]} {"user_id": "u732061897", "problem_id": "p02767", "language": "python", "submission_id_v0": "s699773211", "submission_id_v1": "s064206410", "cpu_time_v0": 21, "cpu_time_v1": 18, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 14.29, "input": "N = int(input())\n\nA = list(map(int, input().split()))\n\nanswer = 10 ** 9\n\nfor i in range(1,101):\n\n tmp = 0\n\n for a in A:\n\n tmp += abs(a-i) ** 2\n\n answer = min(answer,tmp)\n\nprint(answer)", "target": "N = int(input())\n\nA = list(map(int, input().split()))\n\nchushin = sum(A)//N\n\nchushin_1 = sum(A)//N +1\n\nanswer = 0\n\nanswer_1 = 0\n\nfor a in A:\n\n answer += abs(a-chushin) ** 2\n\n answer_1 += abs(a-chushin_1) ** 2\n\nprint((min(answer,answer_1)))", "code_v0_loc": 9, "code_v1_loc": 10, "code_v0_num_chars": 200, "code_v1_num_chars": 242, "code_v0_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nanswer = 10**9\nfor i in range(1, 101):\n tmp = 0\n for a in A:\n tmp += abs(a - i) ** 2\n answer = min(answer, tmp)\nprint(answer)\n", "code_v1_no_empty_lines": "N = int(input())\nA = list(map(int, input().split()))\nchushin = sum(A) // N\nchushin_1 = sum(A) // N + 1\nanswer = 0\nanswer_1 = 0\nfor a in A:\n answer += abs(a - chushin) ** 2\n answer_1 += abs(a - chushin_1) ** 2\nprint((min(answer, answer_1)))\n", "code_same": false, "relative_loc_diff_percent": 10.0, "diff": ["-answer = 10**9", "-for i in range(1, 101):", "- tmp = 0", "- for a in A:", "- tmp += abs(a - i) ** 2", "- answer = min(answer, tmp)", "-print(answer)", "+chushin = sum(A) // N", "+chushin_1 = sum(A) // N + 1", "+answer = 0", "+answer_1 = 0", "+for a in A:", "+ answer += abs(a - chushin) ** 2", "+ answer_1 += abs(a - chushin_1) ** 2", "+print((min(answer, answer_1)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3756797752, "measured_runtime_v1": 0.2943871524, "runtime_lift": 1.2761418836, "key": ["s699773211", "s064206410"]} {"user_id": "u440161695", "problem_id": "p03107", "language": "python", "submission_id_v0": "s703980325", "submission_id_v1": "s025529722", "cpu_time_v0": 26, "cpu_time_v1": 18, "memory_v0": 3444, "memory_v1": 3188, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 30.77, "input": "from collections import Counter\n\nd={chr(i):0 for i in range(2)}\n\ns=Counter(input())\n\nd=d.update(s)\n\nprint((min(s[\"0\"],s[\"1\"])*2))", "target": "s=input()\n\nprint((min(s.count(\"0\"),s.count(\"1\"))*2))", "code_v0_loc": 5, "code_v1_loc": 2, "code_v0_num_chars": 127, "code_v1_num_chars": 50, "code_v0_no_empty_lines": "from collections import Counter\n\nd = {chr(i): 0 for i in range(2)}\ns = Counter(input())\nd = d.update(s)\nprint((min(s[\"0\"], s[\"1\"]) * 2))\n", "code_v1_no_empty_lines": "s = input()\nprint((min(s.count(\"0\"), s.count(\"1\")) * 2))\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-from collections import Counter", "-", "-d = {chr(i): 0 for i in range(2)}", "-s = Counter(input())", "-d = d.update(s)", "-print((min(s[\"0\"], s[\"1\"]) * 2))", "+s = input()", "+print((min(s.count(\"0\"), s.count(\"1\")) * 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5096813786, "measured_runtime_v1": 0.1983500416, "runtime_lift": 2.5696056043, "key": ["s703980325", "s025529722"]} {"user_id": "u238940874", "problem_id": "p02725", "language": "python", "submission_id_v0": "s425361145", "submission_id_v1": "s820245641", "cpu_time_v0": 183, "cpu_time_v1": 162, "memory_v0": 25840, "memory_v1": 25840, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.48, "input": "k,n = list(map(int,input().split()))\n\na=list(map(int,input().split()))\n\na.append(a[0]+k)\n\nlongd=0\n\nfor i in range(n):\n\n tmp=abs(a[i+1]-a[i])\n\n longd=max(longd,tmp)\n\nprint((k-longd))", "target": "k,n=list(map(int,input().split()))\n\na=list(map(int,input().split()))\n\na.append(a[0]+k)\n\n\n\nx=0\n\nfor i in range(len(a)-1):\n\n dis=abs(a[i+1]-a[i])\n\n x=max(x,dis)\n\n\n\nprint((k-x))", "code_v0_loc": 8, "code_v1_loc": 10, "code_v0_num_chars": 179, "code_v1_num_chars": 172, "code_v0_no_empty_lines": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\na.append(a[0] + k)\nlongd = 0\nfor i in range(n):\n tmp = abs(a[i + 1] - a[i])\n longd = max(longd, tmp)\nprint((k - longd))\n", "code_v1_no_empty_lines": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\na.append(a[0] + k)\nx = 0\nfor i in range(len(a) - 1):\n dis = abs(a[i + 1] - a[i])\n x = max(x, dis)\nprint((k - x))\n", "code_same": false, "relative_loc_diff_percent": 20.0, "diff": ["-longd = 0", "-for i in range(n):", "- tmp = abs(a[i + 1] - a[i])", "- longd = max(longd, tmp)", "-print((k - longd))", "+x = 0", "+for i in range(len(a) - 1):", "+ dis = abs(a[i + 1] - a[i])", "+ x = max(x, dis)", "+print((k - x))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2313908032, "measured_runtime_v1": 0.1406400898, "runtime_lift": 1.645269165, "key": ["s425361145", "s820245641"]} {"user_id": "u021916304", "problem_id": "p02886", "language": "python", "submission_id_v0": "s631255245", "submission_id_v1": "s295881998", "cpu_time_v0": 21, "cpu_time_v1": 17, "memory_v0": 3316, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 19.05, "input": "def ii():return int(input())\n\ndef iim():return list(map(int,input().split()))\n\ndef iil():return list(map(int,input().split()))\n\ndef ism():return list(map(str,input().split()))\n\ndef isl():return list(map(str,input().split()))\n\n\n\nn = ii()\n\nD = iil()\n\nans = 0\n\nfor i in range(n):\n\n for j in range(i+1,n):\n\n# print(i,j)\n\n ans += D[i]*D[j] \n\nprint(ans)", "target": "def ii():return int(input())\n\ndef iim():return list(map(int,input().split()))\n\ndef iil():return list(map(int,input().split()))\n\ndef ism():return list(map(str,input().split()))\n\ndef isl():return list(map(str,input().split()))\n\n\n\nn = ii()\n\nD = iil()\n\nsumD = sum(D)\n\nans = 0\n\nfor i in range(n):\n\n ans += D[i]*(sum(D)-D[i])\n\nprint((ans//2))", "code_v0_loc": 14, "code_v1_loc": 13, "code_v0_num_chars": 352, "code_v1_num_chars": 325, "code_v0_no_empty_lines": "def ii():\n return int(input())\n\n\ndef iim():\n return list(map(int, input().split()))\n\n\ndef iil():\n return list(map(int, input().split()))\n\n\ndef ism():\n return list(map(str, input().split()))\n\n\ndef isl():\n return list(map(str, input().split()))\n\n\nn = ii()\nD = iil()\nans = 0\nfor i in range(n):\n for j in range(i + 1, n):\n # print(i,j)\n ans += D[i] * D[j]\nprint(ans)\n", "code_v1_no_empty_lines": "def ii():\n return int(input())\n\n\ndef iim():\n return list(map(int, input().split()))\n\n\ndef iil():\n return list(map(int, input().split()))\n\n\ndef ism():\n return list(map(str, input().split()))\n\n\ndef isl():\n return list(map(str, input().split()))\n\n\nn = ii()\nD = iil()\nsumD = sum(D)\nans = 0\nfor i in range(n):\n ans += D[i] * (sum(D) - D[i])\nprint((ans // 2))\n", "code_same": false, "relative_loc_diff_percent": 7.1428571429, "diff": ["+sumD = sum(D)", "- for j in range(i + 1, n):", "- # print(i,j)", "- ans += D[i] * D[j]", "-print(ans)", "+ ans += D[i] * (sum(D) - D[i])", "+print((ans // 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2355280421, "measured_runtime_v1": 0.0063002633, "runtime_lift": 37.3838408874, "key": ["s631255245", "s295881998"]} {"user_id": "u175034939", "problem_id": "p03353", "language": "python", "submission_id_v0": "s387813464", "submission_id_v1": "s460839958", "cpu_time_v0": 62, "cpu_time_v1": 40, "memory_v0": 5068, "memory_v1": 5068, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 35.48, "input": "S = input()\n\nK = int(input())\n\na = list(set(S))\n\na.sort()\n\n\n\nk = []\n\nl = 0\n\nwhile l < len(a):\n\n for i in range(len(S)):\n\n if S[i] == a[l]:\n\n for j in range(1,6):\n\n if i+j <= len(S):\n\n k.append(S[i:i+j])\n\n else:\n\n break\n\n l += 1\n\n\n\nk = list(set(k))\n\nk.sort()\n\nprint((k[K-1]))", "target": "S = input()\n\nK = int(input())\n\na = []\n\nfor i in range(len(S)+1):\n\n for j in range(1,6):\n\n if i+j <= len(S):\n\n a.append(S[i:i+j])\n\n else:\n\n break\n\n \n\na = list(set(a))\n\na.sort()\n\nprint((a[K-1]))", "code_v0_loc": 20, "code_v1_loc": 13, "code_v0_num_chars": 364, "code_v1_num_chars": 240, "code_v0_no_empty_lines": "S = input()\nK = int(input())\na = list(set(S))\na.sort()\nk = []\nl = 0\nwhile l < len(a):\n for i in range(len(S)):\n if S[i] == a[l]:\n for j in range(1, 6):\n if i + j <= len(S):\n k.append(S[i : i + j])\n else:\n break\n l += 1\nk = list(set(k))\nk.sort()\nprint((k[K - 1]))\n", "code_v1_no_empty_lines": "S = input()\nK = int(input())\na = []\nfor i in range(len(S) + 1):\n for j in range(1, 6):\n if i + j <= len(S):\n a.append(S[i : i + j])\n else:\n break\na = list(set(a))\na.sort()\nprint((a[K - 1]))\n", "code_same": false, "relative_loc_diff_percent": 35.0, "diff": ["-a = list(set(S))", "+a = []", "+for i in range(len(S) + 1):", "+ for j in range(1, 6):", "+ if i + j <= len(S):", "+ a.append(S[i : i + j])", "+ else:", "+ break", "+a = list(set(a))", "-k = []", "-l = 0", "-while l < len(a):", "- for i in range(len(S)):", "- if S[i] == a[l]:", "- for j in range(1, 6):", "- if i + j <= len(S):", "- k.append(S[i : i + j])", "- else:", "- break", "- l += 1", "-k = list(set(k))", "-k.sort()", "-print((k[K - 1]))", "+print((a[K - 1]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3274912031, "measured_runtime_v1": 0.2526222069, "runtime_lift": 1.2963674375, "key": ["s387813464", "s460839958"]} {"user_id": "u653837719", "problem_id": "p02702", "language": "python", "submission_id_v0": "s121665958", "submission_id_v1": "s794197403", "cpu_time_v0": 113, "cpu_time_v1": 101, "memory_v0": 9288, "memory_v1": 9236, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 10.62, "input": "s = input()[::-1]\n\nl = len(s)\n\nc = [0] * 2019\n\nc[0] = 1\n\nten = 1\n\nmod = 0\n\nans = 0\n\n\n\nfor i in range(l):\n\n mod = (mod + int(s[i]) * ten) % 2019\n\n ten = ten * 10 % 2019\n\n c[mod] += 1\n\n\n\nfor i in c:\n\n ans += i * (i - 1) // 2\n\n\n\nprint(ans)", "target": "s = input()[::-1]\n\nc = [0] * 2019\n\nc[0] = 1\n\nmod = 0\n\nten = 1\n\nans = 0\n\n\n\nfor i in s:\n\n mod = (mod + int(i) * ten) % 2019\n\n ten = ten * 10 % 2019\n\n c[mod] += 1\n\n\n\nfor i in c:\n\n ans += i * (i - 1) // 2\n\n\n\nprint(ans)", "code_v0_loc": 17, "code_v1_loc": 16, "code_v0_num_chars": 248, "code_v1_num_chars": 226, "code_v0_no_empty_lines": "s = input()[::-1]\nl = len(s)\nc = [0] * 2019\nc[0] = 1\nten = 1\nmod = 0\nans = 0\nfor i in range(l):\n mod = (mod + int(s[i]) * ten) % 2019\n ten = ten * 10 % 2019\n c[mod] += 1\nfor i in c:\n ans += i * (i - 1) // 2\nprint(ans)\n", "code_v1_no_empty_lines": "s = input()[::-1]\nc = [0] * 2019\nc[0] = 1\nmod = 0\nten = 1\nans = 0\nfor i in s:\n mod = (mod + int(i) * ten) % 2019\n ten = ten * 10 % 2019\n c[mod] += 1\nfor i in c:\n ans += i * (i - 1) // 2\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 5.8823529412, "diff": ["-l = len(s)", "+mod = 0", "-mod = 0", "-for i in range(l):", "- mod = (mod + int(s[i]) * ten) % 2019", "+for i in s:", "+ mod = (mod + int(i) * ten) % 2019"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2661841769, "measured_runtime_v1": 0.1600983288, "runtime_lift": 1.6626293282, "key": ["s121665958", "s794197403"]} {"user_id": "u045939752", "problem_id": "p03814", "language": "python", "submission_id_v0": "s574890983", "submission_id_v1": "s839527046", "cpu_time_v0": 23, "cpu_time_v1": 18, "memory_v0": 3516, "memory_v1": 3500, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.74, "input": "S=input()\n\nprint((S.rfind('Z')-S.find('A')+1))", "target": "s=input().strip()\n\na = s.find('A')\n\nz = s.rfind('Z')\n\nprint((z-a+1))\n", "code_v0_loc": 2, "code_v1_loc": 4, "code_v0_num_chars": 44, "code_v1_num_chars": 67, "code_v0_no_empty_lines": "S = input()\nprint((S.rfind(\"Z\") - S.find(\"A\") + 1))\n", "code_v1_no_empty_lines": "s = input().strip()\na = s.find(\"A\")\nz = s.rfind(\"Z\")\nprint((z - a + 1))\n", "code_same": false, "relative_loc_diff_percent": 50.0, "diff": ["-S = input()", "-print((S.rfind(\"Z\") - S.find(\"A\") + 1))", "+s = input().strip()", "+a = s.find(\"A\")", "+z = s.rfind(\"Z\")", "+print((z - a + 1))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.286565238, "measured_runtime_v1": 0.2292430663, "runtime_lift": 1.2500497511, "key": ["s574890983", "s839527046"]} {"user_id": "u183422236", "problem_id": "p02612", "language": "python", "submission_id_v0": "s828418851", "submission_id_v1": "s809335980", "cpu_time_v0": 81, "cpu_time_v1": 70, "memory_v0": 61540, "memory_v1": 61736, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 13.58, "input": "n = int(input()) % 1000\n\nif n == 0:\n\n print((0))\n\nelse:\n\n print((1000 - n))", "target": "n = int(input())\n\nprint(((1000 - n % 1000) % 1000))", "code_v0_loc": 5, "code_v1_loc": 2, "code_v0_num_chars": 77, "code_v1_num_chars": 49, "code_v0_no_empty_lines": "n = int(input()) % 1000\nif n == 0:\n print((0))\nelse:\n print((1000 - n))\n", "code_v1_no_empty_lines": "n = int(input())\nprint(((1000 - n % 1000) % 1000))\n", "code_same": false, "relative_loc_diff_percent": 60.0, "diff": ["-n = int(input()) % 1000", "-if n == 0:", "- print((0))", "-else:", "- print((1000 - n))", "+n = int(input())", "+print(((1000 - n % 1000) % 1000))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2545247498, "measured_runtime_v1": 0.1889497155, "runtime_lift": 1.3470501881, "key": ["s828418851", "s809335980"]} {"user_id": "u912650255", "problem_id": "p02983", "language": "python", "submission_id_v0": "s074902378", "submission_id_v1": "s358904585", "cpu_time_v0": 618, "cpu_time_v1": 67, "memory_v0": 75568, "memory_v1": 6888, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 89.16, "input": "L ,R = list(map(int,input().split()))\n\n\n\nans =[]\n\nif R - L <= 2019:\n\n for i in range(L,R+1):\n\n for j in range(i+1,R+1):\n\n ans.append(i*j%2019)\n\n\n\nelse:\n\n for i in range(R-L-1010,R-L+1010):\n\n for j in range(i,R-L+1010):\n\n ans.append(i*j%2019)\n\n\n\nprint((min(ans)))\n", "target": "L ,R = list(map(int,input().split()))\n\n\n\nans =[]\n\nfor i in range(L,R+1):\n\n for j in range(i+1,R+1):\n\n ans.append(i*j%2019)\n\n if (i * j % 2019) == 0:\n\n break\n\n else:\n\n continue\n\n break\n\n\n\nprint((min(ans)))", "code_v0_loc": 14, "code_v1_loc": 13, "code_v0_num_chars": 297, "code_v1_num_chars": 237, "code_v0_no_empty_lines": "L, R = list(map(int, input().split()))\nans = []\nif R - L <= 2019:\n for i in range(L, R + 1):\n for j in range(i + 1, R + 1):\n ans.append(i * j % 2019)\nelse:\n for i in range(R - L - 1010, R - L + 1010):\n for j in range(i, R - L + 1010):\n ans.append(i * j % 2019)\nprint((min(ans)))\n", "code_v1_no_empty_lines": "L, R = list(map(int, input().split()))\nans = []\nfor i in range(L, R + 1):\n for j in range(i + 1, R + 1):\n ans.append(i * j % 2019)\n if (i * j % 2019) == 0:\n break\n else:\n continue\n break\nprint((min(ans)))\n", "code_same": false, "relative_loc_diff_percent": 7.1428571429, "diff": ["-if R - L <= 2019:", "- for i in range(L, R + 1):", "- for j in range(i + 1, R + 1):", "- ans.append(i * j % 2019)", "-else:", "- for i in range(R - L - 1010, R - L + 1010):", "- for j in range(i, R - L + 1010):", "- ans.append(i * j % 2019)", "+for i in range(L, R + 1):", "+ for j in range(i + 1, R + 1):", "+ ans.append(i * j % 2019)", "+ if (i * j % 2019) == 0:", "+ break", "+ else:", "+ continue", "+ break"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3668963638, "measured_runtime_v1": 0.2102679547, "runtime_lift": 1.7448990943, "key": ["s074902378", "s358904585"]} {"user_id": "u622570247", "problem_id": "p02773", "language": "python", "submission_id_v0": "s074380513", "submission_id_v1": "s228830644", "cpu_time_v0": 1054, "cpu_time_v1": 898, "memory_v0": 45492, "memory_v1": 47732, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 14.8, "input": "from collections import Counter\n\nimport heapq\n\n\n\nn = int(input())\n\nss = []\n\nfor _ in range(n):\n\n ss.append(input().rstrip())\n\nctr = Counter(ss)\n\nheap = [(-v, k) for k, v in list(ctr.items())]\n\nheapq.heapify(heap)\n\nmaxv = heap[0][0]\n\nwhile heap:\n\n c = heapq.heappop(heap)\n\n if c[0] != maxv:\n\n break\n\n print((c[1]))\n", "target": "from collections import Counter\n\n\n\nn = int(input())\n\nss = []\n\nfor _ in range(n):\n\n ss.append(input().rstrip())\n\nctr = Counter(ss)\n\n\n\na = sorted([(-v, k) for k, v in list(ctr.items())])\n\nmaxv = a[0][0]\n\nfor i in range(len(a)):\n\n if a[i][0] != maxv:\n\n break\n\n print((a[i][1]))", "code_v0_loc": 16, "code_v1_loc": 14, "code_v0_num_chars": 325, "code_v1_num_chars": 282, "code_v0_no_empty_lines": "from collections import Counter\nimport heapq\n\nn = int(input())\nss = []\nfor _ in range(n):\n ss.append(input().rstrip())\nctr = Counter(ss)\nheap = [(-v, k) for k, v in list(ctr.items())]\nheapq.heapify(heap)\nmaxv = heap[0][0]\nwhile heap:\n c = heapq.heappop(heap)\n if c[0] != maxv:\n break\n print((c[1]))\n", "code_v1_no_empty_lines": "from collections import Counter\n\nn = int(input())\nss = []\nfor _ in range(n):\n ss.append(input().rstrip())\nctr = Counter(ss)\na = sorted([(-v, k) for k, v in list(ctr.items())])\nmaxv = a[0][0]\nfor i in range(len(a)):\n if a[i][0] != maxv:\n break\n print((a[i][1]))\n", "code_same": false, "relative_loc_diff_percent": 12.5, "diff": ["-import heapq", "-heap = [(-v, k) for k, v in list(ctr.items())]", "-heapq.heapify(heap)", "-maxv = heap[0][0]", "-while heap:", "- c = heapq.heappop(heap)", "- if c[0] != maxv:", "+a = sorted([(-v, k) for k, v in list(ctr.items())])", "+maxv = a[0][0]", "+for i in range(len(a)):", "+ if a[i][0] != maxv:", "- print((c[1]))", "+ print((a[i][1]))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.3121475418, "measured_runtime_v1": 0.0064239368, "runtime_lift": 48.5913153977, "key": ["s074380513", "s228830644"]} {"user_id": "u428397309", "problem_id": "p03037", "language": "python", "submission_id_v0": "s058389905", "submission_id_v1": "s302443687", "cpu_time_v0": 285, "cpu_time_v1": 131, "memory_v0": 10868, "memory_v1": 10868, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 54.04, "input": "# -*- coding: utf-8 -*-\n\n\n\nN, M = list(map(int, input().split()))\n\nL, R = [None] * M, [None] * M\n\nfor i in range(M):\n\n L[i], R[i] = list(map(int, input().split()))\n\n\n\nl = max(L)\n\nr = min(R)\n\n\n\nans = max(r - l + 1, 0)\n\n\n\nprint(ans)\n", "target": "# -*- coding: utf-8 -*-\n\n\n\nimport sys\n\ninput = sys.stdin.readline\n\n\n\nN, M = list(map(int, input().split()))\n\nL, R = [None] * M, [None] * M\n\nfor i in range(M):\n\n L[i], R[i] = list(map(int, input().split()))\n\n\n\nans = max(min(R) - max(L) + 1, 0)\n\n\n\nprint(ans)\n", "code_v0_loc": 13, "code_v1_loc": 13, "code_v0_num_chars": 222, "code_v1_num_chars": 248, "code_v0_no_empty_lines": "# -*- coding: utf-8 -*-\nN, M = list(map(int, input().split()))\nL, R = [None] * M, [None] * M\nfor i in range(M):\n L[i], R[i] = list(map(int, input().split()))\nl = max(L)\nr = min(R)\nans = max(r - l + 1, 0)\nprint(ans)\n", "code_v1_no_empty_lines": "# -*- coding: utf-8 -*-\nimport sys\n\ninput = sys.stdin.readline\nN, M = list(map(int, input().split()))\nL, R = [None] * M, [None] * M\nfor i in range(M):\n L[i], R[i] = list(map(int, input().split()))\nans = max(min(R) - max(L) + 1, 0)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["+import sys", "+", "+input = sys.stdin.readline", "-l = max(L)", "-r = min(R)", "-ans = max(r - l + 1, 0)", "+ans = max(min(R) - max(L) + 1, 0)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2363609416, "measured_runtime_v1": 0.0060358713, "runtime_lift": 39.1593741465, "key": ["s058389905", "s302443687"]} {"user_id": "u756270013", "problem_id": "p02881", "language": "python", "submission_id_v0": "s868775809", "submission_id_v1": "s345973481", "cpu_time_v0": 439, "cpu_time_v1": 210, "memory_v0": 3060, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 52.16, "input": "import math\n\ninput_num = int(input())\n\nnum_sqrt = int(math.sqrt(input_num))\n\n\n\nminimam = input_num\n\nfor i in range(num_sqrt+1,0,-1):\n\n q, mod = divmod(input_num, i)\n\n distance = q + i -2\n\n if mod == 0 and minimam > distance:\n\n minimam = distance\n\nprint(minimam)", "target": "import math\n\ndef main1():\n\n input_num = int(input())\n\n num_sqrt = int(math.sqrt(input_num))\n\n\n\n minimam = input_num\n\n for i in range(num_sqrt+1,0,-1):\n\n q, mod = divmod(input_num, i)\n\n if mod == 0:\n\n distance = q + i -2\n\n if minimam > distance:\n\n minimam = distance\n\n print(minimam)\n\nmain1()", "code_v0_loc": 11, "code_v1_loc": 14, "code_v0_num_chars": 277, "code_v1_num_chars": 357, "code_v0_no_empty_lines": "import math\n\ninput_num = int(input())\nnum_sqrt = int(math.sqrt(input_num))\nminimam = input_num\nfor i in range(num_sqrt + 1, 0, -1):\n q, mod = divmod(input_num, i)\n distance = q + i - 2\n if mod == 0 and minimam > distance:\n minimam = distance\nprint(minimam)\n", "code_v1_no_empty_lines": "import math\n\n\ndef main1():\n input_num = int(input())\n num_sqrt = int(math.sqrt(input_num))\n minimam = input_num\n for i in range(num_sqrt + 1, 0, -1):\n q, mod = divmod(input_num, i)\n if mod == 0:\n distance = q + i - 2\n if minimam > distance:\n minimam = distance\n print(minimam)\n\n\nmain1()\n", "code_same": false, "relative_loc_diff_percent": 21.4285714286, "diff": ["-input_num = int(input())", "-num_sqrt = int(math.sqrt(input_num))", "-minimam = input_num", "-for i in range(num_sqrt + 1, 0, -1):", "- q, mod = divmod(input_num, i)", "- distance = q + i - 2", "- if mod == 0 and minimam > distance:", "- minimam = distance", "-print(minimam)", "+", "+def main1():", "+ input_num = int(input())", "+ num_sqrt = int(math.sqrt(input_num))", "+ minimam = input_num", "+ for i in range(num_sqrt + 1, 0, -1):", "+ q, mod = divmod(input_num, i)", "+ if mod == 0:", "+ distance = q + i - 2", "+ if minimam > distance:", "+ minimam = distance", "+ print(minimam)", "+", "+", "+main1()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.27158184, "measured_runtime_v1": 0.2170004892, "runtime_lift": 1.2515263951, "key": ["s868775809", "s345973481"]} {"user_id": "u802963389", "problem_id": "p02881", "language": "python", "submission_id_v0": "s879601223", "submission_id_v1": "s706921267", "cpu_time_v0": 178, "cpu_time_v1": 148, "memory_v0": 3060, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 16.85, "input": "# C - Walk on Multiplication Table\n\n# https://atcoder.jp/contests/abc144/tasks/abc144_c\n\n\n\nn = int(input())\n\n\n\nans = 10 ** 12\n\nfor i in range(1, 10 ** 6 + 1):\n\n if n % i == 0:\n\n ans = min(ans, n // i + i)\n\n\n\nprint((ans - 2))", "target": "# C - Walk on Multiplication Table\n\n# https://atcoder.jp/contests/abc144/tasks/abc144_c\n\n\n\nn = int(input())\n\n\n\nans = n\n\nfor i in range(1, int(n**.5) + 2):\n\n if n % i == 0:\n\n ans = min(ans, n // i + i - 2)\n\n\n\nprint(ans)", "code_v0_loc": 11, "code_v1_loc": 11, "code_v0_num_chars": 226, "code_v1_num_chars": 222, "code_v0_no_empty_lines": "# C - Walk on Multiplication Table\n# https://atcoder.jp/contests/abc144/tasks/abc144_c\nn = int(input())\nans = 10**12\nfor i in range(1, 10**6 + 1):\n if n % i == 0:\n ans = min(ans, n // i + i)\nprint((ans - 2))\n", "code_v1_no_empty_lines": "# C - Walk on Multiplication Table\n# https://atcoder.jp/contests/abc144/tasks/abc144_c\nn = int(input())\nans = n\nfor i in range(1, int(n**0.5) + 2):\n if n % i == 0:\n ans = min(ans, n // i + i - 2)\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-ans = 10**12", "-for i in range(1, 10**6 + 1):", "+ans = n", "+for i in range(1, int(n**0.5) + 2):", "- ans = min(ans, n // i + i)", "-print((ans - 2))", "+ ans = min(ans, n // i + i - 2)", "+print(ans)"], "diff_only_import_comment": false, "measured_runtime_v0": 1.0824642203, "measured_runtime_v1": 0.2210092547, "runtime_lift": 4.8978230425, "key": ["s879601223", "s706921267"]} {"user_id": "u077291787", "problem_id": "p04020", "language": "python", "submission_id_v0": "s648607888", "submission_id_v1": "s112859245", "cpu_time_v0": 58, "cpu_time_v1": 46, "memory_v0": 14252, "memory_v1": 14092, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 20.69, "input": "# AGC003B - Simplified mahjong\n\nimport sys\n\ninput = sys.stdin.readline\n\n\n\ndef main():\n\n # split in subsequences when 0 appears -> sum up cur // 2\n\n N = int(input())\n\n A = list(map(int, [input() for _ in range(N)])) + [0]\n\n ans, cur = 0, 0\n\n for i in A:\n\n if i:\n\n cur += i\n\n else:\n\n ans += cur // 2\n\n cur = 0\n\n print(ans)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()", "target": "# AGC003B - Simplified mahjong\n\ndef main():\n\n # split in subsequences when 0 appears -> sum up cur // 2\n\n N, *A = list(map(int, open(0).read().split()))\n\n A.append(0)\n\n ans, cur = 0, 0\n\n for i in A:\n\n if i:\n\n cur += i\n\n else:\n\n ans += cur // 2\n\n cur = 0\n\n print(ans)\n\n\n\n\n\nif __name__ == \"__main__\":\n\n main()", "code_v0_loc": 20, "code_v1_loc": 17, "code_v0_num_chars": 429, "code_v1_num_chars": 369, "code_v0_no_empty_lines": "# AGC003B - Simplified mahjong\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n # split in subsequences when 0 appears -> sum up cur // 2\n N = int(input())\n A = list(map(int, [input() for _ in range(N)])) + [0]\n ans, cur = 0, 0\n for i in A:\n if i:\n cur += i\n else:\n ans += cur // 2\n cur = 0\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_v1_no_empty_lines": "# AGC003B - Simplified mahjong\ndef main():\n # split in subsequences when 0 appears -> sum up cur // 2\n N, *A = list(map(int, open(0).read().split()))\n A.append(0)\n ans, cur = 0, 0\n for i in A:\n if i:\n cur += i\n else:\n ans += cur // 2\n cur = 0\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 15.0, "diff": ["-import sys", "-", "-input = sys.stdin.readline", "-", "-", "- N = int(input())", "- A = list(map(int, [input() for _ in range(N)])) + [0]", "+ N, *A = list(map(int, open(0).read().split()))", "+ A.append(0)"], "diff_only_import_comment": false, "measured_runtime_v0": 0.282343082, "measured_runtime_v1": 0.1984000847, "runtime_lift": 1.4230996042, "key": ["s648607888", "s112859245"]} {"user_id": "u131984977", "problem_id": "p02412", "language": "python", "submission_id_v0": "s229334190", "submission_id_v1": "s721700065", "cpu_time_v0": 1150, "cpu_time_v1": 900, "memory_v0": 6724, "memory_v1": 6720, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 21.74, "input": "while True:\n\n (n, x) = [int(i) for i in input().split()]\n\n if n == x == 0:\n\n break\n\n\n\n count = 0\n\n for a in range(1, n + 1):\n\n for b in range(a + 1, n + 1):\n\n for c in range(b + 1, n + 1):\n\n if sum([a,b,c]) == x:\n\n count += 1\n\n\n\n print(count)", "target": "while True:\n\n (n, x) = [int(i) for i in input().split()]\n\n if n == x == 0:\n\n break\n\n\n\n count = 0\n\n limit = n if n < x else x\n\n for a in range(1, limit + 1):\n\n for b in range(a + 1, limit + 1):\n\n for c in range(b + 1, limit + 1):\n\n if sum([a,b,c]) == x:\n\n count += 1\n\n\n\n print(count)", "code_v0_loc": 13, "code_v1_loc": 14, "code_v0_num_chars": 316, "code_v1_num_chars": 359, "code_v0_no_empty_lines": "while True:\n (n, x) = [int(i) for i in input().split()]\n if n == x == 0:\n break\n count = 0\n for a in range(1, n + 1):\n for b in range(a + 1, n + 1):\n for c in range(b + 1, n + 1):\n if sum([a, b, c]) == x:\n count += 1\n print(count)\n", "code_v1_no_empty_lines": "while True:\n (n, x) = [int(i) for i in input().split()]\n if n == x == 0:\n break\n count = 0\n limit = n if n < x else x\n for a in range(1, limit + 1):\n for b in range(a + 1, limit + 1):\n for c in range(b + 1, limit + 1):\n if sum([a, b, c]) == x:\n count += 1\n print(count)\n", "code_same": false, "relative_loc_diff_percent": 7.1428571429, "diff": ["- for a in range(1, n + 1):", "- for b in range(a + 1, n + 1):", "- for c in range(b + 1, n + 1):", "+ limit = n if n < x else x", "+ for a in range(1, limit + 1):", "+ for b in range(a + 1, limit + 1):", "+ for c in range(b + 1, limit + 1):"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2860648324, "measured_runtime_v1": 0.2158536868, "runtime_lift": 1.3252719315, "key": ["s229334190", "s721700065"]} {"user_id": "u562935282", "problem_id": "p03371", "language": "python", "submission_id_v0": "s168362535", "submission_id_v1": "s471284270", "cpu_time_v0": 242, "cpu_time_v1": 98, "memory_v0": 3060, "memory_v1": 3064, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 59.5, "input": "inf = (5000 * 10 ** 5) * 3\n\n\n\na, b, c, x, y = list(map(int, input().split()))\n\n\n\nret = inf\n\nfor cnt_ab in range(max(x, y) * 2 + 1):\n\n d = cnt_ab // 2\n\n\n\n cnt_a = max(0, x - d)\n\n cnt_b = max(0, y - d)\n\n\n\n t = cnt_ab * c + cnt_a * a + cnt_b * b\n\n ret = min(ret, t)\n\nprint(ret)\n", "target": "def main():\n\n A, B, AB, X, Y = list(map(int, input().split()))\n\n M = max(X, Y)\n\n\n\n k = 0\n\n ans = A * X + B * Y\n\n while True:\n\n ans = min(\n\n ans,\n\n AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B\n\n )\n\n\n\n if k >= M: break\n\n k += 1\n\n\n\n print(ans)\n\n\n\n\n\nif __name__ == '__main__':\n\n main()\n", "code_v0_loc": 14, "code_v1_loc": 20, "code_v0_num_chars": 284, "code_v1_num_chars": 353, "code_v0_no_empty_lines": "inf = (5000 * 10**5) * 3\na, b, c, x, y = list(map(int, input().split()))\nret = inf\nfor cnt_ab in range(max(x, y) * 2 + 1):\n d = cnt_ab // 2\n cnt_a = max(0, x - d)\n cnt_b = max(0, y - d)\n t = cnt_ab * c + cnt_a * a + cnt_b * b\n ret = min(ret, t)\nprint(ret)\n", "code_v1_no_empty_lines": "def main():\n A, B, AB, X, Y = list(map(int, input().split()))\n M = max(X, Y)\n k = 0\n ans = A * X + B * Y\n while True:\n ans = min(ans, AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B)\n if k >= M:\n break\n k += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "code_same": false, "relative_loc_diff_percent": 30.0, "diff": ["-inf = (5000 * 10**5) * 3", "-a, b, c, x, y = list(map(int, input().split()))", "-ret = inf", "-for cnt_ab in range(max(x, y) * 2 + 1):", "- d = cnt_ab // 2", "- cnt_a = max(0, x - d)", "- cnt_b = max(0, y - d)", "- t = cnt_ab * c + cnt_a * a + cnt_b * b", "- ret = min(ret, t)", "-print(ret)", "+def main():", "+ A, B, AB, X, Y = list(map(int, input().split()))", "+ M = max(X, Y)", "+ k = 0", "+ ans = A * X + B * Y", "+ while True:", "+ ans = min(ans, AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B)", "+ if k >= M:", "+ break", "+ k += 1", "+ print(ans)", "+", "+", "+if __name__ == \"__main__\":", "+ main()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4937371187, "measured_runtime_v1": 0.3021148317, "runtime_lift": 1.6342697111, "key": ["s168362535", "s471284270"]} {"user_id": "u349449706", "problem_id": "p02555", "language": "python", "submission_id_v0": "s796837031", "submission_id_v1": "s077713004", "cpu_time_v0": 96, "cpu_time_v1": 64, "memory_v0": 68168, "memory_v1": 63448, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 33.33, "input": "S = int(input())\n\nf = [0]*(S+1)\n\nf[0] = 1\n\nif S >= 3: f[3] = 1\n\nif S >= 4: f[4] = 1\n\nif S >= 5: f[5] = 1\n\nfor i in range(6, S+1):\n\n f[i] = sum(f[i-j] for j in range(3, i+1))%(10**9+7)\n\nprint((f[S]))\n", "target": "S=int(input())\n\nf=[1,0,0]\n\nfor i in range(S-2):f.append(f[i]+f[i+2])\n\nprint((f[S]%(10**9+7)))\n", "code_v0_loc": 9, "code_v1_loc": 4, "code_v0_num_chars": 200, "code_v1_num_chars": 92, "code_v0_no_empty_lines": "S = int(input())\nf = [0] * (S + 1)\nf[0] = 1\nif S >= 3:\n f[3] = 1\nif S >= 4:\n f[4] = 1\nif S >= 5:\n f[5] = 1\nfor i in range(6, S + 1):\n f[i] = sum(f[i - j] for j in range(3, i + 1)) % (10**9 + 7)\nprint((f[S]))\n", "code_v1_no_empty_lines": "S = int(input())\nf = [1, 0, 0]\nfor i in range(S - 2):\n f.append(f[i] + f[i + 2])\nprint((f[S] % (10**9 + 7)))\n", "code_same": false, "relative_loc_diff_percent": 55.5555555556, "diff": ["-f = [0] * (S + 1)", "-f[0] = 1", "-if S >= 3:", "- f[3] = 1", "-if S >= 4:", "- f[4] = 1", "-if S >= 5:", "- f[5] = 1", "-for i in range(6, S + 1):", "- f[i] = sum(f[i - j] for j in range(3, i + 1)) % (10**9 + 7)", "-print((f[S]))", "+f = [1, 0, 0]", "+for i in range(S - 2):", "+ f.append(f[i] + f[i + 2])", "+print((f[S] % (10**9 + 7)))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5486869376, "measured_runtime_v1": 0.341561399, "runtime_lift": 1.6064079231, "key": ["s796837031", "s077713004"]} {"user_id": "u752898745", "problem_id": "p03307", "language": "python", "submission_id_v0": "s632972821", "submission_id_v1": "s560495025", "cpu_time_v0": 37, "cpu_time_v1": 17, "memory_v0": 5304, "memory_v1": 2940, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 54.05, "input": "import math\n\nn=int(input())\n\nprint(((2*n)//math.gcd(2,n)))", "target": "N=int(input());print((N if N%2==0 else N*2))", "code_v0_loc": 3, "code_v1_loc": 1, "code_v0_num_chars": 66, "code_v1_num_chars": 42, "code_v0_no_empty_lines": "import math\n\nn = int(input())\nprint(((2 * n) // math.gcd(2, n)))\n", "code_v1_no_empty_lines": "N = int(input())\nprint((N if N % 2 == 0 else N * 2))\n", "code_same": false, "relative_loc_diff_percent": 66.6666666667, "diff": ["-import math", "-", "-n = int(input())", "-print(((2 * n) // math.gcd(2, n)))", "+N = int(input())", "+print((N if N % 2 == 0 else N * 2))"], "diff_only_import_comment": false, "measured_runtime_v0": 0.4506682441, "measured_runtime_v1": 0.3598311198, "runtime_lift": 1.2524437697, "key": ["s632972821", "s560495025"]} {"user_id": "u347640436", "problem_id": "p03854", "language": "python", "submission_id_v0": "s259161069", "submission_id_v1": "s688102427", "cpu_time_v0": 1216, "cpu_time_v1": 697, "memory_v0": 3420, "memory_v1": 3992, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 42.68, "input": "import sys\n\ns = input()\n\nts = ['']\n\nwhile True:\n\n nts= []\n\n for t in ts:\n\n for w in ['dreamer', 'eraser', 'dream', 'erase']:\n\n if s == t + w:\n\n print('YES')\n\n sys.exit()\n\n if s.startswith(t + w):\n\n nts.append(t + w)\n\n if len(nts) == 0:\n\n print('NO')\n\n sys.exit()\n\n ts = nts\n", "target": "from sys import exit\n\ns = input()\n\nts = ['']\n\nwhile True:\n\n nts= []\n\n for t in ts:\n\n for w in ['dreamer', 'eraser', 'dream', 'erase']:\n\n tw = t + w\n\n if s == tw:\n\n print('YES')\n\n exit()\n\n if s.startswith(tw):\n\n nts.append(tw)\n\n if len(nts) == 0:\n\n print('NO')\n\n exit()\n\n ts = nts\n", "code_v0_loc": 16, "code_v1_loc": 17, "code_v0_num_chars": 320, "code_v1_num_chars": 329, "code_v0_no_empty_lines": "import sys\n\ns = input()\nts = [\"\"]\nwhile True:\n nts = []\n for t in ts:\n for w in [\"dreamer\", \"eraser\", \"dream\", \"erase\"]:\n if s == t + w:\n print(\"YES\")\n sys.exit()\n if s.startswith(t + w):\n nts.append(t + w)\n if len(nts) == 0:\n print(\"NO\")\n sys.exit()\n ts = nts\n", "code_v1_no_empty_lines": "from sys import exit\n\ns = input()\nts = [\"\"]\nwhile True:\n nts = []\n for t in ts:\n for w in [\"dreamer\", \"eraser\", \"dream\", \"erase\"]:\n tw = t + w\n if s == tw:\n print(\"YES\")\n exit()\n if s.startswith(tw):\n nts.append(tw)\n if len(nts) == 0:\n print(\"NO\")\n exit()\n ts = nts\n", "code_same": false, "relative_loc_diff_percent": 5.8823529412, "diff": ["-import sys", "+from sys import exit", "-s = input()", "+s = input()", "- if s == t + w:", "+ tw = t + w", "+ if s == tw:", "- sys.exit()", "- if s.startswith(t + w):", "- nts.append(t + w)", "+ exit()", "+ if s.startswith(tw):", "+ nts.append(tw)", "- sys.exit()", "+ exit()"], "diff_only_import_comment": false, "measured_runtime_v0": 0.2929967599, "measured_runtime_v1": 0.1979754126, "runtime_lift": 1.4799653958, "key": ["s259161069", "s688102427"]} {"user_id": "u584658281", "problem_id": "p02688", "language": "python", "submission_id_v0": "s600438109", "submission_id_v1": "s928531547", "cpu_time_v0": 27, "cpu_time_v1": 24, "memory_v0": 9216, "memory_v1": 9264, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 11.11, "input": "N,K=list(map(int,input().split()))\n\na = [[0]*N]*K\n\na = [[0 for n in range(N)] for k in range(K)]\n\n\n\nfor k in range(K):\n\n d=int(input())\n\n have_k=list(map(int,input().split()))\n\n for h in have_k:\n\n a[k][h-1]=1\n\n\n\nan=[0]*N\n\nfor k in range(K):\n\n for n in range(N):\n\n an[n] = an[n]+a[k][n]\n\n\n\nresult=0\n\nfor i in an:\n\n if i == 0:\n\n result+=1\n\n\n\nprint(result)", "target": "N,K=list(map(int,input().split()))\n\na = [[0 for n in range(N)] for k in range(K)]\n\n\n\nfor k in range(K):\n\n d=int(input())\n\n have_k=list(map(int,input().split()))\n\n for h in have_k:\n\n a[k][h-1]=1\n\n\n\nan=[0]*N\n\nfor k in range(K):\n\n for n in range(N):\n\n an[n] = an[n]+a[k][n]\n\n\n\nresult=0\n\nfor i in an:\n\n if i == 0:\n\n result+=1\n\n\n\nprint(result)", "code_v0_loc": 21, "code_v1_loc": 20, "code_v0_num_chars": 365, "code_v1_num_chars": 350, "code_v0_no_empty_lines": "N, K = list(map(int, input().split()))\na = [[0] * N] * K\na = [[0 for n in range(N)] for k in range(K)]\nfor k in range(K):\n d = int(input())\n have_k = list(map(int, input().split()))\n for h in have_k:\n a[k][h - 1] = 1\nan = [0] * N\nfor k in range(K):\n for n in range(N):\n an[n] = an[n] + a[k][n]\nresult = 0\nfor i in an:\n if i == 0:\n result += 1\nprint(result)\n", "code_v1_no_empty_lines": "N, K = list(map(int, input().split()))\na = [[0 for n in range(N)] for k in range(K)]\nfor k in range(K):\n d = int(input())\n have_k = list(map(int, input().split()))\n for h in have_k:\n a[k][h - 1] = 1\nan = [0] * N\nfor k in range(K):\n for n in range(N):\n an[n] = an[n] + a[k][n]\nresult = 0\nfor i in an:\n if i == 0:\n result += 1\nprint(result)\n", "code_same": false, "relative_loc_diff_percent": 4.7619047619, "diff": ["-a = [[0] * N] * K"], "diff_only_import_comment": false, "measured_runtime_v0": 0.33595281, "measured_runtime_v1": 0.2656919487, "runtime_lift": 1.264444827, "key": ["s600438109", "s928531547"]} {"user_id": "u163320134", "problem_id": "p03037", "language": "python", "submission_id_v0": "s012458960", "submission_id_v1": "s740832114", "cpu_time_v0": 351, "cpu_time_v1": 278, "memory_v0": 6900, "memory_v1": 3060, "status_v0": "Accepted", "status_v1": "Accepted", "improvement_frac": 20.8, "input": "n,m=list(map(int,input().split()))\n\nc=[0]*(n+2)\n\nfor i in range(m):\n\n l,r=list(map(int,input().split()))\n\n c[l-1]+=1\n\n c[r]-=1\n\nfor i in range(1,n+2):\n\n c[i]=c[i]+c[i-1]\n\nans=0\n\nfor i in range(n+2):\n\n if c[i]==m:\n\n ans+=1\n\nprint(ans)", "target": "n,m=list(map(int,input().split()))\n\nl,r=list(map(int,input().split()))\n\nfor i in range(m-1):\n\n tl,tr=list(map(int,input().split()))\n\n if l=0:\n\n ans+=k[i-a[i]]\n\n if a[i]+i<400005:\n\n k[a[i]+i]+=1\n\nprint(ans)", "target": "n=int(input())\n\na=list(map(int,input().split()))\n\nthing={}\n\nans=0\n\nfor i in range(n):\n\n if i-a[i] in thing:\n\n ans+=thing[i-a[i]]\n\n if i+a[i] in thing:\n\n thing[i+a[i]]+=1\n\n else:\n\n thing[i+a[i]]=1\n\nprint(ans)", "code_v0_loc": 12, "code_v1_loc": 12, "code_v0_num_chars": 209, "code_v1_num_chars": 219, "code_v0_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\nk = []\nans = 0\nfor i in range(400005):\n k.append(0)\nfor i in range(n):\n if i - a[i] >= 0:\n ans += k[i - a[i]]\n if a[i] + i < 400005:\n k[a[i] + i] += 1\nprint(ans)\n", "code_v1_no_empty_lines": "n = int(input())\na = list(map(int, input().split()))\nthing = {}\nans = 0\nfor i in range(n):\n if i - a[i] in thing:\n ans += thing[i - a[i]]\n if i + a[i] in thing:\n thing[i + a[i]] += 1\n else:\n thing[i + a[i]] = 1\nprint(ans)\n", "code_same": false, "relative_loc_diff_percent": 0.0, "diff": ["-k = []", "+thing = {}", "-for i in range(400005):", "- k.append(0)", "- if i - a[i] >= 0:", "- ans += k[i - a[i]]", "- if a[i] + i < 400005:", "- k[a[i] + i] += 1", "+ if i - a[i] in thing:", "+ ans += thing[i - a[i]]", "+ if i + a[i] in thing:", "+ thing[i + a[i]] += 1", "+ else:", "+ thing[i + a[i]] = 1"], "diff_only_import_comment": false, "measured_runtime_v0": 0.5354380305, "measured_runtime_v1": 0.0057934456, "runtime_lift": 92.4213443454, "key": ["s021965299", "s412762136"]}